MobiPay class

Main class for Mobibox Payment integration

Constructors

MobiPay()

Properties

applePayConfig ↔ MobiPayApplePayConfig?
Default Apple Pay configuration, used by startPayment to automatically show the Apple Pay button above the card fields when set. Pass a config explicitly to MobiPayApplePayButton instead if you'd rather build your own layout.
getter/setter pair
googlePayConfig ↔ MobiPayGooglePayConfig?
Default Google Pay configuration, used by startPayment to automatically show the Google Pay button above the card fields (below the Apple Pay button - though only one is ever visible, since Apple Pay is iOS-only and Google Pay is Android-only) when set.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createHPFWidget({Key? key, required String sessionToken, String? cardholderName, void onSubmitResult(Map<String, dynamic> data)?, void onSuccessRedirect(String url)?, void onErrorRedirect(String url)?, void onError(Exception e)?, void onValidationError(String url)?, void onTransactionInitiated(MobiPayTransactionResult result)?, void onTransactionComplete(MobiPayTransactionResult result)?, void onTransactionFailed(MobiPayTransactionResult result)?, String? email, Map<String, dynamic>? billingAddress, Map<String, dynamic>? browserInfo, String? birthDay, String? selectedLanguage}) → MobiPayHPFWidget
Create a Hosted Payment Fields widget
getPlatformVersion() → Future<String?>
getSessionToken({required String orderNumber, required String orderAmount, required String orderCurrency, required String orderDescription, bool? recurringInit, String? scheduleId, bool? reqToken, List<String>? cardToken}) → Future<String>
Get a session token for Hosted Payment Fields
initialize({required String checkoutHost, required String merchantKey, required String password, MobiPayApplePayConfig? applePayConfig, MobiPayGooglePayConfig? googlePayConfig}) → void
Initialize MobiPay with your credentials
isApplePayAvailable({MobiPayApplePayConfig? config}) → Future<bool>
Whether Apple Pay is available on this device for config (or the default applePayConfig set during initialize).
isGooglePayAvailable({MobiPayGooglePayConfig? config}) → Future<bool>
Whether Google Pay is available on this device for config (or the default googlePayConfig set during initialize). Always false on non-Android platforms.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processApplePaySale({MobiPayApplePayConfig? config, required String orderId, required String orderAmount, required String orderCurrency, required String orderDescription, required String payerIp, required String termUrl3ds, required Map<String, dynamic> paymentToken, required String payerFirstName, required String payerLastName, required String payerEmail, String? payerAddress, String? payerCountry, String? payerCity, String? payerZip, String? payerPhone, String? payerState}) → Future<MobiPaySaleResponse>
Submits an Apple Pay token via the S2S CARD action=SALE&digital_wallet=applepay request. See MobiPayCardSaleProcessor.processApplePaySale.
processGooglePaySale({MobiPayGooglePayConfig? config, required String orderId, required String orderAmount, required String orderCurrency, required String orderDescription, required String payerIp, required String termUrl3ds, required Map<String, dynamic> paymentToken, required String payerFirstName, required String payerLastName, required String payerEmail, String? payerAddress, String? payerCountry, String? payerCity, String? payerZip, String? payerPhone, String? payerState}) → Future<MobiPaySaleResponse>
Submits a Google Pay token via the S2S CARD action=SALE&digital_wallet=googlepay request - same protocol, required payer profile, and hash formula as the Apple Pay flow (see processApplePaySale); only the digital_wallet value and token shape differ. paymentToken must be the paymentToken map returned by requestGooglePayToken (the full Google Pay PaymentData object).
requestApplePayToken({MobiPayApplePayConfig? config, required String orderAmount, required String orderCurrency, required String orderDescription, List<String> validatePayerFields = const []}) → Future<Map<String, dynamic>?>
Presents the native Apple Pay sheet and returns {"paymentToken": {...}, "billingContact": {...}} (see MobiPayPlatform.requestApplePayToken for the full shape), or null if the payer cancels.
requestGooglePayToken({MobiPayGooglePayConfig? config, required String orderAmount, required String orderCurrency}) → Future<Map<String, dynamic>?>
Presents the native Google Pay sheet and returns {"paymentToken": {...}, "billingContact": {...}} (see MobiPayPlatform.requestGooglePayToken for the full shape), or null if the payer dismisses the sheet.
startPayment({required BuildContext context, required String orderNumber, required String orderAmount, required String orderCurrency, required String orderDescription, String? cardholderName, String? email, void onSubmitResult(Map<String, dynamic> data)?, void onTransactionInitiated(MobiPayTransactionResult result)?, void onTransactionComplete(MobiPayTransactionResult result)?, void onTransactionFailed(MobiPayTransactionResult result)?, void onSuccessRedirect(String url)?, void onErrorRedirect(String url)?, void onError(Exception e)?, void onPaywallClosed()?, Map<String, dynamic>? billingAddress, Map<String, dynamic>? browserInfo, String? birthDay, String? selectedLanguage, bool? recurringInit, String? scheduleId, bool? reqToken, List<String>? cardToken, MobiPayApplePayConfig? applePayConfig, bool enableApplePay = true, String? applePayReturnUrl, String? applePayPayerIp, String? applePayPayerFirstName, String? applePayPayerLastName, String? applePayPayerAddress, String? applePayPayerCity, String? applePayPayerZip, String? applePayPayerState, String? applePayPayerCountry, String? applePayPayerPhone, void onApplePayRedirectRequired(String url, List<Map<String, dynamic>>? redirectParams)?, void onApplePayCancel()?, MobiPayGooglePayConfig? googlePayConfig, bool enableGooglePay = true, void onGooglePayRedirectRequired(String url, List<Map<String, dynamic>>? redirectParams)?, void onGooglePayCancel()?}) → void
Start payment flow by showing a bottom sheet with payment form
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited