commit 0581429a56f0907567b876c2b97b58cfdf34dd1e
parent d39b71f44e38cfcf9873034fd67096bd1370f025
Author: NicholasFarrow <nicholas.w.farrow@gmail.com>
Date: Fri, 22 Jan 2021 23:15:27 +1100
broken key variables in webhook
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gateways/woo_btcpyment.php b/gateways/woo_btcpyment.php
@@ -220,6 +220,7 @@ function btcpyment_init_gateway_class() {
* Webhook to confirm payment
*/
public function webhook() {
+ $order = wc_get_order( $_GET['id'] );
$headers = getallheaders();
// Get supplied signature
$signature = $headers['X-Signature'];
@@ -244,7 +245,6 @@ function btcpyment_init_gateway_class() {
if (hash_equals($signature, $valid_signature) and (abs($now - $_GET['time']) < 5)) {
header( 'HTTP/1.1 200 OK' );
// Complete order
- $order = wc_get_order( $_GET['id'] );
$order->payment_complete();
$order->reduce_order_stock();
update_option('webhook_debug', $_GET);