Making a payment
Basic usage
To initiate a payment, you will need to call the YocoSDK.charge() method. This can only be done
once the SDK has been initialised and authorised.
When calling the YocoSDK.charge() method without a ActivityResultLauncher, and instead handling
the PaymentResult in onActivityResult, the RequestCode will be assigned the
PaymentResultInfo.RequestCode.REFUND_REQUEST value.
The following example demonstrates the basic usage of the YocoSDK.charge() method:
The context that is passed as a parameter MUST be calling Activity/Fragment’s context and NOT
the application context.
Advanced usage
To pass additional information, use the paymentParameters argument in the YocoSDK.charge() call.
Here is a more advanced example of the YocoSDK.charge() method with optional parameters:
If no users are authenticated, the login flow will start. Once completed, the payment flow will continue.
Supported PaymentType values
Here is a list of the currently supported payment methods:
PaymentType.CASH will show the receipt screen and will not go through any payment process.
Supported TippingConfig values
Supported Currencies
Here is a list of the currently supported currencies: