• rafafeuer

    (@rafafeuer)


    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.destination feature 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.php to 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.paymentMethods the 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!

Viewing 1 replies (of 1 total)
  • Plugin Author ndeet

    (@ndeet)

    Hey there, sorry for the late reply due to holidays.

    What you want to achieve is not really possible that way the invoice will always have one destination address and can’t auto-forward on a per invoice basis.

    If you only accept Lightning Network payments you can auto-forward by using the Prism plugin, which forwards payments based on LN-addresses. You can find it in BTCPay Server under “manage plugins”.

Viewing 1 replies (of 1 total)

The topic ‘Split Payment’ is closed to new replies.