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? customerNo = '',
  11. String? customerId = '',
  12. String? paymentSource = '',
  13. String? transactionToken = '',
  14. String? productsCodes = '',
})

Implementation

Future<ApiCallResponse> call({
  String? tenant = '',
  String? token = '',
  String? baseUrl = '',
  String? platform = '',
  double? amount,
  bool? saveBeneficiary,
  String? serviceCode = '',
  String? serviceName = '',
  String? customerName = '',
  String? customerNo = '',
  String? customerId = '',
  String? paymentSource = '',
  String? transactionToken = '',
  String? productsCodes = '',
}) {
  final body = '''
{
"serviceCode": "${serviceCode}",
"serviceName": "${serviceName}",
"amount": ${amount},
"saveBeneficiary": ${saveBeneficiary},
"customerId": "${customerId}",
"customerName": "${customerName}",
"customerNo": "${customerNo}",
"invoicePeriod": "",
"productsCodes": [
  "${productsCodes}"
],
"paymentSource": "Wallet"
}''';
  return ApiManager.instance.makeApiCall(
    callName: 'rechargeMultichoice',
    apiUrl: '${baseUrl}api/blayzPay/bills/multichoice',
    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,
  );
}