PaymentConfig class
Used by Moyasar API along with any of the supported sources.
Constructors
-
PaymentConfig({required String publishableApiKey, required int amount, String currency = 'SAR', required String description, Map<
String, dynamic> ? metadata, List<PaymentNetwork> ? supportedNetworks, ApplePayConfig? applePay, SamsungPayConfig? samsungPay, String merchantCountryCode = 'SA', CreditCardConfig? creditCard, String? givenID, List<PaymentSplit> ? splits, String? baseUrl})
Properties
- amount ↔ int
-
The smallest currency unit.
For example, to charge
SAR 257.58you will have the amount as25758. In other words, 10 SAR = 10 * 100 Halalas.getter/setter pair - applePay ↔ ApplePayConfig?
-
The config required to setup Apple Pay.
getter/setter pair
- baseUrl ↔ String?
-
Optional base URL for the API endpoint.
Default is 'https://api.moyasar.com/v1/payments'.
For staging, use 'https://apimig.moyasar.com/v1/payments'.
getter/setter pair
- creditCard ↔ CreditCardConfig?
-
The config required to extend the Credit Card payment feature.
getter/setter pair
- currency ↔ String
-
Must be in ISO 3166-1 alpha-3 country code format.
The default value is "SAR".
getter/setter pair
- description ↔ String
-
Can be any string you want to tag the payment.
For example
Payment for Order #34321getter/setter pair - givenID ↔ String?
-
given_id It is going be the ID of the created payment.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- merchantCountryCode ↔ String
-
Merchant country code for Samsung Pay (e.g. "SA", "US"). Default "SA".
getter/setter pair
-
metadata
↔ Map<
String, dynamic> ? -
The metadata adds searchable key/value pairs to the payment.
For example
{"size": "xl"}getter/setter pair - publishableApiKey ↔ String
-
You can find your publishableApiKey in your Moyasar Dashboard.
Go to https://docs.moyasar.com/get-your-api-keys for more details.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samsungPay ↔ SamsungPayConfig?
-
The config required to setup Samsung Pay (Android only).
getter/setter pair
-
splits
↔ List<
PaymentSplit> ? -
Optional payment splits for dividing payment amount among recipients.
Only available for aggregation clients. Splitting on non-aggregated payments will be ignored.
Contact your account manager to enable this feature.
getter/setter pair
-
supportedNetworks
↔ List<
PaymentNetwork> -
Optional configuration used to set accepted card networks.
Supported Networks:
PaymentNetwork.amex, PaymentNetwork.visa, PaymentNetwork.mada, PaymentNetwork.masterCardgetter/setter pair
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
Static Properties
- callbackUrl ↔ String
-
Used internally to manage the 3DS step.
getter/setter pair