Skip to content

Conversation

kashif-m
Copy link
Contributor

@kashif-m kashif-m commented Mar 4, 2025

Type of Change

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

Description

This PR exposes customizations for payment links. Below configs are added -

Additional Changes

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

Motivation and Context

Gives granular control to the payment link consumer for designing their UI.

How did you test it?

Tested locally.

1. Add a payment link style ID

cURL

curl --location --request POST 'http://localhost:8080/account/merchant_1741095653/business_profile/pro_dgzCAaE0KhqCTj6cY5a7' \
    --header 'Content-Type: application/json' \
    --header 'api-key: test_admin' \
    --data '{"payment_link_config":{"allowed_domains":["*"],"business_specific_configs":{"style1":{"enabled_saved_payment_method":true,"theme":"#E71D36","logo":"https://hyperswitch.io/favicon.ico","sdk_ui_rules":{".Label":{"fontWeight":"700 !important","fontSize":"13px !important","color":"#003264 !important","opacity":"1 !important"}},"payment_link_ui_rules":{"#submit":{"color":"#003264","fontWeight":"700","fontSize":"18px","padding":"25px 0","borderRadius":"20px","backgroundColor":"#ffc439"},"#hyper-checkout-sdk":{"backgroundColor":"#003264"}}}}}}'

Response

