BuzapayCheckoutButton class
A pre-built checkout button that handles the entire payment flow
The SDK does not determine payment success or failure. Use onComplete to get the transaction reference, then verify the transaction server-side via the Buzapay API or webhooks.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BuzapayCheckoutButton
Constructors
-
BuzapayCheckoutButton({Key? key, required int amount, required String currency, required String email, required String phoneNumber, required String redirectUrl, required Future<
PaymentLinkResponse> generatePaymentLink(PaymentLinkRequest request), String? merchantReference, String? narration, void onComplete(String? reference)?, void onError(Exception error)?, void onPaymentLinkGenerated(PaymentLinkResponse response)?, String? buttonText, ButtonStyle? buttonStyle, Widget? loadingWidget, bool enabled = true}) -
Creates a new BuzapayCheckoutButton
const
Properties
- amount → int
-
Amount in minor units
final
-
Custom button style
final
-
Custom button text
final
- currency → String
-
Currency code
final
- email → String
-
Customer email
final
- enabled → bool
-
Whether the button is enabled
final
-
generatePaymentLink
→ Future<
PaymentLinkResponse> Function(PaymentLinkRequest request) -
Function to generate payment link (injected from Buzapay instance)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingWidget → Widget?
-
Custom loading widget
final
- merchantReference → String?
-
Your unique reference
final
- narration → String?
-
Payment description
final
- onComplete → void Function(String? reference)?
-
Called when the checkout flow ends.
final
- onError → void Function(Exception error)?
-
Called when an error occurs during payment link generation or checkout.
final
- onPaymentLinkGenerated → void Function(PaymentLinkResponse response)?
-
Callback when payment link is generated (before WebView opens)
final
- phoneNumber → String
-
Customer phone number
final
- redirectUrl → String
-
Redirect URL after payment
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BuzapayCheckoutButton> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited