This is a JavaScript application that uses Node.js to demonstrate accepting a payment with an ecommerce payment form using Payments Hub's Browser Post API, then using the returned transaction token to perform a refund on the sale using Payments Hub's Custom Pay API. The code in this repository handles both the front-end and back-end payment process.
To get started, create a free Payments Hub Developer Portal account. This will allow you to get the sandbox credentials that are required to test the app. Log in to your account to view the official Browser Post API Integration Guide and Custom Pay API Integration Guide, then contact the Payments Hub Sales Engineering team to get sandbox credentials added to your Developer Portal account.
When you're ready to start building your app, you can follow along with this tutorial for step-by-step instructions.
Your completed ecommerce app will look similar to the following. Click the Pay button to open the payment form:
Click the "Submit" button to submit a payment:
On the payment result page, customers have the option to request a refund:
The results of the refund will be displayed after processing is complete: