checkout static method
Future<SumupCheckoutResponse>
checkout(
{ - required String title,
- required double total,
- int saleItemsCount = 1,
- double tip = 0.0,
- bool skipSuccessScreen = true,
- bool skipFailureScreen = false,
- bool tipOnCardReader = false,
- String? customerEmail,
- String? customerPhone,
- String? foreignTransactionId,
})
Implementation
static Future<SumupCheckoutResponse> checkout({
required String title,
required double total,
int saleItemsCount = 1,
double tip = 0.0,
bool skipSuccessScreen = true,
bool skipFailureScreen = false,
bool tipOnCardReader = false,
String? customerEmail,
String? customerPhone,
String? foreignTransactionId,
}) async {
await Sumup.prepareForCheckout();
var payment = SumupPayment(
saleItemsCount: saleItemsCount,
title: title,
total: total,
currency: 'EUR',
foreignTransactionId: foreignTransactionId,
tipOnCardReader: tipOnCardReader,
customerEmail: customerEmail,
customerPhone: customerPhone,
skipFailureScreen: skipFailureScreen,
skipSuccessScreen: skipSuccessScreen,
tip: tip,
);
var request = SumupPaymentRequest(payment);
SumupPluginCheckoutResponse response = await Sumup.checkout(request);
return SumupCheckoutResponse.fromSumup(response);
}