Getting Started
This is perhaps the simplest way to integrate Reepay Checkout. Simply initialize it once a payment session have been created. This will automatically redirect the client to the Reepay Checkout Window, within the same browser tab.
1. Include the Reepay Javascript SDK
<script src="https://checkout.reepay.com/checkout.js"></script>
2. Open Checkout as a window
var rp = new Reepay.WindowCheckout('<< YOUR SESSION ID HERE >>');
Notice that for Subscription sessions the method name is WindowSubscription
.
var rp = new Reepay.WindowSubscription('<< YOUR SESSION ID HERE >>');
Events
Events will be fired directly to the Accept and Cancel URLs provided in the session create request as GET parameters, like so:
GET https://yourdomain?id=<the current session id>&invoice=<invoice/charge handle>&customer=<customer handle>&payment_method=<payment method ID stored in Reepay for recurring session or charge session with recurring flag>
Parameter | Type | Description |
---|---|---|
id | string | The current session id |
invoice | string | Invoice/charge handle (charge session) |
customer | string | Customer handle |
subscription | string | Subscription handle (subscription session) |
payment_method | string | Payment method if a new one is created (recurring session or charge session with recurring flag) |
error | string | Potential error code on cancel url |