Payment with MB WAY using mobile phone number
To start a payment via MB WAY you only need the mobile phone number associated with your MB WAY account.
The process works as follows:
- Payment notification sent to the MB WAY application (notification expires after 5-10 minutes);
- User confirms the payment in the application;
- View payment status (optional if you have a webhook subscription).
The following flow illustrates how the payment by MB WAY works:
1. Sending notification of payment MB WAY
POST /payments
- Request
- Response
{
"type": "payment",
"amount": 100,
"callbackUrl": "https://teste.pt", // Opcional se usar webhooks
"paymentMethod": {
"code": "MW",
"details": {
"phoneNumber": "351#123456789"
}
}
}
{
"apiVersion": "1.0",
"date": "2021-10-07T18:09:41+01:00",
"success": true,
"data": {
"id": "42373",
"referenceDetails": {
"reference": "A0000A585"
},
"stateDetails": {
"state": "pending_confirmation"
},
"paymentMethod": {
"code": "MW",
"type": "DEFAULT",
"details": {
"phoneNumber": "351#123456789",
"countryCode": "351",
"last3Digits": "263"
}
},
"amount": 10,
"createdAt": "2021-10-07T18:06:46+01:00",
"updatedAt": "2021-10-07T18:06:46+01:00",
"validDate": {
"start": "2021-10-07T18:06:46+01:00",
"end": "2021-10-07T18:36:46+01:00"
},
"availableMethods": [
{
"code": "MW",
"type": "DEFAULT",
"name": "MB WAY"
}
]
}
}
2. The user validates the payment on the MB WAY application
3. View the status of the payment
GET /payments/{id}
{
"apiVersion": "1.0",
"date": "2021-10-18T11:45:12+01:00",
"success": true,
"data": {
"id": "42373",
"referenceDetails": {
"reference": "A0000A585"
},
"stateDetails": {
"state": "confirmed",
"createdAt": "2021-10-07T18:07:46+01:00"
},
"paymentMethod": {
"code": "MW",
"type": "DEFAULT",
"details": {
"countryCode": "351",
"last3Digits": "263"
}
},
"amount": 100,
"createdAt": "2021-10-07T18:06:46+01:00",
"updatedAt": "2021-10-07T18:06:46+01:00",
"validDate": {
"start": "2021-10-07T18:06:46+01:00",
"end": "2021-10-07T18:36:46+01:00"
},
"availableMethods": [
{
"code": "MW",
"type": "DEFAULT",
"name": "MB WAY"
}
],
"paymentFee": {
"netAmount": "0.27750000",
"taxAmount": "0.04995000",
"invoiceDetails": null
}
}
}