Having a problem getting BTCpay Server set up with WooCommerce. Have sucessfully created a store and paired with BTCpay Server running on Umbrel.
However when I try to test checkout, I receive a fatal error, “CRITICAL Uncaught TypeError”
Any help troubleshooting would be very much appreciated!
CRITICAL Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /home/northernbay/northernbayorganics.com/wp-content/plugins/btcpay-for-woocommerce/lib/Bitpay/Client/Client.php:119
Stack trace:
#0 /home/northernbay/northernbayorganics.com/wp-content/plugins/btcpay-for-woocommerce/lib/Bitpay/Client/Client.php(119): array_key_exists('posData', NULL)
#1 /home/northernbay/northernbayorganics.com/wp-content/plugins/btcpay-for-woocommerce/lib/Bitpay/Client/Client.php(211): Bitpay\Client\Client->fillInvoiceData(Object(Bitpay\Invoice), NULL)
#2 /home/northernbay/northernbayorganics.com/wp-content/plugins/btcpay-for-woocommerce/class-wc-gateway-btcpay.php(892): Bitpay\Client\Client->createInvoice(Object(Bitpay\Invoice))
#3 /home/northernbay/northernbayorganics.com/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(980): WC_Gateway_BtcPay->process_payment(1258)
#4 /home/northernbay/northernbayorganics.com/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(1195): WC_Checkout->process_order_payment(1258, 'btcpay')
#5 /home/northernbay/northernbayorganics.com/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(461): WC_Checkout->process_checkout()
#6 /home/northernbay/northernbayorganics.com/wp-includes/class-wp-hook.php(307): WC_AJAX::checkout('')
#7 /home/northernbay/northernbayorganics.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
#8 /home/northernbay/northernbayorganics.com/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
#9 /home/northernbay/northernbayorganics.com/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(90): do_action('wc_ajax_checkou...')
#10 /home/northernbay/northernbayorganics.com/wp-includes/class-wp-hook.php(307): WC_AJAX::do_wc_ajax('')
#11 /home/northernbay/northernbayorganics.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(false, Array)
#12 /home/northernbay/northernbayorganics.com/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
#13 /home/northernbay/northernbayorganics.com/wp-includes/template-loader.php(13): do_action('template_redire...')
#14 /home/northernbay/northernbayorganics.com/wp-blog-header.php(19): require_once('/home/northernb...')
#15 /home/northernbay/northernbayorganics.com/index.php(17): require('/home/northernb...')
#16 {main}
thrown in /home/northernbay/northernbayorganics.com/wp-content/plugins/btcpay-for-woocommerce/lib/Bitpay/Client/Client.php on line 119
]]>
Hey, is this plugin compatible with the woocommerce blocks checkout page?
Thanks
]]>Hello,
If we have a virtual & downloadable product, the default “WooCommerce” flow would be to set the order to “Completed” upon receipt of payment.
A product, that is only virtual or only downloadable will go to “Processing”. I am using this functionality in my shop for certain products to distinguish which of them will go to completed and which go to processing (as they require manual interaction).
Looking at the plugin configuration, there only seems to be a way to “statically” configure the Order states.
How can I make btcpay work the way WooCommerce does by default?
To give an example, this plugin from a 3rd party crypto payment processor does implement it this way, maybe that helps: https://www.ads-software.com/plugins/coinpayments-payment-gateway-for-woocommerce/
If I interpret this correctly, we would have to call https://woocommerce.wp-a2z.org/oik_api/wc_orderpayment_complete/ instead of forcing the order status externally.
Example implementation from the aforementioned plugin:
/**
* Successful Payment!
*
* @access public
* @param array $posted
* @return void
*/
function successful_request( $posted ) {
global $woocommerce;
$posted = stripslashes_deep( $posted );
// Custom holds post ID
if (!empty($_POST['invoice']) && !empty($_POST['custom'])) {
$order = $this->get_coinpayments_order( $posted );
if ($order === FALSE) {
die("IPN Error: Could not find order info for order: ".$_POST['invoice']);
}
$this->log->add( 'coinpayments', 'Order #'.$order->get_id().' payment status: ' . $posted['status_text'] );
$order->add_order_note('CoinPayments.net Payment Status: '.$posted['status_text']);
if ( $order->get_status() != 'completed' && get_post_meta( $order->get_id(), 'CoinPayments payment complete', true ) != 'Yes' ) {
// no need to update status if it's already done
if ( ! empty( $posted['txn_id'] ) )
update_post_meta( $order->get_id(), 'Transaction ID', $posted['txn_id'] );
if ( ! empty( $posted['first_name'] ) )
update_post_meta( $order->get_id(), 'Payer first name', $posted['first_name'] );
if ( ! empty( $posted['last_name'] ) )
update_post_meta( $order->get_id(), 'Payer last name', $posted['last_name'] );
if ( ! empty( $posted['email'] ) )
update_post_meta( $order->get_id(), 'Payer email', $posted['email'] );
if ($posted['status'] >= 100 || $posted['status'] == 2 || ($this->allow_zero_confirm && $posted['status'] >= 0 && $posted['received_confirms'] > 0 && $posted['received_amount'] >= $posted['amount2'])) {
print "Marking complete\n";
update_post_meta( $order->get_id(), 'CoinPayments payment complete', 'Yes' );
$order->payment_complete();
} else if ($posted['status'] < 0) {
print "Marking cancelled\n";
$order->update_status('cancelled', 'CoinPayments.net Payment cancelled/timed out: '.$posted['status_text']);
mail( get_option( 'admin_email' ), sprintf( __( 'Payment for order %s cancelled/timed out', 'woocommerce' ), $order->get_order_number() ), $posted['status_text'] );
} else {
print "Marking pending\n";
$order->update_status('pending', 'CoinPayments.net Payment pending: '.$posted['status_text']);
}
}
die("IPN OK");
}
}
]]>
I see it’s been updated just 3 months ago but it also has a warning at the top saying it hasn’t been tested with the last 3 major versions of WP.
Is it all up to date and working with the latest versions?
Thanks.
]]>Hello
If I want to sell memberships with woocommerce and the btcpay wordpress plugin, do I need this plugin? https://woocommerce.com/es-es/products/woocommerce-memberships/
is your plugin support woocommerce subscriptions? and the payment method will be displayed when there is a subscription on the cart? The order status will change automatically after payment?
]]>Hi after making a start at implementing your BTCpay I have received a message from google telling me this
“Social engineering content detected on https://www.vitalherbs.co.uk/
To: Webmaster of https://www.vitalherbs.co.uk/,
Google��s Safe Browsing systems have detected that some pages on your site might be hacked or might include third party resources such as ads that are designed to trick users into installing malicious software or giving up sensitive information. To protect your site��s visitors, affected pages have been demoted in Google��s search results, and browsers such as Google Chrome now display a warning when users visit your site. You can see which pages might be affected in the Security Issues report.
This means that now my google ads will be stopped etc and google wont reopen them until the “issue” is resolved. Is this a problem that have heard of before? Is this google trying to stop BTC payments?
]]>WooCommerce shows me an error since its not clear if this plugin is compatible with WooCommerce 4.5.2 (newest right now)
]]>I want to know if I can use it with yith woocommerc subscription or woocommerce subscription
]]>Hi I’d like to use the plugin for wordpress but without woocommerce, only for small payment for selling some photos e.g.
Is that possible?
regards,
]]>I am keen to try this….but it says it has not been tested yet. Any ideas if it will work ok? Thanks
]]>Hello,
All my orders went through Bitcoin shows Pending Payment status even the payment goes successful. Not sure what is wrong but the status is not changing to Processing. On BTC Settings page, I have changed statuses for Paid and Confirmed to “Processing” but not working.
Please respond ASAP. Thank You.
]]>Hi, I recently disabled cron jobs and heartbeat on WordPress to limit CPU usage on my server. I noticed now my lightning payments are going through on BTC Pay Server but stay pending within Woocommerece. It seems the communication that payment was successful is missing. Do you think it’s related to cron jobs or heartbeat, or could it be another issue?
]]>