{"merchant_id":"merchant_1741095653","profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","profile_name":"IN_default","return_url":"https://google.com/success","enable_payment_response_hash":true,"payment_response_hash_key":"fVkaUtGhpJbDbwJ6bkDO1MX6yRgCNlJPSyaaMkOfe8izhPgWUGS8mdP8p95t5gqp","redirect_to_merchant_with_http_post":false,"webhook_details":{"webhook_version":"1.0.1","webhook_username":"random","webhook_password":"pass","webhook_url":"https://webhook.site/c5368f5d-882b-4d3a-b5be-f372294b6146","payment_created_enabled":true,"payment_succeeded_enabled":true,"payment_failed_enabled":true},"metadata":null,"routing_algorithm":null,"intent_fulfillment_time":900,"frm_routing_algorithm":null,"payout_routing_algorithm":null,"applepay_verified_domains":null,"session_expiry":900,"payment_link_config":{"domain_name":null,"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":"Proceed to Payment!","custom_message_for_card_terms":"Hello","payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":{".Label":{"fontWeight":"700 !important","fontSize":"13px !important","opacity":"1 !important","backgroundColor":"red !important","color":"#003264 !important"}},"payment_link_ui_rules":null,"business_specific_configs":{"style2":{"theme":"#1A1A1A","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":null,"custom_message_for_card_terms":null,"payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":null,"payment_link_ui_rules":null},"style1":{"theme":"#E71D36","logo":"https://hyperswitch.io/favicon.ico","seller_name":null,"sdk_layout":null,"display_sdk_only":null,"enabled_saved_payment_method":true,"hide_card_nickname_field":null,"show_card_form_by_default":null,"transaction_details":null,"background_image":null,"details_layout":null,"payment_button_text":null,"custom_message_for_card_terms":null,"payment_button_colour":null,"skip_status_screen":null,"payment_button_text_colour":null,"background_colour":null,"sdk_ui_rules":{".Label":{"color":"#003264 !important","opacity":"1 !important","fontWeight":"700 !important","fontSize":"13px !important"}},"payment_link_ui_rules":{"#submit":{"color":"#003264","fontSize":"18px","backgroundColor":"#ffc439","borderRadius":"20px","padding":"25px 0","fontWeight":"700"},"#hyper-checkout-sdk":{"backgroundColor":"#003264"}}}},"allowed_domains":["*"],"branding_visibility":null},"authentication_connector_details":null,"use_billing_as_payment_method_billing":true,"extended_card_info_config":null,"collect_shipping_details_from_wallet_connector":false,"collect_billing_details_from_wallet_connector":false,"always_collect_shipping_details_from_wallet_connector":false,"always_collect_billing_details_from_wallet_connector":false,"is_connector_agnostic_mit_enabled":true,"payout_link_config":null,"outgoing_webhook_custom_http_headers":null,"tax_connector_id":null,"is_tax_connector_enabled":false,"is_network_tokenization_enabled":true,"is_auto_retries_enabled":false,"max_auto_retries_enabled":null,"always_request_extended_authorization":null,"is_click_to_pay_enabled":true,"authentication_product_ids":null,"card_testing_guard_config":{"card_ip_blocking_status":"disabled","card_ip_blocking_threshold":3,"guest_user_card_blocking_status":"disabled","guest_user_card_blocking_threshold":10,"customer_id_blocking_status":"disabled","customer_id_blocking_threshold":5,"card_testing_guard_expiry":3600},"is_clear_pan_retries_enabled":false}
2. Create a payment link

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_R70SBQ7gQzMiqsCrbSGMBTEtsKbNkgc8sXo5yHgpEA0mvT8BktGLXrn9zPOxLwpf' \
    --data '{"customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"amount":100,"currency":"EUR","payment_link":true,"setup_future_usage":"off_session","capture_method":"automatic","session_expiry":100000,"return_url":"https://example.com","payment_link_config_id":"style1"}'

Response

{"payment_id":"pay_1QLObAU2blLbNSfehTJN","merchant_id":"merchant_1741095653","status":"requires_payment_method","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":null,"client_secret":"pay_1QLObAU2blLbNSfehTJN_secret_oRqjfv36rG6plNEBHvvQ","created":"2025-03-04T22:10:37.490Z","currency":"EUR","customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","customer":{"id":"cus_jJuzSZ5cVZ5mgBGGUNYs","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"off_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":null,"payment_method_data":null,"payment_token":null,"shipping":null,"billing":null,"order_details":null,"email":null,"name":"John Nether","phone":"6168205362","return_url":"https://example.com/","authentication_type":null,"statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_jJuzSZ5cVZ5mgBGGUNYs","created_at":1741126237,"expires":1741129837,"secret":"epk_5255cf68bc6947db9fcf59f285eeb37b"},"manual_retry_allowed":null,"connector_transaction_id":null,"frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":{"link":"http://localhost:8080/payment_link/merchant_1741095653/pay_1QLObAU2blLbNSfehTJN?locale=en","secure_link":"http://localhost:8080/payment_link/s/merchant_1741095653/pay_1QLObAU2blLbNSfehTJN?locale=en","payment_link_id":"plink_Uve1VxVAdO7XJAkBQzMg"},"profile_id":"pro_dgzCAaE0KhqCTj6cY5a7","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":null,"incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-03-06T01:57:17.488Z","fingerprint":null,"browser_info":null,"payment_method_id":null,"payment_method_status":null,"updated":"2025-03-04T22:10:37.496Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":null}
Screenshot 2025-03-05 at 3 41 38 AM

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

Note

* - EDIT 1

@kashif-m kashif-m self-assigned this Mar 4, 2025
@kashif-m kashif-m requested review from a team as code owners March 4, 2025 13:52
@kashif-m kashif-m linked an issue Mar 4, 2025 that may be closed by this pull request
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Mar 4, 2025
sahkal
sahkal previously approved these changes Mar 5, 2025
jarnura
jarnura previously approved these changes Mar 5, 2025
@kashif-m kashif-m dismissed stale reviews from jarnura and sahkal via f233dad March 5, 2025 09:33
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Mar 5, 2025
Merged via the queue into main with commit 6a5ce26 Mar 5, 2025
14 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the 7403-enhancement-payment-link-enhancements branch March 5, 2025 17:28
kashif-m added a commit that referenced this pull request Mar 6, 2025
pixincreate added a commit that referenced this pull request Mar 7, 2025
* 'main' of github.com:juspay/hyperswitch:
  feat(hipay): Add Template PR (#7360)
  chore(version): 2025.03.07.0
  chore(postman): update Postman collection files
  feat(analytics): add new filters, dimensions and metrics for authentication analytics (#7451)
  feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields (#7429)
  feat(analytics): refactor and rewrite authentication related analytics (#7433)
  refactor(core): Added payment id in authentication router data (#7441)
  feat(connector): Added ThreeDs server integration template pr (#7424)
  fix(xendit): Fix wasm changes (#7419)
  chore(postman): postman tests fixes (#7159)
  ci(cypress): move customer acceptance in configs to a const within commons (#7435)
  feat(core): add additional revenue recovery call flow (#7402)
  chore(version): 2025.03.06.0
  feat(payment_link): expose payment link configs for SDK UI rules and payment button (#7427)
pixincreate added a commit that referenced this pull request Mar 7, 2025
…juspay/hyperswitch into connector/gpay-mandates-authorizedotnet

* 'connector/gpay-mandates-authorizedotnet' of github.com:juspay/hyperswitch: (25 commits)
  ci(cypress): address lints and refactor redirection handler (#7437)
  chore: make v1 merchant account forward compatible (#7426)
  fix(dashboard): Added auth key to juspay threeds server (#7457)
  feat(hipay): Add Template PR (#7360)
  chore(version): 2025.03.07.0
  chore(postman): update Postman collection files
  feat(analytics): add new filters, dimensions and metrics for authentication analytics (#7451)
  feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields (#7429)
  feat(analytics): refactor and rewrite authentication related analytics (#7433)
  refactor(core): Added payment id in authentication router data (#7441)
  feat(connector): Added ThreeDs server integration template pr (#7424)
  fix(xendit): Fix wasm changes (#7419)
  chore(postman): postman tests fixes (#7159)
  ci(cypress): move customer acceptance in configs to a const within commons (#7435)
  feat(core): add additional revenue recovery call flow (#7402)
  chore(version): 2025.03.06.0
  feat(payment_link): expose payment link configs for SDK UI rules and payment button (#7427)
  feat(connector): [EFT] Add EFT as a payment method (#7304)
  chore(version): 2025.03.05.1
  feat(connector): [Moneris] Implement mandate for Moneris (#7322)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-api-contract-changes Metadata: This PR involves API contract changes Payment Links
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Payment link enhancements
4 participants