It is possible to create your own payment gateway for Newtek Cart by following these basic steps:
- Your gateway should have the same object-oriented interface as of the other Newtek Cart payment classes. It has to inherit the base class PAYMENT_PROCESSOR (extends PAYMENT_PROCESSOR). The easiest way to do this is to use one of existing gateway classes as a base; Choose the most similar to the one you are installing and modify it. For a simple example, look at %CARTROOT%\content\engine\payment\payment_authorizenet.php (where %CARTROOT%\ is the root folder for your cart installation).
- The following tables in your Newtek Cart database store information for your gateway:
- The “payment_methods” table makes the your module available in the ‘Add Gateway’ page of the Newtek Cart Admin web interface
- The "settings" table stores the gateway settings on a per-installation basis such as an account number and PIN.
- Newtek Cart will automatically create an instance of gateway class and calls class methods when it is required.