juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.63k stars 1.36k forks source link

feat(payments): [Payment links] add hide card nickname field config for secure payment links #6554

Closed srujanchikke closed 4 days ago

srujanchikke commented 1 week ago

Type of Change

Description

Add hide card nickname field config for secure payment links. https://docs.hyperswitch.io/explore-hyperswitch/merchant-controls/integration-guide/web/customization#id-9.-hide-card-nickname-field .

Additional Changes

Motivation and Context

How did you test it?

Secure links

1. Update `allowed_domains` in business profile - (unfold to view cURL) ``` curl --location 'http://localhost:8080/account/merchant_1721984694/business_profile/pro_oXHnmgfZSnfe92PvodqP' \ --header 'Content-Type: application/json' \ --header 'api-key: test_admin' \ --data '{ "payment_link_config": { "allowed_domains": [ "*" ], "enabled_saved_payment_method": true, "hide_card_nickname_field" : true } }' ```
2. Create a payment link - (unfold to view cURL) ``` curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_eBTVu8OMN1HmE2xr0I0dsfypWOVwQBlietvkxf0sgYMdyFM5nRO40M8M4MLH42Jk' \ --data '{ "customer_id": "cus_izAOZiynP5URGEvEfmgH", "amount": 100, "currency": "USD", "payment_link": true, "connector": [ "stripe" ], "session_expiry": 1000000, "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." } }' ```
  1. Open the secure payment link (secure_link in API response) in an iframe for validating the functionality. card nickname field should be disabled even when Save card details checkbox is enabled in sdk.
Screenshot 2024-11-13 at 4 19 23 PM

Checklist

semanticdiff-com[bot] commented 1 week ago

Review changes with  SemanticDiff

Changed Files
| File | Status | | :--- | :--- | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link.rs)  [crates/router/src/core/payment\_link\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link.rs)  58% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference-v2/openapi_spec.json)  [api\-reference\-v2/openapi\_spec\.json](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference-v2/openapi_spec.json) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference-v2/openapi_spec.json)  15% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference/openapi_spec.json)  [api\-reference/openapi\_spec\.json](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference/openapi_spec.json) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#api-reference/openapi_spec.json)  15% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/admin.rs)  [crates/api\_models/src/admin\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/admin.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/admin.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/payments.rs)  [crates/api\_models/src/payments\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/payments.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/api_models/src/payments.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/common_utils/src/consts.rs)  [crates/common\_utils/src/consts\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/common_utils/src/consts.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/common_utils/src/consts.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/business_profile.rs)  [crates/diesel\_models/src/business\_profile\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/business_profile.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/business_profile.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/payment_intent.rs)  [crates/diesel\_models/src/payment\_intent\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/payment_intent.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/diesel_models/src/payment_intent.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/hyperswitch_domain_models/src/lib.rs)  [crates/hyperswitch\_domain\_models/src/lib\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/hyperswitch_domain_models/src/lib.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/hyperswitch_domain_models/src/lib.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/consts.rs)  [crates/router/src/consts\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/consts.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/consts.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js)  [crates/router/src/core/payment\_link/payment\_link\_initiate/payment\_link\_initiator\.js](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js)  [crates/router/src/core/payment\_link/payment\_link\_initiate/secure\_payment\_link\_initiator\.js](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payment_link/payment_link_initiate/secure_payment_link_initiator.js)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payments/transformers.rs)  [crates/router/src/core/payments/transformers\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payments/transformers.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/core/payments/transformers.rs)  0% smaller | | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/types/transformers.rs)  [crates/router/src/types/transformers\.rs](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/types/transformers.rs) | [](https://app.semanticdiff.com/gh/juspay/hyperswitch/pull/6554/changes#crates/router/src/types/transformers.rs)  0% smaller |