-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(core): [Paypal] Add Preprocessing flow to CompleteAuthorize for Card 3DS Auth Verification #2757
Conversation
} | ||
_ => Ok(types::PaymentsPreProcessingRouterData { | ||
response: Err(ErrorResponse { | ||
attempt_status: 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.
Mark failed status
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub enum AuthenticationStatus { | ||
Null, |
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 check if this is required
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.
These are being used for the propagation of error response when the respective field is none
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub enum EnrollementStatus { | ||
Null, |
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 check if this is required
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.
These are being used for the propagation of error response when the respective field is none
Type of Change
Description
Resolves - #3014
Additional Changes
Motivation and Context
How did you test it?
Success Case:
{ "amount": 300, "currency": "PLN", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 97, "customer_id": "custhype1232", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "three_ds", "return_url": "https://www.google.com", "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4000000000001091", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "joseph Doe", "card_cvc": "100" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "PL", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "109.71.40.0" }, "metadata": { "order_category": "applepay" }, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 101, "account_name": "transaction_processing" } ] }
The Psync response would be,
{ "payment_id": "pay_pL135krSvsJmN6m8Xgsb", "merchant_id": "merchant_1701164351", "status": "processing", "amount": 300, "amount_capturable": 0, "amount_received": null, "connector": "paypal", "client_secret": "pay_pL135krSvsJmN6m8Xgsb_secret_I6W73CQ9KFndxMsRpweV", "created": "2023-11-28T10:47:44.381Z", "currency": "USD", "customer_id": "", "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "1091", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "400000", "card_exp_month": "01", "card_exp_year": "2026", "card_holder_name": "joseph Doe" } }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "PL", "line1": "1467", "line2": "CA", "line3": "Harrison Street", "zip": "94122", "state": "CA", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "order_details": [ { "amount": 300, "quantity": 1, "product_name": "Apple iphone 15", "product_img_link": null } ], "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://www.google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": null, "error_message": null, "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": "paypal_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": false, "connector_transaction_id": "0K946454X9731031W", "frm_message": null, "metadata": { "order_category": "applepay" }, "connector_metadata": null, "feature_metadata": null, "reference_id": "pay_pL135krSvsJmN6m8Xgsb_1", "payment_link": null, "profile_id": "pro_WGLGmf79GMN4G7NwlOrJ", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_srpPyEcifCEYXGgXyp3e" }
Failure Case:
{ "amount": 300, "currency": "PLN", "confirm": true, "business_country": "US", "business_label": "default", "amount_to_capture": 97, "customer_id": "custhype1232", "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "authentication_type": "three_ds", "return_url": "https://www.google.com", "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "phone_country_code": "+65", "description": "Its my first payment request", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4868719081564153", "card_exp_month": "01", "card_exp_year": "2025", "card_holder_name": "joseph Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "CA", "line3": "Harrison Street", "city": "San Fransico", "state": "CA", "zip": "94122", "country": "PL", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "browser_info": { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36", "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "language": "nl-NL", "color_depth": 24, "screen_height": 723, "screen_width": 1536, "time_zone": 0, "java_enabled": true, "java_script_enabled": true, "ip_address": "109.71.40.0" }, "metadata": { "order_category": "applepay" }, "order_details": [ { "product_name": "Apple iphone 15", "quantity": 1, "amount": 101, "account_name": "transaction_processing" } ] }
The Psync response would be,
{ "payment_id": "pay_GNv9KCmgHS1xhQuf19dv", "merchant_id": "merchant_1701164351", "status": "failed", "amount": 300, "amount_capturable": 0, "amount_received": null, "connector": "paypal", "client_secret": "pay_GNv9KCmgHS1xhQuf19dv_secret_UKJeIbiD03YxCG0I4q8K", "created": "2023-11-28T10:22:55.080Z", "currency": "USD", "customer_id": "", "description": "Its my first payment request", "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": "off_session", "off_session": null, "capture_on": null, "capture_method": "automatic", "payment_method": "card", "payment_method_data": { "card": { "last4": "4153", "card_type": null, "card_network": null, "card_issuer": null, "card_issuing_country": null, "card_isin": "486871", "card_exp_month": "01", "card_exp_year": "2025", "card_holder_name": "joseph Doe" } }, "payment_token": null, "shipping": null, "billing": { "address": { "city": "San Fransico", "country": "PL", "line1": "1467", "line2": "CA", "line3": "Harrison Street", "zip": "94122", "state": "CA", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" } }, "order_details": [ { "amount": 300, "quantity": 1, "product_name": "Apple iphone 15", "product_img_link": null } ], "email": "something@gmail.com", "name": "Joseph Doe", "phone": "999999999", "return_url": "https://www.google.com/", "authentication_type": "three_ds", "statement_descriptor_name": "Juspay", "statement_descriptor_suffix": "Router", "next_action": null, "cancellation_reason": null, "error_code": "No error code", "error_message": "Cannot continue with Authorization due to failed Liability Shift. Connector Responsded with LiabilityShift: No, EnrollmentStatus: Ready, and AuthenticationStatus: Rejected", "unified_code": null, "unified_message": null, "payment_experience": null, "payment_method_type": "credit", "connector_label": "paypal_US_default", "business_country": "US", "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": true, "connector_transaction_id": "7AG80836YF6630004", "frm_message": null, "metadata": { "order_category": "applepay" }, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_WGLGmf79GMN4G7NwlOrJ", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_srpPyEcifCEYXGgXyp3e" }
Checklist
cargo +nightly fmt --all
cargo clippy