From 3ba3277e91fd97ce3ee1193c14eb6a2e5e47c03a Mon Sep 17 00:00:00 2001 From: Patrick Maguire <33061385+p-maguire@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:18:19 -0400 Subject: [PATCH 1/2] SP-894 Clear Cart after Invoice creation --- BitPayLib/class-bitpayinvoicecreate.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BitPayLib/class-bitpayinvoicecreate.php b/BitPayLib/class-bitpayinvoicecreate.php index 943a7b5..f0ff646 100644 --- a/BitPayLib/class-bitpayinvoicecreate.php +++ b/BitPayLib/class-bitpayinvoicecreate.php @@ -72,6 +72,8 @@ public function execute(): void { $bitpay_invoice = $this->client_factory->create()->createInvoice( $bitpay_invoice, Facade::POS, false ); + WC()->cart->empty_cart(); + $this->bitpay_logger->execute( $bitpay_invoice->toArray(), 'NEW BITPAY INVOICE', true ); $invoice_id = $bitpay_invoice->getId(); From 8f7193f90ad03c55e4bd34a6c93980ccc16934fc Mon Sep 17 00:00:00 2001 From: Patrick