-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(connector): [Nexixpay] add mandates flow for cards #6259
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
caa6bdc
to
05708e2
Compare
data: data.clone(), | ||
http_code: res.status_code, | ||
}) | ||
if data.request.connector_mandate_id().is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check won't be needed if we use an enum for the PaymentsResponse
enum NexixpayResponse { PaymentsPresonse(NexixpayPaymentsResponse), MandateResponse(NexixpayMandateResponse), }
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take reference from Fiuu: Transformers
#[serde(untagged)]
pub enum FiuuPaymentsResponse {
PaymentResponse(Box<PaymentsResponse>),
QRPaymentResponse(Box<DuitNowQrCodeResponse>),
Error(FiuuErrorResponse),
RecurringResponse(Vec<Box<FiuuRecurringResponse>>),
}
c50b691
to
e9826fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add cypress test cases as well.
connectors: &Connectors, | ||
) -> CustomResult<String, errors::ConnectorError> { | ||
Ok(format!("{}/orders/3steps/init", self.base_url(connectors))) | ||
if req.request.connector_mandate_id().is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we check for off_session instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried this but it creates problem as normal payment and cit payment both use same endpoint.
name: item.router_data.get_billing_full_name()?, | ||
street: item.router_data.get_billing_line1()?, | ||
city: item.router_data.get_billing_city()?, | ||
post_code: item.router_data.get_billing_zip()?, | ||
country: item.router_data.get_billing_country()?, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All required fields should be added in payment_connector_required_fields.rs file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its already added
let customer_info = CustomerInfo { | ||
card_holder_name: item.router_data.get_billing_full_name()?, | ||
billing_address: billing_address.clone(), | ||
shipping_address: Some(billing_address), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we hardcoding shipping address to billing_address ?
|
26f8b4a
to
4f85626
Compare
4f85626
to
82749d8
Compare
aabcadc
82749d8
to
aabcadc
Compare
@mrudulvajpayee4935 Please run the cypress testcases for nexixpay |
do we have support for 3ds mandates cypress tests? @Gnanasundari24 |
0394a63
to
26496f9
Compare
54743ec
to
3e810f8
Compare
customer_acceptance: null, | ||
setup_future_usage: "on_session", | ||
billing: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you declare billing as const and use it everywhere else the billing address are same
09e3b1b
to
1eba637
Compare
card_exp_year: "50", | ||
card_number: "4111111111111111", | ||
card_exp_month: "08", | ||
card_exp_year: "25", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
august will come sooner than you might expect:
card_exp_year: "25", | |
card_exp_year: "50", |
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", | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In L53
you've declared customerAcceptance
. Move it above, and re-use it here and below.
status: 501, | ||
body: { | ||
error: { | ||
type: "invalid_request", | ||
message: "No threeds is not supported", | ||
code: "IR_00", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this?
status is expected to be 400
. Unless the connector has specific error message, this line is not needed as it will be handled by Commons
.
Same applies to else where below.
}, | ||
Response: { | ||
status: 200, | ||
trigger_skip: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will have to change the implementation once #6588 gets merged here and else where for trigger_skip
status: 501, | ||
body: { | ||
error: { | ||
type: "invalid_request", | ||
message: "No threeds is not supported", | ||
code: "IR_00", | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, since the same object is used in multiple places, this can be re-used by creating a constant object.
Type of Change
Description
Integrate mandates flow for card payments.
https://developer.nexi.it/en/funzionalita-/pagamenti-ricorrenti
Additional Changes
Motivation and Context
How did you test it?
Cypress test:
1) Multiuse mandates
2) Singleuse mandates
3) Test cases in the headless mode
Note:
Create Call
Confirm Call
MIT Call
Checklist
cargo +nightly fmt --all
cargo clippy