Skip to content

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Apr 15, 2024

Type of Change

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

Description

Currently we show payment link with payment details, where
left side of the payment link contains payment details and the right side contains the sdk.

This is a merchant requirement where they want only the sdk to be displayed in payment link and it should be centered with custom color background.

Additional Changes

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

Added "display_sdk_only" to payment_link_config

Motivation and Context

How did you test it?

TestCase :

Do payment Create with the following curl and test all transaction mobile view etc for payment link.

curl --location 'https://sandbox.hyperswitch.io/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: snd_oaidL49hiU3HmQRKSBsASyb1yANBmLJQJoDsulQbkSuZQiO7xQTj6ks0Alhtr3fD' \
--data '{
    "amount": 1130,
    "currency": "USD",
    "return_url": "https://hyperswitch.io",
    "payment_link": true,
    "payment_link_config": {
        "theme": "#003E78",
        "sdk_layout": "spaced_accordion",
        "display_sdk_only":true
    }
}'

Screenshot 2024-04-15 at 9 13 39 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
  • 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 M-api-contract-changes Metadata: This PR involves API contract changes labels Apr 15, 2024
@sahkal sahkal added this to the April 2024 milestone Apr 15, 2024
@sahkal sahkal self-assigned this Apr 15, 2024
@sahkal sahkal requested review from a team as code owners April 15, 2024 15:41
kashif-m
kashif-m previously approved these changes Apr 16, 2024
Copy link
Contributor

@kashif-m kashif-m left a comment

Choose a reason for hiding this comment

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

Looks good, added two minor suggestions.

link.href = paymentDetails.merchant_logo;
link.type = "image/x-icon";
document.head.appendChild(link);
if (window.__PAYMENT_DETAILS.display_sdk_only){
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use paymentDetails here

}
else{
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible to format this file?

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Apr 16, 2024
Merged via the queue into main with commit 4d99098 Apr 16, 2024
@Gnanasundari24 Gnanasundari24 deleted the support-payment-link-without-checkout-page branch April 16, 2024 13:45
@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