Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
Fix: Update Stripe Postman collection tests (#10231)
Vasanth0c7f82b2a2d1
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.jsonindex 1cdee895b3..90ff48f6fe 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json@@ -49,7 +49,7 @@"card": {"card_number": "378282246310005","card_exp_month": "01",- "card_exp_year": "26",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.jsonindex 47912f2025..ae5b034f32 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.jsonindex 7dfbf639e5..0848b9975c 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.jsonindex 8becf0a7c1..20d0707372 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "Joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.jsonindex 09ffe6396d..3087900529 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario25-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json@@ -49,7 +49,7 @@"card": {"card_number": "378282246310005","card_exp_month": "01",- "card_exp_year": "26",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Confirm/request.jsonindex 91acf28218..2ca438112b 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "Joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.jsonindex 2fc1d3e062..90a9ad690c 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Confirm a payment with requires_customer_action status/Payments - Create with confirm true/request.json@@ -48,7 +48,7 @@"card": {"card_number": "4000000000003063","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Create payment with payment method billing/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Create payment with payment method billing/Payments - Create/request.jsonindex 77323059b8..b7ca179b09 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Create payment with payment method billing/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Create payment with payment method billing/Payments - Create/request.json@@ -41,7 +41,7 @@"card": {"card_number": "378282246310005","card_exp_month": "01",- "card_exp_year": "26",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"},diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Update payment with payment method billing/Payments - Update/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Update payment with payment method billing/Payments - Update/request.jsonindex eafa6b9d22..74e6111fb5 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Update payment with payment method billing/Payments - Update/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Update payment with payment method billing/Payments - Update/request.json@@ -23,7 +23,7 @@"card": {"card_number": "378282246310005","card_exp_month": "01",- "card_exp_year": "26",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"},diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Pass payment method billing in Confirm/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Pass payment method billing in Confirm/Payments - Confirm/request.jsonindex 2ded3043c3..4d11ac5308 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Pass payment method billing in Confirm/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Pass payment method billing in Confirm/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "Joseph Doe","card_cvc": "123"},diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.jsonindex 9e1278c7d9..b3fc605c69 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": null,"card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.jsonindex 02de494d68..51d6998d37 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.jsonindex a0e82b8610..71b9895e4e 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json@@ -43,7 +43,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.jsonindex bfb1e3d863..64777d11e9 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json@@ -25,7 +25,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": ""}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card Number/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card Number/request.jsonindex 2cb146e30a..74ae8e4a73 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card Number/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card Number/request.json@@ -25,7 +25,7 @@"card": {"card_number": "1234","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.jsonindex baa616ddc7..4a9a9179b4 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json@@ -25,7 +25,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.jsonindex b6f0a69ef9..09f192926b 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json@@ -26,7 +26,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - postal code check fail/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - postal code check fail/request.jsonindex bdc8b6bedc..76bb9b834e 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - postal code check fail/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - postal code check fail/request.json@@ -26,7 +26,7 @@"card": {"card_number": "4000000000000036","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - successful payment with billing/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - successful payment with billing/request.jsonindex 2ebb0ebb81..04b7b26bc4 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - successful payment with billing/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Check is payment checks are populated/Payments - successful payment with billing/request.json@@ -26,7 +26,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.jsonindex 4a2876af98..3f746d4bbb 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.jsonindex 978ad9bd54..18058e74f9 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.jsonindex 4a2876af98..3f746d4bbb 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.jsonindex 2fc1d3e062..90a9ad690c 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json@@ -48,7 +48,7 @@"card": {"card_number": "4000000000003063","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.jsonindex 72c0cf1fd9..12b887dd72 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4000000000003063","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.jsonindex 1a9dc98589..679cd6c77f 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario8-Create a failure card payment with confirm true/Payments - Create/request.json@@ -49,7 +49,7 @@"card": {"card_number": "4000000000009995","card_exp_month": "01",- "card_exp_year": "26",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.jsonindex 665946fccf..696268ee06 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.jsonindex 665946fccf..696268ee06 100644--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.jsonindex 322d38b08c..8b95903b8b 100644--- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.jsonindex c7ad4cb274..aac68dc4da 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json@@ -37,7 +37,7 @@"card": {"card_number": "123456","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.jsonindex 9fa8e3bbe1..1c818feabf 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json@@ -37,7 +37,7 @@"card": {"card_number": "123456","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "12345"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.jsonindex c55925d85a..6a723bd0f2 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.jsonindex 4a2876af98..3f746d4bbb 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.jsonindex 665946fccf..696268ee06 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.jsonindex 665946fccf..696268ee06 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.jsonindex 9c2ddbffb6..1050a06f52 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4000000000003063","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.jsonindex 665946fccf..696268ee06 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.jsonindex e52dcb06a5..85f3d10904 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.jsonindex 47912f2025..ae5b034f32 100644--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.jsonindex f3b7f262b8..a4c47e6129 100644--- a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json+++ b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json@@ -24,7 +24,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "John Doe"},"customer_id": "{{customer_id}}",diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.jsonindex 44e9559483..cb08f51c39 100644--- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json+++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json@@ -47,7 +47,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.jsonindex d0a12e7a4a..b7430b3131 100644--- a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json+++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json@@ -38,7 +38,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.jsonindex b7ecd39f2e..26efc1c75f 100644--- a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json+++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json@@ -38,7 +38,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/request.json b/postman/collection-dir/stripe/Payments/Payments - Create/request.jsonindex a9b867f0f6..32a821e75b 100644--- a/postman/collection-dir/stripe/Payments/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Payments/Payments - Create/request.json@@ -38,7 +38,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Payments/Payments - Update/request.json b/postman/collection-dir/stripe/Payments/Payments - Update/request.jsonindex 5bc7fcdf2b..4633e9536b 100644--- a/postman/collection-dir/stripe/Payments/Payments - Update/request.json+++ b/postman/collection-dir/stripe/Payments/Payments - Update/request.json@@ -36,7 +36,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Payments/Session Token/event.test.js b/postman/collection-dir/stripe/Payments/Session Token/event.test.jsindex ae591f10cd..b21577bf55 100644--- a/postman/collection-dir/stripe/Payments/Session Token/event.test.js+++ b/postman/collection-dir/stripe/Payments/Session Token/event.test.js@@ -15,18 +15,40 @@ pm.test(const responseJson = pm.response.json();-// Verify if the wallet_name in the response matches 'apple_pay'+// Debug: Check what's actually in the session_token array+console.log("Session tokens array:", JSON.stringify(responseJson.session_token, null, 2));+console.log("Array length:", responseJson.session_token.length);++// Verify the session_token array exists and has at least one itempm.test(- "[POST]::/payments/session_tokens - Verify wallet_name is 'apple_pay'",+ "[POST]::/payments/session_tokens - session_token array exists with items",function () {- pm.expect(responseJson.session_token[0].wallet_name).to.eql("apple_pay");+ pm.expect(responseJson.session_token).to.be.an('array');+ pm.expect(responseJson.session_token.length).to.be.at.least(1);},);-// Verify if the wallet_name in the response matches 'google_pay'+// Test for google_pay (which we know exists)pm.test(- "[POST]::/payments/session_tokens - Verify wallet_name is 'google_pay'",+ "[POST]::/payments/session_tokens - Verify google_pay exists",function () {- pm.expect(responseJson.session_token[1].wallet_name).to.eql("google_pay");+ const googlePayToken = responseJson.session_token.find(token => token.wallet_name === 'google_pay');+ pm.expect(googlePayToken).to.not.be.undefined;+ pm.expect(googlePayToken.wallet_name).to.eql("google_pay");},);++// Conditional test for apple_pay - only run if it exists+if (responseJson.session_token.find(token => token.wallet_name === 'apple_pay')) {+ pm.test(+ "[POST]::/payments/session_tokens - Verify apple_pay exists",+ function () {+ const applePayToken = responseJson.session_token.find(token => token.wallet_name === 'apple_pay');+ pm.expect(applePayToken).to.not.be.undefined;+ pm.expect(applePayToken.wallet_name).to.eql("apple_pay");+ },+ );+} else {+ console.log("apple_pay not found in response - this might be expected behavior");+}+diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.jsonindex a27c309c9a..f2f832fc58 100644--- a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json@@ -38,7 +38,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.jsonindex 24681fb62d..3aae89595b 100644--- a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json@@ -38,7 +38,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json b/postman/collection-dir/stripe/Refunds/Payments - Create/request.jsonindex 657d42351c..5bb42a1581 100644--- a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json+++ b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json@@ -39,7 +39,7 @@"card": {"card_number": "378282246310005","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "123"}diff --git a/postman/collection-json/paypal.postman_collection.json b/postman/collection-json/paypal.postman_collection.jsondeleted file mode 100644index 8877de116e..0000000000--- a/postman/collection-json/paypal.postman_collection.json+++ /dev/null@@ -1,7619 +0,0 @@-{- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "const path = pm.request.url.toString();",- "const isPostRequest = pm.request.method.toString() === \"POST\";",- "const isPaymentCreation = path.match(/\\/payments$/) && isPostRequest;",- "",- "if (isPaymentCreation) {",- " try {",- " const request = JSON.parse(pm.request.body.toJSON().raw);",- " const merchantConnectorId = pm.collectionVariables.get(\"merchant_connector_id\");",- "",- " // Attach routing",- " const routing = {",- " type: \"single\", data: { connector: \"paypal\", merchant_connector_id: merchantConnectorId }",- " };",- " request[\"routing\"] = routing;",- "",- " let updatedRequest = {",- " mode: \"raw\",",- " raw: JSON.stringify(request),",- " options: {",- " raw: {",- " language: \"json\",",- " },",- " },",- " };",- " pm.request.body.update(updatedRequest);",- " } catch (error) {",- " console.error(\"Failed to inject routing in the request\");",- " console.error(error);",- " }",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "test",- "script": {- "exec": [- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(\"[LOG]::payment_id - \" + jsonData.payment_id);",- "}",- "",- "console.log(\"[LOG]::x-request-id - \" + pm.response.headers.get(\"x-request-id\"));",- ""- ],- "type": "text/javascript"- }- }- ],- "item": [- {- "name": "Health check",- "item": [- {- "name": "New Request",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/accounts - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [],- "url": {- "raw": "{{baseUrl}}/health",- "host": [- "{{baseUrl}}"- ],- "path": [- "health"- ]- }- },- "response": []- }- ]- },- {- "name": "Flow Testcases",- "item": [- {- "name": "QuickStart",- "item": [- {- "name": "Merchant Account - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/accounts - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/accounts - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set merchant_id as variable for jsonData.merchant_id",- "if (jsonData?.merchant_id) {",- " pm.collectionVariables.set(\"merchant_id\", jsonData.merchant_id);",- " console.log(",- " \"- use {{merchant_id}} as collection variable for value\",",- " jsonData.merchant_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{merchant_id}}, as jsonData.merchant_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set api_key as variable for jsonData.api_key",- "if (jsonData?.api_key) {",- " pm.collectionVariables.set(\"api_key\", jsonData.api_key);",- " console.log(",- " \"- use {{api_key}} as collection variable for value\",",- " jsonData.api_key,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set publishable_key as variable for jsonData.publishable_key",- "if (jsonData?.publishable_key) {",- " pm.collectionVariables.set(\"publishable_key\", jsonData.publishable_key);",- " console.log(",- " \"- use {{publishable_key}} as collection variable for value\",",- " jsonData.publishable_key,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{publishable_key}}, as jsonData.publishable_key is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{admin_api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"merchant_id\":\"merchant_{{$timestamp}}\",\"locker_id\":\"m0010\",\"merchant_name\":\"NewAge Retailer\",\"primary_business_details\":[{\"country\":\"US\",\"business\":\"default\"}],\"merchant_details\":{\"primary_contact_person\":\"John Test\",\"primary_email\":\"[email protected]\",\"primary_phone\":\"sunt laborum\",\"secondary_contact_person\":\"John Test2\",\"secondary_email\":\"[email protected]\",\"secondary_phone\":\"cillum do dolor id\",\"website\":\"www.example.com\",\"about_business\":\"Online Retail with a wide selection of organic products for North America\",\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"}},\"return_url\":\"https://duck.com\",\"webhook_details\":{\"webhook_version\":\"1.0.1\",\"webhook_username\":\"ekart_retail\",\"webhook_password\":\"password_ekart@123\",\"payment_created_enabled\":true,\"payment_succeeded_enabled\":true,\"payment_failed_enabled\":true},\"sub_merchants_enabled\":false,\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/accounts",- "host": [- "{{baseUrl}}"- ],- "path": [- "accounts"- ]- },- "description": "Create a new account for a merchant. The merchant could be a seller or retailer or client who likes to receive and send payments."- },- "response": []- },- {- "name": "API Key - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/api_keys/:merchant_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/api_keys/:merchant_id - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set api_key_id as variable for jsonData.key_id",- "if (jsonData?.key_id) {",- " pm.collectionVariables.set(\"api_key_id\", jsonData.key_id);",- " console.log(",- " \"- use {{api_key_id}} as collection variable for value\",",- " jsonData.key_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{api_key_id}}, as jsonData.key_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set api_key as variable for jsonData.api_key",- "if (jsonData?.api_key) {",- " pm.collectionVariables.set(\"api_key\", jsonData.api_key);",- " console.log(",- " \"- use {{api_key}} as collection variable for value\",",- " jsonData.api_key,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{api_key}}, as jsonData.api_key is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{admin_api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "raw": "{\"name\":\"API Key 1\",\"description\":null,\"expiration\":\"2069-09-23T01:02:03.000Z\"}"- },- "url": {- "raw": "{{baseUrl}}/api_keys/:merchant_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "api_keys",- ":merchant_id"- ],- "variable": [- {- "key": "merchant_id",- "value": "{{merchant_id}}"- }- ]- }- },- "response": []- },- {- "name": "Payment Connector - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/account/:account_id/connectors - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/account/:account_id/connectors - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set merchant_connector_id as variable for jsonData.merchant_connector_id",- "if (jsonData?.merchant_connector_id) {",- " pm.collectionVariables.set(",- " \"merchant_connector_id\",",- " jsonData.merchant_connector_id,",- " );",- " console.log(",- " \"- use {{merchant_connector_id}} as collection variable for value\",",- " jsonData.merchant_connector_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{merchant_connector_id}}, as jsonData.merchant_connector_id is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"connector_type\":\"payment_processor\",\"connector_name\":\"paypal\",\"connector_account_details\":{\"auth_type\":\"BodyKey\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\"},\"business_country\":\"US\",\"business_label\":\"default\",\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"Visa\",\"Mastercard\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"Visa\",\"Mastercard\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"paypal\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":false,\"installment_payment_enabled\":false}]}],\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}",- "description": "(Required) The unique identifier for the merchant account"- }- ]- },- "description": "Create a new Payment Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialised services like Fraud / Accounting etc."- },- "response": []- },- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Happy Cases",- "item": [- {- "name": "Scenario8-Create payment with Manual capture with confirm false and surcharge_data",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"surcharge_details\":{\"surcharge_amount\":5,\"tax_amount\":5},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6550);",- " },",- " );",- "}",- "",- "// Response body should have a valid surcharge_details field\"",- "pm.test(\"Check if valid 'surcharge_details' is present in the response\", function () {",- " pm.response.to.have.jsonBody('surcharge_details');",- " pm.expect(jsonData.surcharge_details.surcharge_amount).to.eql(5);",- " pm.expect(jsonData.surcharge_details.tax_amount).to.eql(5);",- "});"- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}"- }- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- " }",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6550\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6550);",- " }",- " );",- "}",- "",- "// Response body should have a valid surcharge_details field\"",- "pm.test(",- " \"Check if valid 'surcharge_details' is present in the response\",",- " function () {",- " pm.response.to.have.jsonBody(\"surcharge_details\");",- " pm.expect(jsonData.surcharge_details.surcharge_amount).to.eql(5);",- " pm.expect(jsonData.surcharge_details.tax_amount).to.eql(5);",- " }",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6550'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6550);",- " }",- " );",- "}",- "",- "// Response body should have a valid surcharge_details field\"",- "pm.test(",- " \"Check if valid 'surcharge_details' is present in the response\",",- " function () {",- " pm.response.to.have.jsonBody(\"surcharge_details\");",- " pm.expect(jsonData.surcharge_details.surcharge_amount).to.eql(5);",- " pm.expect(jsonData.surcharge_details.tax_amount).to.eql(5);",- " }",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario1-Create payment with confirm true",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// //Validate the amount",- "// pm.test(\"[POST]::/payments - connector\", function () {",- "// // pm.expect(jsonData.connector).to.eql(\"paypal\");",- "// pm.expect(jsonData.amount).to.eql(pm.request.amount);",- "// });",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario2-Create payment with confirm false",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario3-Create payment without PMD",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id/confirm - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"0\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario4-Create payment with Manual capture with confirm false",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 0'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}"- }- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario4-Create payment with Manual capture",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- " }",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " }",- " );",- "}",- "",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6540,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario11-Create Partial Capture payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- " }",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]:://payments/:id/capture - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 6540\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":6000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"partially_captured\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " }",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " }",- " );",- "}",- "",- "// Response body should have value \"6000\" for \"amount_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6000);",- " }",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario5-Void the payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Cancel",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"cancelled\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'status' matches 'cancelled'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/cancel",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "cancel"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"cancelled\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'cancelled'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"cancelled\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario6-Create Wallet - Paypal",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- " );",- "}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"127.0.0.1\"},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"payment_method\":\"wallet\",\"payment_method_type\":\"paypal\",\"payment_method_data\":{\"wallet\":{\"paypal_redirect\":{}}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}"- }- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- }- ]- },- {- "name": "Scenario7-Create Wallet - Paypal with confirm false",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\",\"accept_header\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\",\"language\":\"nl-NL\",\"color_depth\":24,\"screen_height\":723,\"screen_width\":1536,\"time_zone\":0,\"java_enabled\":true,\"java_script_enabled\":true,\"ip_address\":\"127.0.0.1\"},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id/confirm - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- " );",- "}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"wallet\",\"payment_method_type\":\"paypal\",\"payment_method_data\":{\"wallet\":{\"paypal_redirect\":{}}},\"customer_acceptance\":{\"acceptance_type\":\"online\",\"accepted_at\":\"2022-09-10T10:11:12Z\",\"online\":{\"ip_address\":\"123.32.25.123\",\"user_agent\":\"Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_customer_action\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- }- ]- },- {- "name": "Variation Cases",- "item": [- {- "name": "Scenario1-Create payment with Invalid card details",- "item": [- {- "name": "Payments - Create(Invalid card number)",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.error_type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.error_type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.error_type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have message about invalid card number",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if error message contains 'invalid card number'\",",- " function () {",- " pm.expect(jsonData.error.message.toLowerCase()).to.include(\"invalid card number\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"123456\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Create(Invalid Exp month)",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"Invalid Expiry Month\" for \"reason\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Month\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"13\",\"card_exp_year\":\"2023\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Create(Invalid Exp Year)",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"next_action.redirect_to_url\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"Invalid Expiry Year\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"Invalid Expiry Year\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"2022\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Create(invalid CVV)",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(\"[POST]::/payments - Content check if 'error' exists\", function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- "});",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"Invalid card_cvc length\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"Invalid card_cvc length\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"12345\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- }- ]- },- {- "name": "Scenario2-Confirming the payment without PMD",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_payment_method\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_payment_method'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_payment_method\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Confirm",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"A payment token or payment method data or ctp service details is required\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(",- " \"A payment token or payment method data or ctp service details is required\",",- " );",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments-Create API"- },- "response": []- }- ]- },- {- "name": "Scenario3-Capture greater amount",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"paypal\");",- "});",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- "",- "// Response body should have value \"null\" for \"amount_received\"",- "if (jsonData?.amount) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_received' matches 'null'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(null);",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount_capturable\"",- "if (jsonData?.amount_capturable) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"amount_to_capture is greater than amount\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(",- " \"amount_to_capture is greater than amount\",",- " );",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario4-Capture the succeeded payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/capture - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/capture - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/capture - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount_to_capture\":7000,\"statement_descriptor_name\":\"Joseph\",\"statement_descriptor_suffix\":\"JS\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/capture",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "capture"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To capture the funds for an uncaptured payment"- },- "response": []- }- ]- },- {- "name": "Scenario5-Void the success_slash_failure payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\"",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\"",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\"",- " );",- "}",- "",- "// Response body should have value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " }",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4012000033330026\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Cancel",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payments/:id/cancel - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/:id/cancel - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments/:id/cancel - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"cancellation_reason\":\"requested_by_customer\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/cancel",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "cancel"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action"- },- "response": []- }- ]- },- {- "name": "Scenario8-Refund for unsuccessful payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payments - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[POST]::/payments - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"StripeCustomer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"1234\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"PiX\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"- },- "response": []- },- {- "name": "Payments - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payments/:id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Validate if response has JSON Body",- "pm.test(\"[GET]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id",- "if (jsonData?.payment_id) {",- " pm.collectionVariables.set(\"payment_id\", jsonData.payment_id);",- " console.log(",- " \"- use {{payment_id}} as collection variable for value\",",- " jsonData.payment_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id",- "if (jsonData?.mandate_id) {",- " pm.collectionVariables.set(\"mandate_id\", jsonData.mandate_id);",- " console.log(",- " \"- use {{mandate_id}} as collection variable for value\",",- " jsonData.mandate_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret",- "if (jsonData?.client_secret) {",- " pm.collectionVariables.set(\"client_secret\", jsonData.client_secret);",- " console.log(",- " \"- use {{client_secret}} as collection variable for value\",",- " jsonData.client_secret,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.\",",- " );",- "}",- "",- "// Response body should have value \"requires_confirmation\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_confirmation'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_confirmation\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- }- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/refunds - Status code is 4xx\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) {}",- "",- "// pm.collectionVariables - Set refund_id as variable for jsonData.payment_id",- "if (jsonData?.refund_id) {",- " pm.collectionVariables.set(\"refund_id\", jsonData.refund_id);",- " console.log(",- " \"- use {{refund_id}} as collection variable for value\",",- " jsonData.refund_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{refund_id}}, as jsonData.refund_id is undefined.\",",- " );",- "}",- "",- "// Response body should have \"error\"",- "pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if 'error' exists\",",- " function () {",- " pm.expect(typeof jsonData.error !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.type' matches 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"payment_id\":\"{{payment_id}}\",\"amount\":540,\"reason\":\"Customer returned product\",\"refund_type\":\"instant\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds"- ]- },- "description": "To create a refund against an already processed payment"- },- "response": []- }- ]- }- ]- }- ]- }- ],- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "info": {- "_postman_id": "351e04ec-1ec0-4cb5-bf39-5b95c8099c53",- "name": "paypal",- "description": "## Get started\n\nJuspay Router provides a collection of APIs that enable you to process and manage payments. Our APIs accept and return JSON in the HTTP body, and return standard HTTP response codes. \nYou can consume the APIs directly using your favorite HTTP/REST library. \nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without affecting production data.\n\n### Base URLs\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n| --- | --- |\n| Sandbox | [https://sandbox.hyperswitch.io](https://sandbox.hyperswitch.io) |\n| Production | [https://router.juspay.io](https://router.juspay.io) |\n\n# Authentication\n\nWhen you sign up for an account, you are given a secret key (also referred as api-key). You may authenticate all API requests with Juspay server by providing the appropriate key in the request Authorization header. \nNever share your secret api keys. Keep them guarded and secure.\n\nContact Support: \nName: Juspay Support \nEmail: [[email protected]](mailto:[email protected])",- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"- },- "variable": [- {- "key": "baseUrl",- "value": "",- "type": "string"- },- {- "key": "admin_api_key",- "value": "",- "type": "string"- },- {- "key": "api_key",- "value": "",- "type": "string"- },- {- "key": "merchant_id",- "value": ""- },- {- "key": "payment_id",- "value": ""- },- {- "key": "customer_id",- "value": ""- },- {- "key": "mandate_id",- "value": ""- },- {- "key": "payment_method_id",- "value": ""- },- {- "key": "refund_id",- "value": ""- },- {- "key": "merchant_connector_id",- "value": ""- },- {- "key": "client_secret",- "value": "",- "type": "string"- },- {- "key": "connector_api_key",- "value": "",- "type": "string"- },- {- "key": "connector_key1",- "value": "",- "type": "string"- },- {- "key": "publishable_key",- "value": "",- "type": "string"- },- {- "key": "api_key_id",- "value": "",- "type": "string"- },- {- "key": "payment_token",- "value": ""- },- {- "key": "gateway_merchant_id",- "value": "",- "type": "string"- },- {- "key": "certificate",- "value": "",- "type": "string"- },- {- "key": "certificate_keys",- "value": "",- "type": "string"- }- ]-}