diff --git a/src/class-wc-gateway-bitpay.php b/src/class-wc-gateway-bitpay.php index 10b7d11..21ba781 100644 --- a/src/class-wc-gateway-bitpay.php +++ b/src/class-wc-gateway-bitpay.php @@ -719,12 +719,16 @@ public function process_payment($order_id) ); } + $responseData = json_decode($client->getResponse()->getBody()); + update_post_meta($order_id, 'BTCPay_redirect', $invoice->getUrl()); update_post_meta($order_id, 'BTCPay_id', $invoice->getId()); update_post_meta($order_id, 'BTCPay_rate', $invoice->getRate()); $formattedRate = number_format($invoice->getRate(), wc_get_price_decimals(), wc_get_price_decimal_separator(), wc_get_price_thousand_separator()); update_post_meta($order_id, 'BTCPay_formatted_rate', $formattedRate); + $this->update_btcpay($order_id, $responseData); + // Reduce stock levels //$order->reduce_order_stock(); wc_reduce_stock_levels($order_id);