mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +08:00
ci(postman): fix archipel configs and test cases (#8360)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Health check",
|
||||
"Flow Testcases"
|
||||
"Flow Testcases",
|
||||
"Netcetera Testcases"
|
||||
]
|
||||
}
|
||||
|
||||
@ -83,6 +83,31 @@
|
||||
{
|
||||
"key": "archipel_transaction_uuid",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"key": "netcetera_certificate",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "netcetera_private_key",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "netcetera_merchant_configuration_id",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "netcetera_requestor_url",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"key": "netcetera_requestor_app_url",
|
||||
"value": "",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -5,14 +5,19 @@
|
||||
"Scenario3a-Create payment with Manual capture",
|
||||
"Scenario3b-Create payment with partial capture",
|
||||
"Scenario3c-Create payment with confirm false and manual capture",
|
||||
"Scenario4-Zero auth mandates",
|
||||
"Scenario5-Create a mandate and recurring payment",
|
||||
"Scenario6-Saved card flow",
|
||||
"Scenario4a-Void a payment",
|
||||
"Scenario4b-Void a partially captured payment",
|
||||
"Scenario4c-Void a successful payment",
|
||||
"Scenario5a-Create a zero auth mandate and recurring payment (using mandate_id)",
|
||||
"Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)",
|
||||
"Scenario6a-Create a mandate and recurring payment (using mandate_id)",
|
||||
"Scenario6b-Create a mandate and recurring payment (using connector agnostic)",
|
||||
"Scenario7-Save card flow",
|
||||
"Scenario8a-Incremental authorization",
|
||||
"Scenario8b-Incremental authorization with partial capture",
|
||||
"Scenario9a-Refund full payment",
|
||||
"Scenario9b-Refund partial payment",
|
||||
"Scenario9c-Refund full incremented payment",
|
||||
"Scenario10-Create 3DS payment"
|
||||
"Scenario10-Create 3DS payment without external 3ds authentication"
|
||||
]
|
||||
}
|
||||
@ -2,8 +2,6 @@
|
||||
"childrenOrder": [
|
||||
"Payments - Create",
|
||||
"Payments - Confirm",
|
||||
"Payments - External 3ds authentication",
|
||||
"Payments - Authorize request intent",
|
||||
"Payments - Retrieve after confirm"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
// Validate status 400
|
||||
pm.test("[POST]::/payments/:id/confirm - Status code is 400", function () {
|
||||
pm.response.to.have.status(400);
|
||||
});
|
||||
|
||||
// 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) {}
|
||||
|
||||
// Validate if response has error body
|
||||
pm.test("[POST]::/payments/:id/confirm - Response has error body", function () {
|
||||
pm.expect(jsonData).to.have.property("error");
|
||||
});
|
||||
|
||||
// Validate if error type is "invalid_request"
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/confirm - Error type is 'invalid_request'",
|
||||
function () {
|
||||
pm.expect(jsonData.error).to.have.property("type", "invalid_request");
|
||||
},
|
||||
);
|
||||
|
||||
// Validate if error message is "Payment method type not supported"
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/confirm - Error message is 'Payment method type not supported'",
|
||||
function () {
|
||||
pm.expect(jsonData.error).to.have.property(
|
||||
"message",
|
||||
"Payment method type not supported",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
// Validate if error reason is "Selected 3DS authentication method is not supported by archipel"
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/confirm - Error reason is 'Selected 3DS authentication method is not supported by archipel'",
|
||||
function () {
|
||||
pm.expect(jsonData.error).to.have.property(
|
||||
"reason",
|
||||
"Selected 3DS authentication method is not supported by archipel",
|
||||
);
|
||||
},
|
||||
);
|
||||
@ -24,7 +24,7 @@
|
||||
"confirm": false,
|
||||
"capture_method": "automatic",
|
||||
"authentication_type": "three_ds",
|
||||
"request_external_three_ds_authentication": true,
|
||||
"request_external_three_ds_authentication": false,
|
||||
"profile_id": "{{profile_id}}",
|
||||
"email": "john_doe@gmail.com",
|
||||
"name": "John Doe",
|
||||
@ -0,0 +1,60 @@
|
||||
// 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) {}
|
||||
|
||||
// Response body should have value "requires_payment_method" for "status"
|
||||
pm.test(
|
||||
"[POST]::/payments/:id - Content check if value for 'status' matches 'requires_payment_method'",
|
||||
function () {
|
||||
pm.expect(jsonData.status).to.eql("requires_payment_method");
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments/:id - Content check if value for 'amount' equal 500",
|
||||
function () {
|
||||
pm.expect(jsonData.amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments/:id - Content check if value for 'net_amount' equal 500",
|
||||
function () {
|
||||
pm.expect(jsonData.net_amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments/:id - Content check if value for 'amount_capturable' equal 0",
|
||||
function () {
|
||||
pm.expect(jsonData.amount_capturable).to.eql(0);
|
||||
},
|
||||
);
|
||||
|
||||
// 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;
|
||||
},
|
||||
);
|
||||
@ -1,4 +0,0 @@
|
||||
// Validate status 2xx
|
||||
pm.test("[GET]::/payments/:id - Status code is 2xx", function () {
|
||||
pm.response.to.be.success;
|
||||
});
|
||||
@ -1,49 +0,0 @@
|
||||
// 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) {}
|
||||
|
||||
// Response body should have value "requires_customer_action" for "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");
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector_transaction_id' exists",
|
||||
function () {
|
||||
pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be
|
||||
.true;
|
||||
pm.collectionVariables.set("connector_transaction_id", jsonData.connector_transaction_id)
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector' is archipel",
|
||||
function () {
|
||||
pm.expect(jsonData.connector).to.be.equal("archipel");
|
||||
},
|
||||
);
|
||||
@ -1,4 +0,0 @@
|
||||
// Validate status 2xx
|
||||
pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () {
|
||||
pm.response.to.be.success;
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Payments - Create mandate",
|
||||
"Payments - Confirm mandate",
|
||||
"Payments - Create recurring",
|
||||
"Payments - Retrieve recurring"
|
||||
]
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
// 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 client_secret as variable for jsonData.client_secret
|
||||
if (jsonData?.client_secret) {
|
||||
pm.collectionVariables.set("client_secret", jsonData.client_secret);
|
||||
console.log(
|
||||
"- use {{client_secret}} as collection variable for 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"
|
||||
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_id"
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'mandate_id' exists is correct ",
|
||||
function () {
|
||||
pm.expect(jsonData.mandate_id).to.eql(pm.collectionVariables.get("mandate_id"));
|
||||
},
|
||||
);
|
||||
|
||||
// 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;
|
||||
},
|
||||
);
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Payments - Create",
|
||||
"Payments - Cancel",
|
||||
"Payments - Retrieve"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -23,14 +23,8 @@
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/payments/:id/cancel",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"payments",
|
||||
":id",
|
||||
"cancel"
|
||||
],
|
||||
"host": ["{{baseUrl}}"],
|
||||
"path": ["payments", ":id", "cancel"],
|
||||
"variable": [
|
||||
{
|
||||
"key": "id",
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
// 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");
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -19,14 +19,28 @@
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"amount": 500,
|
||||
"amount_to_capture": 500,
|
||||
"currency": "EUR",
|
||||
"capture_on": "{{$isoTimestamp}}",
|
||||
"confirm": false,
|
||||
"capture_method": "automatic",
|
||||
"authentication_type": "no_three_ds",
|
||||
"payment_method": "card",
|
||||
"payment_method_type": "credit",
|
||||
"payment_method_data": {
|
||||
"card": {
|
||||
"card_cvc": "123",
|
||||
"card_exp_month": "01",
|
||||
"card_exp_year": "50",
|
||||
"card_holder_name": "John Doe",
|
||||
"card_number": "5185570141917102"
|
||||
}
|
||||
},
|
||||
"profile_id": "{{profile_id}}",
|
||||
"customer_id": "{{customer_id}}",
|
||||
"setup_future_usage": "off_session",
|
||||
"description": "[Archipel Connector][Scenario6] - Create payment with already saved card",
|
||||
"email": "john_doe@gmail.com",
|
||||
"name": "John Doe",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
@ -58,7 +72,9 @@
|
||||
"number": "8056594427",
|
||||
"country_code": "+91"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statement_descriptor_name": "Joseph Doe",
|
||||
"statement_descriptor_suffix": "JS"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
@ -69,6 +85,5 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
// 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");
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Payments - Create",
|
||||
"Payments - Capture",
|
||||
"Payments - Cancel",
|
||||
"Payments - Retrieve"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
// Validate status 2xx
|
||||
pm.test("[POST]::/payments/:id/confirm - Status code is 2xx", function () {
|
||||
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/confirm - Content-Type is application/json",
|
||||
"[POST]::/payments/:id/cancel - Content-Type is application/json",
|
||||
function () {
|
||||
pm.expect(pm.response.headers.get("Content-Type")).to.include(
|
||||
"application/json",
|
||||
@ -14,7 +14,7 @@ pm.test(
|
||||
);
|
||||
|
||||
// Validate if response has JSON Body
|
||||
pm.test("[POST]::/payments/:id/confirm - Response has JSON Body", function () {
|
||||
pm.test("[POST]::/payments/:id/cancel - Response has JSON Body", function () {
|
||||
pm.response.to.have.jsonBody();
|
||||
});
|
||||
|
||||
@ -37,7 +37,6 @@ if (jsonData?.payment_id) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret
|
||||
if (jsonData?.client_secret) {
|
||||
pm.collectionVariables.set("client_secret", jsonData.client_secret);
|
||||
@ -51,11 +50,12 @@ if (jsonData?.client_secret) {
|
||||
);
|
||||
}
|
||||
|
||||
// Response body should have value "succeeded" for "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 "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");
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
{
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
// 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 client_secret as variable for jsonData.client_secret
|
||||
if (jsonData?.client_secret) {
|
||||
pm.collectionVariables.set("client_secret", jsonData.client_secret);
|
||||
console.log(
|
||||
"- use {{client_secret}} as collection variable for value",
|
||||
jsonData.client_secret,
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.",
|
||||
);
|
||||
}
|
||||
|
||||
// Response body should have value "partially_captured" for "status"
|
||||
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 "500" for "amount"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'",
|
||||
function () {
|
||||
pm.expect(jsonData.amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
// Response body should have value "500" for "net_amount"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'net_amount' matches '500'",
|
||||
function () {
|
||||
pm.expect(jsonData.net_amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
// Response body should have value "500" for "amount_capturable"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches '0'",
|
||||
function () {
|
||||
pm.expect(jsonData.amount_capturable).to.eql(0);
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 200",
|
||||
function () {
|
||||
pm.expect(jsonData.amount_received).to.eql(200);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector_transaction_id' exists",
|
||||
function () {
|
||||
pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be
|
||||
.true;
|
||||
pm.collectionVariables.set("connector_transaction_id", jsonData.connector_transaction_id)
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector' is archipel",
|
||||
function () {
|
||||
pm.expect(jsonData.connector).to.be.equal("archipel");
|
||||
},
|
||||
);
|
||||
@ -0,0 +1,44 @@
|
||||
{
|
||||
"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_to_capture": 200,
|
||||
"statement_descriptor_name": "John",
|
||||
"statement_descriptor_suffix": "JD"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/payments/:id/capture",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"payments",
|
||||
":id",
|
||||
"capture"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
// 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");
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -24,9 +24,6 @@
|
||||
"confirm": true,
|
||||
"capture_method": "manual",
|
||||
"authentication_type": "no_three_ds",
|
||||
"profile_id": "{{profile_id}}",
|
||||
"phone_country_code": "+91",
|
||||
"description": "[Archipel][Connector][Scenario7] - Create payment and cancel it",
|
||||
"payment_method": "card",
|
||||
"payment_method_type": "credit",
|
||||
"payment_method_data": {
|
||||
@ -38,6 +35,12 @@
|
||||
"card_number": "5185570141917102"
|
||||
}
|
||||
},
|
||||
"profile_id": "{{profile_id}}",
|
||||
"email": "john_doe@gmail.com",
|
||||
"name": "John Doe",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
@ -52,7 +55,26 @@
|
||||
"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 Doe",
|
||||
"statement_descriptor_suffix": "JS"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
@ -63,6 +85,5 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
// 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");
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Payments - Create",
|
||||
"Payments - Capture",
|
||||
"Payments - Sync payment",
|
||||
"Payments - Cancel"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"eventOrder": ["event.test.js"]
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
// Validate status 400
|
||||
pm.test("[POST]::/payments/:id/cancel - Status code is 400", function () {
|
||||
pm.response.to.have.status(400);
|
||||
});
|
||||
|
||||
// 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();
|
||||
});
|
||||
|
||||
// Validate if response has error body
|
||||
pm.test("[POST]::/payments/:id/cancel - Response has error body", function () {
|
||||
pm.expect(pm.response.json()).to.have.property("error");
|
||||
});
|
||||
|
||||
// Validate if response has "invalid_request" error type
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/cancel - Response has 'invalid_request' error type",
|
||||
function () {
|
||||
pm.expect(pm.response.json().error).to.have.property("type", "invalid_request");
|
||||
},
|
||||
);
|
||||
|
||||
// Validate if response has "You cannot cancel this payment because it has status succeeded" error message
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/cancel - Response has 'You cannot cancel this payment because it has status succeeded' error message",
|
||||
function () {
|
||||
pm.expect(pm.response.json().error).to.have.property(
|
||||
"message",
|
||||
"You cannot cancel this payment because it has status succeeded",
|
||||
);
|
||||
},
|
||||
);
|
||||
@ -0,0 +1,37 @@
|
||||
{
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
}
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
// 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 client_secret as variable for jsonData.client_secret
|
||||
if (jsonData?.client_secret) {
|
||||
pm.collectionVariables.set("client_secret", jsonData.client_secret);
|
||||
console.log(
|
||||
"- use {{client_secret}} as collection variable for 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"
|
||||
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 "500" for "amount"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'amount' matches '500'",
|
||||
function () {
|
||||
pm.expect(jsonData.amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
// Response body should have value "500" for "net_amount"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'net_amount' matches '500'",
|
||||
function () {
|
||||
pm.expect(jsonData.net_amount).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
// Response body should have value "500" for "amount_capturable"
|
||||
pm.test(
|
||||
"[post]:://payments/:id/capture - Content check if value for 'amount_capturable' matches '0'",
|
||||
function () {
|
||||
pm.expect(jsonData.amount_capturable).to.eql(0);
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments:id/capture - Content check if value for 'amount_received' equal 500",
|
||||
function () {
|
||||
pm.expect(jsonData.amount_received).to.eql(500);
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector_transaction_id' exists",
|
||||
function () {
|
||||
pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be
|
||||
.true;
|
||||
pm.collectionVariables.set("connector_transaction_id", jsonData.connector_transaction_id)
|
||||
},
|
||||
);
|
||||
|
||||
pm.test(
|
||||
"[POST]::/payments - Content check if 'connector' is archipel",
|
||||
function () {
|
||||
pm.expect(jsonData.connector).to.be.equal("archipel");
|
||||
},
|
||||
);
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
{
|
||||
"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_to_capture": 500,
|
||||
"statement_descriptor_name": "John",
|
||||
"statement_descriptor_suffix": "JD"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/payments/:id/capture",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"payments",
|
||||
":id",
|
||||
"capture"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
@ -19,12 +19,28 @@
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"amount": 500,
|
||||
"amount_to_capture": 500,
|
||||
"currency": "EUR",
|
||||
"capture_method": "automatic",
|
||||
"confirm": true,
|
||||
"capture_method": "manual",
|
||||
"authentication_type": "no_three_ds",
|
||||
"profile_id": "{{profile_id}}",
|
||||
"customer_id": "{{customer_id}}",
|
||||
"description": "[Archipel Connector][Scenario6] - Create payment and save card",
|
||||
"email": "john_doe@gmail.com",
|
||||
"name": "John Doe",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"payment_method": "card",
|
||||
"payment_method_type": "credit",
|
||||
"payment_method_data": {
|
||||
"card": {
|
||||
"card_cvc": "123",
|
||||
"card_exp_month": "01",
|
||||
"card_exp_year": "50",
|
||||
"card_holder_name": "John Doe",
|
||||
"card_number": "5185570141917102"
|
||||
}
|
||||
},
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
@ -65,4 +65,4 @@ pm.test(
|
||||
pm.expect(typeof jsonData.connector_transaction_id !== "undefined").to.be
|
||||
.true;
|
||||
},
|
||||
);
|
||||
);
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Payments - Create mandate",
|
||||
"Payments - Confirm mandate",
|
||||
"Payments - Retrieve mandate",
|
||||
"List payment methods for a Customer",
|
||||
"Payments - Create recurring",
|
||||
"Payments - Retrieve recurring"
|
||||
]
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
{
|
||||
"method": "GET",
|
||||
"header": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
}
|
||||
],
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/customers/:customer_id/payment_methods",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"customers",
|
||||
":customer_id",
|
||||
"payment_methods"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
// 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 client_secret as variable for jsonData.client_secret
|
||||
if (jsonData?.client_secret) {
|
||||
pm.collectionVariables.set("client_secret", jsonData.client_secret);
|
||||
console.log(
|
||||
"- use {{client_secret}} as collection variable for value",
|
||||
jsonData.client_secret,
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.",
|
||||
);
|
||||
}
|
||||
|
||||
// Response body must not have value "failed" for "status"
|
||||
if (jsonData?.status) {
|
||||
pm.test(
|
||||
"[POST]::/payments/:id/confirm - Content check if value for 'status' not matches 'failed'",
|
||||
function () {
|
||||
pm.expect(jsonData.status).to.not.eql("failed");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 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.collectionVariables - Set mandate_id as variable for jsonData.mandate_id
|
||||
if (jsonData?.mandate_id) {
|
||||
pm.collectionVariables.set("mandate_id", jsonData.mandate_id);
|
||||
console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id);
|
||||
} else {
|
||||
console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');
|
||||
};
|
||||
@ -1,103 +0,0 @@
|
||||
{
|
||||
"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_json_formatted": {
|
||||
"customer_id": "{{customer_id}}",
|
||||
"payment_method": "card",
|
||||
"payment_method_data": {
|
||||
"card": {
|
||||
"card_cvc": "123",
|
||||
"card_exp_month": "01",
|
||||
"card_exp_year": "50",
|
||||
"card_holder_name": "John Doe",
|
||||
"card_number": "5185570141917102",
|
||||
"card_network": "Visa"
|
||||
}
|
||||
},
|
||||
"setup_future_usage": "off_session",
|
||||
"mandate_data": {
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "offline",
|
||||
"accepted_at": "{{$isoTimestamp}}",
|
||||
"online": {
|
||||
"ip_address": "127.0.0.1",
|
||||
"user_agent": "amet irure esse"
|
||||
}
|
||||
},
|
||||
"mandate_type": {
|
||||
"single_use": {
|
||||
"amount": 1000,
|
||||
"currency": "EUR"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Mandate Payments - Create",
|
||||
"Payments - Confirm",
|
||||
"Recurring Payments - Create"
|
||||
]
|
||||
}
|
||||
@ -38,26 +38,30 @@
|
||||
}
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"amount": 799,
|
||||
"currency": "EUR",
|
||||
"confirm": true,
|
||||
"profile_id": "{{profile_id}}",
|
||||
"amount": 0,
|
||||
"currency": "USD",
|
||||
"confirm": false,
|
||||
"capture_method": "automatic",
|
||||
"capture_on": "{{$isoTimestamp}}",
|
||||
"customer_id": "{{customer_id}}",
|
||||
"description": "[Archipel Connector][Scenario4] - Create recurring payment",
|
||||
"email": "guest@example.com",
|
||||
"profile_id": "{{profile_id}}",
|
||||
"name": "John Doe",
|
||||
"setup_future_usage": "off_session",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"authentication_type": "no_three_ds",
|
||||
"mandate_id": "{{mandate_id}}",
|
||||
"off_session": true,
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
"line2": "rue du château",
|
||||
"line3": "",
|
||||
"city": "Neuilly-sur-Seine",
|
||||
"state": "France",
|
||||
"zip": "92200",
|
||||
"country": "FR"
|
||||
"line1": "1467",
|
||||
"line2": "Harrison Street",
|
||||
"line3": "Harrison Street",
|
||||
"city": "San Fransico",
|
||||
"state": "California",
|
||||
"zip": "94122",
|
||||
"country": "US",
|
||||
"first_name": "John",
|
||||
"last_name": "Doe"
|
||||
},
|
||||
"phone": {
|
||||
"number": "8056594427",
|
||||
@ -73,7 +77,7 @@
|
||||
"state": "California",
|
||||
"zip": "94122",
|
||||
"country": "US",
|
||||
"first_name": "joseph",
|
||||
"first_name": "John",
|
||||
"last_name": "Doe"
|
||||
},
|
||||
"phone": {
|
||||
@ -93,11 +97,13 @@
|
||||
"java_script_enabled": true,
|
||||
"ip_address": "125.0.0.1"
|
||||
},
|
||||
"statement_descriptor_name": "joseph",
|
||||
"statement_descriptor_suffix": "JS",
|
||||
"order_details": [
|
||||
{
|
||||
"product_name": "VOD subscription",
|
||||
"product_name": "Apple iphone 15",
|
||||
"quantity": 1,
|
||||
"amount": 799,
|
||||
"amount": 0,
|
||||
"account_name": "transaction_processing"
|
||||
}
|
||||
]
|
||||
@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"key": "publishable_key",
|
||||
"value": "pk_snd_8798c6a9114646f8b970b93ad5765ddf",
|
||||
"value": "{{publishable_key}}",
|
||||
"type": "text",
|
||||
"disabled": true
|
||||
}
|
||||
@ -44,17 +44,15 @@
|
||||
}
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"customer_id": "{{customer_id}}",
|
||||
"payment_method": "card",
|
||||
"payment_method_type": "credit",
|
||||
"payment_method_data": {
|
||||
"card": {
|
||||
"card_cvc": "123",
|
||||
"card_number": "5185570141917102",
|
||||
"card_exp_month": "01",
|
||||
"card_exp_year": "50",
|
||||
"card_holder_name": "John Doe",
|
||||
"card_number": "5185570141917102",
|
||||
"card_network": "Mastercard"
|
||||
"card_cvc": "737"
|
||||
}
|
||||
},
|
||||
"setup_future_usage": "off_session",
|
||||
@ -62,7 +60,7 @@
|
||||
"mandate_data": {
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "offline",
|
||||
"accepted_at": "{{$isoTimestamp}}",
|
||||
"accepted_at": "1963-05-03T04:07:52.723Z",
|
||||
"online": {
|
||||
"ip_address": "125.0.0.1",
|
||||
"user_agent": "amet irure esse"
|
||||
@ -70,10 +68,10 @@
|
||||
},
|
||||
"mandate_type": {
|
||||
"multi_use": {
|
||||
"amount": 799,
|
||||
"currency": "EUR",
|
||||
"start_date": "{{$isoTimestamp}}",
|
||||
"end_date": "2099-01-01T00:00:00Z",
|
||||
"amount": 1000,
|
||||
"currency": "USD",
|
||||
"start_date": "2023-04-21T00:00:00Z",
|
||||
"end_date": "2023-05-21T00:00:00Z",
|
||||
"metadata": {
|
||||
"frequency": "13"
|
||||
}
|
||||
@ -84,14 +82,8 @@
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/payments/:id/confirm",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"payments",
|
||||
":id",
|
||||
"confirm"
|
||||
],
|
||||
"host": ["{{baseUrl}}"],
|
||||
"path": ["payments", ":id", "confirm"],
|
||||
"variable": [
|
||||
{
|
||||
"key": "id",
|
||||
@ -18,32 +18,21 @@
|
||||
}
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"amount": 900,
|
||||
"currency": "EUR",
|
||||
"amount": 500,
|
||||
"currency": "USD",
|
||||
"confirm": true,
|
||||
"profile_id": "{{profile_id}}",
|
||||
"capture_method": "automatic",
|
||||
"capture_on": "{{$isoTimestamp}}",
|
||||
"amount_to_capture": 500,
|
||||
"profile_id": "{{profile_id}}",
|
||||
"customer_id": "{{customer_id}}",
|
||||
"description": "[Archipel Connector][Scenario5] - Create recurring payment",
|
||||
"email": "guest@example.com",
|
||||
"name": "John Doe",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"authentication_type": "no_three_ds",
|
||||
"mandate_id": "{{mandate_id}}",
|
||||
"off_session": true,
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
"line2": "rue du château",
|
||||
"line3": "",
|
||||
"city": "Neuilly-sur-Seine",
|
||||
"state": "France",
|
||||
"zip": "92200",
|
||||
"country": "FR"
|
||||
},
|
||||
"phone": {
|
||||
"number": "8056594427",
|
||||
"country_code": "+91"
|
||||
}
|
||||
},
|
||||
"shipping": {
|
||||
"address": {
|
||||
"line1": "1467",
|
||||
@ -53,14 +42,11 @@
|
||||
"state": "California",
|
||||
"zip": "94122",
|
||||
"country": "US",
|
||||
"first_name": "joseph",
|
||||
"last_name": "Doe"
|
||||
},
|
||||
"phone": {
|
||||
"number": "8056594427",
|
||||
"country_code": "+91"
|
||||
"first_name": "joseph"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statement_descriptor_name": "joseph",
|
||||
"statement_descriptor_suffix": "JS"
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"childrenOrder": [
|
||||
"Mandate Payments - Create",
|
||||
"Payments - Confirm",
|
||||
"Recurring Payments - Create",
|
||||
"List payment methods for a Customer",
|
||||
"Recurring Payments - Confirm"
|
||||
]
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
// Validate status 2xx
|
||||
// Validate status 2xx
|
||||
pm.test("[GET]::/payment_methods/:customer_id - Status code is 2xx", function () {
|
||||
pm.response.to.be.success;
|
||||
});
|
||||
@ -17,12 +17,4 @@ if (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.');
|
||||
}
|
||||
|
||||
// Response body should have at least one card payment method"
|
||||
pm.test(
|
||||
"[GET]::/payment_methods/:customer_id - Content check body has at least one customer_payment_methods",
|
||||
function () {
|
||||
pm.expect(jsonData.customer_payment_methods.length).greaterThan(0);
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
// 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");
|
||||
})};
|
||||
|
||||
// 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;
|
||||
});
|
||||
@ -39,21 +39,29 @@
|
||||
},
|
||||
"raw_json_formatted": {
|
||||
"amount": 0,
|
||||
"currency": "EUR",
|
||||
"currency": "USD",
|
||||
"confirm": false,
|
||||
"capture_method": "automatic",
|
||||
"authentication_type": "no_three_ds",
|
||||
"customer_id": "{{customer_id}}",
|
||||
"email": "guest@example.com",
|
||||
"profile_id": "{{profile_id}}",
|
||||
"description": "[Archipel Connector][Scenario4] - Create Zero auth mandate",
|
||||
"name": "John Doe",
|
||||
"setup_future_usage": "off_session",
|
||||
"phone": "8056594427",
|
||||
"phone_country_code": "+91",
|
||||
"description": "{{$randomLoremSentence}}",
|
||||
"authentication_type": "no_three_ds",
|
||||
"billing": {
|
||||
"address": {
|
||||
"line1": "2 ter",
|
||||
"line2": "rue du château",
|
||||
"line3": "",
|
||||
"city": "Neuilly-sur-Seine",
|
||||
"state": "France",
|
||||
"zip": "92200",
|
||||
"country": "FR"
|
||||
"line1": "1467",
|
||||
"line2": "Harrison Street",
|
||||
"line3": "Harrison Street",
|
||||
"city": "San Fransico",
|
||||
"state": "California",
|
||||
"zip": "94122",
|
||||
"country": "US",
|
||||
"first_name": "John",
|
||||
"last_name": "Doe"
|
||||
},
|
||||
"phone": {
|
||||
"number": "8056594427",
|
||||
@ -69,7 +77,7 @@
|
||||
"state": "California",
|
||||
"zip": "94122",
|
||||
"country": "US",
|
||||
"first_name": "joseph",
|
||||
"first_name": "John",
|
||||
"last_name": "Doe"
|
||||
},
|
||||
"phone": {
|
||||
@ -77,8 +85,28 @@
|
||||
"country_code": "+91"
|
||||
}
|
||||
},
|
||||
"statement_descriptor_name": "Joseph Doe",
|
||||
"statement_descriptor_suffix": "JS"
|
||||
"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",
|
||||
"order_details": [
|
||||
{
|
||||
"product_name": "Apple iphone 15",
|
||||
"quantity": 1,
|
||||
"amount": 0,
|
||||
"account_name": "transaction_processing"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"url": {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user