PaymentRequest constructor
PaymentRequest()
Implementation
PaymentRequest(this.merchant_uuid, this.merchant_op_id, this.description, Details details,
this.return_url, this.cancel_url, Currency currency, this.items, this.invoice_number, this.terminal_id) {
this.currency = currency.name;
double productPriceTotal = 0;
double productTaxTotal = 0;
double productCount = items.length.toDouble();
for(int i=0 ; i<productCount ; i++){
productTaxTotal += items[i].getTax();
productPriceTotal += items[i].getPrice() * items[i].getQuantity();
}
details.setTax(productTaxTotal);
amount = Amount("${productPriceTotal + details.getAmount()}0", details);
}