call method

Future<ApiCallResponse> call({
  1. String? tenant = '',
  2. String? token = '',
  3. String? baseUrl = '',
  4. String? platform = '',
  5. double? amount,
  6. bool? saveBeneficiary,
  7. String? serviceCode = '',
  8. String? serviceName = '',
  9. String? customerName = '',
  10. String? customerId = '',
  11. String? custmerAddress = '',
  12. String? paymentSource = '',
  13. String? transactionToken = '',
})

Implementation

Future<ApiCallResponse> call({
  String? tenant = '',
  String? token = '',
  String? baseUrl = '',
  String? platform = '',
  double? amount,
  bool? saveBeneficiary,
  String? serviceCode = '',
  String? serviceName = '',
  String? customerName = '',
  String? customerId = '',
  String? custmerAddress = '',
  String? paymentSource = '',
  String? transactionToken = '',
}) {
  final body = '''
{
 "amount": ${amount},
"saveBeneficiary": ${saveBeneficiary},
"serviceCode": "${serviceCode}",
"serviceName": "${serviceName}",
"customerName": "${customerName}",
"customerId": "${customerId}",
"paymentSource": "${paymentSource}",
"custmerAddress": "${custmerAddress}"

}''';
  return ApiManager.instance.makeApiCall(
    callName: 'rechargeElectricity',
    apiUrl: '${baseUrl}api/blayzPay/bills/electricity',
    callType: ApiCallType.POST,
    headers: {
      ...BlayzPayAPIGroup.headers,
      'tenant': '${tenant}',
      'Authorization': '${token}',
      'platform': '${platform}',
      'TransactionToken': '${transactionToken}',
    },
    params: {},
    body: body,
    bodyType: BodyType.JSON,
    returnBody: true,
    encodeBodyUtf8: false,
    decodeUtf8: false,
    cache: false,
  );
}