Skip to content
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

feat: add traditional chinese locale #822

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

cookieg13
Copy link
Contributor

@cookieg13 cookieg13 commented Dec 4, 2024

Type of Change

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

Description

Add support for traditional chinese locale for payment links
Backend PR juspay/hyperswitch#6745

How did you test it?

(Need to run both hyperswitch-web and hyperswitch locally to test)

1. Update `allowed_domains` in business profile (Expand to see details)
curl --location 'http://localhost:8080/account/merchant_1733317126/business_profile/pro_I5CYJ8tVS6OHA1GMcXaW' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
    "payment_link_config": {
        "allowed_domains": [
            "*"
        ],
        "enabled_saved_payment_method": true,
        "hide_card_nickname_field" : true
    }
}'

2. Create a payment link with Accept-Language header as "zh-Hant"

cURL
curl --location --request POST 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: dev_9ujhlj2TyCy27k37JtCmZZMbTLKVVebPRTtPcWE1okFjsngoqlZEaw4nQtX1zClT' \ --header 'Accept-Language: zh-Hant' \ --data-raw '{ "amount": 100, "currency": "USD", "payment_link": true, "connector": [ "novalnet" ], "session_expiry": 1000000, "return_url": "http://127.0.0.1:5500/src/pl_iframe.html", "payment_link_config": { "theme": "#14356f", "logo": "https://logosandtypes.com/wp-content/uploads/2020/08/zurich.svg", "seller_name": "Zurich Inc.", "show_card_form_by_default": false } }'

Response of /payments

{
    "payment_id": "pay_rlQ6zFFw7dlEd87TcGlY",
    "merchant_id": "merchant_1733317126",
    "status": "requires_payment_method",
    "amount": 100,
    "net_amount": 100,
    "shipping_cost": null,
    "amount_capturable": 100,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_rlQ6zFFw7dlEd87TcGlY_secret_l4amc98ygqRSMdN5bmQQ",
    "created": "2024-12-04T13:35:45.977Z",
    "currency": "USD",
    "customer_id": null,
    "customer": null,
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "http://127.0.0.1:5500/src/pl_iframe.html",
    "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": null,
    "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_1733317126/pay_rlQ6zFFw7dlEd87TcGlY?locale=zh-Hant",
        "secure_link": "http://localhost:8080/payment_link/s/merchant_1733317126/pay_rlQ6zFFw7dlEd87TcGlY?locale=zh-Hant",
        "payment_link_id": "plink_ALMUnvEV9mgsuHTex9UQ"
    },
    "profile_id": "pro_I5CYJ8tVS6OHA1GMcXaW",
    "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": "2024-12-16T03:22:25.579Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-04T13:35:47.150Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}
3. Screenshots (Expand to see details) Open the secure payment link (`secure_link` in API response) in an iframe for validating the functionality. For checking payment_link simply click on the payment_link (`payment_link` in API response)

Screenshot for payment link
Screenshot 2024-12-04 at 19 06 44

Screenshot for secured payment link
Screenshot 2024-12-04 at 19 07 32

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Copy link

Review changes with  SemanticDiff

@PritishBudhiraja PritishBudhiraja merged commit 2707923 into main Dec 4, 2024
4 checks passed
@PritishBudhiraja PritishBudhiraja deleted the addTraditionalChineseLocal branch December 4, 2024 17:08
@github-actions github-actions bot added the Closed Label will be automatically added when the PR will get merged to main label Dec 4, 2024
PritishBudhiraja pushed a commit that referenced this pull request Dec 5, 2024
# [0.105.0](v0.104.6...v0.105.0) (2024-12-04)

### Features

* add traditional chinese locale ([#822](#822)) ([2707923](2707923))
kashif-m pushed a commit that referenced this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Label will be automatically added when the PR will get merged to main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for traditional chinese locale for payment links
2 participants