- Breaking change (Aug 18, 2021): Please use your secret key (eg,
sk_live_12sds34SRfd3834xx
) to create sessions from here on in. You are probably using your public key (eg,pk_live_12sds34SRfd3834xx
) as this document states before Aug 18, 2021. Please make the change. - Now AVAILABLE for version 2 customers: Magpie has launched its version 2 API, for which you will need a new account. This SDK is also available for merchants who have version 2 accounts. For this, you will need to use the v2 endpoint (ie,
POST https://pay.magpie.im/v2/sessions
for Create session function, andGET https://pay.magpie.im/api/v2/sessions/:session_id
for Retrieve session function. - Get your Version 2 account now!: Magpie has a brand new account for you, with lower transaction rates and better performace. Get your account now at
https://dashboard.magpie.im. ~~(At some near future, https://dashboard.https://beta-dashboard.magpie.im
To create 3D Secure payments -- the one where your customers are presented a challenge before a payment is confirmed -- you will need to change a few things when you make charges
.
To start off a payment, you will still need to obtain a token. It is recommended you use Magpie Checkout to create a token. This means you will not get to see the 16-digit PAN of a card and the CVV, which keeps you safe from liability and PCI-DSS scope.
If you already have a token, you will need to create a charge
. To do this with 3D Secure, you will need to add a few fields in your JSON request body.
A non-3D charge looks like this:
The quickest way to integrate with Magpie is to use Checkout, a prebuilt drop-in integration package that lets merchants easily launch payments in their apps.
Checkout integration is documented here: https://github.com/domdanao/magpie-checkout-sample-php. Clone the repository and start playing with Checkout.
Why use Checkout? Not only can you quickly launch, it also simplifies PCI-DSS requirements. Checkout safely collects card information and returns to the merchant a payment token that they can use for charging. This saves the merchant the higher scope for PCI-DSS certification if they collect credit card information on their own.
Checkout is simple: you include Magpie's JavaScript into your web page and use this to safely collect card information. Simple integration is quick and you can finish with minutes, but complex integration will let give you control on how to manage the user experience that is branded to your app.
I hereby claim:
- I am domdanao on github.
- I am domdanao (https://keybase.io/domdanao) on keybase.
- I have a public key ASAPxyWL1Dyl_4TIJuWGPbDqvdpnIUT0PS8ZGkO32awOOwo
To claim this, I am signing this object: