diff --git a/e2e/order/cancel.spec.ts b/e2e/order/cancel.spec.ts index 268c5e6..951447f 100644 --- a/e2e/order/cancel.spec.ts +++ b/e2e/order/cancel.spec.ts @@ -29,7 +29,7 @@ function createBodyOrder(token: string): CreateOrderData { payer: { email: 'test_1731350184@testuser.com' }, - type_config:{ + type_config: { capture_mode: 'manual' } } diff --git a/src/examples/order/cancel.ts b/src/examples/order/cancel.ts new file mode 100644 index 0000000..3696194 --- /dev/null +++ b/src/examples/order/cancel.ts @@ -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: '', options: { timeout: 5000 } }); + +const order = new Order(mercadoPagoConfig); + +const orderId = ''; + +order.cancel({ + id: orderId, + requestOptions: { + idempotencyKey: '' + } +}).then(console.log).catch(console.error); \ No newline at end of file