Making a payment
Basic usage
To initiate a payment, you 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 is assigned the
PaymentResultInfo.RequestCode.REFUND_REQUEST value.
The following example demonstrates the basic usage of the YocoSDK.charge() method:
The context that’s 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 starts. Once completed, the payment flow continues.
Supported PaymentType values
Here is a list of the supported payment methods:
The cash payment type shows the receipt screen and doesn’t go through any payment process.
Supported TippingConfig values
Supported Currencies
Here is a list of the supported currencies: