Skip to content

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Apr 16, 2024

Type of Change

  • New feature

Description

Currently we don't allow customer saved payment method button to be displayed in payment link, with this change merchant will be able to enable saved payment method option.

Additional Changes

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

added enabled_saved_payment_method in payment_link_config object

Motivation and Context

How did you test it?

Do payments Create using the following curl, generate payment link and look for saved payment method option in the sdk.

Pass the same customer_id again and check if saved payment method is visible for the following customer in subsequent payment links

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_AuHSsPcx0ehbYzSjR9pKwLNS50cMLhGLNNy5sCNXFiIGgZHo44UW53nLzGe6W1ho' \
--data-raw '{
    "amount": 250,
    "currency": "USD",
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Please Pay for your XYZ",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "on_session",
    "payment_link":true,
    "payment_link_config": {
        "theme": "#0C581D", 
        "enabled_saved_payment_method":true
    },
    "order_details": [
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 20,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        },
        {
            "product_name": "Tea",
            "quantity": 1,
            "amount": 110,
            "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
        }
    ],
    "billing": {
        "address": {
            "zip": "94122",            
            "first_name": "sahkal",
            "last_name": "poddar"
        }
    }
}
'

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
  • I added a CHANGELOG entry if applicable

@sahkal sahkal added A-core Area: Core flows C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 16, 2024
@sahkal sahkal added this to the April 2024 milestone Apr 16, 2024
@sahkal sahkal self-assigned this Apr 16, 2024
@sahkal sahkal requested review from a team as code owners April 16, 2024 11:08
@sahkal sahkal added the M-api-contract-changes Metadata: This PR involves API contract changes label Apr 16, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Apr 17, 2024
Merged via the queue into main with commit 14341ca Apr 17, 2024
@likhinbopanna likhinbopanna deleted the support-paymentMethod-payment-link branch April 17, 2024 12:10
pixincreate added a commit that referenced this pull request Apr 18, 2024
…press-for-more-control

* 'main' of github.com:juspay/hyperswitch:
  feat(payments): add amount and connector id filter in list (#4354)
  feat(connector): [NMI] External 3DS flow for Cards (#4385)
  test(cypress): Update ConnectorAuth Details (#4386)
  chore(version): 2024.04.18.0
  fix(router): make payment_instrument optional (#4389)
  fix(config): remove `merchant_business_country` from the connector configs as enums can not be handled in this toml file (#4383)
  feat(payment_link): Add support for saved payment method option for payment link (#4373)
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-feature Category: Feature request or enhancement 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