CheckoutData class

Constructors

CheckoutData({required List<PriceItem> priceItems, required String payToName, bool displayNativePay = false, bool isApple = false, void onNativePay(CheckOutResult checkOutResult)?, void onCashPay(CheckOutResult checkOutResult)?, required dynamic onCardPay(CardFormResults results, CheckOutResult checkOutResult), bool displayEmail = true, bool lockEmail = false, String initEmail = '', String initPhone = '', String initBuyerName = '', List<String>? countriesOverride, Function? onBack, GlobalKey<CardPayButtonState>? payBtnKey, GlobalKey<FormState>? formKey, double? cashPrice, double? taxRate, bool displayTestData = false})
The CheckoutData widget is a stateless widget resembling your typical checkout page and some typical option along with some helpful features such as built-in form validation and credit card icons that update based on the input provided. This is a UI widget only and holds no responsibility and makes no guarantee for transactions using this ui. Transaction security and integrity is the responsibility of the developer and what ever Third-party transaction api that developer is using. A great API to use is Stripe
const

Properties

cashPrice double?
If you are providing a cash option at a discount, provide its price ex: 12.99
final
countriesOverride List<String>?
If you have a List of Countries that you would like to use to override the currently provide list of 1, being 'United States', add the list here. Warning: The credit card form does not currently adjust based on selected country's needs to verify a card. This form may not work for all countries
final
displayCashPay bool
Should the cash option appear?
no setter
displayEmail bool
Should the email box be displayed?
final
displayNativePay bool
should you display native pay option?
final
displayTestData bool
If you would like to display test data during your development, a dataset based on Stripe test data is provided. To use this date, simply mark this true. WARNING: Make sure to mark false for any release
final
formKey GlobalKey<FormState>?
You will need to provide a general FormState key to control, validate and save the form data based on your needs.
final
hashCode int
The hash code for this object.
no setterinherited
initBuyerName String
Provide a name if you have it, to prefill the name field on the Credit Card form
final
initEmail String
Provide an email if you have it, to prefill the email field on the Credit Card form
final
initPhone String
Provide a phone number if you have it, to prefill the name field on the Credit Card form
final
isApple bool
is this the user on an apple based platform?
final
lockEmail bool
Should the email form field be locked? This should only be done if an initEmail is provided
final
onBack Function?
If you would like to provide an integrated back button in the header, add add the needed functionality here. ex) onBack : ()=>Navigator.of(context).pop();
final
onCardPay → dynamic Function(CardFormResults results, CheckOutResult checkOutResult)
Provide a function that receives CardFormResults as a parameter that is to be trigger once the user completes the credit card form and presses pay
final
onCashPay → void Function(CheckOutResult checkOutResult)?
Provide a function that should trigger if the user presses the cash option. Can be left null if Cash option is not to be displayed
final
onNativePay → void Function(CheckOutResult checkOutResult)?
Provide a function that will be triggered once the user clicks on the native button. Can be left null if native option is not to be displayed
final
payBtnKey GlobalKey<CardPayButtonState>?
If you would like to control the pay button state to display text or icons based on the current stage of the payment process, you will need to provide a CardPayButtonState key to update it.
final
payToName String
Provide the name of the vendor handling the transaction or receiving the funds from the user during this transaction
final
priceItems List<PriceItem>
The list of items with prices PriceItem's to be shown within the drop down banner on the checkout page
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtotalCents int
no setter
taxRate double?
The tax rate to be applied to the total price
final
totalCostCents int
no setter
totalPrice String
no setter
totalTax String
no setter
totalTaxCents int
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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