-
Notifications
You must be signed in to change notification settings - Fork 112
Pre Approval
Ariel Rey edited this page Oct 31, 2017
·
2 revisions
The methods available on preapproval are:
- create - Create a Pre Approval
mercadopago.preapproval.create(payload, configurations, callback);
- save - Create a Pre Approval
mercadopago.preapproval.save(payload, configurations, callback);
- update - Update a Pre Approval
mercadopago.preapproval.update(payload, configurations, callback);
- get - Get a Pre Approval
mercadopago.preapproval.get(id, configurations, callback);
- findById - Get a Pre Approval
mercadopago.preapproval.findById(id, configurations, callback);
- search - Searching Pre Approvals
mercadopago.preapproval.search(configurations, callback);
Wrapper Methods:
- cancel - Cancel a Pre Approval
mercadopago.preapproval.cancel(id, configurations, callback);
- pause - Pause a Pre Approval
mercadopago.preapproval.pause(id, configurations, callback);
The method functionality was already explain here.
For API references click here.
Methods like cancel, pause are wrappers of put and post methods that add the correspondent values on the payload. For Example:
If you want to cancel a payment you need to do:
mercadopago.preapproval.update({
id: 1,
status: 'cancelled'
}).then().catch();
But, you can more easily make:
mercadopago.preapproval.cancel(1).then.catch();