diff --git a/README.rst b/README.rst index bed28a2d4fe780c7986b9bb90039ca9b8758c2d7..03d02ad5e34aa1ebf4c9ed8a0b232eee3b363b7f 100644 --- a/README.rst +++ b/README.rst @@ -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":[]}'