getTransactionStatus method

Future<MastercardPaymentResponse> getTransactionStatus({
  1. required String orderId,
  2. required String transactionId,
})

Get transaction status

Implementation

Future<MastercardPaymentResponse> getTransactionStatus({
  required String orderId,
  required String transactionId,
}) async {
  try {
    final response = await _dio.get('/order/$orderId/transaction/$transactionId');
    return MastercardPaymentResponse.fromJson(response.data);
  } on DioException catch (e) {
    throw MastercardException(
      'Failed to get transaction status: ${e.message}',
      statusCode: e.response?.statusCode,
      response: e.response?.data,
    );
  } catch (e) {
    throw MastercardException('Failed to get transaction status: $e');
  }
}