MyfatoorahRequest class
The request that will be send to may fatoorah api
first thing we do is to fetch payment methods as described in their docs
https://myfatoorah.readme.io/docs/api-initiate-payment
Then we make the execute payment as described here
https://myfatoorah.readme.io/docs/api-execute-payment
if the request success we navigate to anew page that contains webview redirected to the returned url
if you need to pop immediately after payment done pass finishAfterCallback
equal true
Note
In case you are using the invoiceItem
, the value sent in invoiceAmount
should be equal to the total
sum value of the item unitPrice
multiplied by the item Quantity ,
for example of you are having 1 item with price of 5 KD and quantity 3,
so the value of the invoiceAmount
should be 15
Constructors
-
MyfatoorahRequest({required String token, required ApiLanguage language, required double invoiceAmount, required Country currencyIso, ShippingConsignee? shippingConsignee, String? mobileCountryCode, String? initiatePaymentUrl, String? executePaymentUrl, String? customerMobile, String url = "https://api.myfatoorah.com", String? customerName, String? customerEmail, String? customerReference, String? customerCivilId, String? userDefinedField, CustomerAddress? customerAddress, DateTime? expiryDate, List<
Supplier> ? suppliers, int? shippingMethod, List<InvoiceItem> ? invoiceItems, RecurringModel? recurringModel}) -
MyfatoorahRequest.live({required String token, required ApiLanguage language, required double invoiceAmount, required Country currencyIso, ShippingConsignee? shippingConsignee, String? mobileCountryCode, String? initiatePaymentUrl, String? executePaymentUrl, String? customerMobile, String? customerName, String? customerEmail, String? customerReference, String? customerCivilId, String? userDefinedField, CustomerAddress? customerAddress, DateTime? expiryDate, List<
Supplier> ? suppliers, int? shippingMethod, List<InvoiceItem> ? invoiceItems, RecurringModel? recurringModel}) -
MyfatoorahRequest.test({required String token, required ApiLanguage language, required double invoiceAmount, required Country currencyIso, ShippingConsignee? shippingConsignee, String? mobileCountryCode, String? initiatePaymentUrl, String? executePaymentUrl, String? customerMobile, String? customerName, String? customerEmail, String? customerReference, String? customerCivilId, String? userDefinedField, CustomerAddress? customerAddress, DateTime? expiryDate, List<
Supplier> ? suppliers, int? shippingMethod, List<InvoiceItem> ? invoiceItems, RecurringModel? recurringModel})
Properties
- currencyIso → Country
-
Callback that will be called after payment success note that this url preferred to return html content with
success message
final
- customerAddress → CustomerAddress?
-
final
- customerCivilId → String?
-
Your customer civil ID that you can associate with the transaction if needed
final
- customerEmail → String?
-
final
- customerMobile → String?
-
Customer mobile number
final
- customerName → String?
-
final
- customerReference → String?
-
Refers to the order or transaction ID in your own system and you can use for payment inquiry as well
final
- executePaymentUrl → String?
-
url to use instead of my fatoorah url
Must not be null if you run on the web
if you set initiatePaymentUrl or executePayment you can set token equal to null
and make these urls set the token from backend for security reasons
This url must return the base response of my fatoorah without any edits
final
- expiryDate → DateTime?
-
The date you want the payment to be expired, if not passed the default is considered from the account profile in the portal
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initiatePaymentUrl → String?
-
url to use instead of my fatoorah url
Must not be null if you run on the web
if you set initiatePaymentUrl or executePayment you can set token equal to null
and make these urls set the token from backend for security reasons
This url must return the base response of my fatoorah without any edits
final
- invoiceAmount → double
-
The amount you are seeking to charge the customer and accepts decimal value e.g. 2.500
final
-
invoiceItems
→ List<
InvoiceItem> ? -
Array of InvoiceItemModel objects, optional
final
- language → ApiLanguage
-
Language of displaying payment methods
final
- mobileCountryCode → String?
-
Customer mobile number country code
final
- recurringModel → RecurringModel?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shippingConsignee → ShippingConsignee?
-
This parameter is only mandatory if you are creating a Shipping invoice.
final
- shippingMethod → int?
-
1 for DHL
2 for ARAMEX
final
-
suppliers
→ List<
Supplier> ? -
This parameter is only mandatory if you are using the Multi-Vendors feature.
final
- token → String
-
authorization token without bearer
final
- url → String
-
final
- userDefinedField → String?
-
A custom field that you may use as additional information to be stored with the transaction
final
Methods
-
executePaymentRequest(
int paymentMethod) → Map< String, dynamic> -
initiatePaymentRequest(
) → Map< String, dynamic> -
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