You are on page 1of 6

Master Pass API Integration

version-1.0

Some Important Notes:1. These APIs can take 5-10 seconds time to response. Because these are communicating via multiple servers/channels. 2. The version is development version. So please co-operate if you find any bug in APIs. 3. All Parameters will be in POST.

Web Services Request/Response Structure


Best practices for every web services. ie (standard format for returns for each call) All message should be followed the template. Success:{"result":true,"message":"message","code":"code","data":[]} Fail:{"result":false,"message":"message","code":"code","data":[]} And we need to define error code and behaviour on client app.

Sample URL to Call:http://54.254.102.185/MasterPassPhp/Web/

Response for success


{"result":true,"error_message":"","error_code":"","data":}

response for failure


{"result":false,"error_message":"BlahBlah","error_code":"100","data":}

Web APIs:1) Get Authorization URL and request token(Process 01 to 08 according to Integration Diagram) Name:- O1_GetRequestToken.php FINAL URL:-http://54.254.102.185/MasterPassPhp/Web/O1_GetRequestToken.php Input:S. No 1. 2. 3. 4. 5. Name user_token user_id restaurant_id order_id app_token Data Type String String String String String Description token got from login API id of user restaurant id order id app token

Output:S. No 1. Name redirect_url Data Type URL Description an absolute path of redirect url of Master pass site where payment would be made

2.

request_token

String

Example output when Success:


{"result":true,"message":"","code":"","data":{"redirect_url":"https:\/\/sandbox.masterpass.com \/Checkout\/Authorize?acceptable_cards=master,amex,diners,discover, maestro,visa&checkout_identifier=a466w1twgesvphsfce9zq1hsh10tdr1 zic&oauth_token=b9d4503d2b187f73793938db26016263&version=v5& suppress_shipping_address=true","request_token":"b9d4503d2b187f73 793938db26016263"}}

Example output when Error:


{result:false,message:message,code:code,data: {}}

2) Get Purchase data(Process 15 to 20 according to Integration Diagram) NOTE:- Master Pass site will automatically redirect user to this API so no need to call this explicitly Name:- O3_Callback.php FINAL URL:- http://54.254.102.185/MasterPassPhp/Web/O3_Callback.php Input:S. No 1. 2. 3. 4. Name profileName auth_token auth_verifier checkout_resource_url Data Type String String String String Description

Output:S. No 1. 1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5 1.6 Name Card BrandId BrandName AccountNumber BillingAddress City Country CountrySubdivision Line1 Line2 PostalCode CardHolderName ExpiryMonth Data Type Array String String String Array String String String String Array String String String Description

1.7 2 3 3.1 3.2 3.3 3.4 3.5 4

ExpiryYear
TransactionId Contact FirstName LastName Country EmailAddress PhoneNumber PayPassWalletIndicator

String String Array String String String String String String

Example output when Success:


{"result":true,"message":"","code":"","data":{"Card":{"BrandId":"master","BrandName":"Maste rCard","AccountNumber":"5204740009900014","BillingAddress":{"City" :"Chico","Country":"US","CountrySubdivision":"US-CA","Line1":"123 Main Street","Line2":[],"PostalCode":"95973"},"CardHolderName":"Bill Smith","ExpiryMonth":"5","ExpiryYear":"2020"},"TransactionId":"95501 1","Contact":{"FirstName":"Joe","LastName":"Test","Country":"US","Em ailAddress":"joe.test@email.com","PhoneNumber":"19876543210"},"PayPassWalletIndicator":"101"}}

Example output when Error:


{result:false,message:message,code:code,data: {}}

3) Receive Post Back data (Process 21 to 23 according to Integration Diagram) Name:- O6_PostTransaction.php Final URL:- http://54.254.102.185/MasterPassPhp/Web/O6_PostTransaction.php Input:S. No 1. 2. Name transactionId order_amount Data Type String String Description transaction Id got from previous API amount of order

Output:S. No 1. 1.2 1.3 1.4 1.5 1.6 1.7 1.8 Name MerchantTransactions TransactionId ConsumerKey Currency OrderAmount PurchaseDate TransactionStatus ApprovalCode Data Type Array String String String String String String String Description Array containing all Request Token of Payment

Example output when Success:


{"result":true,"message":"","code":"","data":{"MerchantTransactions":{"TransactionId":"955011 ","ConsumerKey":"SwvIsclBxqn7QsQuzVls-LhttzZRuJc6wlJIqPs91b8c65f!414d546c654750647a6d4a4e6b482f5847446c4e63556f3d"," Currency":"SGD","OrderAmount":"1000","PurchaseDate":"2014-0310T09:17:17Z","TransactionStatus":"Success","ApprovalCode":"sample" }}}

Example output when Error:


{result:false,message:message,code:code,data: {}}

You might also like