createPayment function

Future<ApiResponse<PaymentRead>> createPayment(
  1. ExsitedClient client,
  2. Object payload, {
  3. bool? raiseOnError,
  4. String? responseFormat,
})

POST /api/{api_version}/payments

Record a payment, wrapped in payment; 201, answered as getPayment reads it. A payment_applied processor with a card token charges the card.

Implementation

Future<ApiResponse<PaymentRead>> createPayment(
  ExsitedClient client,
  Object payload, {
  bool? raiseOnError,
  String? responseFormat,
}) =>
    client.sendPostRequest(PaymentsUrls.payments,
        jsonBody: payload,
        raiseOnError: raiseOnError,
        responseFormat: responseFormat,
        dtoDecoder: PaymentRead.fromMap);