coinbase / coinbase-commerce-woocommerce Goto Github PK
View Code? Open in Web Editor NEWAccept Bitcoin on your WooCommerce-powered website.
Home Page: https://commerce.coinbase.com/integrate/woocommerce
License: Apache License 2.0
Accept Bitcoin on your WooCommerce-powered website.
Home Page: https://commerce.coinbase.com/integrate/woocommerce
License: Apache License 2.0
Hi there,
Should orders that are in 'Pending Payment' for longer than X (??) minutes automatically be marked as Failed? Or do they stay in Pending Payment until manually cancelled?
Thanks,
Plugin doesn't work on multi sites. Support would be great.
Can you implement High Performance Order Storage Support?
Logs as shown below, extracted from uploads/wc-logs/coinbase-xxxx.log. I checked CoinBase, status is COMPLETED, but WooCommerec Orders do not get updated automatically. This is my first transaction with CoinBase, I didn't add any [Checkouts], don't think that is needed right?
Temporary Solution: I had to manually check CoinBase, then change the status to 'Completed' for my customers.
2021-06-24T17:54:30+00:00 INFO Webhook received event: Array
(
[attempt_number] => 1
[event] => Array
(
[api_version] => 2018-03-22
[created_at] => 2021-06-24T17:54:29Z
[data] => Array
(
[id] => 1e47f73a-88b0-48db-a656-acfa79072c45
[code] => D546AV9X
[name] => Website Name
[pricing] => Array
(
[usdc] => Array
(
[amount] => 15.000000
[currency] => USDC
)
[local] => Array
(
[amount] => 15.00
[currency] => USD
)
[bitcoin] => Array
(
[amount] => 0.00043072
[currency] => BTC
)
[ethereum] => Array
(
[amount] => 0.007426000
[currency] => ETH
)
[litecoin] => Array
(
[amount] => 0.11006751
[currency] => LTC
)
)
[logo_url] => https://res.cloudinary.com/commerce/image/upload/v1624548069/image.jpg
[metadata] => Array
(
[source] => woocommerce
[order_id] => 400
[order_key] => wc_order_f2t3lBd711t1a
)
[payments] => Array
(
[0] => Array
(
[block] => Array
(
[hash] => 223944369a74fbd4388c0b48fef0030d76c4b9420e395ed2022c692101753b7a
[height] => 2075275
[confirmations] => 1
[confirmations_required] => 2
)
[value] => Array
(
[local] => Array
(
[amount] => 15.00
[currency] => USD
)
[crypto] => Array
(
[amount] => 0.11006751
[currency] => LTC
)
)
[status] => CONFIRMED
[network] => litecoin
[detected_at] => 2021-06-24T17:49:14Z
[transaction_id] => e4d30b09d54d2a8af46e2e03b3c0d97c7f08ac08bae3358d10ae7ff12098b8ee
)
)
[resource] => charge
[timeline] => Array
(
[0] => Array
(
[time] => 2021-06-24T17:43:43Z
[status] => NEW
)
[1] => Array
(
[time] => 2021-06-24T17:49:15Z
[status] => PENDING
[payment] => Array
(
[value] => Array
(
[amount] => 0.11006751
[currency] => LTC
)
[network] => litecoin
[transaction_id] => e4d30b09d54d2a8af46e2e03b3c0d97c7f08ac08bae3358d10ae7ff12098b8ee
)
)
[2] => Array
(
[time] => 2021-06-24T17:54:29Z
[status] => COMPLETED
[payment] => Array
(
[value] => Array
(
[amount] => 0.11006751
[currency] => LTC
)
[network] => litecoin
[transaction_id] => e4d30b09d54d2a8af46e2e03b3c0d97c7f08ac08bae3358d10ae7ff12098b8ee
)
)
)
[addresses] => Array
(
[usdc] => 0x2e66f71158d2cbeb48a15dfa3279947161aef15a
[bitcoin] => 3GomyAfHb5HgAyXegqhvG3kc5LpsaVFg5S
[ethereum] => 0x2e66f71158d2cbeb48a15dfa3279947161aef15a
[litecoin] => MFxPBPZFyoXJFPfxcsCuthBPCdRmN4x54L
)
[cancel_url] => https://www.mywebsite.com/cart/?cancel_order=true&order=wc_order_f2t3lBd711t1a&order_id=400&redirect&_wpnonce=469a9d0b24
[created_at] => 2021-06-24T17:43:43Z
[expires_at] => 2021-06-24T18:43:43Z
[hosted_url] => https://commerce.coinbase.com/charges/D546AV9X
[description] => 1 x Testing
[confirmed_at] => 2021-06-24T17:54:29Z
[pricing_type] => fixed_price
[redirect_url] => https://www.mywebsite.com/checkout/order-received/400/?key=wc_order_f2t3lBd711t1a
[support_email] => [email protected]
[brand_logo_url] => https://res.cloudinary.com/commerce/image/upload/v1624548069/image.jpg
[exchange_rates] => Array
(
[BTC-USD] => 34825.1
[ETH-USD] => 2019.795
[LTC-USD] => 136.28
[USDC-USD] => 1.0
)
[payment_threshold] => Array
(
[overpayment_absolute_threshold] => Array
(
[amount] => 5.00
[currency] => USD
)
[overpayment_relative_threshold] => 0.005
[underpayment_absolute_threshold] => Array
(
[amount] => 5.00
[currency] => USD
)
[underpayment_relative_threshold] => 0.005
)
[third_party_provider] => woocommerce
)
[id] => 50d9f7fe-ef92-48bc-a495-26dd99e14f07
[resource] => event
[type] => charge:confirmed
)
[id] => ad1fbd8d-2914-4052-bb6b-c5176ee75c79
[scheduled_for] => 2021-06-24T17:54:29Z
)
The version 1.1.1 that you have put, I was already using it downloaded from
https://github.com/coinbase/coinbase-commerce-woocommerce
is a project of many months ago, and always finds many problems with the
latest version of wordpress.
always error:
2019-04-27T00:00:25+00:00 CRITICAL Uncaught Error: Call to a member
function get_meta() on boolean in
/home/wp_pc9bcp/iclunlock.com/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php:346
Stack trace:
#0 /home/wp_pc9bcp/iclunlock.com/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php(299):
WC_Gateway_Coinbase->_update_order_status(false, Array)
#1 /home/wp_pc9bcp/iclunlock.com/wp-includes/class-wp-hook.php(286):
WC_Gateway_Coinbase->handle_webhook('')
#2 /home/wp_pc9bcp/iclunlock.com/wp-includes/class-wp-hook.php(310):
WP_Hook->apply_filters('', Array)
#3 /home/wp_pc9bcp/iclunlock.com/wp-includes/plugin.php(465):
WP_Hook->do_action(Array)
#4 /home/wp_pc9bcp/iclunlock.com/wp-content/plugins/woocommerce/includes/class-wc-api.php(113):
do_action('woocommerce_api...')
#5 /home/wp_pc9bcp/iclunlock.com/wp-includes/class-wp-hook.php(286):
WC_API->handle_api_requests(Object(WP))
#6 /home/wp_pc9bcp/iclunlock.com/wp-includes/class-wp-hook.php(310):
WP_Hook->apply_filters(NULL, Array)
#7 /home/wp_pc9bcp/iclunlock.com/wp-inc in
/home/wp_pc9bcp/iclunlock.com/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php
on line 346
The following supported coins don't have icons that can appear on the checkout page:
ApeCoin
Dai
Dogecoin
SHIBA INU
Tether
Can we please get these added?
This plugin has SQL injection and malicious code it doesn't work on wordpress.
Orders seem to cancel after the payment has been taken and then I have to go into woocommerce and manually complete the order. Due to the nature of the business and the system issuing a ticket number upon payment the system needs to auto turn the order to complete.
Any ideas?
Thanks
Proceed to Pay Button Missing
No idea what is causing this. Could it be my version of wordpress is newer, that is causing the problem?
Anyone has a solution? You can take a look at EatWorklive.Love and try it out. Appreciate if anyone has a solution to this.
For every visitor there is a galaxy of errors...
[Sun Nov 14 15:48:41.186353 2021] [php7:warn] [pid 12507] [client 151.19.36.63:20033] PHP Warning: rmdir(/var/www/html/wp-content/cache/wpo-cache/www.visura.uno): Directory not empty in /var/www/html/wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 879, referer: https://www.visura.uno/wp-admin/admin.php?page=wpo_cache
[Sun Nov 14 15:48:41.186651 2021] [php7:warn] [pid 12507] [client 151.19.36.63:20033] PHP Warning: rmdir(/var/www/html/wp-content/cache/wpo-cache): Directory not empty in /var/www/html/wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 879, referer: https://www.visura.uno/wp-admin/admin.php?page=wpo_cache
[Sun Nov 14 16:39:55.513776 2021] [php7:error] [pid 13040] [client 54.175.255.218:34679] PHP Fatal error: Uncaught Error: Call to a member function get_meta() on bool in /var/www/html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php:346\nStack trace:\n#0 /var/www/html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php(299): WC_Gateway_Coinbase->_update_order_status()\n#1 /var/www/html/wp-includes/class-wp-hook.php(303): WC_Gateway_Coinbase->handle_webhook()\n#2 /var/www/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()\n#3 /var/www/html/wp-inc
PHP Fatal error: Uncaught Error: Call to a member function get_meta() on bool in wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php:346
Stack trace:
#0 wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php(299): WC_Gateway_Coinbase->_update_order_status(false, Array)
#1 wp-includes/class-wp-hook.php(292): WC_Gateway_Coinbase->handle_webhook('')
#2 wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array)
#3 wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#4 wp-content/plugins/woocommerce/includes/class-wc-api.php(161): do_action('woocommerce_api...')
#5 wp-includes/class-wp-hook.php(292): WC_API->handle_api_requests(Object(WP))
#6 wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
#7 wp-includes/plugin.php(551): WP_Hook in wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php on line 346
Payment doesn't show up in wp 5.8
l put all settings but the checkout page the other payment method show up but not coinbase
An option to disable the logos on checkout would be preferable
After successful payment, subscription remains in status pending
. While other payment systems switching status to active
.
Please add support for Woocommere Blocks Checkout. TY
POST https://api.commerce.coinbase.com/charges HTTP/1.1
Host: api.commerce.coinbase.com
User-Agent: coinbase-http-client
Content-Length: 128
Content-Type: applicaton/json
X-Cc-Api-Key: 2226376d-53a4-484a-a838-99f960a6a432
X-Cc-Version: 2018-03-22
Accept-Encoding: gzip
{"name":"Test Charge","description":"Test Charge","pricing_type":"fixed_price","local_price":{"amount":"5.00","currency":"USD"}}
HTTP/1.1 400 Bad Request
Date: Fri, 23 Apr 2021 12:38:10 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 89
Connection: keep-alive
Set-Cookie: __cfduid=d5f077d3f3511407e9e76f02c6bb67b8d1619181490; expires=Sun, 23-May-21 12:38:10 GMT; path=/; domain=.commerce.coinbase.com; HttpOnly; SameSite=Lax
Cache-Control: no-cache
Vary: Cookie, Origin
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Request-Id: 0e9650a7-28a1-414c-8bcb-cca572bd228b
CF-Cache-Status: DYNAMIC
cf-request-id: 09a055e9a20000615f568dd000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 644725bc3b3c615f-ORD
{"error":{"type":"invalid_request","message":"Required parameter missing: pricing_type"}}
Recently, the WooCommerce statuses stopped updating from Pending Payment to Processing after the payment has cleared and we are having to go in and manually check the payments and change their status to Processing.
On our install, once the order gets to the "Processing" status, it automatically sends shipping info to ShipStation and then ShipStation changes the status to "Complete" once the order has shipped.
It's always been like this, but recently just stopped working.
Here is a recent log from the debug logs:
2021-04-14T10:52:00+00:00 INFO Coinbase Request Args for charges: Array
(
[name] => My Store
[description] => 1 x My Product
[pricing_type] => fixed_price
[local_price] => Array
(
[amount] => 52.99
[currency] => USD
)
[metadata] => Array
(
[order_id] => 246883
[order_key] => wc_order_8X5ZWKk9odPiZ
[source] => woocommerce
)
[redirect_url] => https://mywebsite.com/checkout/order-received/246883/?key=wc_order_4z5ZqKk9idPiZ&utm_nooverride=1
[cancel_url] => https://mywebsite.com/cart/?cancel_order=true&order=wc_order_4z5ZqKk9idPiZ&order_id=246883&redirect&_wpnonce=631c4c0c4c
)
I found out that there is a PHP notice problem:
To fix this I checked into the coinbase-commerce.php and found there 2 references to "payment_method".
/**
* Add order Coinbase meta after General and before Billing
*
* @see: https://rudrastyh.com/woocommerce/customize-order-details.html
*
* @param WC_Order $order WC order instance
*/
function cb_order_meta_general( $order )
{
if ($order->payment_method == 'coinbase') {
?>
<br class="clear"/>
<h3>Coinbase Commerce Data</h3>
<div class="">
<p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p>
</div>
<?php
}
}
/**
* Add Coinbase meta to WC emails
*
* @see https://docs.woocommerce.com/document/add-a-custom-field-in-an-order-to-the-emails/
*
* @param array $fields indexed list of existing additional fields.
* @param bool $sent_to_admin If should sent to admin.
* @param WC_Order $order WC order instance
*
*/
function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
if ($order->payment_method == 'coinbase') {
$fields['coinbase_commerce_reference'] = array(
'label' => __( 'Coinbase Commerce Reference #' ),
'value' => $order->get_meta( '_coinbase_charge_id' ),
);
}
return $fields;
}
there i changed:
this:
if ($order->payment_method == 'coinbase') {
to:
if ($order->get_payment_method() == 'coinbase') {
and
this:
function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
if ($order->payment_method == 'coinbase') {
to:
function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
if ($order->get_payment_method() == 'coinbase') {
This will fix the PHP notice problem.
After successful payment via Coinbase few days ago, my Woocommerce store is still showing "Blockchain Pending" status.
Does it get auto updated or do i need to do something and what is the turnaround time for status update?
Thanks.
I'm seeing some errors when the webhook is called, seemingly the order_id
is invalid.
$order_id = $event_data['metadata']['order_id'];
$this->_update_order_status( wc_get_order( $order_id ), $event_data['timeline'] );
wc_get_order( $order_id )
is returning false
.
The full log:
PHP Fatal error: Uncaught Error: Call to a member function get_meta() on boolean in /home/user/public_html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php:346
Stack trace:
#0 /home/user/public_html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php(299): WC_Gateway_Coinbase->_update_order_status(false, Array)
#1 /home/user/public_html/wp-includes/class-wp-hook.php(288): WC_Gateway_Coinbase->handle_webhook('')
#2 /home/user/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)
#3 /home/user/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#4 /home/user/public_html/wp-content/plugins/woocommerce/includes/class-wc-api.php(148): do_action('woocommerce_api...')
#5 /home/user/public_html/wp-includes/class-wp-hook.php(288): WC_API->handle_api_requests(Object(WP))
#6 /home/user/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)
#7 /home/user/public_html/wp-includes/plugin.php(544): WP_H in /home/user/public_html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php on line 346
Using Coinbase Commerce v1.1.4 and WooCommerce 5.3.0, I am having an issue where the loading (jQuery/WooCommerce Block Overlay) is not going away for the shop table and payment section. This issue only happens (screenshot below) when using the WooCommerce single page checkout. Shown in this screenshot:
Specifically, the two components are the shop_table woocommerce-checkout-review-order-table
and woocommerce-checkout-payment
sections.
It sounds like this is similar to what was posted in https://wordpress.org/support/topic/doesnt-work-with-woocommere-blocks-checkout/
This may be tied to issue #7, but I haven't received a notification from my website that I've received a new order. I've confirmed that I'm receiving this email with other payment methods.
Thanks,
It seems a required API parameter is missing for pricing_type. The error log gives the following "Required parameter missing: pricing_type"
How to reproduce:
-> Attempt to pay via Coinbase
-> Go back and pay via another payment method
-> Order transitions to "Processing"
-> After the given delay, plugin will expire the order and set it to "Cancelled"
-> Customer will not receive goods/services that were paid for
I am interested in accepting Coinbase Commerce in our website. I run a multi-vendor website based on woo-commerce. It is not a multi-site.
I would like to offer our vendors the ability to accept coinbase payments without being a middleman in the transaction.
Would this make sense from a technical standpoint?
If we did ask each vendor to supply an API key, could we simply use one central webhook secret or would that fail?
Can one server receive notifications for multiple accounts in this manner?
What are the security risks of storing API key and webhook secret for each vendor?
Is it already possible to override the API key and webhook secret with your plugin? If not, would you be willing to provide actions that we can hook into?
Thanks in advance for your help and clarification!!
If two woocommerce website use same account. coinbase server will post same result to all webs' webhook.
if two web's woocommerce order is euqal,handle_webhook will not check this order whether or not belong to this system.
Another way is add a new meta like: host url,app name ...etc.
2023-11-18T12:24:34+00:00 CRITICAL Uncaught Error: Call to a member function get_meta() on bool in public_html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php:382
Stack trace:
#0 /public_html/wp-content/plugins/coinbase-commerce/class-wc-gateway-coinbase.php(332): WC_Gateway_Coinbase->_update_order_status(false, Array)
#1 /public_html/wp-includes/class-wp-hook.php(324): WC_Gateway_Coinbase->handle_webhook('')
#2 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#3 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#4 /public_html/wp-content/plugins/woocommerce/includes/class-wc-api.php(161): do_action('woocommerce_api...')
#5 /public_html/wp-includes/class-wp-hook.php(324): WC_API->handle_api_requests(Object(WP))
#6 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#7 /public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#8 /public_html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)
#9 /public_html/wp-includes/class-wp.php(813): WP->parse_request('')
#10 /public_html/wp-includes/functions.php(1336): WP->main('')
#11 /public_html/wp-blog-header.php(16): wp()
#12 /public_html/index.php(17): require('/home/egycar5/p...')
#13 {main}
this report from Woocommerce log.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.