bitpay / bitpay-checkout-for-woocommerce

BitPay Checkout for WooCommerce
MIT License
14 stars 22 forks source link

Error creating invoice #84

Open shaunek-hero opened 3 months ago

shaunek-hero commented 3 months ago

Upon viewing the error.log files we see a few instances where the API call to create a new Bitpay invoice did not succeed. Unfortunately the transaction.log file has no information about the API call, all we have is the error. Here is the content from our error log file yesterday when a customer tried to place an order 3 times. The user emailed us and said he was redirected to our custom CMS page (https://www.herobullion.com/bitpay-error/).

=====================NEW BITPAY INVOICE===========================
BITPAY-INVOICE-CREATE: Failed to create invoice-> failed to serialize Invoice object : failed to retrieve HTTP response body : Syntax error
=================================================

======================NEW BITPAY INVOICE===========================
BITPAY-INVOICE-CREATE: Failed to create invoice-> failed to serialize Invoice object : failed to retrieve HTTP response body : Syntax error
=================================================

======================NEW BITPAY INVOICE===========================
BITPAY-INVOICE-CREATE: Failed to create invoice-> failed to serialize Invoice object : failed to retrieve HTTP response body : Syntax error
=================================================

This isn't much info to go on, but perhaps you guys have a suggestion on some additional logging I can add to help debug this issue if it happens again? This specific customer is asking how he can place another order.

p-maguire commented 2 months ago

@shaunek-hero The only time I've seen this specific error message when testing has been cases where a User was attempting to place an Order that was underneath the BitPay threshold for creating an Invoice ($1 USD). If you're sure the invoice amount is valid, and the key is correct, you could try adding logging to the $bitpay_invoice var before the point in the code where the invoice is actually generated, to see if there's anything not being set properly there. We'd be happy to take a look if you have any more information or additional steps to replicate the issue.