Skip to content

Payment

Ariel Rey edited this page Oct 31, 2017 · 5 revisions

The methods available on payment are:

  • create - Create a Payment
mercadopago.payment.create(payload, configurations, callback);
  • save - Create a Payment
mercadopago.payment.save(payload, configurations, callback);
  • update - Update a Payment
mercadopago.payment.update(payload, configurations, callback);
  • get - Get a Payment
mercadopago.payment.get(id, configurations, callback);
  • findById - Get a Payment
mercadopago.payment.findById(id, configurations, callback);
  • search - Searching Payments
mercadopago.payment.search(configurations, callback);

Wrapper Methods:

  • cancel - Cancel a Payment
mercadopago.payment.cancel(id, configurations, callback);
  • refund - Refund a Payment
mercadopago.payment.refund(id, configurations, callback);
  • refundPartial - Refund partial amount from a Payment
mercadopago.payment.refundPartial(refundObject, configurations, callback);

The method functionality was already explain here.

For API references click here.

Wrapper Methods

Methods like cancel, refund and refundPartial 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.payment.update({
  id: 1,
  status: 'cancelled'
}).then().catch();

But, you can more easily make:

mercadopago.payment.cancel(1).then.catch();
Clone this wiki locally