toJson method

Map<String, dynamic> toJson()

Converts ChargeCardRequest instance to a map

Implementation

Map<String, dynamic> toJson() {
  return {
    "card_number": this.cardNumber,
    "cvv": this.cvv,
    "expiry_month": this.expiryMonth,
    "expiry_year": this.expiryYear,
    "currency": this.currency,
    "amount": this.amount,
    "email": this.email,
    "fullname": this.fullName,
    "country": this.country,
    "tx_ref": this.txRef,
    "redirect_url": (this.redirectUrl == null || this.redirectUrl!.isEmpty)
        ? FlutterwaveURLS.DEFAULT_REDIRECT_URL
        : this.redirectUrl,
    "authorization": this.authorization == null
        ? Authorization().toJson()
        : this.authorization?.toJson()
  };
}