requestTokenPayment method
Future<PaymentResponse>
requestTokenPayment({
- required PaymentRequest paymentRequest,
- CreditCard? card,
- ApplePayTokenData? applePayTokenData,
- required PaymentMethod method,
override
pay using The Checkout.com token (e.g., a card or digital wallet token)
Implementation
@override
Future<PaymentResponse> requestTokenPayment({
required PaymentRequest paymentRequest,
CreditCard? card,
ApplePayTokenData? applePayTokenData,
required PaymentMethod method,
}) async {
final token = await _tokenize(
method,
applePayTokenData: applePayTokenData,
card: card,
);
Map<String, dynamic> response = await apiBase.call(
RESTOption.post,
resource: _payments,
headers: headers,
body: paymentRequest.copyWith(token: token).toJson(),
);
return PaymentResponse.fromMap(response);
}