Skip to content

Commit

Permalink
V2.12.8: fixes checkout issues when users are creating accounts durin…
Browse files Browse the repository at this point in the history
…g checkout
  • Loading branch information
0xNe0x1 committed Nov 27, 2024
1 parent 78deac5 commit be5a8be
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*** DePay Web3 Payments for WooCommerce Changelog ***

2024-11-27 - version 2.12.8
* fixes checkout issues when users are creating accounts during checkout

2024-11-9 - version 2.12.7
* fix solflare handover + fix some solana rpcs

Expand Down
4 changes: 2 additions & 2 deletions depay-woocommerce-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* WC tested up to: 8.7.0
* Requires at least: 5.8
* Requires PHP: 7.0
* Version: 2.12.7
* Version: 2.12.8
*
* @package DePay\Payments
*/
Expand All @@ -21,7 +21,7 @@
define( 'DEPAY_WC_PLUGIN_FILE', __FILE__ );
define( 'DEPAY_WC_ABSPATH', __DIR__ . '/' );
define( 'DEPAY_MIN_WC_ADMIN_VERSION', '0.23.2' );
define( 'DEPAY_CURRENT_VERSION', '2.12.7' );
define( 'DEPAY_CURRENT_VERSION', '2.12.8' );

require_once DEPAY_WC_ABSPATH . '/vendor/autoload.php';

Expand Down
2 changes: 1 addition & 1 deletion dist/checkout.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion languages/depay-woocommerce-payments.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: DePay WooCommerce Payments 2.12.7\n"
"Project-Id-Version: DePay WooCommerce Payments 2.12.8\n"
"Report-Msgid-Bugs-To: "
"[email protected]\n"
"MIME-Version: 1.0\n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-woocommerce-depay-payments",
"moduleName": "WooCommerceDePayPayments",
"version": "2.12.7",
"version": "2.12.8",
"description": "WooCommerce DePay plugin to accept Web3 payments directly into your wallet with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: web3, payments, woocommerce, depay, cryptocurrency
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.2
Stable tag: 2.12.7
Stable tag: 2.12.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
9 changes: 8 additions & 1 deletion src/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ const displayCheckout = async()=>{
const checkoutId = window.location.hash.match(/wc-depay-checkout-(.*?)@/)[1]
const response = JSON.parse(await wp.apiRequest({
path: `/depay/wc/checkouts/${checkoutId}`,
method: 'POST'
method: 'POST',
headers: {
'X-WP-Nonce': wpApiSettings?.nonce, // Use WordPress's REST API nonce
},
}).catch((error)=>{
if(error?.responseJSON?.code === 'rest_cookie_invalid_nonce') {
window.location.reload(true)
}
}))
if(response.redirect) {
window.location = response.redirect
Expand Down

0 comments on commit be5a8be

Please sign in to comment.