Thawani class

Constructors

Thawani.pay(BuildContext context, {required String api, required List<Product> products, required void onCreate(Create create), required void onCancelled(Map<String, dynamic> payStatus), required void onPaid(Map<String, dynamic> payStatus), Widget? child, int? expiredInMinuets, required String pKey, required Map<String, dynamic> metadata, required String clintID, ButtonStyle? buttonStyle, bool? testMode, String? customerID, required bool saveCard, void onError(Map error)?, void onCreateCustomer(CreateCustomerModel data)?, Color? savedCardBackground, Color? savedCardTextColor, Widget? savedCardsAppBarText, void getSavedCustomer(String data)?, String? deleteTextError, String? deleteText, String? selectCardText, void savedCards(List<CardData> data)?, String? successUrl, String? cancelUrl})

Properties

api String
API Code From Thawani Company
final
buttonStyle ButtonStyle?
Button Style
final
cancelUrl String?
The customer would be redirected to successUrl if he decides to cancel the payment (From Thawani API Doc).
final
child Widget?
The Widget Shown In The Button , By Default it have Text
final
clintID String
The Clint Id to be generated by merchant to identify the session (From Thawani API Doc).
final
customerID String?
You can send Custom Customer ID to get the user saved card
final
deleteText String?
This text show when the user try to delete saved card from saved cards screen it's shown if saveCard is true only
final
deleteTextError String?
This text show when the user faced Error in delete saved card from saved cards screen it's shown if saveCard is true only
final
expiredInMinuets int?
to set custom expiry for a session. Default is 24 hours. Minimum 30 minutes and maximum 7 days (10080 minutes).
final
getSavedCustomer ↔ void Function(String data)?
This function show you the Saved Customer ID if it's a exist Customer
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
metadata Map<String, dynamic>
Useful for storing additional information about your products, customers (From Thawani API Doc).
final
onCancelled → void Function(Map<String, dynamic> payStatus)
The Function And The Result Of Data If The User Cancelled The Payment.
final
onCreate → void Function(Create create)
The Function And The Result Of Data After Create Session.
final
onCreateCustomer → void Function(CreateCustomerModel data)?
This function show you the Customer Data if it's a new Customer
final
onError → void Function(Map error)?
The Function And The Reason Of The Error, If Any Error Happen.
final
onPaid → void Function(Map<String, dynamic> payStatus)
The Function And The Result Of Data If The User Cancelled The Payment.
final
pKey String
The Publishable Key From Thawani Company
final
products List<Product>
A list of products the customer is purchasing. maximum 100 products (From Thawani API Doc).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saveCard bool
Make It true If you want allow the customer to save the payment card
final
savedCardBackground Color?
To change the saved card background color it's shown if saveCard is true only
final
savedCards → void Function(List<CardData> data)?
This function show you the Customer Data if it's a new Customer
final
savedCardsAppBarText Widget?
To change the appbar in saved cards screen it's shown if saveCard is true only
final
savedCardTextColor Color?
To change the saved card Text color it's shown if saveCard is true only
final
selectCardText String?
This text show when the user click on the saved card from saved cards screen it's shown if saveCard is true only
final
successUrl String?
The customer would be redirected to successUrl if payment processed successfully (From Thawani API Doc).
final
testMode bool?
Make It true If You Want Test The Package Or The Api
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payApi({required BuildContext context, required String api, required String publishKey, required String clintID, required String customerID, required List<Product> products, String? successUrl, String? cancelUrl, required Map<String, dynamic> metadata, required bool testMode, required void onCreate(Create create), required void onCancelled(Map<String, dynamic> payStatus), required void onPaid(Map<String, dynamic> payStatus), required dynamic onError(Map error)?}) → dynamic
toString() String
A string representation of this object.
inherited

Operators

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