Skip to content

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

test(cypress): RealTimePayment for xendit (#13339)

HS-QUALIBOT38a4f8741a0b
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index a880fe274e..eb5d59a26d 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -519,6 +519,14 @@ export const payment_methods_enabled = [
installment_payment_enabled: true,
payment_experience: "redirect_to_url",
},
+ {
+ payment_method_type: "qris",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: true,
+ installment_payment_enabled: false,
+ payment_experience: "redirect_to_url",
+ },
],
},
{
@@ -2171,6 +2179,41 @@ export const connectorDetails = {
billing: standardBillingAddress,
},
}),
+ Qris: getCustomExchange({
+ Request: {
+ payment_method: "real_time_payment",
+ payment_method_type: "qris",
+ payment_method_data: {
+ real_time_payment: {
+ qris: {},
+ },
+ },
+ billing: standardBillingAddress,
+ },
+ }),
+ QrisMandate: getCustomExchange({
+ Request: {
+ payment_method: "real_time_payment",
+ payment_method_type: "qris",
+ payment_method_data: {
+ real_time_payment: {
+ qris: {},
+ },
+ },
+ billing: standardBillingAddress,
+ setup_future_usage: "off_session",
+ mandate_data: {
+ customer_acceptance: {
+ acceptance_type: "online",
+ accepted_at: "2026-07-13T18:09:53Z",
+ online: {
+ ip_address: "127.0.0.1",
+ user_agent: "test-agent",
+ },
+ },
+ },
+ },
+ }),
},
card_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Xendit.js b/cypress-tests/cypress/e2e/configs/Payment/Xendit.js
index cfad1a2c78..70bb1e340e 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Xendit.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Xendit.js
@@ -66,6 +66,69 @@ const multiUseMandateData = {
},
};
export const connectorDetails = {
+ real_time_payment_pm: {
+ PaymentIntent: {
+ Request: {
+ currency: "IDR",
+ amount: 10000,
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ Qris: {
+ Request: {
+ payment_method: "real_time_payment",
+ payment_method_type: "qris",
+ payment_method_data: {
+ real_time_payment: {
+ qris: {},
+ },
+ },
+ billing: billingDetails,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ QrisMandate: {
+ Request: {
+ payment_method: "real_time_payment",
+ payment_method_type: "qris",
+ payment_method_data: {
+ real_time_payment: {
+ qris: {},
+ },
+ },
+ billing: billingDetails,
+ setup_future_usage: "off_session",
+ mandate_data: {
+ customer_acceptance: {
+ acceptance_type: "online",
+ accepted_at: "2026-07-13T18:09:53Z",
+ online: {
+ ip_address: "127.0.0.1",
+ user_agent: "test-agent",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ },
card_pm: {
PaymentIntent: {
Request: {
diff --git a/cypress-tests/cypress/e2e/spec/Payment/31-RealTimePayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/31-RealTimePayment.cy.js
index 00ea586124..3a44a75505 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/31-RealTimePayment.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/31-RealTimePayment.cy.js
@@ -88,4 +88,127 @@ describe("Real Time Payment", () => {
});
});
});
+
+ context("QRIS automatic capture flow", () => {
+ let shouldContinue = true;
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Payment Intent", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Payment Methods Call Test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm QRIS", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["Qris"];
+
+ cy.confirmRealTimePaymentCallTest(
+ fixtures.confirmBody,
+ data,
+ true,
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Retrieve Payment", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["Qris"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ });
+ });
+
+ it("Sync Payment", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["Qris"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ });
+ });
+ });
+
+ context("QRIS mandate setup flow", () => {
+ let shouldContinue = true;
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Payment Intent with Mandate Setup", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["PaymentIntent"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Payment Methods Call Test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm QRIS with Mandate", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["QrisMandate"];
+
+ cy.confirmRealTimePaymentCallTest(
+ fixtures.confirmBody,
+ data,
+ true,
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Retrieve Payment", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "real_time_payment_pm"
+ ]["QrisMandate"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ });
+ });
+ });
});
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 09ea043a5e..c0a8bf6d3c 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -5991,6 +5991,24 @@ Cypress.Commands.add(
}
break;
+ case "qris":
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ if (response.body.status === "requires_customer_action") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .and.have.nested.property("image_data_url").and.not.be.null;
+ globalState.set(
+ "image_data_url",
+ response.body.next_action.image_data_url
+ );
+ globalState.set("nextActionType", "image_data_url");
+ }
+ break;
+
default:
expect(response.body)
.to.have.property("next_action")