Skip to content

Commit

Permalink
fix checkout uuid match
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Oct 4, 2022
1 parent 39b71d8 commit 0ff0821
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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 includes/class-depay-wc-payments-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function process_payment( $order_id ) {

return( [
'result' => 'success',
'redirect' => '#wc-depay-checkout-' . $checkout_id . '-' . time()
'redirect' => '#wc-depay-checkout-' . $checkout_id . '@' . time()
] );
} else {
$order->payment_complete();
Expand Down
2 changes: 1 addition & 1 deletion src/checkout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.addEventListener( 'hashchange', async()=> {
if ( window.location.hash.startsWith( '#wc-depay-checkout-' ) ) {
let checkoutId = window.location.hash.match(/wc-depay-checkout-(.*?)$/)[1]
let checkoutId = window.location.hash.match(/wc-depay-checkout-(.*?)@/)[1]
let accept = JSON.parse(await wp.apiRequest({ path: `/depay/wc/checkouts/${checkoutId}` }))
DePayWidgets.Payment({
accept,
Expand Down

0 comments on commit 0ff0821

Please sign in to comment.