Checkout countryCode comes from the server-wide org.killbill.server.region, not from the tenant or the account

Open
#150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
backend, payments

Research direction

Start with AdyenSDKClientImpl.java, especially the countryCode assignment at line 69, then trace how AdyenActivator.java and AdyenConfigProperties supply configuration. Check the checkout session tests and add coverage for country selection across accounts or tenants. Done means each session uses the intended shopper or merchant country and invalid country values no longer cause the described checkout failure.

Written by the indexing model from the issue text.

Description

Symptoms

Every /sessions request the plugin sends to Adyen carries the same countryCode, the value of the Kill Bill server property org.killbill.server.region.
The value is the same for all tenants and all accounts on the server. The account’s country and the per-tenant Adyen config are not used.
Drop-in shows the payment methods of that one country for every shopper. For example, TWINT (CH only) appears only when the server region is CH.

When the region is not a valid ISO 3166 two-letter code, Adyen rejects the session and the checkout fails.

Steps to reproduce

  • Set org.killbill.server.region=US and restart Kill Bill.
  • Create an account with country=CH on a tenant configured for an Adyen merchant account that has TWINT enabled.
  • Start a checkout for that account through the plugin (/plugins/adyen-plugin/checkout).
  • Open Drop-in with the returned session.

Expected

  • The session’s countryCode matches the shopper or merchant context (account country, or tenant setting), so CH payment methods (e.g. TWINT) are offered to a CH account.
  • Different tenants or accounts on the same server can use different countries.

Actual

  • countryCode=US is sent. TWINT is not offered.
  • Changing the country requires changing a server-wide property and restarting, which affects every tenant.
  • With a non-ISO region value, Adyen returns 422 "Field 'countryCode' is not valid", and the checkout call returns HTTP 500.

Evidence

  • AdyenSDKClientImpl.java line 69: checkoutSession.setCountryCode(adyenConfigProperties.getRegion());

  • AdyenActivator.java line 55: region read from PluginEnvironmentConfig.getRegion(...), i.e. the server property, passed to AdyenConfigurationHandler for all tenants.

  • AdyenConfigProperties: no tenant-level country setting.

  • Reproduced locally: the first checkout attempt failed with Adyen 422 countryCode invalid (logged in catalina.out). TWINT appeared in Drop-in only after setting the server region to CH.

Dominant language
Java
Stars
11
Forks
31
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from killbill/killbill-adyen-plugin

All issues in killbill/killbill-adyen-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.