LokotroPaymentRequest.fromJson constructor
LokotroPaymentRequest.fromJson(
- Map<String, dynamic> json
)
Implementation
factory LokotroPaymentRequest.fromJson(Map<String, dynamic> json) {
return LokotroPaymentRequest(
customerReference: json['customer_reference'] as String,
amount: json['amount'] as String,
currency: json['currency'] as String,
paymentMethod: json['payment_method'] as String? ?? 'wallet',
userInfo: json['user_info'] as String? ?? 'none',
paymentMethodInfo: json['payment_method_info'] as String? ?? 'none',
feeCoveredBy: json['fee_covered_by'] as String? ?? 'buyer',
deliveryBehaviour: json['delivery_behaviour'] as String? ?? 'direct_delivery',
notifyUrl: json['notify_url'] as String,
successRedirectUrl: json['success_redirect_url'] as String?,
failRedirectUrl: json['fail_redirect_url'] as String?,
merchant: json['merchant'] != null ? LokotroMerchantInfo.fromJson(json['merchant']) : null,
cfgSystemCountryId: json['cfg_system_country_id'] as String?,
phoneNumber: json['phone_number'] as String?,
email: json['email'] as String?,
firstName: json['first_name'] as String?,
lastName: json['last_name'] as String?,
walletNumber: json['wallet_number'] as String?,
walletPin: json['wallet_pin'] as String?,
flashNumber: json['flash_number'] as String?,
flashPin: json['flash_pin'] as String?,
cardNumber: json['card_number'] as String?,
cardExpiryDate: json['card_expiry_date'] as String?,
cardCvv: json['card_cvv'] as String?,
cardHolderName: json['card_holder_name'] as String?,
mobileMoneyPhoneNumber: json['mobile_money_phone_number'] as String?,
mastercardPaymentMethod: json['mastercard_payment_method'] as String?,
metadata: json['metadata'] as Map<String, dynamic>?,
);
}