Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(payment_link): add support for hide card nickname field for open payment links #6700

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

srujanchikke
Copy link
Contributor

Type of Change

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

Description

add support for hide card nickname field for open payment links

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?

Hide card nickname field for open payment links
Test case 1 :

Update Business profile :

curl --location 'http://localhost:8080/account/merchant_1732812062/business_profile/pro_xfhW4Bgz6SgdBJudP8aH' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
    "payment_link_config": {
        "allowed_domains": [
            "*"
        ],
        "hide_card_nickname_field" : true,
        "enabled_saved_payment_method": true,
        "display_sdk_only" :true
    }
}'

create payment links :

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'api-key: dev_tbCduVvExqcxwTFowfuDfAAzd3IUqJy9mLCR6exZlG17lnDVN7TU1IH1kGsBxdAr' \
--data '{
    "customer_id": "cus_izAOZiynP5URGEvEfmgH",
    "amount": 100,
    "currency": "USD",
    "payment_link": true,
    "setup_future_usage" : "off_session",
    "session_expiry": 1000000,
    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html"
}'

card nickname should not be asked incase of customer initiated payments(setup future usage = offsession).
Screenshot 2024-11-28 at 10 20 38 PM

Test case 2 :

  • Incase of default and hide_card_nickname_field config value set to false,
Screenshot 2024-11-28 at 10 19 57 PM

Test case 3 :

setup_future_usage = on_session / null , if hide_card_nick_name field is set to false, nick name should not present in SDK
Screenshot 2024-11-28 at 10 19 57 PM

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

@srujanchikke srujanchikke added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed Payment Links labels Nov 28, 2024
@srujanchikke srujanchikke self-assigned this Nov 28, 2024
@srujanchikke srujanchikke requested a review from a team as a code owner November 28, 2024 16:55
Copy link

semanticdiff-com bot commented Nov 28, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payment_link/payment_link_initiate/payment_link_initiator.js  82% smaller

sahkal
sahkal previously approved these changes Nov 29, 2024
swangi-kumari
swangi-kumari previously approved these changes Nov 29, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Dec 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 1, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Dec 2, 2024
Merged via the queue into main with commit 933911e Dec 2, 2024
15 of 17 checks passed
@likhinbopanna likhinbopanna deleted the hide_card_nick_name_field branch December 2, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows Payment Links S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants