Skip to content

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Oct 31, 2023

Type of Change

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

Description

Custom payment link css config for each payments in payment-Create fall back to merchant account

Additional Changes

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

"payment_link_object": { "link_expiry": "2025-10-09T16:23:10Z", "merchant_custom_domain_name": null, "custom_merchant_name": null, "payment_link_config": { "merchant_logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg", "color_scheme": { "background_primary_color": "#FED5BF", "sdk_theme": "#FED5BF" } } }

Motivation and Context

How did you test it?

This PR enables merchant to create custom config for each payment, by passing the below object inside payment_link_object

"payment_link_config": { "merchant_logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg", "color_scheme": { "background_primary_color": "#FED5BF", "sdk_theme": "#FED5BF" } }

Test cases

curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_xVgcVhcjChHQjUNu0dV9FEzVd7nkOn0YbBfyGW202qlAoYY8vplqBlsA3ivZbYay' \ --data '{ "amount": 3423, "currency": "USD", "confirm": false, "customer_id": "sahkal", "return_url": "https://google.com", "description": "For selling Tea", "order_details": [ { "product_name": "Tea", "quantity": 1, "amount": 10, "product_img_link": null }, { "product_name": "Tea", "quantity": 1, "amount": 10, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 10, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 10, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" }, { "product_name": "Tea", "quantity": 1, "amount": 10, "product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg" } ], "payment_link_object": { "link_expiry": "2025-10-09T16:23:10Z", "merchant_custom_domain_name": null, "custom_merchant_name": null, "payment_link_config": { "merchant_logo": "https://i.pinimg.com/736x/4d/83/5c/4d835ca8aafbbb15f84d07d926fda473.jpg", "color_scheme": { "background_primary_color": "#FED5BF", "sdk_theme": "#FED5BF" } } } }'

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 R-waiting-on-L1 labels Oct 31, 2023
@sahkal sahkal added this to the October 2023 Milestone milestone Oct 31, 2023
@sahkal sahkal self-assigned this Oct 31, 2023
@sahkal sahkal requested review from a team as code owners October 31, 2023 10:16
@sahkal sahkal added M-api-contract-changes Metadata: This PR involves API contract changes M-database-changes Metadata: This PR involves database schema changes labels Nov 14, 2023
@likhinbopanna likhinbopanna removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 17, 2023
@likhinbopanna likhinbopanna added this pull request to the merge queue Nov 17, 2023
Merged via the queue into main with commit c39beb2 Nov 17, 2023
@likhinbopanna likhinbopanna deleted the custom-payment-link-config-for-payment-create branch November 17, 2023 08:28
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 M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants