feat(core): add support for confirmation flow for click to pay#6982
Merged
Gnanasundari24 merged 67 commits intomainfrom Feb 20, 2025
Merged
Conversation
…2-refactor-refactor-ctp-flow-to-fetch-mca_id-and-get-the-connector-creds-instead-of-connector_name
…_id-and-get-the-connector-creds-instead-of-connector_name
…-the-connector-creds-instead-of-connector_name' of https://github.com/juspay/hyperswitch into 7862-refactor-refactor-ctp-flow-to-fetch-mca_id-and-get-the-connector-creds-instead-of-connector_name
…_id-and-get-the-connector-creds-instead-of-connector_name
…ow-for-click-to-pay
…5-feature-add-support-for-confirmation-flow-for-click-to-pay
8 tasks
sai-harsha-vardhan
previously approved these changes
Feb 11, 2025
deepanshu-iiitu
previously approved these changes
Feb 12, 2025
ShankarSinghC
previously approved these changes
Feb 12, 2025
crates/router/src/core/payments.rs
Outdated
| &business_profile, | ||
| &key_store, | ||
| mandate_type, | ||
| &false, |
Contributor
There was a problem hiding this comment.
As this does not provide the information about what is this field, can we make this as enum for better readability ?
| Some("Approval Code received".to_string()), | ||
| ), | ||
| _ => ( | ||
| Some("03".to_string()), |
Contributor
There was a problem hiding this comment.
Can we please give code comments for this hardcoding
Contributor
Author
There was a problem hiding this comment.
The reason for the code is provided, which states based in transaction we need to send 02 to mastercard stating approval code received and same for code 03
59bf3b9
deepanshu-iiitu
previously approved these changes
Feb 18, 2025
ShankarSinghC
approved these changes
Feb 19, 2025
deepanshu-iiitu
approved these changes
Feb 19, 2025
sai-harsha-vardhan
approved these changes
Feb 19, 2025
pixincreate
added a commit
that referenced
this pull request
Feb 21, 2025
* 'main' of github.com:juspay/hyperswitch: fix(connector): [DATATRANS] Fix Force Sync Flow (#7331) chore(version): 2025.02.21.0 fix(connector): [DATATRANS] Add new payment status (#7327) feat(router): [Xendit] add support for split payments (#7143) fix(payment_methods_v2): update fingerprint implementation in v2 (#7270) feat(router): Add Payments - List endpoint for v2 (#7191) feat(core): add support for confirmation flow for click to pay (#6982) chore(version): 2025.02.20.0 fix(connector): [SCRIPT] Update template generating script and updated connector doc (#7301) ci(cypress): add assertions for `requires_cvv` (#7296) refactor(utils): match string for state with SDK's naming convention (#7300) feat(core): add hypersense integration api (#7218) chore(version): 2025.02.19.0 feat(connector): [Moneris] Add payments flow (#7249) feat(core): api ,domain and diesel model changes for extended authorization (#6607) feat(payments): [Payment links] Add configs for payment link (#7288)
pixincreate
added a commit
that referenced
this pull request
Feb 22, 2025
…tusedPM * 'main' of github.com:juspay/hyperswitch: (22 commits) feat(connector): add Samsung pay mandate support for Cybersource (#7298) chore(masking): add peek_mut to PeekInterface (#7281) feat(samsung_pay): collect customer address details form Samsung Pay based on business profile config and connector required fields (#7320) ci: update creds (#7345) feat(router): add `merchant_configuration_id` in netcetera metadata and make other merchant configurations optional (#7347) fix(routing): Fixed 5xx error logs in dynamic routing metrics (#7335) fix(connector): [DATATRANS] Fix Force Sync Flow (#7331) chore(version): 2025.02.21.0 fix(connector): [DATATRANS] Add new payment status (#7327) feat(router): [Xendit] add support for split payments (#7143) fix(payment_methods_v2): update fingerprint implementation in v2 (#7270) feat(router): Add Payments - List endpoint for v2 (#7191) feat(core): add support for confirmation flow for click to pay (#6982) chore(version): 2025.02.20.0 fix(connector): [SCRIPT] Update template generating script and updated connector doc (#7301) ci(cypress): add assertions for `requires_cvv` (#7296) refactor(utils): match string for state with SDK's naming convention (#7300) feat(core): add hypersense integration api (#7218) chore(version): 2025.02.19.0 feat(connector): [Moneris] Add payments flow (#7249) ...
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Add support for confirmation flow for click to pay
currenlty in cick to pay we do authentication with mastercard and authorisation with adyen.
But to be prod certified mastercard needs a confirmation notification from hyperswitch after authorisation stating the state of the transaction.
So, in this Pr I have added confirmation flow for click to pay
How did you test it?
Add config to make the merchant eligible for authentication service
Create merchant connector account for Ctp_mastercard
Adyen
update business profile with ctp_mastercard mca_id
do payments create
do payments confirm
Expected Response
{ "payment_id": "pay_Ft9Ke5Lun924OCJa7yll", "merchant_id": "dqwdwljildwduoqwhduwqcqwjd", "status": "failed", "amount": 1130, "net_amount": 1130, "shipping_cost": null, "amount_capturable": 0, "amount_received": null, "connector": "adyen", "client_secret": "pay_Ft9Ke5Lun924OCJa7yll_secret_po1FVW5adQWFolWJUhMb", "created": "2024-12-18T13:00:47.663Z", "currency": "USD", "customer_id": null, "customer": null, "description": null, "refunds": null, "disputes": null, "mandate_id": null, "mandate_data": null, "setup_future_usage": null, "off_session": null, "capture_on": null, "capture_method": null, "payment_method": "card", "payment_method_data": null, "payment_token": null, "shipping": null, "billing": null, "order_details": null, "email": null, "name": null, "phone": null, "return_url": "https://hyperswitch.io/", "authentication_type": "no_three_ds", "statement_descriptor_name": null, "statement_descriptor_suffix": null, "next_action": null, "cancellation_reason": null, "error_code": "2", "error_message": "Refused", "unified_code": "UE_9000", "unified_message": "Something went wrong", "payment_experience": null, "payment_method_type": "debit", "connector_label": null, "business_country": null, "business_label": "default", "business_sub_label": null, "allowed_payment_method_types": null, "ephemeral_key": null, "manual_retry_allowed": true, "connector_transaction_id": "KN8X64SH6PRRVS65", "frm_message": null, "metadata": null, "connector_metadata": null, "feature_metadata": null, "reference_id": null, "payment_link": null, "profile_id": "pro_KCTRv8sFQfC0r65CZxrn", "surcharge_details": null, "attempt_count": 1, "merchant_decision": null, "merchant_connector_id": "mca_L6N77PiH3BI2BTPwkZPL", "incremental_authorization_allowed": false, "authorization_count": null, "incremental_authorizations": null, "external_authentication_details": null, "external_3ds_authentication_attempted": false, "expires_on": "2024-12-18T13:15:47.663Z", "fingerprint": null, "browser_info": { "language": "en-GB", "time_zone": -330, "ip_address": "::1", "user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36", "color_depth": 24, "java_enabled": true, "screen_width": 2560, "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", "screen_height": 1440, "java_script_enabled": true }, "payment_method_id": null, "payment_method_status": null, "updated": "2024-12-18T13:04:08.461Z", "split_payments": null, "frm_metadata": null, "merchant_order_reference_id": null, "order_tax_amount": null, "connector_mandate_id": null }Reason for it being failed is ayden doesn't support click to pay in sandbox, but does support in production
Look for confirmation call in logs
Checklist
cargo +nightly fmt --allcargo clippy