retrieveIntentClient method

  1. @override
Future<PaymentIntentResponse> retrieveIntentClient(
  1. String paymentIntentId,
  2. String clientKey
)
override

Retrieve payment intent. Used for re-query to check payment status

Implementation

@override
Future<PaymentIntentResponse> retrieveIntentClient(
  String paymentIntentId,
  String clientKey,
) async {
  final _http = PayMongoHttp(_apiKey);
  final options = PayMongoOptions(
    path: '/payment_intents/$paymentIntentId',
    params: {
      "client_key": clientKey,
    },
  );

  final response =
      await _http.get(Uri.https(_url, "v1${options.path}", options.params));
  _http.close();
  final json = serialize<Map<String, dynamic>>(response, options.path);

  return PaymentIntentResponse.fromMap(json);
}