initPayment method

Future initPayment(
  1. String public_key,
  2. int amount,
  3. bool sandbox,
  4. String currency,
  5. String company_name,
  6. String template,
  7. String color,
  8. String logo_url,
)

Implementation

Future<dynamic> initPayment(
    String public_key,
    int amount,
    bool sandbox,
    String currency,
    String company_name,
    String template,
    String color,
    String logo_url) async {

  dynamic headers = {
    "public_key": this.public_key,
    "private_key": this.private_key,
    "secret_key": this.secret_key,
    "merchant_key": this.merchant_key
  };

  dynamic map = {
    "invoice": {
      "keys": {
        "public": this.public_key,
        "private": this.private_key,
        "secret": this.secret_key
      },
      "amount": amount,
      "sandbox": sandbox,
      "currency": "xof",
     /* "items": [
        {"name": "T-shirt", "qte": "2", "price": "500", "totalamount": "1000"}
      ]*/
    },
    "store": {
      "name": company_name,
      "template": template,
      "color": color,
      "phone": "",
      "logo_url":logo_url
    }
  };

  return await apiClient.postFromApi(init_payment_url, map, headers);
}