Refund Integrator


To refund a payment you will just need to call the SDK refund() method. This requires an authenticated user with the correct refund permissions to be able to perform a refund.

import com.yoco.payment_ui_sdk.YocoSDK
// Optional: Additional user info
val userInfo = HashMap<String, Any>().apply {
this["UserId"] = "test01"
this["Title"] = "Manager"
// Optional: Params containing additional for advanced functionality
val params = RefundParameters(
staffMember = YocoStaff(name = "John", staffNumber = "007"),
receiptDelegate = this,
userInfo = userInfo,
refundCompleteNotifier = { _: Int, result: PaymentResult ->
// Do something once the refund is complete
// Initiating the refund
context = requireContext(),
transactionId = <transactionId>,
params = params,
result = refundResult

If no user has logged in, you WILL be prompted to login using you Yoco account details. If successful, it will continue to the refund flow.

Handling Receipts

Handling Payment Result