-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(router): Custom payment link config for payment create #2741
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
Merged
likhinbopanna
merged 9 commits into
main
from
custom-payment-link-config-for-payment-create
Nov 17, 2023
Merged
feat(router): Custom payment link config for payment create #2741
likhinbopanna
merged 9 commits into
main
from
custom-payment-link-config-for-payment-create
Nov 17, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Narayanbhat166
suggested changes
Nov 9, 2023
migrations/2023-10-31-070509_add_payment_link_config_in_payment_link_db/up.sql
Outdated
Show resolved
Hide resolved
migrations/2023-10-31-070509_add_payment_link_config_in_payment_link_db/down.sql
Outdated
Show resolved
Hide resolved
jarnura
approved these changes
Nov 16, 2023
Narayanbhat166
approved these changes
Nov 17, 2023
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Custom payment link css config for each payments in payment-Create fall back to merchant account
Additional Changes
"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
cargo +nightly fmt --all
cargo clippy