initPayment method
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);
}