-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(cypress): Add Checkout Connector (#6559)
- Loading branch information
1 parent
c562ceb
commit 0b63efb
Showing
5 changed files
with
321 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,298 @@ | ||
const successfulNo3DSCardDetails = { | ||
card_number: "4242424242424242", | ||
card_exp_month: "01", | ||
card_exp_year: "25", | ||
card_holder_name: "joseph Doe", | ||
card_cvc: "123", | ||
}; | ||
|
||
const successfulThreeDSTestCardDetails = { | ||
card_number: "4242424242424242", | ||
card_exp_month: "01", | ||
card_exp_year: "25", | ||
card_holder_name: "joseph Doe", | ||
card_cvc: "123", | ||
}; | ||
|
||
const customerAcceptance = { | ||
acceptance_type: "offline", | ||
accepted_at: "1963-05-03T04:07:52.723Z", | ||
online: { | ||
ip_address: "127.0.0.1", | ||
user_agent: "amet irure esse", | ||
}, | ||
}; | ||
|
||
export const connectorDetails = { | ||
card_pm: { | ||
PaymentIntent: { | ||
Request: { | ||
currency: "USD", | ||
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "requires_payment_method", | ||
}, | ||
}, | ||
}, | ||
"3DSManualCapture": { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulThreeDSTestCardDetails, | ||
}, | ||
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "requires_customer_action", | ||
}, | ||
}, | ||
}, | ||
"3DSAutoCapture": { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulThreeDSTestCardDetails, | ||
}, | ||
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "requires_customer_action", | ||
}, | ||
}, | ||
}, | ||
No3DSManualCapture: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "requires_capture", | ||
}, | ||
}, | ||
}, | ||
No3DSAutoCapture: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "processing", | ||
}, | ||
}, | ||
}, | ||
Capture: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
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, | ||
}, | ||
customer_acceptance: null, | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "succeeded", | ||
}, | ||
}, | ||
}, | ||
PartialRefund: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
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, | ||
}, | ||
customer_acceptance: null, | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "succeeded", | ||
}, | ||
}, | ||
}, | ||
SyncRefund: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
customer_acceptance: null, | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "succeeded", | ||
}, | ||
}, | ||
}, | ||
ZeroAuthMandate: { | ||
Response: { | ||
status: 501, | ||
body: { | ||
error: { | ||
type: "invalid_request", | ||
message: "Setup Mandate flow for Checkout is not implemented", | ||
code: "IR_00", | ||
}, | ||
}, | ||
}, | ||
}, | ||
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: 501, | ||
body: { | ||
error: { | ||
type: "invalid_request", | ||
message: "Setup Mandate flow for Checkout is not implemented", | ||
code: "IR_00", | ||
}, | ||
}, | ||
}, | ||
}, | ||
SaveCardUseNo3DSAutoCapture: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
setup_future_usage: "on_session", | ||
customer_acceptance: customerAcceptance, | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "processing", | ||
}, | ||
}, | ||
}, | ||
SaveCardUseNo3DSManualCapture: { | ||
Request: { | ||
payment_method: "card", | ||
payment_method_data: { | ||
card: successfulNo3DSCardDetails, | ||
}, | ||
setup_future_usage: "on_session", | ||
customer_acceptance: customerAcceptance, | ||
}, | ||
Response: { | ||
status: 200, | ||
body: { | ||
status: "requires_capture", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters