Create your own payment gateway
As of Shopkit v1.1, all payment gateways are defined in a standardized way within the
Square, Stripe and PayPal are included. Here’s how to add your own gateway, if you want to give your customers another payment option:
Setting up the folder
- Copy an existing gateway’s folder and rename it.
- [blueprint details]
Sending data to the gateway
process.php. This is where your customers will be directed when they click
Pay Now. Shopkit will pass along the $txn object so you can use that data.
process.phpshould send the transaction data and payment information to the gateway.
- Never collect users’ credit card information directly with the Shopkit server. All sensitive details should be handled by the gateway, either directly on their site, or through a SDK provided by them.
- Make sure the gateway has a callback URL where it will send the transaction response. This should be
Verifying order details
callback.php, verify the charge against the pending order.
callback.phpneeds to update the transaction text file with
'status' => 'paid', the gateway transaction ID, and any customer details you might have
- Make sure you include the
order.callbacksnippet, which updates inventory and sends any required notifications.
- If all is good, send the user along to
http://example.com/shop/confirm, passing as many variables as you can to autofill the form (