©2014 MasterCard.Proprietary and Confidentialdeveloper.mastercard.com @MasterCardDev
©2014 MasterCard.Proprietary and Confidential
Peter van der Linden
Coding to the MasterCard OpenAPIs
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
1. credit card basics
2. what the OpenAPIs do
3. choices for coding
4. how to REST with a proxy
What you'll take away
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
bit.ly/1PpWZTa
Cardholder Issuer Merchant Acquirer
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
http://developer.mastercard.com
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Consumer APIs
API What it does
Locations Gives a list of nearby ATMs, rePower and travel card agents.
MoneySend Entity-to-consumer payments (sender can be merchant,government, NGO, person, self)
Merchant ID Expands the brief seller details on a credit card statement
rePower Top up a pre-paid card at POS, ATM, etc
Local Favorites List restaurants favored by locals in some place
Places Up-to-date info about nearby merchants (e.g. really open?)
Western UnionMoney Transfer
Send/get money to/from Western Union network
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Merchant APIsAPI What it does:
Simplify Commerce Adds ability to pay by any credit card to a merchant's website. More later
MasterPass PartnerWallet
Creates new, or links to an issuer bank's existing, MasterCard-branded wallet.Users can add any payment card into their wallet. More later.
MasterPassmerchant checkout
Allows user to choose a payment card at checkout. Remembers billing & ship data.Easily integrated with Simplify Commerce (2-3 lines of javascript),Shows icons representing cart contents during checkout for better UIConnected chkout = merchant saves user/wallet connection for speed in checkoutExpress checkout = recall which card & details are used, for next time. More later.
Lost/Stolen cards Checks if a card number is on the list of lost or stolen cards
Fraud score How risky is this transaction? 0 = safe, 999 = very high risk
Retail bankingagent
Draw money from your existing pre-paid card, at a participating merchant(Mexico only)
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
http://developer.mastercard.com
> APIs
> API name
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Download the SDK
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
1. credit card basics2. what the OpenAPIs do3. Choices for use 4. How to REST with a proxy
Where we are
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
REST APIs
Most of our APIs are simple REST APIs
Exceptions: Simplify Commerce, MasterPass
Here's how the REST APIs work
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Review REST info
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Security – required for financials!
RSA key pair, public key delivered in a CSR Oauth 1, with Google body-hash extension a nonce SHA-1 hash of request body, base64 encoded Sign signature base string using your private key
See http://goo.gl/jDPzMm for full details
That's a lot of coding for nothing visible!
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
Hackathon Solution – proxy server! URL as it appears in docs on developer zone:
https://sandbox.api.mastercard.com/atms/v1/atm
Proxy server URL (Oct 24/25 only)
http://dmartin.org:8024/atms/v1/atm
Full URL with args:http://dmartin.org:8024/atms/v1/atm?Format=XML&PageOffset=0&PageLength=10&AddressLine1=70+Main+St&PostalCode=63366&Country=USA&InternationalMaestroAccepted=1
©2015 MasterCard.tialdeveloper.mastercard.com @MasterCardDev
REST APIs - summaryUse proxy to Sandbox, not production URLs
Use http not https, with proxy
Don't adjust your browser or PC proxy settings
Get string, or Post XML doc
Response is sent back as an XML document
Tip: get it working in Postman first
Tip: http://xmlvalidator.com
©2014 MasterCard.Proprietary and Confidentialdeveloper.mastercard.com @MasterCardDev
@MasterCardDev
Peter van der LindenDeveloper Evangelist
©2014 MasterCard.Proprietary and Confidentialdeveloper.mastercard.com @MasterCardDev
From the experts
– Simplify Commerce– MasterPass