diff --git a/README.md b/README.md index 9eeb44b3..cf1b68ae 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,13 @@ const body = { }, }; -// Step 5: Make the request -payment.create({ body }).then(console.log).catch(console.log); +// Step 5: Create request options object - Optional +const requestOptions = { + idempotencyKey: '', +}; + +// Step 6: Make the request +payment.create({ body, requestOptions }).then(console.log).catch(console.log); ``` ### Step 1: Import the parts of the module you want to use diff --git a/src/examples/payment/cancel.ts b/src/examples/payment/cancel.ts index 592dde4e..ac1b6594 100644 --- a/src/examples/payment/cancel.ts +++ b/src/examples/payment/cancel.ts @@ -13,5 +13,8 @@ const payment = new Payment(client); payment.cancel({ id: '', + requestOptions: { + idempotencyKey: '' + }, }).then(console.log).catch(console.log); diff --git a/src/examples/payment/capture.ts b/src/examples/payment/capture.ts index 106b4b8c..e4f24c63 100644 --- a/src/examples/payment/capture.ts +++ b/src/examples/payment/capture.ts @@ -14,5 +14,8 @@ const payment = new Payment(client); payment.capture({ id: '', transaction_amount: 12.34, + requestOptions: { + idempotencyKey: '' + }, }).then(console.log).catch(console.log); diff --git a/src/examples/payment/create.ts b/src/examples/payment/create.ts index 33beaf65..5aed47ef 100644 --- a/src/examples/payment/create.ts +++ b/src/examples/payment/create.ts @@ -18,5 +18,8 @@ payment.create({ body: { payer: { email: '' }, +}, +requestOptions: { + idempotencyKey: '' } }).then(console.log).catch(console.log);