toMinorUnits() is currently protected, which means that it can only be used from within gateway classes, but not from plugin forms, where it's also possible that they're needed. Case in point, Ingenico: #2928926: Incorrect amount set when the currency doesn't have 2 decimals.

CommentFileSizeAuthor
#4 2944281-4.patch2.11 KBflocondetoile
#2 2944281-2.patch850 bytesflocondetoile

Comments

bojanz created an issue. See original summary.

flocondetoile’s picture

Status: Active » Needs review
StatusFileSize
new850 bytes

Tiny patch that makes toMinorUnits() a public method

agoradesign’s picture

You should define in in the Interface too

flocondetoile’s picture

StatusFileSize
new2.11 KB

#3 Sure.

zaporylie’s picture

Status: Needs review » Reviewed & tested by the community

I don't think we need a special test for it. LGTM.

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

We didn't commit this a year ago because we identified a use case where the same functionality was needed, but the gateway wasn't present, so we wanted to explore introducing a new service.

However, in the meantime we've come up with no better ideas, and gateways have been forced to copy-paste the protected method.
So, let's proceed with the patch as-is, and chase perfection another day. We can always deprecate this method once that happens.

  • bojanz committed 7f2dd24 on 8.x-2.x authored by flocondetoile
    Issue #2944281 by flocondetoile, agoradesign: PaymentGatewayBase::...

Status: Fixed » Closed (fixed)

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