Forum OpenACS Q&A: Response to ACS Service Contract questions (for a PayPal gateway)

Hi Roberto, the service contracts package was designed to provide flexibility of design. In our case the ecommerce package is not coupled into any specific payment gateway (e.g. authorizenet, verisign, paypal, ...) but it is depended on implementations of an abstract contract that describes the functionality required by any concrete implementation of such a service.

Therefore, provided that the existing (Bart & Janine) payment-gateway contract is general enough, you only need to write an implementation of that contract for paypal. This way your paypal implementation will automatically be available to the ecommerce package (or any other package that makes use of the payment-gateway service contract) without any modifications to the ecommerce libraries or data model or page flow.

In case the existing payment-gateway contract is not general enough to cover paypal's functionality only then did you need to provide a new (generalized/abstract) contract, say micropayments-gateway and then write an implementation for paypal with the new contract. Note though, that in such a case it will be required that the ecommerce package code be modified to handle both contracts.

Let me know if you need more info about this.