Split Payment
-
Hi there!
I’m working on a WooCommerce + Dokan multi-vendor setup using BTCPay for WooCommerce v2 (latest version – 2.7.2). I’m trying to implement split payments using the
paymentMethod.destinationfeature available on BTCPay Server invoices.The idea is to split the payment between the marketplace and the vendor at the invoice level, without needing custodial wallets or post-processing.
I added a filter in my
functions.phpto modify the invoice data like this:phpCopiar
Editar
add_filter(‘btcpaywc_v2_invoice_data’, function ($data, $order) {
$data[‘checkout’][‘paymentMethods’][] = [
‘value’ => 95,
‘destination’ => ‘[MARKETPLACE_ADDRESS]’,
‘paymentMethod’ => ‘BTC’,
];
$data[‘checkout’][‘paymentMethods’][] = [
‘value’ => 5,
‘destination’ => ‘[VENDOR_ADDRESS]’,
‘paymentMethod’ => ‘BTC’,
];
return $data;
}, 10, 2);However, BTCPay seems to ignore the custom destinations and routes the full amount to the store’s main wallet instead.
Questions:
- Does the plugin support this use case?
- Is
checkout.paymentMethodsthe right key to modify? - Are there any specific conditions (store permissions, BTCPay version, etc) needed for this to work?
Thanks in advance for any insight!
The topic ‘Split Payment’ is closed to new replies.