Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(payment-link): alternate text for manual captures#7574

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
likhinbopanna merged 3 commits intomainfromalternate-text-for-manual-captures
Apr 25, 2025

Conversation

mrudulvajpayee4935
Copy link
Contributor

@mrudulvajpayee4935mrudulvajpayee4935 commentedMar 19, 2025
edited
Loading

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Payment links will haveAdd Payment Method as button text in case merchant send is_setup_mandate_flow astrue in payment_link_config,Authorize Payment in case of manual capture payments andPay Now in automatic captures.
is_setup_mandate_flow field is only used to alter the text in payment button our core flow of setup mandate remains the same i.e setup mandate flow is used only if amount is zero other authorize flow is used in payments core.
Priority given according to below:

  1. Payment button text added while business profile creation.
  2. is_setup_mandate_flow passed in payment_link_config
  3. Zero amount setup mandate flow.
  4. Manual captures payment.
  5. Automatic captures.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Payment links created with capture_method: manual - where the intention is to authorize the customer for some non zero amount, and capture the authorized amount at some later point in time. In such scenarios, the text Pay Now is incorrect as the user is not actually paying in that moment.

How did you test it?

Curls involved to test the flows:

Automatic captures:

curl --location 'http://localhost:8080/payments' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'api-key: dev_qTm0pV0gtb4DRMB1eKS5h3EgUvdNvvSADkPjZMXyUY5rvEkvPUMdJBjMq0Y8M7MV' \--data-raw '{    "currency": "EUR",    "amount": 10,    "authentication_type": "three_ds",    "description": "Joseph First Crypto",    "email": "hyperswitch_sdk_demo_id@gmail.com",    "setup_future_usage": "off_session",    "connector_metadata": {        "noon": {            "order_category": "applepay"        }    },    "payment_link": true,    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html",    "payment_link_config": {        "theme": "#14356f",        "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",        "seller_name": "Zurich Inc.",        "setup_mandate": true    },    "metadata": {        "udf1": "value1",        "new_customer": "true",        "login_date": "2019-09-10T10:11:12Z"    },    "customer_acceptance": null,    "customer_id": "cus_CL6UOh3X35RCzaGNN24t"}'
image

Manual Captures:

curl --location 'http://localhost:8080/payments' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'api-key: dev_qTm0pV0gtb4DRMB1eKS5h3EgUvdNvvSADkPjZMXyUY5rvEkvPUMdJBjMq0Y8M7MV' \--data-raw '{    "currency": "EUR",    "amount": 10,    "authentication_type": "three_ds",    "description": "Joseph First Crypto",    "email": "hyperswitch_sdk_demo_id@gmail.com",    "setup_future_usage": "off_session",    "connector_metadata": {        "noon": {            "order_category": "applepay"        }    },    "payment_link": true,    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html",    "payment_link_config": {        "theme": "#14356f",        "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",        "seller_name": "Zurich Inc."    },    "metadata": {        "udf1": "value1",        "new_customer": "true",        "login_date": "2019-09-10T10:11:12Z"    },    "customer_acceptance": null,    "capture_method": "manual",    "customer_id": "cus_CL6UOh3X35RCzaGNN24t"}'
image

setup_mandate_flow

curl --location 'http://localhost:8080/payments' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'api-key: dev_qTm0pV0gtb4DRMB1eKS5h3EgUvdNvvSADkPjZMXyUY5rvEkvPUMdJBjMq0Y8M7MV' \--data-raw '{    "currency": "EUR",    "amount": 10,    "authentication_type": "three_ds",    "description": "Joseph First Crypto",    "email": "hyperswitch_sdk_demo_id@gmail.com",    "setup_future_usage": "off_session",    "connector_metadata": {        "noon": {            "order_category": "applepay"        }    },    "payment_link": true,    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html",    "payment_link_config": {        "theme": "#14356f",        "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",        "seller_name": "Zurich Inc.",        "is_setup_mandate_flow": true    },    "metadata": {        "udf1": "value1",        "new_customer": "true",        "login_date": "2019-09-10T10:11:12Z"    },    "customer_acceptance": null,    "capture_method": "manual",    "customer_id": "cus_CL6UOh3X35RCzaGNN24t"}'
image

setup_mandate_flow with zero amount

curl --location 'http://localhost:8080/payments' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'api-key: dev_iwLbXyltixlkkaaEPH4Sa5HtJtXlDKZ9wOdiGGZV3RTDhgl24aD9lbghKEn9fz88' \--data-raw '{    "currency": "EUR",    "amount": 0,    "setup_future_usage": "off_session",    "authentication_type": "three_ds",    "description": "Joseph First Crypto",    "email": "hyperswitch_sdk_demo_id@gmail.com",    "connector_metadata": {        "noon": {            "order_category": "applepay"        }    },    "payment_link": true,    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html",    "payment_link_config": {        "theme": "#14356f",        "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",        "seller_name": "Zurich Inc."    },    "metadata": {        "udf1": "value1",        "new_customer": "true",        "login_date": "2019-09-10T10:11:12Z"    },    "customer_acceptance": null,    "customer_id": "cus_CL6UOh3X35RCzaGNN24t"}'
image

Checklist

  • I formatted the codecargo +nightly fmt --all
  • I addressed lints thrown bycargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@semanticdiff-comSemanticDiff.com
Copy link

semanticdiff-combot commentedMar 19, 2025
edited
Loading

@mrudulvajpayee4935mrudulvajpayee4935 linked an issueMar 19, 2025 that may beclosed by this pull request
kashif-m
kashif-m previously approved these changesMar 25, 2025
sahkal
sahkal previously approved these changesMar 25, 2025
@mrudulvajpayee4935mrudulvajpayee4935force-pushed thealternate-text-for-manual-captures branch fromcaba777 to7f9afb2CompareApril 24, 2025 08:24
@hyperswitch-bothyperswitch-botbot added the M-api-contract-changesMetadata: This PR involves API contract changes labelApr 24, 2025
sahkal
sahkal previously approved these changesApr 24, 2025
@mrudulvajpayee4935mrudulvajpayee4935force-pushed thealternate-text-for-manual-captures branch from8d21c90 toa8b9748CompareApril 24, 2025 18:08
@hyperswitch-bothyperswitch-botbot removed the M-api-contract-changesMetadata: This PR involves API contract changes labelApr 24, 2025
@hyperswitch-bothyperswitch-botbot added the M-api-contract-changesMetadata: This PR involves API contract changes labelApr 24, 2025
if (paymentDetails.payment_button_text) {
payNowButtonText.textContent = paymentDetails.payment_button_text;
} else if (paymentDetails.is_setup_mandate_flow || (paymentDetails.amount==="0.00" && paymentDetails.setup_future_usage_applied ==="off_session")) {
payNowButtonText.textContent = translations.addPaymentMethod;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ideally we should compute in rust code and send the computed value to JS bro,

Let's refactor in the subsequent PR

mrudulvajpayee4935 reacted with thumbs up emoji
@likhinbopannalikhinbopanna added this pull request to themerge queueApr 25, 2025
Merged via the queue intomain with commitfa46593Apr 25, 2025
16 of 20 checks passed
@likhinbopannalikhinbopanna deleted the alternate-text-for-manual-captures branchApril 25, 2025 12:16
@Junjun13910
Copy link

Junjun13910 commentedApr 25, 2025 via email

How to do itAdrian
On Fri, Apr 25, 2025 at 6:17 AM likhinbopanna ***@***.***> wrote: Merged#7574 <#7574> into main. — Reply to this email directly, view it on GitHub <#7574 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BJVKREALZJFCMMUZQOBEVYD23IRT7AVCNFSM6AAAAABZKU33I2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJXGQYDKNRQGEZDGOI> . You are receiving this because you commented.Message ID: ***@***.***>

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Junjun13910Junjun13910Junjun13910 left review comments

@jagan-jayajagan-jayajagan-jaya approved these changes

@sahkalsahkalsahkal approved these changes

@kashif-mkashif-mkashif-m approved these changes

Labels
M-api-contract-changesMetadata: This PR involves API contract changesPayment Links
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
@mrudulvajpayee4935@Junjun13910@jagan-jaya@sahkal@kashif-m@SanchithHegde@likhinbopanna

[8]ページ先頭

©2009-2025 Movatter.jp