pay

fun pay(paymentMethod: PaymentMethod, paymentCredentials: PaymentCredentials?)

Needs to be called when the checkout is state CheckoutState.REQUEST_PAYMENT_METHOD.

When successful the state will switch to CheckoutState.WAIT_FOR_APPROVAL which waits for a event of the backend that the payment has been confirmed or denied.

Possible states after receiving the event:

CheckoutState.PAYMENT_APPROVED CheckoutState.DENIED_BY_PAYMENT_PROVIDER

Parameters

paymentMethod

the payment method to pay with

paymentCredentials

may be null if the payment method requires no payment credentials