PayMob Merchant Integration Pay Mob Guide V2.0
User Manual:
Open the PDF directly: View PDF .
Page Count: 27
Download | |
Open PDF In Browser | View PDF |
PayMob Solutions PayMob Payment-onDelivery Service Merchant Developers Guide v2.0 All Rights Reserved, 2015 PayMob Solutions, SAE PayMob Payment-on-Delivery Service Table of Contents ............................................................................................................................................. 1 Disclaimer ....................................................................................................................... 3 License Agreement ......................................................................................................... 3 Copyright ........................................................................................................................ 3 Preface................................................................................................................................. 4 What Is the Purpose of This Guide ..................................................................................... 4 Who Should Read This Guide ............................................................................................ 4 Where to Get Help .............................................................................................................. 4 Merchant Setup Process ...................................................................................................... 5 Definitions........................................................................................................................... 6 Integration Requests............................................................................................................ 7 1. Register Order.............................................................................................................. 7 2. Update Order ............................................................................................................. 10 3. Get Order Information from Merchant (Optional) .................................................... 12 4. Delete Order (Optional) ............................................................................................. 14 5. Cancel Order (Optional) ............................................................................................ 15 CallBack Notifications (Cash/Card) ................................................................................. 17 6. Payment Response ..................................................................................................... 17 7. Check Order Status .................................................................................................... 20 8. Update Order Currency Request................................................................................ 23 Error Handling .................................................................................................................. 25 Self-Testing Guide ............................................................................................................ 26 1. Register Order Testing............................................................................................... 26 2. Request Order Information Testing ........................................................................... 27 3. Payment Notification ................................................................................................. 27 PayMob Merchant Developers Guide v2.0 2 PayMob Payment-on-Delivery Service Disclaimer We may make improvements and/or changes to the products and services described in this Manual at any time. License Agreement The software described in this Manual is supplied under a license agreement and may only be used in accordance with the terms of that agreement. Copyright PayMob owns the intellectual property in this Manual exclusively. You acknowledge that you must not perform any act which infringes the copyright or any other intellectual property rights of PayMob and cannot make any copies of this Manual unless in accordance with these terms and conditions. Without our express written consent you must not: • distribute any information contained in this Manual to the public media or quote or use such information in the public media; or • allow access to the information in this Manual to any company, firm, partnership, association, individual, group of individuals or other legal entity other than your officers, directors and employees who require the information for purposes directly related to your business. PayMob Merchant Developers Guide v2.0 3 PayMob Payment-on-Delivery Service Preface What Is the Purpose of This Guide This Merchant Developers Guide highlights the several methods of integration with PayMob’s Payment-on-Delivery Service API with the partnered Merchants which allows Merchants to register payment orders to be electronically processed for the Merchant to receive the payment upon delivery. It seeks to guide developers to use the functionality of the Payment-on-Delivery Service API. The guide also outlines the business logic around the payment processing on PayMob’s Payment-on-Delivery Service Servers. Who Should Read This Guide PayMob Payment-on-Delivery API provides an easy to use, low integration effort solution for payment enabling web-sites, ecommerce applications, online stores or any equivalent merchant. The solution uses standard web technology allowing merchants to integrate payment capabilities into their online store without installing or configuring any payments software making it suitable for most website hosting environments This guide is specifically aimed at business analysts and integrators who want to effectively integrate PayMob’s Payment-on-Delivery Service into merchant applications, and merchant bank personnel who will be involved with the support of the process. Where to Get Help If you need assistance with Payment-on-Delivery Service Guide, please contact your PayMob’s account manager, the details of which you will be given once you sign up with PayMob’s Payment-on-Delivery Service through your acquiring bank. PayMob Merchant Developers Guide v2.0 4 PayMob Payment-on-Delivery Service Merchant Setup Process The following table guides you through the basic steps to enable an online store to using PayMob Payment-on-Delivery Service. Step 1: Receive PayMob Admin Panel Credentials from Bank Account Manager Step 2: Download the Integration Guide material from the Admin Panel Step 3: Obtain your API Key and API Secret Key from the Admin Panel Step 4: Design and Implement the Integration Step 5: Test your Integration Step 6: Go Live Step 7: Conduct Pre-Production testing Step 8: Begin Live Processing of Payment-on-Delivery Orders PayMob Merchant Developers Guide v2.0 5 PayMob Payment-on-Delivery Service Definitions API-KEY API-SECRET-KEY REF-1 REF-2 Live Host Test Host airway_bill merchant_order_id Predefined Values that are sent along with the requests to PayMob servers in order to authenticate the sender server. The values for those keys are available in the API Settings tab of PayMob’s Admin Panel. These values are set by the developer to allow the sender server to authenticate PayMob Callbacks. These values are sent in the header of each Callback request. These values are set in the API Settings tab of PayMob’s Admin Panel. https://liveapi.paymobsolutions.com http://test5.paymobsolutions.com This parameter servers as a unique identifier to the collector for the order This parameter serves as a unique identifier to the merchant for the order PayMob Merchant Developers Guide v2.0 6 PayMob Payment-on-Delivery Service Integration Requests 1. Register Order Figure 1 – Data Flow The below URL is where the merchant registers an order at PayMob PATH : /api/register_order/ POST Request: HTTP Header includes: API-KEY: xxxxxxx API-SECRET-KEY: xxxxxxxx JSON format body: { “merchant_order_id”: { x:{ “amount”: x, “extra_order_type”: x, “product_info”: x, }, xy : { “amount”: x, “extra_order_type”: x, “product_info”: x, }, }, PayMob Merchant Developers Guide v2.0 7 PayMob Payment-on-Delivery Service 8 "total_amount": x, “currency”: x, “order_time”: x, “courier_id”: x, “comments”: x, “expected_payment_method”: x, "customer": { “name”: x, “phone”: x, “address”: x, “email”: x, } “expiry_time”: x, “expiry_action”: x, “cancel_upon_expiration”: x, “extra_order_type”: x, “in_promo”: x, “promo_code”: x, “extra_x1”: x, “extra_x2”: x, “extra_x3”: x, “extra_x4”: x, “extra_x5”: x, } Parameter Name merchant_order_id Data Type JSON Is Required Comments True No restrictions on the id format Float/Integer Example {1234 : {“amount”: x, “extra_order_type”: x, “product_info”: x}} 123.50 merchant_order_id .amount merchant_order_id .extra_order_type merchant_order_id .product_info total_amount currency 250 CharArray “Bags category” False 250 CharArray “Apparel” False 123.50 EGP True False 1422038585 MA8213 “simple comment” CASH False True False True Float/Integer Choice Field: EGP /USD order_time Timestamp courier_id Alphanumeric comments TextField expected_payment_ Choice Field: True PayMob Merchant Developers Guide v2.0 Default: EGP PayMob Payment-on-Delivery Service method customer.name customer.phone customer.address customer.email expiry_time expiry_action cancel_upon_expir ation extra_order_type in_promo promo_code extra_x1 extra_x2 extra_x3 extra_x4 extra_x5 CASH/CARD/ MWALLET 250 CharArray 50 CharArray 250 CharArray 250 CharArray Timestamp ChoiceField: EMAIL/CALL BACK/EMAIL -CALLBACK Boolean Field 250 CharArray Boolean Field 250 CharArray Reserved Reserved Reserved Reserved Reserved “Bisll White” “+201005023132” “48, Street 16” client@client.com 1422038585 EMAILCALLBACK True True True True False False True False “Bags category” True 30%DISCOUNT N/A N/A N/A N/A N/A False False False False False False False False PayMob Server Response { "paymob_id": x, “request_status”: x, “qr_code_awb”: x, “airway_bill”: x, } Parameter Name paymob_id request_status qr_code_awb Data Type Integer Choice Field: SUCCESS/ FAILURE URL Field airway_bill Alphanumeric Example 41233352 SUCCESS Is Required Comments True True https://api.qrserver .com/v1/create-qrcode/?size=150x1 50&data=1234 True True PayMob Merchant Developers Guide v2.0 9 PayMob Payment-on-Delivery Service 10 2. Update Order The below URL is where the merchant update an order at PayMob PATH : /api/update_order/POST Request: HTTP Header includes: API-KEY: xxxxxxx API-SECRET-KEY: xxxxxxxx JSON format body: { “merchant_order_id”: { x:{ “amount”: x, “extra_order_type”: x, “product_info”: x, }, xy : { “amount”: x, “extra_order_type”: x, “product_info”: x, }, }, "total_amount": x, “courier_id”: x, “expected_payment_method”: x, “expiry_time”: x, “expiry_action”: x, “cancel_upon_expiration”: x, “extra_x1”: x, “extra_x2”: x, “extra_x3”: x, “extra_x4”: x, “extra_x5”: x, } Parameter Name merchant_order_id Data Type JSON Example {1234 : {“amount”: x, “extra_order_type”: x, “product_info”: x}} Is Required Comments True No restrictions on the id format PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service merchant_order_id .amount merchant_order_id .extra_order_type merchant_order_id .product_info total_amount courier_id expected_payment_ method expiry_time expiry_action cancel_upon_expir ation extra_x1 extra_x2 extra_x3 extra_x4 extra_x5 Float/Integer 123.50 True 250 CharArray “Bags category” False 250 CharArray “Apparel” False Float/Integer Alphanumeric Choice Field: CASH/CARD/ MWALLET Timestamp ChoiceField: EMAIL/CALL BACK/EMAIL -CALLBACK Boolean Field 123.50 MA8213 CASH True True True 1422038585 EMAILCALLBACK False False True False Reserved Reserved Reserved Reserved Reserved N/A N/A N/A N/A N/A False False False False False PayMob Server Response { "paymob_id": x, “request_status”: x, “airway_bill”: x, “merchant_order_id”: { x:{ “amount”: x, “extra_order_type”: x, “product_info”: x, }, xy : { “amount”: x, “extra_order_type”: x, “product_info”: x, }, }, } Parameter Name paymob_id Data Type Integer Example 41233352 Is Required Comments True PayMob Merchant Developers Guide v2.0 11 PayMob Payment-on-Delivery Service request_status merchant_order_id merchant_order_id .amount merchant_order_id .extra_order_type merchant_order_id .product_info Choice Field: SUCCESS/ FAILURE JSON SUCCESS 12 True Float/Integer {1234 : True {“amount”: x, “extra_order_type” : x, “product_info”: x}} 123.50 True 250 CharArray “Bags category” False 250 CharArray “Apparel” False No restrictions on the id format Figure 3 – Activity Diagram for Order Retrieval 3. Get Order Information from Merchant (Optional) This method is to validate the latest order amount during the time of payment (fulfillment). PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service 13 URL: THE URL SHALL BE SPECIFIED BY THE ORGANIZATION THROUGH THE ADMIN PANEL POST Request: HTTP Header includes: REF-1: xxxxx REF-2: xxxxx JSON format body: { “airway_bill”: x, “attempted_payment_method”: x, “courier_id”: x, } Parameter Name airway_bil attempted_paymen t_method courier_id Data Type Alphanumeric ChoiceField CASH/CARD/ MWALLET Alphanumeric Example B1458F CARD Is Required Comments True False MA813 True Merchant Server Response on Successful Airway Bill Retrieval: { “merchant_order_id”: { x:{ “amount”: x, “extra_order_type”: x, “product_info”: x, }, xy : { “amount”: x, “extra_order_type”: x, “product_info”: x, }, }, "latest_amount": x, “currency”: x, } Parameter Name merchant_order_id Data Type JSON Example {1234 : Is Required Comments True No restrictions on PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service merchant_order_id .amount merchant_order_id .extra_order_type merchant_order_id .product_info latest_amount currency Float/Integer {“amount”: x, “extra_order_type” : x, “product_info”: x}} 123.50 True 250 CharArray “Bags category” False 250 CharArray “Apparel” False Float/Integer Choice Field: EGP/USD 123.50 EGP True False 14 the id format Default: EGP Merchant Server Response on Failure in Airway Bill Retrieval: { “error_code”: x, “error_message”: x, } Parameter Name error_code Data Type Choice Field: 0/1/2 Example 1 error_message String “Order does not exist” Is Required Comments True 0: Airway_bill does not exist 1: Payment is prohibited for this airway_bill 2: Other problems with the order False 4. Delete Order The below URL is where the collector can delete order: PATH : /api/delete_order/ / POST Request: HTTP Header includes: API-KEY: xxxxxxx API-SECRET-KEY: xxxxxxxx PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service 15 JSON format body: NO JSON BODY PayMob Server Response { “request_status”: x, “error_code”: x, } Parameter Name request_status error_code Data Type Choice Field: SUCCESS/ FAILURE Choice Field: 1/2 Example SUCCESS Is Required Comments True 1 True 1: Order has already been paid 2: Order cannot be deleted for other reasons 5. Cancel Order The below URL is where the collector can delete order: PATH : /api/cancel_order/ / POST Request: HTTP Header includes: API-KEY: xxxxxxx API-SECRET-KEY: xxxxxxxx JSON format body: NO JSON BODY PayMob Server Response { “request_status”: x, “error_code”: x, } Parameter Name request_status Data Type Choice Field: Example SUCCESS Is Required Comments True PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service error_code SUCCESS/ FAILURE Choice Field: 1/2 1 True PayMob Merchant Developers Guide v2.0 16 1: Order has already been paid 2: Order cannot be deleted for other reasons PayMob Payment-on-Delivery Service CallBack Notifications (Cash/Card) Important Note: Upon transaction completion, PayMob server will automatically notify the merchant server about the updated status of the transaction. Figure 4 – Payment Notification Activity Diagram 6. Payment Response PayMob server shall send the following information to the CallBack URL Specified by the Merchant POST Request: HTTP Header includes: REF-1: xxxxxxx REF-2: xxxxxxx JSON format body: { “request_status”: x, PayMob Merchant Developers Guide v2.0 17 PayMob Payment-on-Delivery Service 18 "paymob_id": x, “merchant_order_id”: { x: { “amount”: x, “extra_order_type”: x, “product_info”: x, }. xy: { “amount”: x, “extra_order_type”: x, “product_info”: x, }. “airway_bill”: x, "actual_payment_method": x, "payment_status": x, "total_amount": x, “currency”: x, “merchant_id”: x, “courier_id”: x, "order_paid_on": x, “batch_number”: x, “card_type”: x, “card_num” x, “in_promo”: x. “promo_code”: x, “transaction_number”: x, “fail_count”: x, “fail_reasons”: [], “merchant_callback_retries”: x, } Parameter Name request_status Data Type ChoiceField: SUCCESS/ FAILURE Integer JSON paymob_id merchant_order_id merchant_order_id. amount merchant_order_id. Example SUCCESS Is Required Comments True Float/Integer 12314 True {1234 : True {“amount”: x, “extra_order_type ”: x, “product_info”: x}} 123.50 True 250 CharArray “Bags category” False PayMob Merchant Developers Guide v2.0 No restrictions on the id format PayMob Payment-on-Delivery Service extra_order_type merchant_order_id. product_info airway_bill actual_payment_me thod 250 CharArray “Apparel” Alphanumeric False True CASH True PAID True 123.50 EGP True False merchant_id ChoiceField: CASH/CARD/ MWALLET ChoiceField: PAID/ UNPAID/ VOID/ CANCELLED Float/Integer Choice Field: EGP/USD Alphanumeric ME4112 True courier_id Alphanumeric MA8213 True order_paid_on batch_number Timestamp DateField: DD/MM/YYY Y ChoiceField: mastercard/visa Digits 24/5/2015 True False Visa False 1234 False True 30%DISCOUNT 4323 5 [{“error_code”: 12, “description”: “x”}, {“error_code”: 1, “description”: “x”}] 4 False False True True True payment_status total_amount currency card_type card_num in_promo promo_code transaction_number fail_count fail_reasons Booelean Field 250 CharArray Integer Integer List of Error Objects merchant_callback_ retries Unsigned Integer 19 True PayMob Merchant Developers Guide v2.0 No restrictions on the format Default: EGP No restrictions on the format No restrictions on the format Last 4 digits in the payment card number 0 means first attempts, no retries. PayMob Payment-on-Delivery Service Error Object: error_code error_message Unsigned integer String 12314 “message” True True Merchant Server Response { } "ack”: “ok” ** If PayMob server does not receive any response, it will attempt to retry every 2 hours within the gap of 2 days until the Merchant server acknowledges the request. If the duration of 2 days has passed, and the Merchant server didn’t respond to the Callback notification, PayMob server shall stop sending notification about the status of the nonacknowledged order. However, the Merchant server can check the status of the order afterwards using “Check Order Status” 7. Check Order Status At any time whenever the merchant wants to check the status of an order. The below URL is where the merchant can request the order status: PATH : /api/order/awb/ / POST Request: HTTP Header includes: API-KEY: xxxxxxx API-SECRET-KEY: xxxxxxxx JSON format body: NO JSON BODY PayMob Server Response { "paymob_id": x, “request_status”: x, “merchant_order_id”: { x: { “amount”: x, “extra_order_type”: x, PayMob Merchant Developers Guide v2.0 20 PayMob Payment-on-Delivery Service 21 “product_info”: x, }. xy: { “amount”: x, “extra_order_type”: x, “product_info”: x, }. “airway_bill”: x, "actual_payment_method": x, "payment_status": x, "total_amount": x, “currency”: x, “merchant_id”: x, “order_time”: x, "order_paid_on": x, “transaction_number”: x, “expiry_time”: x, “card_type”: x, “card_num”: x, “in_promo”: x, “promo_code”: x, “fail_count”: x, “fail_reasons”: [], "customer": { “name”: x, “phone”: x, “address”: x, } “comments”: x, “extra_order_type”: x, “extra_x1”: x, “extra_x2”: x, “extra_x3”: x, “extra_x4”: x, “extra_x5”: x, } Parameter Name paymob_id request_status merchant_order_id Data Type Integer Choice Field: SUCCESS/ FAILURE JSON Example 12314 SUCCESS Is Required Comments True True {1234 : True {“amount”: x, “extra_order_type PayMob Merchant Developers Guide v2.0 No restrictions on the id format PayMob Payment-on-Delivery Service merchant_order_id. amount merchant_order_id. extra_order_type merchant_order_id. product_info airway_bill Float/Integer ”: x, “product_info”: x}} 123.50 250 CharArray “Bags category” False 250 CharArray “Apparel” False actual_payment_me thod ChoiceField: CASH/CARD/ MWALLET ChoiceField: PAID/ UNPAID/ VOID/ CANCELLED Float/Integer Choice Field: EGP/USD Alphanumeric Timestamp Timestamp Integer Timestamp ChoiceField: mastercard/visa Digits CASH True PAID True 123.50 EGP True False MA8213 4323 1422038585 Visa True False True True False False 1234 False in_promo promo_code fail_count fail_reasons Booelean Field Alphanumeric Integer List of Error Objects False False True True customer.name customer.phone 250 CharArray 50 CharArray customer.address 250 CharArray True 30%DISCOUNT 5 [{“error_code”: 12, “description”: “x”}, {“error_code”: 1, “description”: “x”}] “Ahmed Sayed” “+201005023132 ” “48, Faisal Street” payment_status total_amount currency merchant_id order_time order_paid_on transaction_number expiry_time card_type card_num Alphanumeric True True True True True PayMob Merchant Developers Guide v2.0 22 No restrictions on the format Default: EGP Last 4 digits in the payment card number PayMob Payment-on-Delivery Service comments TextField extra_order_type extra_x1 extra_x2 extra_x3 extra_x4 extra_x5 250 CharArray Reserved Reserved Reserved Reserved Reserved “simple comment” “Bags category” N/A N/A N/A N/A N/A False False False False False False False Error Object: error_code error_message Unsigned integer String 12314 “message” True True 8. Update Order Currency Request This request is for currency conversion when needed by the end customer URL: THE URL SHALL BE SPECIFIED BY THE ORGANIZATION THROUGH THE ADMIN PANEL POST Request: HTTP Header includes: REF-1: xxxxx REF-2: xxxxx JSON format body: { “airway_bill”: x, “courier_id”: x, “currency”: x, } Parameter Name airway_bil courier_id currency Data Type Alphanumeric Alphanumeric Choice Field: EGP/USD Example B1458F MA8213 EGP Is Required Comments True True True Merchant Server Response on Successful Airway Bill Retrieval: { “merchant_order_id”: { x: { “amount”: x, PayMob Merchant Developers Guide v2.0 23 PayMob Payment-on-Delivery Service 24 “extra_order_type”: x, “product_info”: x, }. xy: { “amount”: x, “extra_order_type”: x, “product_info”: x, }. "total_amount": x, “currency”: x, } Parameter Name merchant_order_id Data Type JSON merchant_order_id .amount merchant_order_id .extra_order_type merchant_order_id .product_info total_amount currency Float/Integer Example Is Required Comments {1234 : True No restrictions on {“amount”: x, the id format “extra_order_type” : x, “product_info”: x}} 123.50 True 250 CharArray “Bags category” False 250 CharArray “Apparel” False Float/Integer Choice Field: EGP/USD 123.50 EGP True False Default: EGP Merchant Server Response on Failure in Airway Bill Retrieval: { “error_code”: x, “error_message”: x, } Parameter Name error_code Data Type Choice Field: 0/1/2 Example 1 error_message String “Order does not exist” Is Required Comments True 0: Airway_bill does not exist 1: Payment is prohibited for this airway_bill 2: Other problems with the order False PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service 25 Error Handling Below is the list of all error levels along with a description for what each level represents in addition to the possible message values for each error level. Error Level Description Level 0 User Authentication Error Level 1 Level 2 Level 3 Level 4 Level 5 Message Values - ‘Unidentified User’ - ‘User is not a Merchant, please consult your access control’ HTTP Request Type Error - ‘Expected POST request only’ Error: Invalid/Missing - ‘Required ’merchant_order_id’ field’ Data Type in the - ‘Required ’merchant_order_id’ field’ parameter of the request - ‘’order_time’ must be of type timestamp’ - ‘expected_payment_method’ shall have a value of ’CASH’ or ’CARD’’ - ’Customer’ information shall be specified. Please refer to the documentation.’ - ‘Customer email should be specified’ - ’courier_id’ parameter must have a value’ - ’airway_bill’ parameter is mandatory’ Misconfiguration in the - ‘courier_id’ value is not identified. Please consult the Admin Portal admin portal to identify the courier. Logic Error - ‘Order with the same merchant order id already been created.’ - ‘Order with the same airway bill and courier already been created.’ - ‘Order Not found’ - ‘Unidentified PATH’ Unauthorized Request: - ’courier_id’ value is not linked to a courier account’ Please contact PayMob - ’courier_id’ is linked to an account that is not Support verified. Please wait until courier account is verified.’ PayMob Merchant Developers Guide v2.0 PayMob Payment-on-Delivery Service Self-Testing Guide Throughout the integration, developers should use this guide to ensure the correctness the sent and retrieved data from and to PayMob servers. 1. Register Order Testing Upon sending a successful request to register an order, verification of this order can be done through the Search Order tab on PayMob Admin Panel. Assume order airway_bill was “10099”, it should appear in the search results. PayMob Merchant Developers Guide v2.0 26 PayMob Payment-on-Delivery Service 2. Request Order Information Testing To simulate the Request Order Information, under the Test Request Order Information Callback in the API Settings tab on PayMob Admin Panel, developers are required to enter a registered Airway Bill code and click on Test Request. 3. Payment Notification To simulate a transaction, under the Test Transaction Notification Callback in the API Setting on PayMob Admin Panel, developers are required to enter a registered Airway Bill code and click on Test Request. PayMob Merchant Developers Guide v2.0 27
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 27 Language : en-US Tagged PDF : Yes Title : PayMob Merchant Integration Author : All Rights Reserved, 2015 Subject : Business Continuity Plan Creator : Microsoft® Word 2016 Create Date : 2015:12:21 21:27:50+02:00 Modify Date : 2015:12:21 21:27:50+02:00 Producer : Microsoft® Word 2016EXIF Metadata provided by EXIF.tools