Problem/Motivation
It seems to me like the amount sent to the bank for payment is not correct. It first hit me while trying to pay for an order of 60 EUR, for which I received the error: Invalid order amount. Amount must be a positive whole-number string in minor units. coming from \GlobalPayments\Api\Builders\HPPBuilder::withAmount() which didn't make any sense.
While checking the code of that function, I found out that its comment mentions:
Configure order amount in minor units (e.g., 1000 for 10.00).
The amount the PaymentOffsiteForm provides though doesn't do this change.
Proposed resolution
Multiply the amount by 100 or another dynamic number based on the fraction digits of the currency.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | invalid_amount_sent_to_the_bank-3618111-5.patch | 1.37 KB | vensires |
Issue fork commerce_nbg_redirect-3618111
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
vensiresAttaching patch based on MR.
Comment #4
vensiresUploading patch from latest MR.
Comment #5
vensiresMissed an extra
$. This is the correct patch finally.Comment #7
anpel commented