Mobile Wallets

📘

The steps in this guide are following to the essential steps mentioned in the payment API flow guide, so please check it before proceeding to this guide.

Pay Request:

📘

Now that you have obtained the payment key, you need to prepare your checkout experience (i.e. client-side code). Our API enables you to accept payment on your website/web app.

URL: https://accept.paymob.com/api/acceptance/payments/pay

method: POST

source: Merchant's server

recipient: Accept's server

content-type: JSON

Test Credentials:

Number

PIN

OTP

01010101010

123456

123456

example request data:

{
  "source": {
    "identifier": "wallet mobile number", 
    "subtype": "WALLET"
  },
  "payment_token": "ZXlKMGVYQWlULjRi2T2..."  // token obtained in step 3
}

example response data:

{
  "id":78,
  "pending": "true",
  "amount_cents":1000,
  "success":"fasle",
  "is_auth": "false",
  "is_capture": "false",
  "is_standalone_payment":"true",
  "is_voided": "false",
  "is_refunded": "false",
  "is_3d_secure": "false",
  "integration_id":1,
  "profile_id":1,
  "has_parent_transaction": "false",
  "order":{
    "id":103,
    "created_at":"2016-12-26T06:49:16.651010Z",
    "delivery_needed": "false",
    "merchant":{
      "id":1,
      "created_at":"2016-11-17T15:02:53.646620Z",
      "phones":[
        "011111111111",
        "012324151432"
      ],
      "company_emails":[
        "[email protected]",
        "[email protected]"
      ],
      "company_name":"Wuckert, Zieme and Dach",
      "state":"Oklahoma",
      "country":"Oman",
      "city":"Port Arvillachester",
      "postal_code":"83372",
      "street":"Walker Ramp"
    },
    "collector": "null",
    "amount_cents":1000,
    "shipping_data":{
      "id":73,
      "first_name":"Clifford",
      "last_name":"Nicolas",
      "street":"Ethan Land",
      "building":"8028",
      "floor":"42",
      "apartment":"803",
      "city":"Jaskolskiburgh",
      "state":"Utah",
      "country":"CR",
      "email":"[email protected]",
      "phone_number":"+86(8)9135210486",
      "postal_code":"01898",
      "extra_description":"",
      "shipping_method":"UNK",
      "order_id":94,
      "order":94
    },
    "currency":"EGP",
    "is_payment_locked":"true",
    "merchant_order_id": "null",
    "wallet_notification": "null",
    "paid_amount_cents":0,
    "items":[]
  },
  "created_at":"2016-12-26T06:49:16.680871Z",
  "transaction_processed_callback_responses":[],
  "currency":"EGP",
  "source_data":{
    "number": 01274155230,
    "sub_type": "WALLET",
    "type": "wallet"
  },
  "error_occured": "false",
  "owner": 2,
  "parent_transaction": "null",
  "redirect_url": "this_is_the_wallet_redirect_url"
}

Notice:
The value of the key pending is "true" and success is "false" if the transaction went successful, you should receive success: "true", and pending: "false".

After you receive the response, the user should be redirected to the redirect_url in the response. The user will then be prompted to enter his MPIN, and the transaction will be processed afterward. To enhance the experience, after the transaction is processed, the user will be redirected to the URL the merchant setup in the transaction response callback. For clarification is provided in step 6.

👍

That's it, you've successfully finalized your Vodafone Cash payments integration with Accept :tada:.
Now, prepare endpoints to receive payment notifications from Accept's server, to learn more about the transactions webhooks, please check this guide.


Did this page help you?