Meda Pay Web Integration Guide for Express Payment
Document Revision 1.0.1
Use MedaPay web to easily and securely accept online payments. This guide shows you how to create bill, view bill details, and process payments.
|1.||Get Authorization Token from MedaPay.|
|3.||Add MedaPay Button.|
|4.||Process payment with MedaPay.|
|5.||Check payment status upon redirection.|
Get Authorization Token from MedaPay
Before you can integrate MedaPay, you ought to get your application registered and obtain an Authorization Token. After you get a token that lets you access protected API resources, you can create bills and get started in the Sandbox enviroment to test your web app.
Please contact MedaPay team to obtain your Authorization Token.
To create a Bill in MedaPay:
The request will include the following data:
|An array with details for the customer and order. It is mandatory to specify these information: |
|Specify the return and cancel URLs:|
Example Create Bill request:
Sample API Response
- The Create Bill call to /v1/bills creates a bill with status
created. Save the associated
orderIdto pass to subsequent calls.
- A successful Create Bill request returns an HTTP 2 status code. Any other status value indicates an error. In this case, correct the problem and resubmit the bill.
Example response to the preceeding create order request:
Add MedaPay Button
https://api.sandbox.pay.meda.chat/v1/pay/bills/10000000) from the create bill response, either create a button "Pay with MedaPay" or directly redirect the customer to MedaPay to initiate payment.
Process payment with MedaPay
After the customer is redirected to MedaPay Web, He or she will be presented with the payment details and available ways to settle the bill. Currently availabe payment options include:
- CBE Birr
- Hello Cash
After payment is
canceled, customers will be redirected back to your website to complete their order; Please note
redirectUrls from create bill section are used here.
Check payment status upon redirection
Payment status can be checked using the following url:
Possible bill statuses:
created: for bills that are created
pending: waiting for payment to be processed
canceled: canceled by user or due to insufficient balance
complete: payment successfully processed and bill settled
With that you are integrated with MedaPay Express Payment.