Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
danielen-meli committed Dec 2, 2024
1 parent 2e40739 commit a0dda76
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/order/cancel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function createBodyOrder(token: string): CreateOrderData {
payer: {
email: '[email protected]'
},
type_config:{
type_config: {
capture_mode: 'manual'
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/examples/order/cancel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Mercado Pago Process Order.
*
* @see {@link [TODO: insert Order documentation URL] Documentation }.
*/

import { Order } from '@src/clients/order';
import MercadoPago from '@src/index';

const mercadoPagoConfig = new MercadoPago({ accessToken: '<ACCESS_TOKEN>', options: { timeout: 5000 } });

const order = new Order(mercadoPagoConfig);

const orderId = '<ORDER_ID>';

order.cancel({
id: orderId,
requestOptions: {
idempotencyKey: '<IDEMPOTENCY_KEY>'
}
}).then(console.log).catch(console.error);

0 comments on commit a0dda76

Please sign in to comment.