API
Skip to main content

Save MB WAY

To save the MB WAY method for future purchases, it is only necessary to make a successful payment via MB WAY.

The process works as follows:

  1. Notify MB WAY payment indicating the flag createRegistration=true and the UUID of the customer;
  2. User confirms payment in the application;
  3. View payment or View customer methods.

1. Notification of MB WAY payment with registration

POST /payments

{
"type": "payment",
"amount": 100,
"customer": {
"uuid": "e2343605-cf46-43de-b20b-9b7d1c95a9b2" // <== ID do cliente registado
},
"paymentMethod": {
"code": "MW",
"details": {
"phoneNumber": "351#123456789",
"createRegistration": true // <== Flag indicativa para guardar o método
}
}
}

2. The User validates the payment on the MB WAY application

MB WAY confirmed

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": {
"uuid": "811900ea-e386-40be-bd7d-b55c009968a5", // <== UUID do método registado
"code": "MW",
"type": "DEFAULT",
"details": {
"phoneNumber": "351#961879263",
"createRegistration": true
}
},
"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
},
"customer": {
"uuid": "e2343605-cf46-43de-b20b-9b7d1c95a9b2"
}
}
}