Skip to content

Instantly share code, notes, and snippets.

View domdanao's full-sized avatar
🏠
Working from home

Dominick Danao domdanao

🏠
Working from home
View GitHub Profile
@domdanao
domdanao / checkout_sessions.md
Last active August 27, 2021 08:30
Magpie Checkout, next gen

Checkout Sessions


Important announcements

  1. 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.
  2. 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, and GET https://pay.magpie.im/api/v2/sessions/:session_id for Retrieve session function.
  3. 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://beta-dashboard.magpie.im https://dashboard.magpie.im. ~~(At some near future, https://dashboard.
@domdanao
domdanao / sources.md
Last active March 6, 2024 13:53
Sources: accept payments from e-wallets

Sources

PayMaya GCash WeChat Pay Alipay China UnionPay

With sources, Magpie merchants can now accept payments from the following e-wallets:

  • GCash (gcash)
  • PayMaya (paymaya)
  • Alipay (alipay)
  • WeChat Pay (wechat)
@domdanao
domdanao / 3dsecure.md
Last active May 5, 2021 08:57
Making 3D Secure payments

3D Secure Payments

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:

@domdanao
domdanao / elements.md
Created October 24, 2020 03:28
Magpie Elements

Magpie Elements

To use Magpie Elements, you need to include the Magpie Elements main js file.

<script src="https://js.magpie.im/v1/magpie.min.js"></script>

Next is to create an instance of Magpie object by providing your public key.

Integrating with Magpie

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.

Keybase proof

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: