Welcome to the SpankPay SDK!
Get paid with crypto!
Overview
The SpankPay Merchant SDK makes it easy to get paid with cryptocurrency: easy for your users, and easy for you (the developer).
Getting started with SpankPay is a simple three-step process:
1. Include the SpankPay JavaScript
Add the following line to the bottom of the page on which you will be accepting payments:
2. Add a Pay with SpankPay button
Add the following code to create a button which will start a SpankPay payment. Alternatively, you can call the JavaScript API directly.
3. Generate an API key and write a Webhook endpoint
Integrating SpankPay
1. Include the SpankPay JavaScript
The first step in integrating SpankPay into your website is including the SpankPay JavaScript. This can be done directly with a <script>
tag:
Or via npm
:
2. Create a Purchase
Which will show the SpankPay payment page when the Pay with SpankPay! button is clicked, and call the onSpankPayPayment
callback once the payment has been completed and the webhook callback has been called.
3. Implement a Webhook Callback URL
For more, see:
4. Testing Your Integration
Testing API Keys
Every API key has a corresponding "testing" key. This testing key shares common settings (such as accepted coins) with the main key, but the currency list in the Purchase iframe will also include the option to pay with "test" versions of each coin.
When a test coin is selected, the user will be presented with a "send fake payment" button, which will immediately simulate a payment with that coin.
Test payments are identical to real payments, except the currencies will be prefixed with "TEST":
Note that the testing API key also uses a different secret key.
We recommend using the testing key in your development and staging environments.
Testing Webhooks
Last updated
Was this helpful?