Amount sent to Adyen is wrong unless it has exactly two decimal places (e.g. 10 is charged as 0.10)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start by reading the amount conversion in src/main/java/org/killbill/billing/plugin/adyen/client/AdyenSDKClientImpl.java around lines 133–138, then check how sessions, refunds, and purchases use it. Verify the conversion against the CHF examples in the issue, including amounts with zero or more than two decimal places and currencies with different minor units; done means Adyen receives the correct minor-unit value for all three flows.
Written by the indexing model from the issue text.
Description
Description
The plugin converts the Kill Bill amount to Adyen minor units by removing the decimal point from the amount's string form. The result is correct only when the amount has exactly two decimals. Any other scale changes the amount sent to Adyen: 10 is sent as 10 minor units (0.10), and 10.5 as 105 (1.05). Currencies whose minor unit is not 2 decimals (e.g. JPY, KWD) are always converted incorrectly. Checkout sessions, purchases and refunds are affected.
Environment
- killbill-adyen-plugin 0.10.x (
maint-for-0-24-x) and 0.11.0 (master) - Kill Bill 0.24.x, Adyen TEST
Steps to reproduce
- Create a payment through the plugin with an amount that has no decimals:
POST /1.0/kb/accounts/{accountId}/paymentswith{"transactionType":"PURCHASE","amount":10,"currency":"CHF"} - Check the amount on the Adyen side (Customer Area or the AUTHORISATION webhook
amount.value).
Expected
Adyen receives amount.value = 1000 (CHF 10.00). Kill Bill and Adyen amounts match.
Actual
Adyen receives amount.value = 10 (CHF 0.10). Kill Bill records 10.00.
| Kill Bill amount | Sent to Adyen (amount.value) |
Charged |
|---|---|---|
10.00 |
1000 | 10.00 |
10 |
10 | 0.10 |
10.5 |
105 | 1.05 |
1.000000000 |
1000000000 | 10,000,000.00 |
Evidence
- Conversion:
AdyenSDKClientImpl.java#L133-L138String minorUnit = amount.toString().replace(".", ""); return Long.valueOf(minorUnit); - Used for:
- Observed:
- Local test: a demo-app checkout of
20was recorded in Kill Bill as 20.00 USD, while the Adyen AUTHORISATION webhook showedamount.value = 20.
- Local test: a demo-app checkout of
- Dominant language
- Java
- Stars
- 11
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from killbill/killbill-adyen-plugin
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Plugin cannot connect to Adyen LIVE: no setting for the live endpoint URL prefixPossibly taken @kccrcodes claimed this 2 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 74/100
killbill/killbill-adyen-plugin#151 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 56/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
All issues in killbill/killbill-adyen-plugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
RegistryExceptionHandler uses self-referencing basePackageClasses instead of a controller classOpenbug finsim-registry good-first-issue
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
status:pending type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug level:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
exoego/keycloak-fuhito#666 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
hammy275/immersive-mc#669 ·