verifyPayment method
Future<NetworkResponse>
verifyPayment({
- required ValidateDirectChargeRequest body,
- required String publicKey,
Verifies a payment by checking its status. This method sends a request to the API to verify the status of a payment. Returns a NetworkResponse containing the result of the payment verification.
Implementation
Future<NetworkResponse> verifyPayment({
/// [body]: The [ValidateDirectChargeRequest] object that contains the necessary data for verification
required ValidateDirectChargeRequest body,
/// [publicKey]: The public key required for the API request.
required String publicKey,
}) async {
return apiClient.request(
requestType: RequestType.post,
requiresAuth: true,
path: ChapaUrl.verifyUrl,
data: body.toJson(),
fromJsonSuccess: ValidateDirectChargeResponse.fromJson,
fromJsonError: ApiErrorResponse.fromJson,
publicKey: publicKey,
);
}