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
ci(postman): Update API creds before making payment (#2531)
Pa1NarK269776558215
diff --git a/postman/collection-dir/stripe/QuickStart/.meta.json b/postman/collection-dir/stripe/QuickStart/.meta.jsonindex c4939d7ab9..afeb7c5704 100644--- a/postman/collection-dir/stripe/QuickStart/.meta.json+++ b/postman/collection-dir/stripe/QuickStart/.meta.json@@ -4,6 +4,8 @@"API Key - Create","Payment Connector - Create","Payments - Create",+ "Payment Connector - Update",+ "Payments - Create-copy","Payments - Retrieve","Refunds - Create","Refunds - Retrieve"diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.prerequest.js b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/event.prerequest.jsnew file mode 100644index 0000000000..e69de29bb2diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.jsonindex ff1f8084a8..9d742acdf3 100644--- a/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json+++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Create/request.json@@ -44,7 +44,7 @@"business_label": "default","connector_account_details": {"auth_type": "HeaderKey",- "api_key": "{{connector_api_key}}"+ "api_key": "{{connector_api_key}}_invalid_values"},"test_mode": false,"disabled": false,@@ -259,7 +259,10 @@{"type": "CARD","parameters": {- "allowed_auth_methods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],+ "allowed_auth_methods": [+ "PAN_ONLY",+ "CRYPTOGRAM_3DS"+ ],"allowed_card_networks": ["AMEX","DISCOVER",@@ -293,8 +296,15 @@},"payment_request_data": {"label": "applepay pvt.ltd",- "supported_networks": ["visa", "masterCard", "amex", "discover"],- "merchant_capabilities": ["supports3DS"]+ "supported_networks": [+ "visa",+ "masterCard",+ "amex",+ "discover"+ ],+ "merchant_capabilities": [+ "supports3DS"+ ]}}}@@ -302,8 +312,14 @@},"url": {"raw": "{{baseUrl}}/account/:account_id/connectors",- "host": ["{{baseUrl}}"],- "path": ["account", ":account_id", "connectors"],+ "host": [+ "{{baseUrl}}"+ ],+ "path": [+ "account",+ ":account_id",+ "connectors"+ ],"variable": [{"key": "account_id",diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/.event.meta.jsonnew file mode 100644index 0000000000..4ac527d834--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/.event.meta.json@@ -0,0 +1,6 @@+{+ "eventOrder": [+ "event.test.js",+ "event.prerequest.js"+ ]+}diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/event.prerequest.js b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/event.prerequest.jsnew file mode 100644index 0000000000..e69de29bb2diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/event.test.js b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/event.test.jsnew file mode 100644index 0000000000..d7259b6a84--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/event.test.js@@ -0,0 +1,39 @@+// 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.",+ );+}diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/request.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/request.jsonnew file mode 100644index 0000000000..ef812ef5d1--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/request.json@@ -0,0 +1,333 @@+{+ "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_json_formatted": {+ "connector_type": "fiz_operations",+ "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": "hyperswitch-sdk-test.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"+}diff --git a/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/response.json b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/response.jsonnew file mode 100644index 0000000000..fe51488c70--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payment Connector - Update/response.json@@ -0,0 +1 @@+[]diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/.event.meta.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/.event.meta.jsonnew file mode 100644index 0000000000..4ac527d834--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/.event.meta.json@@ -0,0 +1,6 @@+{+ "eventOrder": [+ "event.test.js",+ "event.prerequest.js"+ ]+}diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/event.prerequest.js b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/event.prerequest.jsnew file mode 100644index 0000000000..e69de29bb2diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/event.test.js b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/event.test.jsnew file mode 100644index 0000000000..ffcdd527d0--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/event.test.js@@ -0,0 +1,80 @@+// 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;+ },+);diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.jsonnew file mode 100644index 0000000000..da1e0039c8--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json@@ -0,0 +1,103 @@+{+ "method": "POST",+ "header": [+ {+ "key": "Content-Type",+ "value": "application/json"+ },+ {+ "key": "Accept",+ "value": "application/json"+ }+ ],+ "body": {+ "mode": "raw",+ "options": {+ "raw": {+ "language": "json"+ }+ },+ "raw_json_formatted": {+ "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": "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": "joseph",+ "last_name": "Doe"+ },+ "phone": {+ "number": "8056594427",+ "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": "8056594427",+ "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": "stripe"+ }+ }+ },+ "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"+}diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/response.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/response.jsonnew file mode 100644index 0000000000..fe51488c70--- /dev/null+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/response.json@@ -0,0 +1 @@+[]diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js b/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.jsindex a6947db94c..44aef3e03b 100644--- a/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/event.test.js@@ -59,3 +59,32 @@ if (jsonData?.client_secret) {"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;+ },+);