call method
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 = '',
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,
);
}