feat(connector): [checkout] Add mandate flow#9248
Conversation
Changed Files
|
60561a7 to
e71d951
Compare
| }), | ||
| }, | ||
| enums::AuthenticationType::ThreeDs => { | ||
| let challenge_indicator = if item.router_data.request.setup_future_usage |
There was a problem hiding this comment.
use is_mandate_payment util here
| metadata, | ||
| }) | ||
|
|
||
| match item.router_data.request.payment_method_data { |
There was a problem hiding this comment.
Dont put a second match over payment_method_data
extra fields shoudl be handled in a tuple in the first match over payment_method_data
| }; | ||
|
|
||
| let mandate_reference = | ||
| if item.data.request.setup_future_usage == Some(FutureUsage::OffSession) { |
There was a problem hiding this comment.
This check is not needed
| let error_response = if status == AttemptStatus::Failure { | ||
| Some(ErrorResponse { | ||
| status_code: item.http_code, | ||
| code: item | ||
| .response | ||
| .response_code | ||
| .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()), | ||
| message: item | ||
| .response | ||
| .response_summary | ||
| .clone() | ||
| .unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()), | ||
| reason: item.response.response_summary, | ||
| attempt_status: None, | ||
| connector_transaction_id: Some(item.response.id.clone()), | ||
| network_advice_code: None, | ||
| network_decline_code: None, | ||
| network_error_message: None, | ||
| connector_metadata: None, | ||
| }) | ||
| } else { | ||
| None | ||
| }; |
There was a problem hiding this comment.
Directly return ok of error response from here
| }; | ||
|
|
||
| let mandate_reference = | ||
| if item.data.request.setup_future_usage == Some(FutureUsage::OffSession) { |
There was a problem hiding this comment.
use is_mandate_payment util
| [mandates.supported_payment_methods] | ||
| card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,datatrans,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal,xendit,moneris,archipel,worldpayvantiv" | ||
| card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,datatrans,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal,xendit,moneris,archipel,worldpayvantiv" | ||
| card.credit.connector_list = "checkout,stripe,adyen,authorizedotnet,cybersource,datatrans,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal,xendit,moneris,archipel,worldpayvantiv" |
There was a problem hiding this comment.
In the test cases I see that the there are 0 dollar payments.
Then should we add checkout in [zero_mandates.supported_payment_methods] as well ?
There was a problem hiding this comment.
missed it, added now.
ShankarSinghC
left a comment
There was a problem hiding this comment.
Can you mention why setup_future_usage was added to PaymentsSyncData in the PR description?
Type of Change
Description
Integrated CIT/MIT and setup mandate flow.
Added
setup_future_usagetoPaymentsSyncDatato support mandate payments.For mandate flows, the source_id (connector mandate ID) must be stored in the MandateReference. To identify whether a payment is mandate-based, we need the setup_future_usage field.
Additional Changes
Motivation and Context
How did you test it?
CIT/MIT:
CIT
RequestResponse
Psync (after comleting redirection)
MIT
RequestResponse
PSync
Setup Mandate flow
CIT
Request
Response
Psync
MIT
Request:
Response:
PSync
Checklist
cargo +nightly fmt --allcargo clippy