checkout static method

Future<SumupCheckoutResponse> checkout({
  1. required String title,
  2. required double total,
  3. int saleItemsCount = 1,
  4. double tip = 0.0,
  5. bool skipSuccessScreen = true,
  6. bool skipFailureScreen = false,
  7. bool tipOnCardReader = false,
  8. String? customerEmail,
  9. String? customerPhone,
  10. 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);
}