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.

Command icon 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

vensires created an issue. See original summary.

vensires’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Attaching patch based on MR.

vensires’s picture

StatusFileSize
new1.37 KB

Uploading patch from latest MR.

vensires’s picture

StatusFileSize
new1.37 KB

Missed an extra $. This is the correct patch finally.

anpel made their first commit to this issue’s fork.

anpel’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.