Skip to content

feat(payments): [Payment links] Add configs for payment link#7288

Merged
Gnanasundari24 merged 1 commit intomainfrom
paymentLinkConfig
Feb 18, 2025
Merged

feat(payments): [Payment links] Add configs for payment link#7288
Gnanasundari24 merged 1 commit intomainfrom
paymentLinkConfig

Conversation

@dgeee13
Copy link
Contributor

@dgeee13 dgeee13 commented Feb 17, 2025

Type of Change

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

Description

Added below configs for payment link

  1. payment_button_colour: Text for customizing message for card terms
  2. custom_message_for_card_terms: Custom background colour for payment link's handle confirm button https://docs.hyperswitch.io/explore-hyperswitch/merchant-controls/integration-guide/web/customization#custom-message-for-card-terms

Additional Changes

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

Motivation and Context

How did you test it?

Tested locally

Update business_profile configs

curl --location --request POST 'http://localhost:8080/account/merchant_1739787034/business_profile/pro_8METe0Ui8phk2DKuovKO' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
    "payment_link_config": {
        "allowed_domains": [
            "*"
        ],
        "payment_button_colour": "#ff69b4",
        "custom_message_for_card_terms": "Lorem ipsum odor amet, consectetuer adipiscing elit."
    }
}'

Create payment link

curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_m9IjvJK2az8nLr3dKHlaH19j7nVibvQRDMCgoabWiZXH1XpjXg6GSDlZxBxfTwTC' \
--data-raw '{
    "amount": 10,
    "setup_future_usage": "off_session",
    "payment_type": "setup_mandate",
    "currency": "EUR",
    "payment_link": true,
    "session_expiry": 1000000,
    "return_url": "https://google.com",
    "payment_link_config": {
        "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg",
        "seller_name": "Zurich Inc."
    }
}'

Payment link
Screenshot 2025-02-17 at 18 17 02

Secured Payment link
Screenshot 2025-02-17 at 18 40 13

Checklist

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

@dgeee13 dgeee13 self-assigned this Feb 17, 2025
@dgeee13 dgeee13 requested review from a team as code owners February 17, 2025 13:10
@dgeee13 dgeee13 requested a review from kashif-m February 17, 2025 13:10
@dgeee13 dgeee13 changed the title add configs for payment link feat(payments): [Payment links] Add configs for payment link Feb 17, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the comment init

Comment on lines 684 to 713
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of writing these redundant lines of code again and again, can we use the macro get_payment_link_config_value!

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Feb 17, 2025
@dgeee13 dgeee13 force-pushed the paymentLinkConfig branch 2 times, most recently from e0ee462 to 071e835 Compare February 18, 2025 06:58
kashif-m
kashif-m previously approved these changes Feb 18, 2025
@dgeee13 dgeee13 removed the request for review from a team February 18, 2025 07:03
Comment on lines 635 to 650
Copy link
Contributor

Choose a reason for hiding this comment

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

you can append the following values in line 610 only right!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doing that throws error. The macro call at 635 is actually returning option<..> values, but the previous macro call does not return option.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay! this is because we have default values for the above params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes @sahkal

sahkal
sahkal previously approved these changes Feb 18, 2025
@dgeee13 dgeee13 dismissed stale reviews from sahkal and kashif-m via 27fc5e8 February 18, 2025 09:41
let locking_action = payload.get_locking_input(flow.clone());

api::server_wrap(
Box::pin(api::server_wrap(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added this to address clippy v2 error
Screenshot 2025-02-18 at 14 45 37

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 18, 2025
Merged via the queue into main with commit 72080c6 Feb 18, 2025
17 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the paymentLinkConfig branch February 18, 2025 15:29
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants