A simple, but flexible web app to process a payment using the Stripe API.
OR
npm install
cat .env.example > .env
- In the
.env
file, enter the required Stripe info npm run start
- open http://localhost:3000/?a=100&n=Hello%20World!&d=A%20short%20description%20here
It is recommended that all values for string parameters be url encoded.
Available query string parameters:
{
a: 'The amount in pennies. Must be a whole number. Required. E.g., $30 would be 3000',
n: 'The title you would like to give the payment. Required. September Golf Trip',
d: 'The short description you would like to give the payment. Optional. Robert Trent Jones Golf Trail',
e: 'The email in which you want to send a receipt to. Optional. [email protected]',
i: 'The url for the payment icon. Optional. https://my.cdn.com/tiger-woods.jpg',
t: 'The button text. Optional. Pay {{amount}} for Things. Note the {{amount}} will be replaced by the actual amount'
b: 'The background url for the payment page. Optional. https://my.cdn.com/the-masters.jpg',
o: 'Automatically add the Stripe transaction fees to the total amount. Must be a truthy value to enable. Optional. Defaults to `false`'
c: 'ISO currency code. Optional. Defaults to `USD`.'
r: 'The redirect url after a successful payment. Optional. http://my.store.com',
f: 'The customer's first name. It will be saved as metadata on the transaction. Optional. John.',
l: 'The customer's last name. It will be saved as metadata on the transaction. Optional. Doe.',
z: 'Whether or not to require billing zip code for verification',
m_*: 'Any qs parameter prepended with m_ will be added to the payment as metadata. Optional. m_favoriteColor=green'
}
The 'b' parameter can also be a valid hex color if you prefer a monochrome background other than the default white. E.g. b=ff0 or b=F9F9F9.
The kitchen sink example. The resulting page output is shown at the top of this page. The Kitchen Sink