TransactionPayload.compact constructor

TransactionPayload.compact(
  1. Merchant merchant,
  2. Payment payment,
  3. Customer customer,
  4. Config? config,
)

Implementation

TransactionPayload.compact(
    Merchant merchant, Payment payment, Customer customer, Config? config) {
  this.merchantCode = merchant.merchantId;
  this.domain = merchant.domain;
  this.transactionReference = payment.transactionReference;
  this.orderId = payment.orderId;
  this.currencyCode = payment.currencyCode;
  this.amount = payment.amount;
  this.narration = payment.narration;
  this.preauth = payment.getPreauth();
  // CONFIG DETAILS
  if (config != null) {
    this.providerIconUrl = config.providerIconUrl ??= null;
    this.iconUrl = config.iconUrl ??= null;
    this.primaryAccentColor = config.primaryAccentColor ??= null;
  }
  //CUSTOMER DETAILS
  this.customerId = customer.id;
  this.customerFirstName = customer.firstName;
  this.customerSecondName = customer.secondName;
  this.customerEmail = customer.email;
  this.customerMobile = customer.mobile;
  this.customerCity = customer.city;
  this.customerCountry = customer.country;
  this.customerPostalCode = customer.postalCode;
  this.customerStreet = customer.street;
  this.customerState = customer.state;
}