mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Arindam Sahoo <arindams2002@gmail.com>
1078 lines
25 KiB
JavaScript
1078 lines
25 KiB
JavaScript
import {
|
|
cardRequiredField,
|
|
connectorDetails as commonConnectorDetails,
|
|
getCustomExchange,
|
|
} from "./Commons";
|
|
|
|
const successfulNo3DSCardDetails = {
|
|
card_number: "4242424242424242",
|
|
card_exp_month: "10",
|
|
card_exp_year: "50",
|
|
card_holder_name: "morino",
|
|
card_cvc: "737",
|
|
};
|
|
|
|
const successfulThreeDSTestCardDetails = {
|
|
card_number: "4000002500003155",
|
|
card_exp_month: "10",
|
|
card_exp_year: "50",
|
|
card_holder_name: "morino",
|
|
card_cvc: "737",
|
|
};
|
|
|
|
const failedNo3DSCardDetails = {
|
|
card_number: "4000000000000002",
|
|
card_exp_month: "01",
|
|
card_exp_year: "25",
|
|
card_holder_name: "joseph Doe",
|
|
card_cvc: "123",
|
|
};
|
|
|
|
const singleUseMandateData = {
|
|
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: {
|
|
single_use: {
|
|
amount: 8000,
|
|
currency: "USD",
|
|
},
|
|
},
|
|
};
|
|
|
|
const multiUseMandateData = {
|
|
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: 8000,
|
|
currency: "USD",
|
|
},
|
|
},
|
|
};
|
|
|
|
const payment_method_data_3ds = {
|
|
card: {
|
|
last4: "3155",
|
|
card_type: "CREDIT",
|
|
card_network: "Visa",
|
|
card_issuer: "INTL HDQTRS-CENTER OWNED",
|
|
card_issuing_country: "UNITEDSTATES",
|
|
card_isin: "400000",
|
|
card_extended_bin: null,
|
|
card_exp_month: "10",
|
|
card_exp_year: "50",
|
|
card_holder_name: "morino",
|
|
payment_checks: null,
|
|
authentication_data: null,
|
|
},
|
|
billing: null,
|
|
};
|
|
|
|
const payment_method_data_no3ds = {
|
|
card: {
|
|
last4: "4242",
|
|
card_type: "CREDIT",
|
|
card_network: "Visa",
|
|
card_issuer: "STRIPE PAYMENTS UK LIMITED",
|
|
card_issuing_country: "UNITEDKINGDOM",
|
|
card_isin: "424242",
|
|
card_extended_bin: null,
|
|
card_exp_month: "10",
|
|
card_exp_year: "50",
|
|
card_holder_name: "morino",
|
|
payment_checks: {
|
|
cvc_check: "pass",
|
|
address_line1_check: "pass",
|
|
address_postal_code_check: "pass",
|
|
},
|
|
authentication_data: null,
|
|
},
|
|
billing: null,
|
|
};
|
|
|
|
const requiredFields = {
|
|
payment_methods: [
|
|
{
|
|
payment_method: "card",
|
|
payment_method_types: [
|
|
{
|
|
payment_method_type: "credit",
|
|
card_networks: [
|
|
{
|
|
eligible_connectors: ["stripe"],
|
|
},
|
|
],
|
|
required_fields: cardRequiredField,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
|
|
export const connectorDetails = {
|
|
multi_credential_config: {
|
|
specName: ["connectorAgnostic"],
|
|
value: "connector_2",
|
|
},
|
|
card_pm: {
|
|
PaymentIntent: {
|
|
Request: {
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_payment_method",
|
|
setup_future_usage: "on_session",
|
|
},
|
|
},
|
|
},
|
|
PaymentIntentOffSession: {
|
|
Configs: {
|
|
CONNECTOR_CREDENTIAL: {
|
|
specName: ["connectorAgnostic"],
|
|
value: "connector_2",
|
|
},
|
|
},
|
|
Request: {
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
amount: 6500,
|
|
authentication_type: "no_three_ds",
|
|
setup_future_usage: "off_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_payment_method",
|
|
setup_future_usage: "off_session",
|
|
},
|
|
},
|
|
},
|
|
SessionToken: {
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
session_token: [
|
|
{
|
|
wallet_name: "apple_pay",
|
|
connector: "stripe",
|
|
},
|
|
{
|
|
wallet_name: "google_pay",
|
|
connector: "stripe",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
PaymentIntentWithShippingCost: {
|
|
Request: {
|
|
currency: "USD",
|
|
shipping_cost: 50,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_payment_method",
|
|
shipping_cost: 50,
|
|
amount: 6500,
|
|
},
|
|
},
|
|
},
|
|
PaymentConfirmWithShippingCost: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
shipping_cost: 50,
|
|
amount_received: 6550,
|
|
amount: 6500,
|
|
net_amount: 6550,
|
|
},
|
|
},
|
|
},
|
|
"3DSManualCapture": {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
setup_future_usage: "on_session",
|
|
payment_method_data: payment_method_data_3ds,
|
|
},
|
|
},
|
|
},
|
|
|
|
"3DSAutoCapture": {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
setup_future_usage: "on_session",
|
|
payment_method_data: payment_method_data_3ds,
|
|
},
|
|
},
|
|
},
|
|
No3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
payment_method: "card",
|
|
attempt_count: 1,
|
|
payment_method_data: payment_method_data_no3ds,
|
|
},
|
|
},
|
|
},
|
|
No3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
payment_method: "card",
|
|
attempt_count: 1,
|
|
payment_method_data: payment_method_data_no3ds,
|
|
},
|
|
},
|
|
},
|
|
No3DSFailPayment: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: failedNo3DSCardDetails,
|
|
},
|
|
customer_acceptance: null,
|
|
setup_future_usage: "on_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "failed",
|
|
error_code: "card_declined",
|
|
error_message:
|
|
"message - Your card was declined., decline_code - generic_decline",
|
|
unified_code: "UE_9000",
|
|
unified_message: "Something went wrong",
|
|
},
|
|
},
|
|
},
|
|
Capture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
amount: 6500,
|
|
amount_capturable: 0,
|
|
amount_received: 6500,
|
|
},
|
|
},
|
|
},
|
|
PartialCapture: {
|
|
Request: {},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "partially_captured",
|
|
amount: 6500,
|
|
amount_capturable: 0,
|
|
amount_received: 100,
|
|
},
|
|
},
|
|
},
|
|
Void: {
|
|
Request: {},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "cancelled",
|
|
},
|
|
},
|
|
},
|
|
Refund: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
manualPaymentRefund: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
manualPaymentPartialRefund: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
PartialRefund: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
SyncRefund: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
customer_acceptance: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
MandateSingleUse3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: singleUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
MandateSingleUse3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: singleUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
MandateSingleUseNo3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: singleUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
MandateSingleUseNo3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: singleUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
MandateMultiUseNo3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: multiUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
MandateMultiUseNo3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: multiUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
MandateMultiUse3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: multiUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
MandateMultiUse3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: multiUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
MITAutoCapture: getCustomExchange({
|
|
Configs: {
|
|
CONNECTOR_CREDENTIAL: {
|
|
specName: ["connectorAgnostic"],
|
|
value: "connector_2",
|
|
},
|
|
},
|
|
...commonConnectorDetails.card_pm.MITAutoCapture,
|
|
}),
|
|
MITManualCapture: {
|
|
Request: {},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
ZeroAuthMandate: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: singleUseMandateData,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
ZeroAuthPaymentIntent: {
|
|
Request: {
|
|
amount: 0,
|
|
setup_future_usage: "off_session",
|
|
currency: "USD",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_payment_method",
|
|
setup_future_usage: "off_session",
|
|
},
|
|
},
|
|
},
|
|
ZeroAuthConfirmPayment: {
|
|
Request: {
|
|
payment_type: "setup_mandate",
|
|
payment_method: "card",
|
|
payment_method_type: "credit",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
setup_future_usage: "off_session",
|
|
},
|
|
},
|
|
},
|
|
SaveCardUseNo3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
SaveCardUseNo3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
PaymentMethodIdMandateNo3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: null,
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
SaveCardUseNo3DSAutoCaptureOffSession: {
|
|
Configs: {
|
|
CONNECTOR_CREDENTIAL: {
|
|
specName: ["connectorAgnostic"],
|
|
value: "connector_2",
|
|
},
|
|
},
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_type: "debit",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
setup_future_usage: "off_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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
SaveCardUseNo3DSManualCaptureOffSession: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
setup_future_usage: "off_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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
SaveCardConfirmAutoCaptureOffSession: {
|
|
Configs: {
|
|
CONNECTOR_CREDENTIAL: {
|
|
specName: ["connectorAgnostic"],
|
|
value: "connector_2",
|
|
},
|
|
},
|
|
Request: {
|
|
setup_future_usage: "off_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
SaveCardConfirmManualCaptureOffSession: {
|
|
Request: {
|
|
setup_future_usage: "off_session",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
SaveCardConfirmAutoCaptureOffSessionWithoutBilling: {
|
|
Request: {
|
|
setup_future_usage: "off_session",
|
|
billing: null,
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "succeeded",
|
|
},
|
|
},
|
|
},
|
|
PaymentMethodIdMandateNo3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulNo3DSCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: null,
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_capture",
|
|
},
|
|
},
|
|
},
|
|
PaymentMethodIdMandate3DSAutoCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
currency: "USD",
|
|
mandate_data: null,
|
|
authentication_type: "three_ds",
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
PaymentMethodIdMandate3DSManualCapture: {
|
|
Request: {
|
|
payment_method: "card",
|
|
payment_method_data: {
|
|
card: successfulThreeDSTestCardDetails,
|
|
},
|
|
mandate_data: null,
|
|
authentication_type: "three_ds",
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
bank_redirect_pm: {
|
|
PaymentIntent: getCustomExchange({
|
|
Request: {
|
|
currency: "EUR",
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_payment_method",
|
|
},
|
|
},
|
|
}),
|
|
Ideal: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "ideal",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
ideal: {
|
|
bank_name: "ing",
|
|
},
|
|
},
|
|
},
|
|
billing: {
|
|
address: {
|
|
line1: "1467",
|
|
line2: "Harrison Street",
|
|
line3: "Harrison Street",
|
|
city: "San Fransico",
|
|
state: "California",
|
|
zip: "94122",
|
|
country: "NL",
|
|
first_name: "joseph",
|
|
last_name: "Doe",
|
|
},
|
|
phone: {
|
|
number: "9123456789",
|
|
country_code: "+91",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
Giropay: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "giropay",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
giropay: {},
|
|
},
|
|
},
|
|
billing: {
|
|
address: {
|
|
line1: "1467",
|
|
line2: "Harrison Street",
|
|
line3: "Harrison Street",
|
|
city: "San Fransico",
|
|
state: "California",
|
|
zip: "94122",
|
|
country: "DE",
|
|
first_name: "joseph",
|
|
last_name: "Doe",
|
|
},
|
|
phone: {
|
|
number: "9123456789",
|
|
country_code: "+91",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "failed",
|
|
error_code: "payment_method_not_available",
|
|
error_message:
|
|
"Giropay is deprecated and can no longer be used for payment acceptance. Please refer to https://docs.stripe.com/payments/giropay",
|
|
},
|
|
},
|
|
},
|
|
Sofort: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "sofort",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
sofort: {},
|
|
},
|
|
},
|
|
billing: {
|
|
address: {
|
|
line1: "1467",
|
|
line2: "Harrison Street",
|
|
line3: "Harrison Street",
|
|
city: "San Fransico",
|
|
state: "California",
|
|
zip: "94122",
|
|
country: "DE",
|
|
first_name: "joseph",
|
|
last_name: "Doe",
|
|
},
|
|
phone: {
|
|
number: "9123456789",
|
|
country_code: "+91",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
Eps: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "eps",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
eps: {
|
|
bank_name: "bank_austria",
|
|
},
|
|
},
|
|
},
|
|
billing: {
|
|
address: {
|
|
line1: "1467",
|
|
line2: "Harrison Street",
|
|
line3: "Harrison Street",
|
|
city: "San Fransico",
|
|
state: "California",
|
|
zip: "94122",
|
|
country: "AT",
|
|
first_name: "joseph",
|
|
last_name: "Doe",
|
|
},
|
|
phone: {
|
|
number: "9123456789",
|
|
country_code: "+91",
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
Blik: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "blik",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
blik: {
|
|
blik_code: "777987",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "failed",
|
|
error_code: "payment_intent_invalid_parameter",
|
|
},
|
|
},
|
|
},
|
|
Przelewy24: {
|
|
Request: {
|
|
payment_method: "bank_redirect",
|
|
payment_method_type: "przelewy24",
|
|
payment_method_data: {
|
|
bank_redirect: {
|
|
przelewy24: {
|
|
bank_name: "citi",
|
|
billing_details: {
|
|
email: "guest@juspay.in",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
Response: {
|
|
status: 200,
|
|
body: {
|
|
status: "requires_customer_action",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
pm_list: {
|
|
PmListResponse: {
|
|
PmListNull: {
|
|
payment_methods: [],
|
|
},
|
|
pmListDynamicFieldWithoutBilling: requiredFields,
|
|
pmListDynamicFieldWithBilling: requiredFields,
|
|
pmListDynamicFieldWithNames: requiredFields,
|
|
pmListDynamicFieldWithEmail: requiredFields,
|
|
},
|
|
},
|
|
};
|