Refunding a Payment

info

When calling YocoSDK.refund() without passing in a ActivityResultLauncher and handling the PaymentResult in onActivityResult, it will be assigned the PaymentResultInfo.RequestCode.REFUND_REQUEST code

Parameters

  1. context: Context - The calling Activity/Fragment initiating the payment
  2. transactionId: String? - transactionId that should be refunded
  3. params: RefundParameters - (Optional) Provides additional info regarding the payment
    1. receiptDelegate: ReceiptDelegate? - (Optional) Receipt screen callback handler and util
    2. userInfo: Map<String, Any>? - (Optional) Map of key-value pairs, providing additional info regarding the user which will be returned to the PaymentResult
    3. staffMember: YocoStaff? - (Optional) Yoco Staff member performing payment
    4. refundCompleteNotifier: ((resultCode: Int, result: PaymentResult) -> Unit)? - (Optional) refund completion handler
  4. result: ActivityResultLauncher<Intent>? - (Optional) activity result handler contract to handle intent result
danger

The context that is passed as a parameter MUST be calling activity/fragment's context and NOT the application context.