Configuring Payment Gateway Templates Plugin Estimated Reading Time: 3 Minutes Ubersmith supports many payment gateways. To connect to a gateway that Ubersmith does not support, your developers can build a payment gateway plugin with the Ubersmith SDK. The Payment Gateway Template plugin is the starting point for this work. It contains a sample credit card gateway, a sample ACH gateway, and a sample IPN (instant payment notification) gateway. For development and testing only: The Payment Gateway Template plugin does not connect to a real payment gateway, and it does not move money. In Pass mode, every transaction is approved. The plugin gives a random transaction ID and authorization number. In Fail mode, every transaction is declined. Do not use this plugin for a brand that takes real payments. If you set it as the gateway of a live brand, invoices show as paid, but you do not receive the money. To use the plugin, do these steps: Enable the plugin. Add a plugin instance for a brand. Select the plugin gateways on the Payment Processing Options page. Use the plugin code as the model for your own payment gateway plugin. Enable the plugin Go to Settings > Global Settings > Customization > Plugins. Under Core Plugins, click Payment Gateway Template. If the plugin shows DISABLED, click the toggle. Then click Yes to confirm. For more information about plugins, refer to the article "Using Plugins". Add a plugin instance The plugin has one module, Brand. It allows one instance. On the Brand card, click add new instance. In Brands, select the brands that can use the plugin gateways. To select all brands, select Apply to all. Under Configuration, set Mode: Pass: The plugin approves every transaction. Fail: The plugin declines every transaction. Use this mode to test how Ubersmith shows a declined payment. Click save. After you save, the Brand card shows Instances: 1. To change the mode later, click show instances, then click edit. Select the plugin gateways After you add an instance, the plugin gateways become available on the Payment Processing Options page of each brand in the instance. Switch to the brand that is in the plugin instance. Go to Settings > Payment Processing Options. To use the plugin for credit cards, go to the Credit Cards section. In Credit Card Gateway, select Payment Gateway Template under Plugin Credit Card Gateways. Set Accept CVV2 Codes as necessary. To use the plugin for ACH accounts, go to the ACH Accounts section. In ACH Gateway, select Payment Gateway Template under Plugin ACH Account Gateways. To use the plugin for IPN payments, go to the Plugin Payment Gateways section. Under Payment Gateway Template, select Enable. Click Update. The plugin has no settings on the Payment Processing Options page. The Mode setting is on the plugin instance. Build your own gateway plugin The plugin code is in the Ubersmith installation, in plugins_ubersmith/ubersmithplugin/payment_gateway_template/. Copy it as the start of your own plugin. Give your plugin its own name, identifier, and namespace in manifest.json. The plugin has one class for each type of gateway, in the transaction/ folder: File Gateway type Methods to implement class.credit_card.php Credit card create, update, delete (card tokens), authorize, capture, authorize_capture, void, credit class.ach.php ACH authorize, capture, authorize_capture, void, credit class.ipn.php IPN url, config_description, request_fields, payment, process_success, verify, check_txn_id, refund In each method, replace the sample code with a call to your payment gateway. Keep only the gateway types that your gateway supports. Each method logs its request and response with the SDK Log function. To see these entries, refer to the article "Managing the Plugin Logger".