Skip to content

3.1.0 - HUF/RON/TRY currencies, onpay_website required

Choose a tag to compare

@tomsommer tomsommer released this 07 Sep 17:50
· 4 commits to master since this release

Checked against OnPay's technical reference rather than against itself. It had drifted in two places.

Three missing currencies

HUF, RON and TRY are accepted by OnPay but were rejected here. The allow-list was clearly generated from that page once and never revisited — both are ordered by ISO 4217 numeric code, and the three slot exactly where the reference puts them (HUF 348 after DKK, RON 946 and TRY 949 after USD).

Taking payments in those currencies already worked, since setCurrency() does not validate. What failed:

new Currency('HUF');   // ApiException: Unsupported currency provided: HUF

along with Currency::getPaymentMethods() and isPaymentMethodAvailable() for those three, and any payment method declaring ALL_CURRENCY_CODES under-reporting its supported currencies by three.

The list is deliberately what OnPay accepts, not what ISO 4217 defines, so it will drift again. CurrenciesTest now asserts it against the documented set, which turns the next drift into a failing test rather than a support ticket.

onpay_website is required

OnPay documents it as required; isValid() did not ask for it. A window missing it passed here and was turned away at the redirect instead.

$window->isValid();   // was true without a website, now false

If you build windows without calling setWebsite(), isValid() now returns false. That is the intended correction — OnPay would have rejected those windows anyway — but it is a behaviour change rather than a pure addition, so it is worth checking before upgrading.

validatePayment() is unaffected: it does not consult requiredFields, so verifying an inbound callback with a bare window that has only the secret set works exactly as before. That is covered by a test.