mobibox_pay 1.2.3
mobibox_pay: ^1.2.3 copied to clipboard
A Flutter plugin to seamlessly integrate with the Mobibox payment gateway
1.2.3 #
- Fixed: card payments could stall on the 3DS verification page. When
the SALE response returned
redirect, the issuer's 3DS page is rendered inside the same WebView as the card fields - but that WebView was wrapped inIgnorePointerfor the whole duration of any in-flight payment, including the card flow's own. The page rendered correctly and then silently swallowed every tap, so the payer could not complete verification. Observed on live transactions.MobiPayCheckoutnow tracks wallet payments separately (_isWalletPaymentInProgress) and only locks the card WebView while an Apple Pay / Google Pay payment is in flight - the case the lock was added for. The card flow's own payment no longer locks it, so 3DS works.- All other cross-locking is unchanged: the sheet still can't be dismissed mid-payment, and the wallet buttons are still disabled while a card payment (including its 3DS step) is in flight. Double submission from the card form is prevented inside the HPF form itself (submit button disabled + spinner while in flight).
- Payer fields remain required; the Protocol Mapping "optional
parameters" route does not apply to CyberSource merchants. Akurateco
confirmed that
payer_address/payer_country/payer_city/payer_zipcan be marked optional at the platform level, but that the CyberSource connector still requires them downstream - so omitting them passes platform validation and is then declined by the connector.payer_phonecannot be made optional at all. The effective requirement is therefore the union: first name, last name, address, city, zip, country, email, phone. The wallet sheets continue to collect all of them:- Apple Pay:
requiredBillingContactFields = [.postalAddress, .name],requiredShippingContactFields = [.phoneNumber, .emailAddress], with in-sheet validation across address/city/zip/country/phone/email. - Google Pay:
FULL-format billing address withphoneNumberRequired: true, plus email. payer_stateis the only genuinely optional field, sent when available.
- Apple Pay:
1.2.0 #
- Added: native Google Pay support (Android only), submitted via the
same S2S CARD protocol as Apple Pay (
action=SALE&digital_wallet=googlepay, full payer profile, same "Formula 8" hash) - see Appendix C of the Mobibox/Akurateco S2S CARD docs.- New
MobiPayGooglePayConfig(gateway- value from your Mobibox account manager,gatewayMerchantId- your CLIENT_KEY,paymentApiUrl,merchantDisplayName,environmenttest/production,countryCode,supportedNetworks,allowedAuthMethods). - New
MobiPayGooglePayButtonmirroringMobiPayApplePayButton's API (availability self-check, payer fallbacks, callbacks,enabledcross-locking). Shown byMobiPayCheckout/MobiPay.startPaymentin the same slot as the Apple Pay button - at most one is ever visible, since each hides itself off its own platform. MobiPay:initialize(googlePayConfig: ...),isGooglePayAvailable,requestGooglePayToken,processGooglePaySale;startPayment(googlePayConfig: ..., enableGooglePay: ..., onGooglePayRedirectRequired: ..., onGooglePayCancel: ...). The existingapplePayPayer*fallbacks,applePayReturnUrl, andapplePayPayerIpapply to Google Pay too (payer data is wallet-agnostic).- The Google Pay sheet is asked for a FULL-format billing address +
phone + email, which Google enforces in-sheet before returning - so
all payer_* fields Mobibox requires are collected natively, with no
Apple-style missing-field gap (no
validatePayerFieldsmechanism needed on Android). - Payment locking across all three methods: while a Google Pay SALE is in flight the Apple Pay button and card fields are locked (and vice versa); pressing the card form's Pay disables both wallet buttons.
MobiPayCardSaleProcessor.processDigitalWalletSaleadded (digitalWallet=applepay/googlepay);processApplePaySalenow delegates to it (signature unchanged, not breaking).- Android plugin now implements
ActivityAwareand depends oncom.google.android.gms:play-services-wallet. Host apps must add<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true"/>inside<application>in their own AndroidManifest.xml.
- New
1.1.8 #
- Fixed: in-sheet validation could dead-end on "Update Shipping Contact".
When 1.1.7's validation flagged a missing phone/email, it used
paymentContactInvalidError- which refers to the sheet's shipping contact section - while phone/email were requested viarequiredBillingContactFieldsonly. The sheet demanded a section that didn't exist in its UI, leaving the payer stuck with no way to proceed (observed on-device). Root cause: Apple provides field-level billing errors for postal-address sub-fields only; there is no billing error key for phone/email/name.- Phone/email are now requested via
requiredShippingContactFields(billing keeps.postalAddress/.name), so the sheet has a real, editable contact section for those errors to point at. This also restores 1.1.4's reliable auto-fill for phone/email (billing contacts don't dependably carry them - Apple Developer Forums thread 61802 / rdar://26981967), so most payers will never see the prompt at all. nameis no longer validated in-sheet (no Apple error key can reference it without the same stuck-state risk). Wallet cards essentially always carry the cardholder name; the Dart-side fallback/exception still backstops it.- The payload sent to Dart is unchanged in shape: phone/email are merged
from the shipping contact into the same
billingContactmap. No Dart-side API changes; requires an iOS rebuild (pod install).
- Phone/email are now requested via
1.1.7 #
- Added: in-sheet payer field validation for Apple Pay. Mobibox's S2S
CARD SALE request requires a full payer profile (name, address, city, zip,
country, phone, email). Previously, if PassKit's billing contact was
missing one of these and no
payer*fallback parameter was supplied, the payment failed after the Apple Pay sheet closed, with an exception. Now the missing field is enforced inside the sheet: after the payer authorizes,MobiPayPlugin.swiftvalidates the billing contact and, if a required field is absent, returns field-levelPKPaymentErrors - the sheet stays open with the offending field highlighted (e.g. "Postal code is required"), the payer completes it in Apple's own UI and re-authorizes. Re-authorization generates a fresh payment token, so the token-lifetime concern with collecting data outside the sheet does not apply.- New optional
validatePayerFieldsparameter onMobiPay.requestApplePayToken/MobiPayPlatform.requestApplePayToken(accepted values:name,address,city,zip,country,phone,email; defaults to[], i.e. no in-sheet enforcement - not breaking). MobiPayApplePayButtoncomputes this list automatically: a field is enforced in-sheet only when the matchingpayer*fallback parameter was not supplied. Fields the host app can back-fill itself never block the payer.- Requires a full iOS rebuild (
pod installin the consuming app) - this is a native code change and will not arrive via hot reload or an old TestFlight build.
- New optional
1.1.6 #
- Reverted the
requiredShippingContactFieldsworkaround added in 1.1.4:MobiPayPlugin.swiftrequests phone/email viarequiredBillingContactFieldsagain (singlebillingContactsource, matching 1.1.3), instead of splitting them out torequiredShippingContactFields. This knowingly reintroduces the intermittent missing phone/email behavior 1.1.4 fixed -PKPaymentRequestnow again relies on PassKit auto-filling from the payer's Wallet card most of the time;MobiPayApplePayButton'spayerPhone/payerEmailfallback parameters remain the safety net for whichever field PassKit doesn't supply. No Dart-side API changes. - Fixed: switching focus between the Card Number/Expiry/CVV fields (hosted in
iframes within the Hosted Payment Fields form) could blank the form
momentarily.
applyNumericKeyboard()inmobi_pay_hpf_widget.dartwas changing an iframe input'stypeattribute while it was focused, forcing WebKit to blur/refocus it mid-transition; it's now applied proactively (piggybacking on the existing field-state poll) before the field is ever focused, so the focus-time call is a no-op. - Fixed: focusing different fields in the card form could scroll the whole
bottom sheet down until only the Apple Pay button remained visible.
MobiPay.startPayment's bottom sheet padded itself by the live keyboard inset (viewInsets.bottom), which differs between the full keyboard (Cardholder Name) and the numeric keypad (Card Number/Expiry/CVV) - so switching fields repositioned the embedded WebView on every focus change, racing with its own internal keyboard-avoidance scroll. The padding now only grows to the largest inset seen since the sheet opened and resets once the keyboard fully closes, so it no longer changes between fields.
1.1.5 #
- Added:
MobiPayTransactionResult.applePayEmail- the email the payer used/edited in the Apple Pay sheet itself (PassKit's contact), surfaced through the existingonTransactionInitiated/onTransactionComplete/onTransactionFailedcallbacks onMobiPayApplePayButton. Only set when PassKit actually supplied it;nullif it fell back to the widget'spayerEmailparameter instead, so it's safe to use for fraud/verification checks without risk of it silently being a pre-supplied value.
1.1.4 #
- Fixed: Apple Pay's
billingContactpayload would intermittently be missingphoneNumberand/oremailAddress, surfacing asMobiPayApplePayButton's "Apple Pay payer phone/email is required..." errors even though the payer had a valid Wallet card. Root cause:PKPaymentRequest.requiredBillingContactFieldsdoes not reliably return phone/email - a billingPKContactis backed by the card's on-file billing address, which doesn't carry those fields (open PassKit bug, Apple Developer Forums thread 61802 / rdar://26981967).MobiPayPlugin.swiftnow requests.phoneNumber/.emailAddressviarequiredShippingContactFieldsinstead (.postalAddress/.nameremain onrequiredBillingContactFields), which Apple does populate reliably, even with noshippingMethodsset. No Dart-side API changes.
1.1.3 #
- Switched Apple Pay's SALE request from the S2S APM protocol to S2S
CARD. S2S APM forwards the Apple Pay token undecrypted, which not every
connector supports - on connectors that don't, it fails with
error_code: 205001 "Merchant mappings not found."(confirmed via Akurateco support ticket). S2S CARD works on both.- New endpoint:
POST /post(e.g.https://api.mobibox.io/post) - not the S2S APM/post-vaendpoint. UpdateMobiPayApplePayConfig.paymentApiUrl. - New
MobiPayHash.generateDigitalWalletSaleHashimplementing S2S CARD's "Formula 8":md5(uppercase(reverse(email) + password)). - New
MobiPayCardSaleProcessor(mobi_pay_card_sale_processor.dart) building thedigital_wallet=applepay/payment_tokenSALE request with S2S CARD's full required payer profile (name, address, city, zip, country, phone, email,term_url_3ds). MobiPayPlugin.swiftnow setsrequiredBillingContactFieldson thePKPaymentRequest, so PassKit collects the payer's name/address/phone/ email as part of the Apple Pay sheet -requestApplePayTokenreturns{"paymentToken": {...}, "billingContact": {...}}instead of the raw token map.MobiPayApplePayButtonprefers this native billing contact and falls back to its ownpayerFirstName/payerLastName/payerAddress/payerCity/payerZip/payerState/payerCountry/payerPhoneparameters (also newly added) for anything PassKit didn't supply.
- New endpoint:
- Breaking:
MobiPay.processApplePaySaleandMobiPayCardSaleProcessor.processApplePaySalerequire the new payer fields above andtermUrl3ds(replacingreturnUrl); the S2S APM-onlyidentifierparameter andMobiPayCheckout.applePayIdentifier/MobiPay.startPayment(applePayIdentifier: ...)were removed (S2S CARD has no equivalent field).MobiPayApplePayButton.identifierwas also removed. MobiPaySaleProcessor.processApplePaySale(S2S APM) is no longer called by this package for Apple Pay, but remains available for merchants whose connector does support undecrypted tokens, or other S2S APM brands.- Fixed:
MobiPayApplePayButtonno longer stays tappable while a card payment (or another Apple Pay attempt) is already in flight - and the card fields are now locked while an Apple Pay SALE is in flight too.
1.1.2 #
- Add native Apple Pay support (iOS only), shown above the existing card
fields as a button + "Or pay using" divider, matching the standard
checkout layout.
MobiPayApplePayConfig- merchant identifier, S2S APM payment URL, country code, supported networks, merchant capabilities.MobiPay.initialize(applePayConfig: ...)and per-call override viaMobiPay.startPayment(applePayConfig: ..., enableApplePay: ...).MobiPayApplePayButton/MobiPayApplePayDividerfor building a custom layout instead of usingstartPayment's bottom sheet.- New
MobiPayHash.generateSaleHashandMobiPaySaleProcessorimplementing the raw S2S APMaction=SALE&brand=applepayprotocol (separate from the Hosted Payment Fields JSON API used for cards). - Native iOS PassKit integration (
PKPaymentAuthorizationController) added toMobiPayPlugin.swift;PassKitframework added to the podspec. - Requires an Apple Pay Merchant Identifier + certificates set up in your
Apple Developer account and in the Mobibox admin panel's "Wallets" tab,
the
com.apple.developer.in-app-paymentsentitlement enabled in your app's Xcode project, and your S2S APMPAYMENT_URLfrom your Mobibox account manager. SeeMobiPayApplePayConfigdoc comments for details.
1.1.1 #
- Update for Mobibox_pay SDK.
- Changelog:
- Stop Accepting Numeric Input for Cardholder Name