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 and fix failing Postman collection tests (#10265)
Ashish Kumardd40155c1736
diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Create Gift Card payment/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Create Gift Card payment/Payments - Create/request.jsonindex e00c0bcf3d..9c218eab4d 100644--- a/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Create Gift Card payment/Payments - Create/request.json+++ b/postman/collection-dir/adyen_uk/Flow Testcases/Happy Cases/Scenario19-Create Gift Card payment/Payments - Create/request.json@@ -37,8 +37,8 @@"payment_method_data": {"gift_card": {"givex": {- "number": "6364530000000000",- "cvc": "122222"+ "number": "6006490000000000",+ "cvc": "737"}}},diff --git a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.jsonindex ea9ecd8243..e7e5eb9b98 100644--- a/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json+++ b/postman/collection-dir/adyen_uk/Flow Testcases/Variation Cases/Scenario10-Create Gift Card payment where it fails due to insufficient balance/Payments - Create/request.json@@ -37,8 +37,8 @@"payment_method_data": {"gift_card": {"givex": {- "number": "6364530000000000",- "cvc": "122222"+ "number": "6006490000000000",+ "cvc": "737"}}},diff --git a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.jsonindex a224e4801f..8838e723a9 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.jsonindex b4169de208..0dc5f50abf 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario28-Create partially captured payment with refund/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.jsonindex 402aa25fef..6f2b6c6a4e 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json@@ -44,7 +44,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.jsonindex 25b3254440..95903a5968 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.jsonindex 25b3254440..95903a5968 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.jsonindex b65703d6e8..5efd149982 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario6-Create 3DS payment/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/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.jsonindex c8ed633c9f..4aadb38096 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario7-Create 3DS payment with confirm false/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/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/bluesnap/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.jsonindex 4159d076f5..da059372ec 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/QuickStart/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/bluesnap/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/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json+++ b/postman/collection-dir/bluesnap/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/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.jsonindex d68379f944..d6d267da6a 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json+++ b/postman/collection-dir/bluesnap/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/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.jsonindex 25b3254440..95903a5968 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.jsonindex ce837e7a52..4f05865253 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario6-Create 3DS payment with greater capture/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/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/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.jsonindex cf87979677..b7674ebfc1 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.jsonindex 119353069b..e96ab61299 100644--- a/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json+++ b/postman/collection-dir/bluesnap/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4242424242424242","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/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.jsindex 30eaca5c0c..645aaa8f96 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.jsonindex 4e96529fe9..2620f1d048 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4485040371536584","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/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.jsonindex 74441099ea..bfa86e0d00 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/3DS Payment/Payments - Create/request.json@@ -34,11 +34,11 @@"payment_method": "card","payment_method_data": {"card": {- "card_number": "4242424242424242",- "card_exp_month": "10",- "card_exp_year": "25",+ "card_number": "4111111111111111",+ "card_exp_month": "12",+ "card_exp_year": "30","card_holder_name": "joseph Doe",- "card_cvc": "123"+ "card_cvc": "100"}},"billing": {diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.jsonindex 04df55714a..adb1d51a1b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Cancel After Partial Capture/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4242424242424242","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/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.jsonindex 04df55714a..adb1d51a1b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Refund After Partial Capture/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4242424242424242","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/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.jsonindex 04df55714a..adb1d51a1b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Retrieve After Partial Capture/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4242424242424242","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/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.jsonindex 04df55714a..adb1d51a1b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario10-Multiple Captures/Successful Partial Capture and Refund/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4242424242424242","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/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Payments - Create/event.test.jsindex 74bc3f6ab7..acc7533755 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Payments - Create/event.test.js@@ -49,12 +49,12 @@ if (jsonData?.customer_id) {console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');};-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}\ No newline at end of filediff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Save card payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Save card payments - Confirm/event.test.jsindex 4f38b75d82..789f705d75 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Save card payments - Confirm/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario11-Save card flow/Save card payments - Confirm/event.test.js@@ -63,12 +63,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario12-Don't Pass CVV for save card flow and verify success payment/Save card payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario12-Don't Pass CVV for save card flow and verify success payment/Save card payments - Confirm/event.test.jsindex 82a20684b2..8206ca97da 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario12-Don't Pass CVV for save card flow and verify success payment/Save card payments - Confirm/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario12-Don't Pass CVV for save card flow and verify success payment/Save card payments - Confirm/event.test.js@@ -63,12 +63,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario14-Save card payment with manual capture/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario14-Save card payment with manual capture/Payments - Create/event.test.jsindex 74bc3f6ab7..acc7533755 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario14-Save card payment with manual capture/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario14-Save card payment with manual capture/Payments - Create/event.test.js@@ -49,12 +49,12 @@ if (jsonData?.customer_id) {console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');};-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}\ No newline at end of filediff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.jsindex bc42544064..c1f2547cc3 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Confirm/event.test.js@@ -63,12 +63,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.jsonindex 762826dac0..1bccdebf30 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario2-Create payment with confirm false/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.jsindex 71acfe9749..5c36ce33cb 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/event.test.js@@ -63,12 +63,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.jsonindex cc9d7304aa..180e29f90f 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json@@ -44,7 +44,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.jsonindex de5aa29f7b..14bfddb09e 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture with confirm false/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.jsonindex c4f2248a4f..92955dda9c 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario5-Create payment with Manual capture/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.jsonindex c4f2248a4f..92955dda9c 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario6-Create Partial Capture payment/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.jsonindex c4f2248a4f..92955dda9c 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.jsindex 4b3558a20c..99de04c1b1 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.jsonindex 47f08f9f37..0146cfc45b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario8-Refund full payment/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.jsindex 4b3558a20c..99de04c1b1 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.jsonindex 47f08f9f37..0146cfc45b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Happy Cases/Scenario9-Partial refund/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.jsonindex 872fac0738..e1c2d80320 100644--- a/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/QuickStart/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.jsonindex 2d0e17e60e..3ee0226aa8 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid card number)/request.json+++ b/postman/collection-dir/checkout/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": "4644968546281686","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/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.jsonindex bd5526d6f8..e0fb3efe2f 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(invalid CVV)/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.jsonindex c4f2248a4f..92955dda9c 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.jsindex 16c37817f0..0905a16fb2 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.jsonindex 47f08f9f37..0146cfc45b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.jsindex 16c37817f0..0905a16fb2 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.jsonindex 06284e30ae..f774af6b6f 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.jsindex 4b3558a20c..99de04c1b1 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/event.test.js@@ -60,12 +60,12 @@ if (jsonData?.client_secret) {);}-// Response body should have value "processing" for "status"+// Response body should have value "processing" or "succeeded" for "status"if (jsonData?.status) {pm.test(- "[POST]::/payments - Content check if value for 'status' matches 'processing'",+ "[POST]::/payments - Content check if value for 'status' matches 'processing' or 'succeeded'",function () {- pm.expect(jsonData.status).to.eql("processing");+ pm.expect(["processing", "succeeded"]).to.include(jsonData.status);},);}diff --git a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.jsonindex 47f08f9f37..0146cfc45b 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund exceeds amount/Payments - Create/request.json@@ -36,7 +36,7 @@"card": {"card_number": "4005519200000004","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/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.jsonindex 758498447d..9cad00e136 100644--- a/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json+++ b/postman/collection-dir/checkout/Flow Testcases/Variation Cases/Scenario6-Refund for unsuccessful payment/Payments - Create/request.json@@ -37,7 +37,7 @@"card": {"card_number": "371449635398431","card_exp_month": "10",- "card_exp_year": "25",+ "card_exp_year": "30","card_holder_name": "joseph Doe","card_cvc": "1234"}diff --git a/postman/collection-json/adyen_uk.postman_collection.json b/postman/collection-json/adyen_uk.postman_collection.jsondeleted file mode 100644index 8503f05090..0000000000--- a/postman/collection-json/adyen_uk.postman_collection.json+++ /dev/null@@ -1,13957 +0,0 @@-{- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "// Add appropriate profile_id for relevant requests",- "const path = pm.request.url.toString();",- "const isPostRequest = pm.request.method.toString() === \"POST\";",- "const isPaymentCreation = path.match(/\\/payments$/) && isPostRequest;",- "const isPayoutCreation = path.match(/\\/payouts\\/create$/) && isPostRequest;",- "",- "if (isPaymentCreation || isPayoutCreation) {",- " try {",- " const request = JSON.parse(pm.request.body.toJSON().raw);",- "",- " // Attach profile_id",- " const profile_id = isPaymentCreation",- " ? pm.collectionVariables.get(\"payment_profile_id\")",- " : pm.collectionVariables.get(\"payout_profile_id\");",- " request[\"profile_id\"] = profile_id;",- "",- " // Attach routing",- " const routing = { type: \"single\", data: \"adyen\" };",- " 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 profile_id 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"postman_merchant_GHAction_{{$guid}}\",\"locker_id\":\"m0010\",\"merchant_name\":\"NewAge Retailer\",\"primary_business_details\":[{\"country\":\"US\",\"business\":\"default\"},{\"country\":\"GB\",\"business\":\"payouts\"}],\"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.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set profile_id as variable for jsonData.payment_profile_id",- "if (jsonData?.profile_id) {",- " pm.collectionVariables.set(\"payment_profile_id\", jsonData.profile_id);",- " console.log(",- " \"- use {{payment_profile_id}} as collection variable for value\",",- " jsonData.profile_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_profile_id}}, as jsonData.profile_id is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"adyen\",\"connector_account_details\":{\"auth_type\":\"BodyKey\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\",\"api_secret\":\"{{connector_api_secret}}\"},\"test_mode\":true,\"disabled\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"pay_bright\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"walley\",\"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\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mobile_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"ali_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"we_chat_pay\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"mb_way\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"gift_card\",\"payment_method_types\":[{\"payment_method_type\":\"givex\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"giropay\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"blik\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"trustly\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_czech_republic\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_finland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_poland\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"online_banking_slovakia\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bancontact_card\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\"}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}}}}"- },- "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": "Payout 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.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set profile_id as variable for jsonData.payout_profile_id",- "if (jsonData?.profile_id) {",- " pm.collectionVariables.set(\"payout_profile_id\", jsonData.profile_id);",- " console.log(",- " \"- use {{payout_profile_id}} as collection variable for value\",",- " jsonData.profile_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payout_profile_id}}, as jsonData.profile_id is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"payout_processor\",\"connector_name\":\"adyen\",\"connector_account_details\":{\"auth_type\":\"SignatureKey\",\"api_key\":\"{{connector_api_key}}\",\"key1\":\"{{connector_key1}}\",\"api_secret\":\"{{connector_api_secret}}\"},\"test_mode\":true,\"disabled\":false,\"business_country\":\"GB\",\"business_label\":\"payouts\",\"metadata\":{\"endpoint_prefix\":\"\"}}"- },- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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.\",",- " );",- "}",- ""- ],- "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\":600,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Payouts - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payouts/create - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payouts/create - 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]::/payouts/create - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// Validate if status is successful",- "// if (jsonData?.status) {",- "// pm.test(\"[POST]::/payouts/create - Content check if value for 'status' matches 'success'\",",- "// function () {",- "// pm.expect(jsonData.status).to.eql(\"success\");",- "// },",- "// );",- "// }",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {",- " jsonData = pm.response.json();",- "} catch (e) { }",- "",- "// pm.collectionVariables - Set payout_id as variable for jsonData.payout_id",- "if (jsonData?.payout_id) {",- " pm.collectionVariables.set(\"payout_id\", jsonData.payout_id);",- " console.log(",- " \"- use {{payout_id}} as collection variable for value\",",- " jsonData.payout_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payout_id}}, as jsonData.payout_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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":1,\"currency\":\"EUR\",\"customer_id\":\"payout_customer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payout request\",\"connector\":[\"adyen\"],\"payout_type\":\"bank\",\"payout_method_data\":{\"bank\":{\"iban\":\"NL46TEST0136169112\",\"bic\":\"ABNANL2A\",\"bank_name\":\"Deutsche Bank\",\"bank_country_code\":\"NL\",\"bank_city\":\"Amsterdam\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"CA\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"entity_type\":\"Individual\",\"recurring\":true,\"metadata\":{\"ref\":\"123\"},\"confirm\":true,\"auto_fulfill\":true}"- },- "url": {- "raw": "{{baseUrl}}/payouts/create",- "host": [- "{{baseUrl}}"- ],- "path": [- "payouts",- "create"- ]- },- "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": "Payouts - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payouts/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payouts/: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]::/payouts/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "// pm.collectionVariables - Set payout_id as variable for jsonData.payout_id",- "if (jsonData?.payout_id) {",- " pm.collectionVariables.set(\"payout_id\", jsonData.payout_id);",- " console.log(",- " \"- use {{payout_id}} as collection variable for value\",",- " jsonData.payout_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payout_id}}, as jsonData.payout_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}}/payouts/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payouts",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{payout_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": "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\");",- " },",- " );",- "}",- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "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}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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.\",",- " );",- "}",- "",- "// 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": "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\",\"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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// 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_received\"",- "if (jsonData?.amount_received) {",- " pm.test(",- " \"[POST]::/payments:id/capture - Content check if value for 'amount_received' matches '0'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(0);",- " },",- " );",- "}",- ""- ],- "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 \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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": "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.\",",- " );",- "}",- "",- "// 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": "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\",\"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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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 3DS 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_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;",- " },",- ");",- ""- ],- "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4917610000000000\",\"card_exp_month\":\"03\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"}},\"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\":\"125.0.0.1\"},\"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_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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario7-Create 3DS 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\");",- " },",- " );",- "}",- ""- ],- "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4917610000000000\",\"card_exp_month\":\"03\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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 \"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;",- " },",- ");",- ""- ],- "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}}\",\"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\":\"125.0.0.1\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario8-Refund full 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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"DUPLICATE\",\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario9-Create a mandate and recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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-copy",- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Scenario10-Partial refund",- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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\":\"RETURN\",\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Refunds - Create-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"1000\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "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\":1000,\"reason\":\"FRAUD\",\"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": []- },- {- "name": "Refunds - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Payments - Retrieve-copy",- "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 \"refunds\"",- "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",- " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",- "});",- ""- ],- "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-Bank Redirect-eps",- "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\":1000,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":1000,\"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\",\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\"}},\"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\":\"AT\",\"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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"eps\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"eps\");",- " },",- " );",- "}",- "",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- ""- ],- "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\":\"bank_redirect\",\"payment_method_type\":\"eps\",\"payment_method_data\":{\"bank_redirect\":{\"eps\":{\"billing_details\":{\"billing_name\":\"John Doe\"},\"bank_name\":\"ing\",\"preferred_language\":\"en\",\"country\":\"AT\"}}},\"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\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario12-Refund recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Joseph\",\"last_name\":\"Doe\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Joseph\",\"last_name\":\"Doe\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":6570,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6570,\"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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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-copy",- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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 Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"reason\":\"DUPLICATE\",\"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": []- },- {- "name": "Refunds - Retrieve Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario13-Bank debit-ach",- "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\":10000,\"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\":\"+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\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"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 \"ach\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"ach\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- ""- ],- "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\":\"bank_debit\",\"payment_method_type\":\"ach\",\"payment_method_data\":{\"bank_debit\":{\"ach_bank_debit\":{\"account_number\":\"40308669\",\"routing_number\":\"121000358\",\"sort_code\":\"560036\",\"shopper_email\":\"[email protected]\",\"card_holder_name\":\"joseph Doe\",\"bank_account_holder_name\":\"David Archer\",\"billing_details\":{\"houseNumberOrName\":\"50\",\"street\":\"Test Street\",\"city\":\"Amsterdam\",\"stateOrProvince\":\"NY\",\"postalCode\":\"12010\",\"country\":\"US\",\"name\":\"A. Klaassen\",\"email\":\"[email protected]\"},\"reference\":\"daslvcgbaieh\"}}},\"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\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario14-Bank debit-Bacs",- "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\":100,\"currency\":\"GBP\",\"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\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"GB\"}},\"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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Response body should have value \"bacs\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'bacs'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"bacs\");",- " },",- " );",- "}",- "",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- ""- ],- "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\":\"bank_debit\",\"payment_method_type\":\"bacs\",\"payment_method_data\":{\"bank_debit\":{\"bacs_bank_debit\":{\"account_number\":\"40308669\",\"routing_number\":\"121000358\",\"sort_code\":\"560036\",\"shopper_email\":\"[email protected]\",\"card_holder_name\":\"joseph Doe\",\"bank_account_holder_name\":\"David Archer\",\"billing_details\":{\"houseNumberOrName\":\"50\",\"street\":\"Test Street\",\"city\":\"Amsterdam\",\"stateOrProvince\":\"NY\",\"postalCode\":\"12010\",\"country\":\"GB\",\"name\":\"A. Klaassen\",\"email\":\"[email protected]\"},\"reference\":\"daslvcgbaieh\"}}},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario15-Bank Redirect-Trustly",- "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\":1000,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":1000,\"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\",\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"FI\"}},\"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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"giropay\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'trustly'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"trustly\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- ""- ],- "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\":\"bank_redirect\",\"payment_method_type\":\"trustly\",\"payment_method_data\":{\"bank_redirect\":{\"trustly\":{\"billing_details\":{\"billing_name\":\"John Doe\"},\"bank_name\":\"ing\",\"preferred_language\":\"en\",\"country\":\"FI\"}}},\"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\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario16-Add card flow",- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- ""- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"737\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 Copy",- "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(\"adyen\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- "});",- ""- ],- "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\":\"FRAUD\",\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'pending'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"pending\");",- " },",- " );",- "}",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario17-Pass Invalid CVV for save card flow and verify failed payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(100, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_code\"",- "if (jsonData?.error_code) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_code' matches '24'\",",- " function () {",- " pm.expect(jsonData.error_code).to.eql(\"24\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_message\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_message' matches 'CVC Declined'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"CVC Declined\");",- " },",- " );",- "}"- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"123\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Scenario18-Don't Pass CVV for save card flow and verify failed payment Copy",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(100, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'adyen'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_code\"",- "if (jsonData?.error_code) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_code' matches '24'\",",- " function () {",- " pm.expect(jsonData.error_code).to.eql(\"24\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_message\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_message' matches 'CVC Declined'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"CVC Declined\");",- " },",- " );",- "}"- ],- "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_token\":\"{{payment_token}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"adyen\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Scenario19-Create Gift Card 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\":1100,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":1100,\"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\":\"gift_card\",\"payment_method_type\":\"givex\",\"payment_method_data\":{\"gift_card\":{\"givex\":{\"number\":\"6364530000000000\",\"cvc\":\"122222\"}}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario10-Create Gift Card payment where it fails due to insufficient balance",- "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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Response body should have error message as \"Insufficient balance in the payment method\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error_message' matches 'Insufficient balance in the payment method'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"Insufficient balance in the 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\":14100,\"currency\":\"EUR\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":14100,\"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\":\"gift_card\",\"payment_method_type\":\"givex\",\"payment_method_data\":{\"gift_card\":{\"givex\":{\"number\":\"6364530000000000\",\"cvc\":\"122222\"}}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"Failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- ""- ],- "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 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 \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector_error\");",- " },",- " );",- "}",- ""- ],- "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\":\"25\",\"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\":\"united states\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// 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 '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\":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\":\"371449635398431\",\"card_exp_month\":\"01\",\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - 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 \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",- " 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\":\"371449635398431\",\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid card_cvc length'\",",- " 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\":\"371449635398431\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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}}\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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\",\"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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "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\",\"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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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": "Scenario6-Create 3DS payment with greater 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.\",",- " );",- "}",- "",- "// 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;",- " },",- ");",- ""- ],- "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\",\"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"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\"}},\"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\"},\"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_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\");",- " },",- " );",- "}",- ""- ],- "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": "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":7540,\"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": "Scenario7-Refund exceeds 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 \"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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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 \"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 \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'The refund amount exceeds the amount captured'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(",- " \"The refund amount exceeds the amount captured\",",- " );",- " },",- " );",- "}",- ""- ],- "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\":7000,\"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": []- }- ]- },- {- "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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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\");",- " },",- " );",- "}",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'This Payment could not be refund because it has a status of requires_confirmation. The expected state is succeeded, partially_captured'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(",- " \"This Payment could not be refund because it has a status of requires_confirmation. The expected state is succeeded, partially_captured\",",- " );",- " },",- " );",- "}",- ""- ],- "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": []- }- ]- },- {- "name": "Scenario9-Create a recurring payment with greater mandate 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 \"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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":\"4111111111111111\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"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\"},\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring Payments - Create",- "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/: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\");",- " },",- " );",- "}",- "",- "// Response body should have value \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Mandate Validation Failed'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"Mandate Validation Failed\");",- " },",- " );",- "}",- ""- ],- "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\":8040,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":8040,\"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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"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": "Scenario10-Create payouts using unsupported methods",- "item": [- {- "name": "ACH Payouts - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payouts/create - Status code is 4xx\", function () {",- " pm.response.to.be.clientError;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payouts/create - 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]::/payouts/create - 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 payout_id as variable for jsonData.payout_id",- "if (jsonData?.payout_id) {",- " pm.collectionVariables.set(\"payout_id\", jsonData.payout_id);",- " console.log(",- " \"- use {{payout_id}} as collection variable for value\",",- " jsonData.payout_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payout_id}}, as jsonData.payout_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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":10000,\"currency\":\"USD\",\"customer_id\":\"payout_customer\",\"email\":\"[email protected]\",\"name\":\"Doest John\",\"phone\":\"9123456789\",\"phone_country_code\":\"+1\",\"description\":\"Its my first payout request\",\"connector\":[\"adyen\"],\"payout_type\":\"bank\",\"payout_method_data\":{\"bank\":{\"bank_routing_number\":\"110000000\",\"bank_account_number\":\"000123456789\",\"bank_name\":\"Stripe Test Bank\",\"bank_country_code\":\"US\",\"bank_city\":\"California\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"CA\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Doest\",\"last_name\":\"John\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"1\"}},\"entity_type\":\"Individual\",\"recurring\":false,\"metadata\":{\"ref\":\"123\",\"vendor_details\":{\"account_type\":\"custom\",\"business_type\":\"individual\",\"business_profile_mcc\":5045,\"business_profile_url\":\"https://www.pastebin.com\",\"business_profile_name\":\"pT\",\"company_address_line1\":\"address_full_match\",\"company_address_line2\":\"Kimberly Way\",\"company_address_postal_code\":\"31062\",\"company_address_city\":\"Milledgeville\",\"company_address_state\":\"GA\",\"company_phone\":\"+16168205366\",\"company_tax_id\":\"000000000\",\"company_owners_provided\":false,\"capabilities_card_payments\":true,\"capabilities_transfers\":true},\"individual_details\":{\"tos_acceptance_date\":1680581051,\"tos_acceptance_ip\":\"103.159.11.202\",\"individual_dob_day\":\"01\",\"individual_dob_month\":\"01\",\"individual_dob_year\":\"1901\",\"individual_id_number\":\"000000000\",\"individual_ssn_last_4\":\"0000\",\"external_account_account_holder_type\":\"individual\"}},\"confirm\":true,\"auto_fulfill\":true,\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "url": {- "raw": "{{baseUrl}}/payouts/create",- "host": [- "{{baseUrl}}"- ],- "path": [- "payouts",- "create"- ]- },- "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": "Bacs Payouts - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "pm.test(\"[POST]::/payouts/create - Status code is 4xx\", function () {",- " pm.response.to.be.clientError;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/payouts/create - 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]::/payouts/create - 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 payout_id as variable for jsonData.payout_id",- "if (jsonData?.payout_id) {",- " pm.collectionVariables.set(\"payout_id\", jsonData.payout_id);",- " console.log(",- " \"- use {{payout_id}} as collection variable for value\",",- " jsonData.payout_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payout_id}}, as jsonData.payout_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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":1,\"currency\":\"GBP\",\"customer_id\":\"payout_customer\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payout request\",\"payout_type\":\"bank\",\"payout_method_data\":{\"bank\":{\"bank_sort_code\":\"231470\",\"bank_account_number\":\"28821822\",\"bank_name\":\"Deutsche Bank\",\"bank_country_code\":\"NL\",\"bank_city\":\"Amsterdam\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"CA\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"John\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"entity_type\":\"Individual\",\"recurring\":true,\"metadata\":{\"ref\":\"123\"},\"confirm\":true,\"auto_fulfill\":true,\"connector\":[\"adyen\"],\"business_label\":\"abcd\",\"business_country\":\"US\",\"browser_info\":{\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36\",\"accept_header\":\"text\\\\/html,application\\\\/xhtml+xml,application\\\\/xml;q=0.9,image\\\\/webp,image\\\\/apng,*\\\\/*;q=0.8\",\"language\":\"en-GB\",\"color_depth\":30,\"screen_height\":1117,\"screen_width\":1728,\"time_zone\":-330,\"java_enabled\":true,\"java_script_enabled\":true}}"- },- "url": {- "raw": "{{baseUrl}}/payouts/create",- "host": [- "{{baseUrl}}"- ],- "path": [- "payouts",- "create"- ]- },- "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": []- }- ]- }- ]- }- ]- }- ],- "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": "de5a144d-d247-4751-a8f3-ecfa9832641c",- "name": "adyen_uk",- "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": "https://integ.hyperswitch.io",- "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": "payout_id",- "value": "",- "type": "string"- },- {- "key": "merchant_connector_id",- "value": ""- },- {- "key": "client_secret",- "value": "",- "type": "string"- },- {- "key": "connector_api_key",- "value": "",- "type": "string"- },- {- "key": "connector_key1",- "value": ""- },- {- "key": "publishable_key",- "value": "",- "type": "string"- },- {- "key": "payment_token",- "value": "",- "type": "string"- },- {- "key": "gateway_merchant_id",- "value": "",- "type": "string"- },- {- "key": "certificate",- "value": "",- "type": "string"- },- {- "key": "certificate_keys",- "value": "",- "type": "string"- },- {- "key": "api_key_id",- "value": ""- },- {- "key": "connector_api_secret",- "value": "",- "type": "string"- },- {- "key": "payment_profile_id",- "value": "",- "type": "string"- },- {- "key": "payout_profile_id",- "value": "",- "type": "string"- }- ]-}diff --git a/postman/collection-json/bluesnap.postman_collection.json b/postman/collection-json/bluesnap.postman_collection.jsonindex 4f9e2066ca..953be2130f 100644--- a/postman/collection-json/bluesnap.postman_collection.json+++ b/postman/collection-json/bluesnap.postman_collection.json@@ -559,7 +559,7 @@"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"4242424242424242\",\"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\",\"last_name\":\"abc\"}},\"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",@@ -4338,7 +4338,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"25\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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",@@ -5248,7 +5248,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -5679,7 +5679,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -6423,7 +6423,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -6665,7 +6665,7 @@"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"4242424242424242\",\"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\",\"last_name\":\"abc\"}},\"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",@@ -7198,7 +7198,7 @@"language": "json"}},- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"+ "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"30\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"},"url": {"raw": "{{baseUrl}}/payments/:id/confirm",@@ -7449,7 +7449,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -7841,7 +7841,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -8209,7 +8209,7 @@"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"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\",\"last_name\":\"abc\"}},\"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",@@ -8451,7 +8451,7 @@"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"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\",\"last_name\":\"abc\"}},\"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",@@ -8862,7 +8862,7 @@"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\":\"25\",\"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\":\"united states\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"+ "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\":\"united states\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\"}},\"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",@@ -9231,7 +9231,7 @@"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\":\"25\",\"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\"}}"+ "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\":\"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",@@ -9635,7 +9635,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -10015,7 +10015,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -10276,7 +10276,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -10533,7 +10533,7 @@"language": "json"}},- "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "raw": "{\"amount\":6540,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual\",\"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"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\",\"last_name\":\"abc\"}},\"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",@@ -10913,7 +10913,7 @@"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\":\"25\",\"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\",\"last_name\":\"abc\"}},\"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\"}}"+ "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\":\"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\",\"last_name\":\"abc\"}},\"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",@@ -11250,7 +11250,7 @@"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\"}}"+ "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\":\"4242424242424242\",\"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",diff --git a/postman/collection-json/checkout.postman_collection.json b/postman/collection-json/checkout.postman_collection.jsondeleted file mode 100644index 1391462850..0000000000--- a/postman/collection-json/checkout.postman_collection.json+++ /dev/null@@ -1,14164 +0,0 @@-{- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"postman_merchant_GHAction_{{$guid}}\",\"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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"checkout\",\"connector_account_details\":{\"auth_type\":\"SignatureKey\",\"api_key\":\"{{connector_api_key}}\",\"api_secret\":\"{{connector_api_secret}}\",\"key1\":\"{{connector_key1}}\"},\"test_mode\":false,\"disabled\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"payment_methods_enabled\":[{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"debit\",\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"],\"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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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?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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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\":6540,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. 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": "Scenario11-Save card flow",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(1000, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",- "};",- "",- "// Response body should have value \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}"- ],- "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\":\"adyensavecard\",\"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://google.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\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"checkout\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'checkout'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- " },",- " );",- "}",- ""- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"- },- "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-copy",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Refunds - Create Copy",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- ""- ],- "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": []- },- {- "name": "Refunds - Retrieve Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario12-Don't Pass CVV for save card flow and verify success payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(1000, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.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\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "// Response body should have value \"checkout\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'checkout'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- " },",- " );",- "}",- "",- ""- ],- "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_token\":\"{{payment_token}}\"}"- },- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Scenario13-Pass Invalid CVV for save card flow and verify failed payment",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(1000, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.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\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "// Response body should have value \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'checkout'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_code\"",- "if (jsonData?.error_code) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_code' matches 'cvv_invalid'\",",- " function () {",- " pm.expect(jsonData.error_code).to.eql(\"cvv_invalid\");",- " },",- " );",- "}",- "",- "// Response body should have value \"24\" for \"error_message\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_message' matches 'cvv_invalid'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"cvv_invalid\");",- " },",- " );",- "}"- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"- },- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Scenario14-Save card payment with manual capture",- "item": [- {- "name": "Payments - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "pm.environment.set(\"random_number\", _.random(1000, 100000));",- ""- ],- "type": "text/javascript"- }- },- {- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id is undefined.');",- "};",- "",- "// Response body should have value \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}"- ],- "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\":\"adyensavecard\",\"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://google.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\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"checkout\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'checkout'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- " },",- " );",- "}",- ""- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"- },- "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 - 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 '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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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-copy",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 '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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// //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://google.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4485040371536584\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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://google.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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(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 existing 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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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(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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments:id/confirm - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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(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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 existing 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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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(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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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(\"checkout\");",- "});",- "",- "// 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 \"succeeded\" 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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 '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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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-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(\"checkout\");",- "});",- "",- "// 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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " 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": "Scenario6-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(\"checkout\");",- "});",- "",- "// 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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 '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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 '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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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": "Scenario7-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(\"checkout\");",- "});",- "",- "// 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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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": "Scenario8-Refund full 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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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 - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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\":6540,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario9-Partial refund",- "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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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 - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "Refunds - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- ""- ],- "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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Refunds - Create-copy",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"1000\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "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\":1000,\"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": []- },- {- "name": "Refunds - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Payments - Retrieve-copy",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 \"refunds\"",- "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",- " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",- "});",- ""- ],- "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": "Scenario10-Multiple Captures",- "item": [- {- "name": "Successful Partial Capture and Refund",- "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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":6000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 - 1",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 \"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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured_and_capturable'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured_and_capturable\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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 - Capture - 2",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 \"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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured_and_capturable'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured_and_capturable\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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 - Capture - 3",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 \"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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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\",",- " );",- "});",- "",- "// 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true&expand_captures=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- },- {- "key": "expand_captures",- "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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6000\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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\":6000,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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(\"checkout\");",- "});",- "",- "// Response body should have value \"6000\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(6000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Retrieve After Partial 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":6000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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.\",",- " );",- "}",- "",- "// Response body should have value \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 \"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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured_and_capturable'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured_and_capturable\");",- " },",- " );",- "}"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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-copy",- "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.\",",- " );",- "}",- "",- "// Response body should have value \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured_and_capturable'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured_and_capturable\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/:id?force_sync=true&expand_captures=true",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "query": [- {- "key": "force_sync",- "value": "true"- },- {- "key": "expand_captures",- "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": "Cancel After Partial 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":6000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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": "Payments - Capture",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// 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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured_and_capturable'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured_and_capturable\");",- " },",- " );",- "}",- "",- "// 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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 - Cancel",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 4xx",- "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 \"cancellation succeeded\" for \"payment status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- "",- "// 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "Refund After Partial 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":6000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"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\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 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 \"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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":2000,\"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": "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) {}",- "",- "// 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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\":2000,\"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": []- }- ]- },- {- "name": "3DS 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 \"connector error\" for \"error type\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/cancel - Content check if value for 'jsonData.status' matches 'requires_customer_action'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_customer_action\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":6000,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"manual_multiple\",\"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\":\"three_ds\",\"return_url\":\"https://duck.com\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4242424242424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "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 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 \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- ""- ],- "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\":\"4644968546281686\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Month'\",",- " 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\":\"4005519200000004\",\"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 \"invalid_request\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - 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 \"Invalid Expiry Year\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",- " 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 'invalid_request'\",",- " 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.message' matches 'Invalid card_cvc length'\",",- " 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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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 existing 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(\"checkout\");",- "});",- "",- "// 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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- ""- ],- "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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "Scenario6-Refund exceeds 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 \"processing\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'processing'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"processing\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"checkout\");",- "});",- "",- "// 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(6540);",- " },",- " );",- "}",- "",- "// 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 - 6540'\",",- " function () {",- " pm.expect(jsonData.amount_capturable).to.eql(0);",- " },",- " );",- "}",- ""- ],- "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\":\"4005519200000004\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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(\"checkout\");",- "});",- "",- "// 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 - 540'\",",- " 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": "Refunds - Create",- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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 \"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 \"The refund amount exceeds the amount captured\" for \"message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'The refund amount exceeds the amount captured'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(",- " \"The refund amount exceeds the amount captured\",",- " );",- " },",- " );",- "}",- ""- ],- "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\":7000,\"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": []- }- ]- },- {- "name": "Scenario6-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\":\"25\",\"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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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": "prerequest",- "script": {- "exec": [- "setTimeout(function(){",- " console.log(\"Sleeping for 3 seconds before next request.\");",- "}, 3000);"- ],- "type": "text/javascript"- }- },- {- "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": "9ab8f157-6b4b-430a-9ca8-34931682f988",- "name": "Checkout Collection",- "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",- "_exporter_id": "25180378",- "_collection_link": "https://galactic-desert-365744.postman.co/workspace/postman-tests-for-all-connector~f274d40a-132c-47e3-8240-6793392ee4d1/collection/25180378-9ab8f157-6b4b-430a-9ca8-34931682f988?action=share&creator=25180378&source=collection_link"- },- "variable": [- {- "key": "baseUrl",- "value": "https://sandbox.hyperswitch.io",- "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": "connector_api_secret",- "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"- }- ]-}diff --git a/postman/collection-json/stripe.postman_collection.json b/postman/collection-json/stripe.postman_collection.jsondeleted file mode 100644index 3ef7636f69..0000000000--- a/postman/collection-json/stripe.postman_collection.json+++ /dev/null@@ -1,25534 +0,0 @@-{- "event": [- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "MerchantAccounts",- "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.\",",- " );",- "}",- "",- "// pm.collectionVariables - Set merchant_id as variable for jsonData.merchant_id",- "if (jsonData?.merchant_id) {",- " pm.collectionVariables.set(\"organization_id\", jsonData.organization_id);",- " console.log(",- " \"- use {{organization_id}} as collection variable for value\",",- " jsonData.organization_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{organization_id}}, as jsonData.organization_id is undefined.\",",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/accounts - Organization id is generated\",",- " function () {",- " pm.expect(typeof jsonData.organization_id !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":\"postman_merchant_GHAction_{{$guid}}\",\"locker_id\":\"m0010\",\"merchant_name\":\"NewAge Retailer\",\"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/success\",\"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\"},\"primary_business_details\":[{\"country\":\"US\",\"business\":\"default\"}]}"- },- "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": "Merchant Account - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/accounts/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/accounts/: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 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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/accounts/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "accounts",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{merchant_id}}",- "description": "(Required) The unique identifier for the merchant account"- }- ]- },- "description": "Retrieve a merchant account details."- },- "response": []- },- {- "name": "Merchant Account - List",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/accounts/list - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/accounts/list - 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 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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/accounts/list?organization_id={{organization_id}}",- "host": [- "{{baseUrl}}"- ],- "path": [- "accounts",- "list"- ],- "query": [- {- "key": "organization_id",- "value": "{{organization_id}}"- }- ],- "variable": [- {- "key": "organization_id",- "value": "{{organization_id}}",- "description": "(Required) - Organization id"- }- ]- },- "description": "List merchant accounts for an organization"- },- "response": []- },- {- "name": "Merchant Account - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/accounts/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/accounts/: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 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_id}}\",\"merchant_name\":\"NewAge Retailer\",\"locker_id\":\"m0010\",\"merchant_details\":{\"primary_contact_person\":\"joseph Test\",\"primary_email\":\"[email protected]\",\"primary_phone\":\"veniam aute officia ullamco esse\",\"secondary_contact_person\":\"joseph Test2\",\"secondary_email\":\"[email protected]\",\"secondary_phone\":\"proident adipisicing officia nulla\",\"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,\"parent_merchant_id\":\"xkkdf909012sdjki2dkh5sdf\",\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/accounts/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "accounts",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{merchant_id}}",- "description": "(Required) The unique identifier for the merchant account"- }- ]- },- "description": "To update an existing merchant account. Helpful in updating merchant details such as email, contact deteails, or other configuration details like webhook, routing algorithm etc"- },- "response": []- }- ]- },- {- "name": "API Key",- "item": [- {- "name": "Create API Key",- "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": "Update API Key",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/api_keys/:merchant_id/:api_key_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/:api_key_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\":null,\"description\":\"My very awesome API key\",\"expiration\":null}"- },- "url": {- "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "api_keys",- ":merchant_id",- ":api_key_id"- ],- "variable": [- {- "key": "merchant_id",- "value": "{{merchant_id}}"- },- {- "key": "api_key_id",- "value": "{{api_key_id}}"- }- ]- }- },- "response": []- },- {- "name": "Retrieve API Key",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/api_keys/:merchant_id/:api_key_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/api_keys/:merchant_id/:api_key_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": "GET",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/api_keys/:merchant_id/:api_key_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "api_keys",- ":merchant_id",- ":api_key_id"- ],- "variable": [- {- "key": "merchant_id",- "value": "{{merchant_id}}"- },- {- "key": "api_key_id",- "value": "{{api_key_id}}"- }- ]- }- },- "response": []- },- {- "name": "List API Keys",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/api_keys/:merchant_id/list - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/api_keys/:merchant_id/list - 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": "GET",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/api_keys/:merchant_id/list",- "host": [- "{{baseUrl}}"- ],- "path": [- "api_keys",- ":merchant_id",- "list"- ],- "variable": [- {- "key": "merchant_id",- "value": "{{merchant_id}}"- }- ]- }- },- "response": []- }- ]- },- {- "name": "PaymentConnectors",- "item": [- {- "name": "Payment Connector - Create Multiple",- "item": [- {- "name": "Create First Connector",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/accounts/: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.\",",- " );",- "}",- "",- "// Validate if the connector label is the one that is passed in the request",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - connector_label is the same as that is passed in the request\",",- " function () {",- " pm.expect(jsonData.connector_label).to.eql(\"first_stripe\")",- " },",- ");"- ],- "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\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_label\":\"first_stripe\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"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\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"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": "Create Second Connector",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/accounts/: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.\",",- " );",- "}",- "",- "// Validate if the connector label is the one that is passed in the request",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - connector_label is the same as that is passed in the request\",",- " function () {",- " pm.expect(jsonData.connector_label).to.eql(\"second_stripe\")",- " },",- ");"- ],- "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\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_label\":\"second_stripe\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"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\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"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": "Payment Connector - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/accounts/: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.\",",- " );",- "}",- "",- "// Validate if the connector label is the one that is passed in the request",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - connector_label is not autogenerated\",",- " function () {",- " pm.expect(jsonData.connector_label).to.eql(\"first_stripe_connector\")",- " },",- ");"- ],- "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\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_label\":\"first_stripe_connector\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"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\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"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": "Payment Connector - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/accounts/:account_id/connectors/:connector_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/accounts/:account_id/connectors/:connector_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 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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- },- {- "key": "x-merchant-id",- "value": "{{merchant_id}}"- }- ],- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors",- ":connector_id"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}",- "description": "(Required) The unique identifier for the merchant account"- },- {- "key": "connector_id",- "value": "{{merchant_connector_id}}",- "description": "(Required) The unique identifier for the payment connector"- }- ]- },- "description": "Retrieve Payment Connector details."- },- "response": []- },- {- "name": "Payment Connector - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/account/:account_id/connectors/:connector_id - 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/:connector_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 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.\",",- " );",- "}",- "",- "// Validate if the connector label is the one that is passed in the request",- "pm.test(",- " \"[POST]::/accounts/:account_id/connectors - connector_label is not autogenerated\",",- " function () {",- " pm.expect(jsonData.connector_label).to.eql(\"updated_stripe_connector\")",- " },",- ");"- ],- "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"- },- {- "key": "x-merchant-id",- "value": "{{merchant_id}}"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"connector_type\":\"payment_processor\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"connector_label\":\"updated_stripe_connector\",\"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\":\"pay_later\",\"payment_method_types\":[{\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors",- ":connector_id"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}"- },- {- "key": "connector_id",- "value": "{{merchant_connector_id}}"- }- ]- },- "description": "To update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc"- },- "response": []- },- {- "name": "List Connectors by MID",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/account/:account_id/connectors - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/account/:account_id/connectors - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- }- ]- },- "method": "GET",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "x-merchant-id",- "value": "{{merchant_id}}"- }- ],- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}"- }- ]- }- },- "response": []- },- {- "name": "Payment Connector - Delete",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[DELETE]::/account/:account_id/connectors/:connector_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[DELETE]::/account/:account_id/connectors/:connector_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 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": "{{admin_api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- },- {- "key": "in",- "value": "header",- "type": "string"- }- ]- },- "method": "DELETE",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors",- ":connector_id"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}"- },- {- "key": "connector_id",- "value": "{{merchant_connector_id}}"- }- ]- },- "description": "Delete or Detach a Payment Connector from Merchant Account"- },- "response": []- },- {- "name": "Delete API Key",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[DELETE]::/api_keys/:merchant_id/:api-key - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[DELETE]::/api_keys/:merchant_id/:api-key - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{admin_api_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- }- ]- },- "method": "DELETE",- "header": [- {- "key": "Content-Type",- "value": "application/json"- },- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/api_keys/:merchant_id/:api-key",- "host": [- "{{baseUrl}}"- ],- "path": [- "api_keys",- ":merchant_id",- ":api-key"- ],- "variable": [- {- "key": "merchant_id",- "value": "{{merchant_id}}"- },- {- "key": "api-key",- "value": "{{api_key_id}}"- }- ]- }- },- "response": []- },- {- "name": "Merchant Account - Delete",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[DELETE]::/accounts/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[DELETE]::/accounts/:id - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "// Response Validation",- "const schema = {",- " type: \"object\",",- " description: \"Merchant Account\",",- " required: [\"merchant_id\", \"deleted\"],",- " properties: {",- " merchant_id: {",- " type: \"string\",",- " description: \"The identifier for the MerchantAccount object.\",",- " maxLength: 255,",- " example: \"y3oqhf46pyzuxjbcn2giaqnb44\",",- " },",- " deleted: {",- " type: \"boolean\",",- " description:",- " \"Indicates the deletion status of the Merchant Account object.\",",- " example: true,",- " },",- " },",- "};",- "",- "// Validate if response matches JSON schema",- "pm.test(\"[DELETE]::/accounts/:id - Schema is valid\", function () {",- " pm.response.to.have.jsonSchema(schema, {",- " unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"],",- " });",- "});",- ""- ],- "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": "DELETE",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/accounts/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "accounts",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{merchant_id}}",- "description": "(Required) The unique identifier for the merchant account"- }- ]- },- "description": "Delete a Merchant Account"- },- "response": []- }- ]- },- {- "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\":\"postman_merchant_GHAction_{{$guid}}\",\"locker_id\":\"m0010\",\"merchant_name\":\"NewAge Retailer\",\"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/success\",\"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\"},\"primary_business_details\":[{\"country\":\"US\",\"business\":\"default\"}]}"- },- "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": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }- },- {- "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\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}_invalid_values\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"affirm\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"afterpay_clearpay\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"invoke_sdk_client\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"ideal\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"giropay\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"becs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_transfer\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"debit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\",\"parameters\":{\"gateway\":\"example\",\"gateway_merchant_id\":\"{{gateway_merchant_id}}\"}}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}},\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"{{certificate}}\",\"display_name\":\"applepay\",\"certificate_keys\":\"{{certificate_keys}}\",\"initiative_context\":\"sdk-test-app.netlify.app\",\"merchant_identifier\":\"merchant.com.stripe.sang\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}}"- },- "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.\",",- " );",- "}",- "",- "// Response body should have value \"failed\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'status' matches 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Response body should have an error message",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error_message' is not 'null'\",",- " function () {",- " pm.expect(jsonData.error_message).is.not.null;",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have \"billing.email\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'billing.email' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should not have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' should be null\",",- " function () {",- " pm.expect(jsonData?.payment_method_data?.billing).to.be.null;",- " },",- ");",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"},\"email\":\"[email protected]\"},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":{\"connector\":\"stripe\",\"merchant_connector_id\":\"{{merchant_connector_id}}\"}}}"- },- "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": "Payment Connector - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[POST]::/account/:account_id/connectors/:connector_id - 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/:connector_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 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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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"- },- {- "key": "x-merchant-id",- "value": "{{merchant_id}}"- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"connector_type\":\"payment_processor\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"affirm\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"afterpay_clearpay\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"invoke_sdk_client\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"ideal\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"giropay\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"becs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_transfer\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"debit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\",\"parameters\":{\"gateway\":\"example\",\"gateway_merchant_id\":\"{{gateway_merchant_id}}\"}}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}},\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"{{certificate}}\",\"display_name\":\"applepay\",\"certificate_keys\":\"{{certificate_keys}}\",\"initiative_context\":\"sdk-test-app.netlify.app\",\"merchant_identifier\":\"merchant.com.stripe.sang\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}}"- },- "url": {- "raw": "{{baseUrl}}/account/:account_id/connectors/:connector_id",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- ":account_id",- "connectors",- ":connector_id"- ],- "variable": [- {- "key": "account_id",- "value": "{{merchant_id}}"- },- {- "key": "connector_id",- "value": "{{merchant_connector_id}}"- }- ]- },- "description": "To update an existing Payment Connector. Helpful in enabling / disabling different payment methods and other settings for the connector etc"- },- "response": []- },- {- "name": "Payments - Create-copy",- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"routing\":{\"type\":\"single\",\"data\":{\"connector\":\"stripe\",\"merchant_connector_id\":\"{{merchant_connector_id}}\"}}}"- },- "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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 \"profile_id\" and not \"null\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'profile_id' exists and is not 'null'\",",- " function () {",- " pm.expect(typeof jsonData.profile_id !== \"undefined\").to.be.true;",- " pm.expect(jsonData.profile_id).is.not.null;",- " },",- ");",- ""- ],- "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\":600,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Customers",- "description": "Create a Customer entity which you can use to store and retrieve specific customers' data and payment methods.",- "item": [- {- "name": "Create Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/customers - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/customers - 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]::/customers - 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) {}",- "",- "// Response body should have \"customer_id\"",- "pm.test(",- " \"[POST]::/customers - Content check if 'customer_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.customer_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have a minimum length of \"1\" for \"customer_id\"",- "if (jsonData?.customer_id) {",- " pm.test(",- " \"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'\",",- " function () {",- " pm.expect(jsonData.customer_id.length).is.at.least(1);",- " },",- " );",- "}",- "",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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": "{\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"First customer\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/customers",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers"- ]- },- "description": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details."- },- "response": []- },- {- "name": "List Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/customers - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/customers - 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]::/customers - 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) {}",- "",- "",- "// Response body should have a minimum length of \"1\" for \"customer_id\"",- "if (jsonData?.customer_id) {",- " pm.test(",- " \"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '2'\",",- " function () {",- " pm.expect(jsonData.customer_id.length).is.at.least(2);",- " },",- " );",- "}",- "",- "",- "// Define the regular expression pattern to match customer_id",- "var customerIdPattern = /^[a-zA-Z0-9_]+$/;",- "",- "// Define an array to store the validation results",- "var validationResults = [];",- "",- "// Iterate through the JSON array",- "jsonData.forEach(function(item, index) {",- " if (item.hasOwnProperty(\"customer_id\")) {",- " if (customerIdPattern.test(item.customer_id)) {",- " validationResults.push(\"customer_id \" + item.customer_id + \" is valid.\");",- " } else {",- " validationResults.push(\"customer_id \" + item.customer_id + \" is not valid.\");",- " }",- " } else {",- " validationResults.push(\"customer_id is missing for item at index \" + index);",- " }",- "});",- "",- "// Check if any customer_id is not valid and fail the test if necessary",- "if (validationResults.some(result => !result.includes(\"is valid\"))) {",- " pm.test(\"Customer IDs validation failed: \" + validationResults.join(\", \"), function() {",- " pm.expect(false).to.be.true;",- " });",- "} else {",- " pm.test(\"All customer IDs are valid: \" + validationResults.join(\", \"), function() {",- " pm.expect(true).to.be.true;",- " });",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/list",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- "list"- ]- }- },- "response": []- },- {- "name": "Retrieve Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/customers/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/customers/: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]::/customers/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{customer_id}}",- "description": "(Required) unique customer id"- }- ]- },- "description": "Retrieve a customer's details."- },- "response": []- },- {- "name": "Update Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/customers/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/customers/: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(\"[POST]::/customers/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- ""- ],- "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": "{\"email\":\"[email protected]\",\"name\":\"John Test\",\"phone_country_code\":\"+65\",\"phone\":\"888888888\",\"description\":\"First customer\",\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/customers/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{customer_id}}",- "description": "(Required) unique customer id"- }- ]- },- "description": "Updates the customer's details in a customer object."- },- "response": []- },- {- "name": "Ephemeral Key",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/ephemeral_keys - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/ephemeral_keys - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "raw": "{\"customer_id\":\"{{customer_id}}\"}"- },- "url": {- "raw": "{{baseUrl}}/ephemeral_keys",- "host": [- "{{baseUrl}}"- ],- "path": [- "ephemeral_keys"- ]- }- },- "response": []- },- {- "name": "Delete Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[DELETE]::/customers/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[DELETE]::/customers/: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(\"[DELETE]::/customers/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "DELETE",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{customer_id}}",- "description": "(Required) unique customer id"- }- ]- },- "description": "Delete a customer record."- },- "response": []- }- ]- },- {- "name": "Payments",- "description": "Process and manage payments across wide range of payment processors using the Unified Payments API.",- "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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\",\"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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Session Token",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/session_tokens - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payments/session_tokens - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- "",- "const responseJson = pm.response.json();",- "",- "// Verify if the wallet_name in the response matches 'apple_pay'",- "pm.test(",- " \"[POST]::/payments/session_tokens - Verify wallet_name is 'apple_pay'\",",- " function () {",- " pm.expect(responseJson.session_token[0].wallet_name).to.eql(\"apple_pay\");",- " },",- ");",- "",- "// Verify if the wallet_name in the response matches 'google_pay'",- "pm.test(",- " \"[POST]::/payments/session_tokens - Verify wallet_name is 'google_pay'\",",- " function () {",- " pm.expect(responseJson.session_token[1].wallet_name).to.eql(\"google_pay\");",- " },",- ");",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "auth": {- "type": "apikey",- "apikey": [- {- "key": "value",- "value": "{{publishable_key}}",- "type": "string"- },- {- "key": "key",- "value": "api-key",- "type": "string"- }- ]- },- "method": "POST",- "header": [- {- "key": "Content-Type",- "value": "application/json"- }- ],- "body": {- "mode": "raw",- "raw": "{\"payment_id\":\"{{payment_id}}\",\"wallets\":[],\"client_secret\":\"{{client_secret}}\"}"- },- "url": {- "raw": "{{baseUrl}}/payments/session_tokens",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "session_tokens"- ]- }- },- "response": []- },- {- "name": "Payments - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/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(\"[POST]::/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.\",",- " );",- "}",- ""- ],- "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\":20000,\"currency\":\"SGD\",\"confirm\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"email\":\"[email protected]\",\"name\":\"joseph Doe\",\"phone\":\"9123456789\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"payment_method\":\"card\",\"return_url\":\"https://duck.com\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"John\",\"last_name\":\"Doe\"}},\"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/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}",- "description": "(Required) unique payment id"- }- ]- },- "description": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created "- },- "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.\",",- " );",- "}",- ""- ],- "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": "Payments - Confirm (Through Client Secret)",- "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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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 - 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.\",",- " );",- "}",- ""- ],- "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 - Create Again",- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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 Again (Through API Key)",- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "{}"- },- "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 - Create Yet Again",- "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\":\"manual\",\"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_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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();",- "});",- ""- ],- "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": "Payment-List",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/payments/list - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/payments/list - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "api-key",- "value": "snd_0b8e1deb82f241eca47617afb1398858"- }- ],- "url": {- "raw": "{{baseUrl}}/payments/list",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- "list"- ],- "query": [- {- "key": "customer_id",- "value": "",- "disabled": true- },- {- "key": "starting_after",- "value": "",- "disabled": true- },- {- "key": "ending_before",- "value": "",- "disabled": true- },- {- "key": "limit",- "value": "100",- "disabled": true- },- {- "key": "created",- "value": "",- "disabled": true- },- {- "key": "created.lt",- "value": "",- "disabled": true- },- {- "key": "created.gt",- "value": "",- "disabled": true- },- {- "key": "created.lte",- "value": "",- "disabled": true- },- {- "key": "created_gte",- "value": "",- "disabled": true- }- ]- }- },- "response": []- }- ]- },- {- "name": "Refunds",- "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.\",",- " );",- "}",- ""- ],- "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\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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.\",",- " );",- "}",- ""- ],- "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\":600,\"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": []- },- {- "name": "Refunds - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "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": "{\"reason\":\"Paid by mistake\",\"metadata\":{\"udf1\":\"value2\",\"new_customer\":\"false\",\"login_date\":\"2019-09-1T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To update the properties of a Refund object. This may include attaching a reason for the refund or metadata fields"- },- "response": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "PaymentMethods",- "item": [- {- "name": "P_Create Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/customers - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/customers - 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]::/customers - 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) {}",- "",- "// Response body should have \"customer_id\"",- "pm.test(",- " \"[POST]::/customers - Content check if 'customer_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.customer_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have a minimum length of \"1\" for \"customer_id\"",- "if (jsonData?.customer_id) {",- " pm.test(",- " \"[POST]::/customers - Content check if value of 'customer_id' has a minimum length of '1'\",",- " function () {",- " pm.expect(jsonData.customer_id.length).is.at.least(1);",- " },",- " );",- "}",- "",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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": "{\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"First customer\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"}}"- },- "url": {- "raw": "{{baseUrl}}/customers",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers"- ]- },- "description": "Create a customer object and store the customer details to be reused for future payments. Incase the customer already exists in the system, this API will respond with the customer details."- },- "response": []- },- {- "name": "PaymentMethods - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/payment_methods - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[POST]::/payment_methods - 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 payment_method_id as variable for jsonData.payment_method_id",- "if (jsonData?.payment_method_id) {",- " pm.collectionVariables.set(\"payment_method_id\", jsonData.payment_method_id);",- " console.log(",- " \"- use {{payment_method_id}} as collection variable for value\",",- " jsonData.payment_method_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_method_id}}, as jsonData.payment_method_id is undefined.\",",- " );",- "}",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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": "{\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_issuer\":\"Visa\",\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"John Doe\"},\"customer_id\":\"{{customer_id}}\",\"metadata\":{\"city\":\"NY\",\"unit\":\"245\"}}"- },- "url": {- "raw": "{{baseUrl}}/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "payment_methods"- ]- },- "description": "To create a payment method against a customer object. In case of cards, this API could be used only by PCI compliant merchants"- },- "response": []- },- {- "name": "List payment methods for a Merchant",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/payment_methods/:merchant_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\",",- " function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(",- " \"application/json\",",- " );",- " },",- ");",- ""- ],- "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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- "payment_methods"- ],- "query": [- {- "key": "client_secret",- "value": "{{client_secret}}"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular merchant id."- },- "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.\",",- " );",- "}",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(",- " \"- use {{customer_id}} as collection variable for value\",",- " jsonData.customer_id,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"no_three_ds\",\"return_url\":\"https://duck.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(",- " \"[GET]::/payment_methods/:customer_id - Status code is 2xx\",",- " function () {",- " pm.response.to.be.success;",- " },",- ");",- "",- "// Validate if response header has matching content-type",- "pm.test(",- " \"[GET]::/payment_methods/:customer_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) {}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(",- " \"payment_token\",",- " jsonData.customer_payment_methods[0].payment_token,",- " );",- " console.log(",- " \"- use {{payment_token}} as collection variable for value\",",- " jsonData.customer_payment_methods[0].payment_token,",- " );",- "} else {",- " console.log(",- " \"INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "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\":\"postman_merchant_GHAction_{{$guid}}\",\"locker_id\":\"m0010\",\"merchant_name\":\"NewAge Retailer\",\"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\"},\"primary_business_details\":[{\"country\":\"US\",\"business\":\"default\"}]}"- },- "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\":\"stripe\",\"business_country\":\"US\",\"business_label\":\"default\",\"connector_account_details\":{\"auth_type\":\"HeaderKey\",\"api_key\":\"{{connector_api_key}}\"},\"test_mode\":false,\"disabled\":false,\"payment_methods_enabled\":[{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"affirm\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"afterpay_clearpay\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"redirect_to_url\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"pay_later\",\"payment_method_types\":[{\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"payment_experience\":\"invoke_sdk_client\",\"payment_method_type\":\"klarna\"}]},{\"payment_method\":\"bank_redirect\",\"payment_method_types\":[{\"payment_method_type\":\"ideal\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"giropay\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sofort\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"eps\",\"payment_experience\":null,\"card_networks\":null,\"accepted_currencies\":null,\"accepted_countries\":null,\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_debit\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"becs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"bank_transfer\",\"payment_method_types\":[{\"payment_method_type\":\"ach\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"bacs\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"sepa\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"credit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"]}]},{\"payment_method\":\"card\",\"payment_method_types\":[{\"payment_method_type\":\"debit\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true,\"card_networks\":[\"AmericanExpress\",\"Discover\",\"Interac\",\"JCB\",\"Mastercard\",\"Visa\",\"DinersClub\",\"UnionPay\",\"RuPay\"]}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"apple_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]},{\"payment_method\":\"wallet\",\"payment_method_types\":[{\"payment_method_type\":\"google_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true},{\"payment_method_type\":\"we_chat_pay\",\"payment_experience\":\"invoke_sdk_client\",\"minimum_amount\":1,\"maximum_amount\":68607706,\"recurring_enabled\":true,\"installment_payment_enabled\":true}]}],\"metadata\":{\"google_pay\":{\"allowed_payment_methods\":[{\"type\":\"CARD\",\"parameters\":{\"allowed_auth_methods\":[\"PAN_ONLY\",\"CRYPTOGRAM_3DS\"],\"allowed_card_networks\":[\"AMEX\",\"DISCOVER\",\"INTERAC\",\"JCB\",\"MASTERCARD\",\"VISA\"]},\"tokenization_specification\":{\"type\":\"PAYMENT_GATEWAY\",\"parameters\":{\"gateway\":\"example\",\"gateway_merchant_id\":\"{{gateway_merchant_id}}\"}}}],\"merchant_info\":{\"merchant_name\":\"Narayan Bhat\"}},\"apple_pay\":{\"session_token_data\":{\"initiative\":\"web\",\"certificate\":\"{{certificate}}\",\"display_name\":\"applepay\",\"certificate_keys\":\"{{certificate_keys}}\",\"initiative_context\":\"sdk-test-app.netlify.app\",\"merchant_identifier\":\"merchant.com.stripe.sang\"},\"payment_request_data\":{\"label\":\"applepay pvt.ltd\",\"supported_networks\":[\"visa\",\"masterCard\",\"amex\",\"discover\"],\"merchant_capabilities\":[\"supports3DS\"]}}}}"- },- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": "Refunds - Create",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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.\",",- " );",- "}",- ""- ],- "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\":600,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. 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": "Scenario2-Create a payment and Confirm",- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"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\":\"125.0.0.1\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have \"browser_info\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'browser_info' exists\",",- " function () {",- " pm.expect(typeof jsonData.browser_info !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"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\",\"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\"}},\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"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\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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 \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "Scenario2a-Create payment with confirm false card holder name null",- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":null,\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"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\":\"125.0.0.1\"}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario2b-Create payment with confirm false card holder name empty",- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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 - 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\");",- " },",- " );",- "}"- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"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\":\"125.0.0.1\"}}"- },- "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\");",- " },",- " );",- "}"- ],- "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\");",- " },",- " );",- "}",- ""- ],- "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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "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.\",",- " );",- "}",- "",- "// 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": "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\",\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- "",- "// 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 '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_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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario4a-Create payment with manual_multiple 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.\",",- " );",- "}",- "",- "// 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": "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\",\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- "",- "// 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);",- " },",- " );",- "}",- ""- ],- "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 \"succeeded\" 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\");",- " },",- " );",- "}",- ""- ],- "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.\",",- " );",- "}",- "",- "// 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": "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\",\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 3DS 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_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;",- " },",- ");",- ""- ],- "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\",\"business_country\":\"US\",\"business_label\":\"default\",\"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\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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_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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario7-Create 3DS 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\");",- " },",- " );",- "}",- ""- ],- "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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;",- " },",- ");",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario8-Create a failure card 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 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"card_declined\" for \"error_code\"",- "if (jsonData?.error_code) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_code' matches 'card_declined'\",",- " function () {",- " pm.expect(jsonData.error_code).to.eql(\"card_declined\");",- " },",- " );",- "}",- "",- "// Response body should have value \"message - Your card has insufficient funds., decline_code - insufficient_funds\" for \"error_message\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_message' matches 'message - Your card has insufficient funds., decline_code - insufficient_funds'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"message - Your card has insufficient funds., decline_code - insufficient_funds\");",- " },",- " );",- "}",- ""- ],- "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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"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\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000009995\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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 'failed'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"failed\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"card_declined\" for \"error_code\"",- "if (jsonData?.error_code) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_code' matches 'card_declined'\",",- " function () {",- " pm.expect(jsonData.error_code).to.eql(\"card_declined\");",- " },",- " );",- "}",- "",- "// Response body should have value \"message - Your card has insufficient funds., decline_code - insufficient_funds\" for \"error_message\"",- "if (jsonData?.error_message) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error_message' matches 'message - Your card has insufficient funds., decline_code - insufficient_funds'\",",- " function () {",- " pm.expect(jsonData.error_message).to.eql(\"message - Your card has insufficient funds., decline_code - insufficient_funds\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario9-Refund full 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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario9a-Partial refund",- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "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 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Refunds - Create-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"1000\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "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\":1000,\"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": []- },- {- "name": "Refunds - Retrieve-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '1000'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- },- {- "name": "Payments - Retrieve-copy",- "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 \"refunds\"",- "pm.test(\"[POST]::/payments - Content check if 'refunds' exists\", function () {",- " pm.expect(typeof jsonData.refunds !== \"undefined\").to.be.true;",- "});",- ""- ],- "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": "Scenario10-Create a mandate and recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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-copy",- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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-Refund recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"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\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring 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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":6570,\"currency\":\"USD\",\"confirm\":true,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6570,\"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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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-copy",- "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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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 Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '6540'\",",- " function () {",- " pm.expect(jsonData.amount).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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":6540,\"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": []- },- {- "name": "Refunds - Retrieve Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario12-BNPL-klarna",- "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\":8000,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":8000,\"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\",\"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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"klarna\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'klarna'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"klarna\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"pay_later\",\"payment_method_type\":\"klarna\",\"payment_experience\":\"redirect_to_url\",\"payment_method_data\":{\"pay_later\":{\"klarna_redirect\":{\"issuer_name\":\"stripe\",\"billing_email\":\"[email protected]\",\"billing_country\":\"US\"}}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"},\"email\":\"[email protected]\"},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario13-BNPL-afterpay",- "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\":7000,\"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\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"country\":\"ES\"},\"email\":\"[email protected]\"},\"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\":\"SE\",\"first_name\":\"John\",\"last_name\":\"Doe\"}},\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"metadata\":{\"order_details\":{\"product_name\":\"Socks\",\"amount\":7000,\"quantity\":1}}}"- },- "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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"afterpay_clearpay\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'afterpay_clearpay'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"afterpay_clearpay\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"pay_later\",\"payment_method_type\":\"afterpay_clearpay\",\"payment_experience\":\"redirect_to_url\",\"payment_method_data\":{\"pay_later\":{\"afterpay_clearpay_redirect\":{\"billing_name\":\"Akshaya\",\"billing_email\":\"[email protected]\"}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario14-BNPL-affirm",- "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\":7000,\"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\":\"+65\",\"description\":\"Its my first payment request\",\"authentication_type\":\"three_ds\",\"return_url\":\"https://duck.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"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\":{\"order_details\":{\"product_name\":\"Socks\",\"amount\":7000,\"quantity\":1}}}"- },- "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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"affirm\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'affirm'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"affirm\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"pay_later\",\"payment_method_type\":\"affirm\",\"payment_experience\":\"redirect_to_url\",\"payment_method_data\":{\"pay_later\":{\"affirm_redirect\":{\"issuer_name\":\"affirm\",\"billing_email\":\"[email protected]\",\"billing_country\":\"US\"}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario15-Bank Redirect-Ideal",- "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\":1000,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":1000,\"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\",\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"NL\"}},\"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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"ideal\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ideal'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"ideal\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"bank_redirect\",\"payment_method_type\":\"ideal\",\"payment_method_data\":{\"bank_redirect\":{\"ideal\":{\"bank_name\":\"ing\",\"preferred_language\":\"en\"}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario16-Bank Redirect-eps",- "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\":1000,\"currency\":\"EUR\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":1000,\"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\",\"billing\":{\"address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"AT\"}},\"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 - Content check if 'next_action.redirect_to_url' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.redirect_to_url !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have value \"eps\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'eps'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"eps\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"bank_redirect\",\"payment_method_type\":\"eps\",\"payment_method_data\":{\"bank_redirect\":{\"eps\":{\"billing_details\":{\"billing_name\":\"John Doe\"},\"bank_name\":\"hypo_oberosterreich_salzburg_steiermark\",\"preferred_language\":\"en\",\"country\":\"AT\"}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario17-Bank Transfer-ach",- "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\":800,\"currency\":\"USD\",\"confirm\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":800,\"customer_id\":\"poll\",\"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://hs-payments-test.netlify.app/payments\",\"statement_descriptor_name\":\"Juspay\",\"statement_descriptor_suffix\":\"Router\",\"metadata\":{\"udf1\":\"value1\",\"new_customer\":\"true\",\"login_date\":\"2019-09-10T10:11:12Z\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"HarrisonStreet\",\"line3\":\"HarrisonStreet\",\"city\":\"SanFransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Swangi\",\"last_name\":\"Kumari\"},\"email\":\"[email protected]\"}}"- },- "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.type\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'next_action.type' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.type !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"ach\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'ach'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"ach\");",- " },",- " );",- "}",- "",- "// Response body should have value \"display_bank_transfer_information\" for \"next_action.type\"",- "if (jsonData?.next_action.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'display_bank_transfer_information'\",",- " function () {",- " pm.expect(jsonData.next_action.type).to.eql(",- " \"display_bank_transfer_information\",",- " );",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"bank_transfer\",\"payment_method_type\":\"ach\",\"payment_method_data\":{\"bank_transfer\":{\"ach_bank_transfer\":{\"billing_details\":{\"email\":\"[email protected]\"}}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario18-Bank Debit-ach",- "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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\":1800,\"currency\":\"USD\",\"confirm\":true,\"business_label\":\"default\",\"capture_method\":\"automatic\",\"connector\":[\"stripe\"],\"customer_id\":\"klarna\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"authentication_type\":\"three_ds\",\"email\":\"[email protected]\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"phone_country_code\":\"+65\",\"description\":\"Its my first payment request\",\"return_url\":\"https://google.com\",\"statement_descriptor_name\":\"Juspay\",\"statement_descriptor_suffix\":\"Router\",\"setup_future_usage\":\"off_session\",\"business_country\":\"US\",\"mandate_data\":{\"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\"}},\"mandate_type\":{\"single_use\":{\"amount\":6540,\"currency\":\"USD\"}}},\"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\"}},\"payment_method\":\"bank_debit\",\"payment_method_type\":\"ach\",\"payment_method_data\":{\"bank_debit\":{\"ach_bank_debit\":{\"billing_details\":{\"name\":\"John Doe\",\"email\":\"[email protected]\"},\"account_number\":\"000123456789\",\"routing_number\":\"110000000\"}}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"HarrisonStreet\",\"line3\":\"HarrisonStreet\",\"city\":\"SanFransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Swangi\",\"last_name\":\"Kumari\"}},\"metadata\":{\"order_details\":{\"product_name\":\"Apple iphone 15\",\"quantity\":1,\"amount\":1800,\"account_name\":\"transaction_processing\"}}}"- },- "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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario19-Wallet-Wechatpay",- "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\":800,\"currency\":\"USD\",\"confirm\":false,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":800,\"customer_id\":\"poll\",\"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\",\"statement_descriptor_name\":\"Juspay\",\"statement_descriptor_suffix\":\"Router\",\"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.type\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'next_action.type' exists\",",- " function () {",- " pm.expect(typeof jsonData.next_action.type !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have value \"ach\" for \"payment_method_type\"",- "if (jsonData?.payment_method_type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'we_chat_pay'\",",- " function () {",- " pm.expect(jsonData.payment_method_type).to.eql(\"we_chat_pay\");",- " },",- " );",- "}",- "",- "// Response body should have value \"qr_code_information\" for \"next_action.type\"",- "if (jsonData?.next_action.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'payment_method_type' matches 'qr_code_information'\",",- " function () {",- " pm.expect(jsonData.next_action.type).to.eql(\"qr_code_information\");",- " },",- " );",- "}",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"wallet\",\"payment_method_type\":\"we_chat_pay\",\"payment_method_data\":{\"wallet\":{\"we_chat_pay_qr\":{}}},\"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 \"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\");",- " },",- " );",- "}",- ""- ],- "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": "Scenario20- Update address and List Payment method",- "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.');",- "};",- "",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": "List Payment Methods for a Merchant",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:merchant_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",- "});",- "",- "// Parse the response body as JSON",- "var responseBody = pm.response.json();",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"card\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'card'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"card\";",- " });",- "});",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"pay_later\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'pay_later'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"pay_later\";",- " });",- "});",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"wallet\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'wallet'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"wallet\";",- " });",- "});",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"bank_debit\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_debit'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"bank_debit\";",- " });",- "});",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"bank_transfer\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_transfer'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"bank_transfer\";",- " });",- "});"- ],- "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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- "payment_methods"- ],- "query": [- {- "key": "client_secret",- "value": "{{client_secret}}"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular merchant id."- },- "response": []- },- {- "name": "Payments - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/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(\"[POST]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "",- "// Parse the JSON response",- "var jsonData = pm.response.json();",- "",- "// Check if the 'currency' is equal to \"EUR\"",- "pm.test(\"[POST]::/payments/:id -Content Check if 'currency' matches 'EUR' \", function () {",- " pm.expect(jsonData.currency).to.eql(\"EUR\");",- "});",- "",- "// Extract the \"country\" field from the JSON data",- "var country = jsonData.billing.address.country;",- "",- "// Check if the country is \"NL\"",- "pm.test(\"[POST]::/payments/:id -Content Check if billing 'Country' matches NL (Netherlands)\", function () {",- " pm.expect(country).to.equal(\"NL\");",- "});",- "",- "var country1 = jsonData.shipping.address.country;",- "",- "// Check if the country is \"NL\"",- "pm.test(\"[POST]::/payments/:id -Content Check if shipping 'Country' matches NL (Netherlands)\", function () {",- " pm.expect(country1).to.equal(\"NL\");",- "});",- ""- ],- "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": "{\"currency\":\"EUR\",\"shipping\":{\"address\":{\"line1\":\"1468\",\"line2\":\"Koramangala \",\"line3\":\"Koramangala \",\"city\":\"Bangalore\",\"state\":\"Karnataka\",\"zip\":\"560065\",\"country\":\"NL\",\"first_name\":\"Preeetam\",\"last_name\":\"Rev\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"billing\":{\"address\":{\"line1\":\"1468\",\"line2\":\"Koramangala \",\"line3\":\"Koramangala \",\"city\":\"Bangalore\",\"state\":\"Karnataka\",\"zip\":\"560065\",\"country\":\"NL\",\"first_name\":\"Preeetam\",\"last_name\":\"Rev\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"},\"email\":\"[email protected]\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}"- }- ]- },- "description": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created "- },- "response": []- },- {- "name": "List Payment Methods for a Merchant-copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:merchant_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:merchant_id - Content-Type is application/json\", function () {",- " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",- "});",- "",- "",- "// Parse the response body as JSON",- "var responseBody = pm.response.json();",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"card\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'card'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"card\";",- " });",- "});",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"ideal\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id - Content Check if payment_method matches 'ideal'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"ideal\";",- " });",- "});",- "",- "// Check if \"payment_methods\" array contains a \"payment_method\" with the value \"bank_redirect\"",- "pm.test(\"[GET]::/payment_methods/:merchant_id -Content Check if payment_method matches 'bank_redirect'\", function () {",- " var paymentMethods = responseBody.payment_methods;",- " var cardPaymentMethod = paymentMethods.find(function (method) {",- " return method.payment_method == \"bank_redirect\";",- " });",- "});"- ],- "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": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}",- "host": [- "{{baseUrl}}"- ],- "path": [- "account",- "payment_methods"- ],- "query": [- {- "key": "client_secret",- "value": "{{client_secret}}"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular merchant id."- },- "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\");",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "//// 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\");",- "})};",- "",- ""- ],- "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\":\"bank_redirect\",\"payment_method_type\":\"ideal\",\"payment_method_data\":{\"bank_redirect\":{\"ideal\":{\"billing_details\":{\"billing_name\":\"Example\",\"email\":\"[email protected]\"},\"bank_name\":\"ing\"}}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"125.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"multi_use\":{\"amount\":7000,\"currency\":\"USD\",\"start_date\":\"2023-04-21T00:00:00Z\",\"end_date\":\"2023-05-21T00:00:00Z\",\"metadata\":{\"frequency\":\"13\"}}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"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\":\"128.0.0.1\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{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\");",- "})};"- ],- "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": "Scenario21- Update 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.');",- "};",- "",- "// pm.collectionVariables - Set customer_id as variable for jsonData.customer_id",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 - Update",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[POST]::/payments/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[POST]::/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(\"[POST]::/payments/:id - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "",- "// Parse the JSON response",- "var jsonData = pm.response.json();",- "",- "// Check if the 'amount' is equal to \"1000\"",- "pm.test(\"[POST]::/payments/:id -Content Check if 'amount' matches '1000' \", function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- "});",- "",- "",- ""- ],- "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\":1000,\"amount_to_capture\":1000}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{payment_id}}"- }- ]- },- "description": "To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created "- },- "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\");",- "});",- "",- "// Set response object as internal variable",- "let jsonData = {};",- "try {jsonData = pm.response.json();}catch(e){}",- "",- "// Validate if response has JSON Body ",- "pm.test(\"[POST]::/payments/:id/confirm - Response has JSON Body\", function () {",- " pm.response.to.have.jsonBody();",- "});",- "",- "//// 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\");",- "})};",- "",- "",- "// Check if the 'amount' is equal to \"1000\"",- "pm.test(\"[POST]::/payments/:id -Content Check if 'amount' matches '1000' \", function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- "});",- "",- "//// Response body should have value \"amount_received\" for \"1000\"",- "if (jsonData?.amount_received) {",- "pm.test(\"[POST]::/payments - Content check if value for 'amount_received' matches '1000'\", function() {",- " pm.expect(jsonData.amount_received).to.eql(1000);",- "})};",- ""- ],- "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"- },- {- "key": "publishable_key",- "value": "",- "type": "text",- "disabled": true- }- ],- "body": {- "mode": "raw",- "options": {- "raw": {- "language": "json"- }- },- "raw": "{\"client_secret\":\"{{client_secret}}\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"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\":\"128.0.0.1\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id/confirm",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id",- "confirm"- ],- "variable": [- {- "key": "id",- "value": "{{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 - Content check if value for 'status' matches 'succeeded'\", function() {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- "})};",- "",- "",- "// Check if the 'amount' is equal to \"1000\"",- "pm.test(\"[POST]::/payments/:id -Content Check if 'amount' matches '1000' \", function () {",- " pm.expect(jsonData.amount).to.eql(1000);",- "});",- "",- "//// Response body should have value \"amount_received\" for \"1000\"",- "if (jsonData?.amount_received) {",- "pm.test(\"[POST]::/payments - Content check if value for 'amount_received' matches '1000'\", function() {",- " pm.expect(jsonData.amount_received).to.eql(1000);",- "})};",- ""- ],- "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": "Scenario22-Add card flow",- "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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\");",- " })};"- ],- "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\":\"stripesavecard_1234\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"737\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"737\"}"- },- "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\",",- " );",- "});",- "",- "// 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": "Refunds - Create Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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.\",",- " );",- "}",- ""- ],- "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\":600,\"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": []- },- {- "name": "Refunds - Retrieve",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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.\",",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario23-Don't Pass CVV for save card flow and verifysuccess 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"stripesavecard_1234\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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 \"adyen\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- "",- "// 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\");",- " })};"- ],- "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_token\":\"{{payment_token}}\"}"- },- "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": "Scenario24-Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":\"adyensavecard\",\"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://google.com\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"credit\",\"payment_method_data\":{\"card\":{\"card_number\":\"371449635398431\",\"card_exp_month\":\"03\",\"card_exp_year\":\"2030\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"7373\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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\");",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- "});",- "",- "// 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) {",- " pm.test(",- " \"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches 'amount - 540'\",",- " 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": "List payment methods for a Customer",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx ",- "pm.test(\"[GET]::/payment_methods/:customer_id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/payment_methods/:customer_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){}",- "",- "if (jsonData?.customer_payment_methods[0]?.payment_token) {",- " pm.collectionVariables.set(\"payment_token\", jsonData.customer_payment_methods[0].payment_token);",- " console.log(\"- use {{payment_token}} as collection variable for value\", jsonData.customer_payment_methods[0].payment_token);",- "} else {",- " console.log('INFO - Unable to assign variable {{payment_token}}, as jsonData.customer_payment_methods[0].payment_token is undefined.');",- "}"- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/customers/:customer_id/payment_methods",- "host": [- "{{baseUrl}}"- ],- "path": [- "customers",- ":customer_id",- "payment_methods"- ],- "query": [- {- "key": "accepted_country",- "value": "co",- "disabled": true- },- {- "key": "accepted_country",- "value": "pa",- "disabled": true- },- {- "key": "accepted_currency",- "value": "voluptate ea",- "disabled": true- },- {- "key": "accepted_currency",- "value": "exercitation",- "disabled": true- },- {- "key": "minimum_amount",- "value": "100",- "disabled": true- },- {- "key": "maximum_amount",- "value": "10000000",- "disabled": true- },- {- "key": "recurring_payment_enabled",- "value": "true",- "disabled": true- },- {- "key": "installment_payment_enabled",- "value": "true",- "disabled": true- }- ],- "variable": [- {- "key": "customer_id",- "value": "{{customer_id}}",- "description": "//Pass the customer id"- }- ]- },- "description": "To filter and list the applicable payment methods for a particular Customer ID"- },- "response": []- },- {- "name": "Save card 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.');",- "};",- "",- "if (jsonData?.customer_id) {",- " pm.collectionVariables.set(\"customer_id\", jsonData.customer_id);",- " console.log(\"- use {{customer_id}} as collection variable for value\",jsonData.customer_id);",- "} else {",- " console.log('INFO - Unable to assign variable {{customer_id}}, as jsonData.customer_id 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\":false,\"capture_method\":\"manual\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"{{customer_id}}\",\"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://google.com\",\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"9123456789\",\"country_code\":\"+91\"}},\"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": "Save card 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_capture\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'status' matches 'requires_capture'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"requires_capture\");",- " },",- " );",- "}",- "",- "",- "// Response body should have value \"stripe\" for \"connector\"",- "if (jsonData?.connector) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'connector' matches 'stripe'\",",- " function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- " },",- " );",- "}",- ""- ],- "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_token\":\"{{payment_token}}\",\"card_cvc\":\"7373\"}"- },- "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 - 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(\"stripe\");",- "});",- "",- "// 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 '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 'amount - 540'\",",- " 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-copy",- "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(\"stripe\");",- "});",- "",- "// 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 '6540'\",",- " function () {",- " pm.expect(jsonData.amount_received).to.eql(6540);",- " },",- " );",- "}",- "",- "// 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 - 540'\",",- " 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": "Refunds - Create Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[POST]::/refunds - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'status' matches 'succeeded'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"succeeded\");",- " },",- " );",- "}",- "",- "// Response body should have value \"540\" for \"amount\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- "",- "// Validate the connector",- "pm.test(\"[POST]::/payments - connector\", function () {",- " pm.expect(jsonData.connector).to.eql(\"stripe\");",- "});",- ""- ],- "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": []- },- {- "name": "Refunds - Retrieve Copy",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 2xx",- "pm.test(\"[GET]::/refunds/:id - Status code is 2xx\", function () {",- " pm.response.to.be.success;",- "});",- "",- "// Validate if response header has matching content-type",- "pm.test(\"[GET]::/refunds/: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 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 value \"succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/refunds - 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?.status) {",- " pm.test(",- " \"[POST]::/refunds - Content check if value for 'amount' matches '540'\",",- " function () {",- " pm.expect(jsonData.amount).to.eql(540);",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- }- ],- "request": {- "method": "GET",- "header": [- {- "key": "Accept",- "value": "application/json"- }- ],- "url": {- "raw": "{{baseUrl}}/refunds/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "refunds",- ":id"- ],- "variable": [- {- "key": "id",- "value": "{{refund_id}}",- "description": "(Required) unique refund id"- }- ]- },- "description": "To retrieve the properties of a Refund. This may be used to get the status of a previously initiated payment or next action for an ongoing payment"- },- "response": []- }- ]- },- {- "name": "Scenario25-Create payment without customer_id and with billing address and shipping address",- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"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\",\"setup_future_usage\":\"on_session\",\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"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\":\"sundari\",\"last_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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 \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "Scenario26-Confirm a payment with requires_customer_action status",- "item": [- {- "name": "Payments - Create with confirm true",- "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;",- " },",- ");",- ""- ],- "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\",\"business_country\":\"US\",\"business_label\":\"default\",\"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\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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(\"[GET]::/payments/:id - Status code is 400\", function () {",- " pm.response.to.be.error;",- "});",- "",- "// 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) { }",- "",- "",- "// Response body should have appropriatae error message",- "if (jsonData?.message) {",- " pm.test(",- " \"Content check if appropriate error message is present\",",- " function () {",- " pm.expect(jsonData.message).to.eql(\"You cannot confirm this payment because it has status requires_customer_action\");",- " },",- " );",- "}",- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"}},\"client_secret\":\"{{client_secret}}\",\"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\":\"125.0.0.1\"}}"- },- "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": "Scenario27-Create payment with payment method billing",- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data.billing !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should not have \"payment.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment.billing' is null\",",- " function () {",- " pm.expect(jsonData?.billing).to.be.null",- " },",- ");",- ""- ],- "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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"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\",\"setup_future_usage\":\"on_session\",\"payment_method\":\"card\",\"payment_method_type\":\"debit\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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 \"connector_transaction_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'connector_transaction_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.connector_transaction_id !== \"undefined\").to.be",- " .true;",- " },",- ");",- "",- "// Response body should have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data.billing !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "Scenario28-Update payment with payment method billing",- "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 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,\"business_country\":\"US\",\"business_label\":\"default\",\"capture_method\":\"automatic\",\"capture_on\":\"2022-09-10T10:11:12Z\",\"amount_to_capture\":6540,\"customer_id\":\"bernard123\",\"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\",\"setup_future_usage\":\"on_session\",\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\",\"last_name\":\"sundari\"}},\"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 - Update",- "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) { }",- "",- "// 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_confirmation\");",- " },",- " );",- "}",- "",- "// Response body should have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data.billing !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"01\",\"card_exp_year\":\"26\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments/:id",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments",- ":id"- ],- "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 - 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data.billing !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "Scenario29-Pass payment method billing in Confirm",- "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"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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": "{\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"Joseph Doe\",\"card_cvc\":\"123\"},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}},\"client_secret\":\"{{client_secret}}\",\"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\":\"125.0.0.1\"}}"- },- "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\");",- " },",- " );",- "}",- "",- "// Response body should have \"payment_method_data.billing\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'payment_method_data.billing' exists\",",- " function () {",- " pm.expect(typeof jsonData.payment_method_data.billing !== \"undefined\").to.be",- " .true;",- " },",- ");",- ""- ],- "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": "Scenario30-Ensure API Contract for Payment Method Data",- "item": [- {- "name": "Payments - Card Payment Method Invalid Card CVC",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 400\", 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.test(\"[POST]::/payments - Response has appropriate error message\", function () {",- " pm.expect(jsonData.error.message).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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - Card Payment Method Invalid Card Number",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 400\", 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();",- "});",- ""- ],- "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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"1234\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - Card Payment Method Invalid Expiry month",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 400\", 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.test(\"[POST]::/payments - Response has appropriate error message\", function () {",- " pm.expect(jsonData.error.message).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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"13\",\"card_exp_year\":\"69\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - Card Payment Method Invalid Expiry year",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 400\", 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) { }",- "",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check for error message to equal `Invalid Expiry Year`\",",- " 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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"22\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - Card Payment Method Success",- "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) { }",- "",- "// 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_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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - Reward Payment Method",- "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) { }",- "",- "// 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_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\",\"payment_method\":\"reward\",\"payment_method_type\":\"evoucher\",\"payment_method_data\":\"reward\"}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- }- ]- },- {- "name": "Scenario31-Check is payment checks are populated",- "item": [- {- "name": "Payments - cvv check fails",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 200\", 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.test(\"[POST]::/payments - Response has cvc check as fail\", function () {",- " pm.expect(jsonData.payment_method_data.card.payment_checks.cvc_check).to.eql(\"fail\");",- "})",- ""- ],- "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,\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000000101\",\"card_exp_month\":\"12\",\"card_exp_year\":\"34\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - payment check populated for successful payment without billing",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 200\", 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) { }",- "",- "// 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\");",- " },",- " );",- "}",- "",- "pm.test(\"[POST]::/payments - Response has payment checks\", function () {",- " pm.expect(jsonData.payment_method_data.card.payment_checks).to.eql({",- " \"address_line1_check\": null,",- " \"address_postal_code_check\": null,",- " \"cvc_check\": \"pass\"",- " });",- "})",- ""- ],- "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,\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - postal code check fail",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 200\", 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) { }",- "",- "// 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\");",- " },",- " );",- "}",- "",- "pm.test(\"[POST]::/payments - Response has postal code check as fail\", function () {",- " pm.expect(jsonData.payment_method_data.card.payment_checks.address_postal_code_check).to.eql(\"fail\");",- "})",- "",- ""- ],- "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,\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000000036\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- },- {- "name": "Payments - successful payment with billing",- "event": [- {- "listen": "test",- "script": {- "exec": [- "// Validate status 400",- "pm.test(\"[POST]::/payments - Status code is 200\", 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) { }",- "",- "// 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\");",- " },",- " );",- "}",- "",- "pm.test(\"[POST]::/payments - Response has payment checks\", function () {",- " pm.expect(jsonData.payment_method_data.card.payment_checks).to.eql({",- " \"address_line1_check\": \"pass\",",- " \"address_postal_code_check\": \"pass\",",- " \"cvc_check\": \"pass\"",- " });",- "})",- ""- ],- "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,\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrisoff Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"Narayan\",\"last_name\":\"Doe\"},\"email\":\"[email protected]\"}}"- },- "url": {- "raw": "{{baseUrl}}/payments",- "host": [- "{{baseUrl}}"- ],- "path": [- "payments"- ]- },- "description": "Create a Payment to ensure api contract is intact"- }- }- ]- }- ]- },- {- "name": "Variation Cases",- "item": [- {- "name": "Scenario10-Refund exceeds amount captured",- "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\");",- " },",- " );",- "}",- ""- ],- "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\":\"+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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- "",- "// 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);",- " },",- " );",- "}",- ""- ],- "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 \"Succeeded\" for \"status\"",- "if (jsonData?.status) {",- " pm.test(",- " \"[POST]::/payments/:id - Content check if value for 'status' matches 'partially_captured'\",",- " function () {",- " pm.expect(jsonData.status).to.eql(\"partially_captured\");",- " },",- " );",- "}",- ""- ],- "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\");",- " },",- " );",- "}",- "",- "// Response body should have value \"The refund amount exceeds the amount captured\" for \"error message\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments/:id/confirm - Content check if value for 'error.message' matches 'The refund amount exceeds the amount captured'\",",- " function () {",- " pm.expect(jsonData.error.message).to.eql(\"The refund amount exceeds the amount captured\");",- " },",- " );",- "}",- ""- ],- "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\":6540,\"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": []- }- ]- },- {- "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 \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.type' matches 'connector_error'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"connector_error\");",- " },",- " );",- "}",- ""- ],- "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\":\"25\",\"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\":\"united states\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"united states\"}},\"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 \"connector error\" for \"error type\"",- "if (jsonData?.error?.type) {",- " pm.test(",- " \"[POST]::/payments - 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\":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\":\"378282246310005\",\"card_exp_month\":\"01\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 'invalid_request'\",",- " function () {",- " pm.expect(jsonData.error.type).to.eql(\"invalid_request\");",- " },",- " );",- "}",- "",- "// Response body should have value \"connector error\" for \"error message\"",- "if (jsonData?.error?.message) {",- " pm.test(",- " \"[POST]::/payments - Content check if value for 'error.message' matches 'Invalid Expiry Year'\",",- " 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\":\"378282246310005\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 \"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(\"connector\");",- " },",- " );",- "}",- ""- ],- "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\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "type": "text/javascript"- }- },- {- "listen": "prerequest",- "script": {- "exec": [- ""- ],- "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\");",- " },",- " );",- "}",- ""- ],- "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\",\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": "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\",\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": "Scenario6-Create 3DS payment with greater 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.\",",- " );",- "}",- "",- "// 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;",- " },",- ");",- ""- ],- "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\",\"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\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"card_number\":\"4000000000003063\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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_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\");",- " },",- " );",- "}",- ""- ],- "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": "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\":7540,\"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": "Scenario7-Refund exceeds 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 \"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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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\");",- " },",- " );",- "}",- ""- ],- "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 \"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": "{\"payment_id\":\"{{payment_id}}\",\"amount\":7000,\"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": []- }- ]- },- {- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"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\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": []- }- ]- },- {- "name": "Scenario9-Create a recurring payment with greater mandate 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 \"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\");",- " },",- " );",- "}",- "",- "// 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\");",- " },",- " );",- "}",- "",- "// Response body should have \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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\":\"378282246310005\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\",\"card_cvc\":\"123\"}},\"setup_future_usage\":\"off_session\",\"mandate_data\":{\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"mandate_type\":{\"single_use\":{\"amount\":7000,\"currency\":\"USD\"}}},\"customer_acceptance\":{\"acceptance_type\":\"offline\",\"accepted_at\":\"1963-05-03T04:07:52.723Z\",\"online\":{\"ip_address\":\"127.0.0.1\",\"user_agent\":\"amet irure esse\"}},\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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 \"mandate_id\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_id' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_id !== \"undefined\").to.be.true;",- " },",- ");",- "",- "// Response body should have \"mandate_data\"",- "pm.test(",- " \"[POST]::/payments - Content check if 'mandate_data' exists\",",- " function () {",- " pm.expect(typeof jsonData.mandate_data !== \"undefined\").to.be.true;",- " },",- ");",- ""- ],- "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": "Recurring Payments - Create",- "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/: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": "{\"amount\":8040,\"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\",\"mandate_id\":\"{{mandate_id}}\",\"off_session\":true,\"billing\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"shipping\":{\"address\":{\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"city\":\"San Fransico\",\"state\":\"California\",\"zip\":\"94122\",\"country\":\"US\",\"first_name\":\"sundari\"}},\"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": []- }- ]- }- ]- }- ]- }- ],- "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": "a553df38-fa33-4522-b029-1cd32821730e",- "name": "Stripe Postman Collection",- "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",- "_exporter_id": "24206034"- },- "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": "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"- }- ]-}