createInstrument method

  1. @override
Future<Instrument> createInstrument({
  1. required InstrumentRequest instrumentRequest,
})
override

Exchange a single use Checkout.com token for a payment instrument reference, that can be used at any time to request one or more payments.

Implementation

@override
Future<Instrument> createInstrument(
    {required InstrumentRequest instrumentRequest}) async {
  //
  Map<String, dynamic> responseMap = await apiBase.call(RESTOption.post,
      resource: _instruments,
      headers: headers,
      body: instrumentRequest.toJson());

  return Instrument.fromMap(responseMap);
}