Skip to content
Snippets Groups Projects
Commit 28309e0f authored by Tom Prince's avatar Tom Prince
Browse files

Update the README with the new API.

parent 2ca189c5
No related branches found
No related tags found
1 merge request!100Update the README with the new API.
......@@ -26,21 +26,19 @@ First, run the server::
$ stack run
Then configure Stripe with a `webhook`_ pointing at the server and receiving the *charge.successful* event.
Configure Stripe with ``http://<youraddress>:8081/v1/stripe/webhook``.
Then create a testing charge::
Then create a testing charge using Stripe::
$ STRIPE_SECRET_KEY=sk_test_...
$ curl \
https://api.stripe.com/v1/charges \
-u ${STRIPE_SECRET_KEY}: \
-d amount=999 \
-d currency=usd \
-d source=tok_visa \
-d 'metadata[Voucher]=abcdefghijk'
This results in Stripe making a callback to the PaymentServer with the charge details.
http://<youraddress>:8081/v1/stripe/charge \
-X POST \
-H 'content-type: application/json' \
--data '{ "token":"tok_visa", "voucher":"abcdefg", "amount":"650", "currency":"USD" }'
The PaymentServer marks the voucher as paid in its database.
Then redeem the vouncher for tokens::
.. _webhook: https://stripe.com/docs/webhooks/setup#configure-webhook-settings
$ curl \
http://<youraddress>:8081/v1/redeem \
-X POST \
-H 'content-type: application/json' \
--data '{ "redeemVoucher": "abcdefg", "redeemTokens":[]}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment