Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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
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

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

Open
mrudulvajpayee4935 wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromalternate-text-for-manual-captures

Conversation

mrudulvajpayee4935
Copy link
Contributor

Type of Change

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

Description

Payment links will haveAdd Payment Method as the button text in case of manual captures payments. Payment button text is localised and will have value according to locale used.

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?

Curl:

curl --location 'http://localhost:8080/payments' \--header 'Content-Type: application/json' \--header 'Accept: application/json' \--header 'api-key: dev_MEIFMzxdOieBrD6NfMq5fkdKPlnh9EGSk4qgFWZ2Zv7cAR3eleriFFmTmJnfu2bI' \--header 'Accept-Language: de' \--data '{    "amount": 700,    "customer_id": "cus_5CPXeuPb98HjRkbQifzd",    "currency": "USD",    "payment_link": true,    "session_expiry": 1000000,    "return_url": "https://google.com",    "payment_link_config": {        "logo": "https://cdn.pixabay.com/photo/2021/08/28/08/48/deer-geface-6580415_1280.png",        "seller_name": "Cookie Inc."    }}'

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

Review changes with  SemanticDiff

Changed Files
FileStatus
  crates/router/src/core/payment_link/payment_link_initiate/payment_link.js  23% smaller
  crates/router/src/core/payment_link/locale.js  0% smaller

@mrudulvajpayee4935mrudulvajpayee4935 linked an issueMar 19, 2025 that may beclosed by this pull request
@@ -319,7 +319,7 @@ function initializeEventListeners(paymentDetails) {
var payNowButtonText = document.createElement("div");
var payNowButtonText = document.getElementById('submit-button-text');
if (payNowButtonText) {
payNowButtonText.textContent = paymentDetails.payment_button_text || translations.payNow;
payNowButtonText.textContent = paymentDetails.amount==0 ? translations.addPaymentMethod : paymentDetails.payment_button_text || translations.payNow;
Copy link
Contributor

Choose a reason for hiding this comment

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

Give precedence topaymentDetails.payment_button_text

And use strict check (===) for equality statement, since this is JS ..

Better to use if else for readability, since we have 3 variables involved now

@mrudulvajpayee4935mrudulvajpayee4935force-pushed thealternate-text-for-manual-captures branch from4c46287 tof796402CompareMarch 25, 2025 08:02
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Junjun13910Junjun13910Junjun13910 left review comments

@sahkalsahkalsahkal approved these changes

@kashif-mkashif-mkashif-m approved these changes

Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternate text for Pay Now button for manual captures
5 participants
@mrudulvajpayee4935@sahkal@kashif-m@Junjun13910@SanchithHegde

[8]ページ先頭

©2009-2025 Movatter.jp