-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e40739
commit a0dda76
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ function createBodyOrder(token: string): CreateOrderData { | |
payer: { | ||
email: '[email protected]' | ||
}, | ||
type_config:{ | ||
type_config: { | ||
capture_mode: 'manual' | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |