Skip to content

Uncaught BitPaySDK\Exceptions\InvoiceQueryException: BITPAY-INVOICE-GET: Failed to retrieve invoice #212

@doliveira-v

Description

@doliveira-v

Hi there, can someone please check why we're getting this error? the JSON returned is valid but the bug is still in place.

bitpay/sdk: 7.2.0
PHP: 8.1

<?php
require('/home/sites/myapp/my_initial_script.php');

                        $bitpay = BitPaySDK\Client::create()->withData(
                                BitPaySDK\Environment::Production,
                                BITPAY_KEY_PATH,
                                new BitPaySDK\Tokens(
                                        BITPAY_TOKEN
                                ),
                                BITPAY_KEY,
                                (MY_PROXY),
                        );
var_dump($bitpay->getInvoice('3fq...cropped...Np'));
[16-Feb-2023 09:40:58 America/New_York] PHP Fatal error:  Uncaught BitPaySDK\Exceptions\InvoiceQueryException: BITPAY-INVOICE-GET: Failed to retrieve invoice-> failed to deserialize BitPay server response (Invoice) : BITPAY-UTIL: Unexpected JsonMapper exception. -> JSON property "selectedWallet" in class "BitPaySDK\Model\Invoice\BuyerProvidedInfo" must not be NULL in /home/sites/myapp/v0.6/vendor/bitpay/sdk/src/BitPaySDK/Client.php:327
Stack trace:
#0 /home/user/bitpay.php(13): BitPaySDK\Client->getInvoice('3fqs...cropped...Np')
#1 {main}
  thrown in /home/sites/myapp/v0.6/vendor/bitpay/sdk/src/BitPaySDK/Client.php on line 327
[16-Feb-2023 09:40:58 America/New_York] PHP Warning (User): (argv:[0] => bitpay.php) bitpay.php:Uncaught BitPaySDK\Exceptions\InvoiceQueryException: BITPAY-INVOICE-GET: Failed to retrieve invoice-> failed to deserialize BitPay server response (Invoice) : BITPAY-UTIL: Unexpected JsonMapper exception. -> JSON property "selectedWallet" in class "BitPaySDK\Model\Invoice\BuyerProvidedInfo" must not be NULL in /home/sites/myapp/v0.6/vendor/bitpay/sdk/src/BitPaySDK/Client.php:327 Stack trace: #0 /home/user/bitpay.php(13): BitPaySDK\Client->getInvoice('3fqskL3FZcYkmpM...') #1 {main}   thrown /home/sites/myapp/v0.6/vendor/bitpay/sdk/src/BitPaySDK/Client.php:327  [] - line 625 in /home/sites/myapp/v0.6/classes/Logger.php -  in /home/sites/myapp/v0.6/classes/Logger.php on line 625
[16-Feb-2023 09:40:58 America/New_York] PHP Stack trace:
[16-Feb-2023 09:40:58 America/New_York] PHP   0. handleError() :0
[16-Feb-2023 09:40:58 America/New_York] PHP   1. trigger_error() /home/sites/myapp/v0.6/classes/Logger.php:625
[16-Feb-2023 09:40:58 America/New_York] PHP   2. trigger_error() /home/sites/myapp/v0.6/classes/Logger.php:364
[16-Feb-2023 09:40:58 America/New_York] PHP   3. log() /home/sites/myapp/v0.6/include/exception_handler.php:155
[16-Feb-2023 09:40:58 America/New_York] PHP   4. catchFatalError() :0
{
    "url": "https://bitpay.com/invoice?id=3fqskL3 ...cropped... Np",
    "status": "expired",
    "price": 500,
    "currency": "USD",
    "itemDesc": "$500 account credit for total...cropped...gmail.com (NO REFUNDS)",
    "orderId": "...cropped...",
    "invoiceTime": 1676058827981,
    "rateRefreshTime": 1676058827981,
    "expirationTime": 1676059727981,
    "currentTime": 1676558726734,
    "guid": "90349e...cropped...2d0d35607a3",
    "id": "3fq...cropped...Np",
    "lowFeeDetected": false,
    "amountPaid": 0,
    "displayAmountPaid": "0",
    "exceptionStatus": false,
    "targetConfirmations": 6,
    "guaranteedPaymentTargetConfirmations": 6,
    "guaranteedPayment": false,
    "transactions": [],
    "transactionSpeed": "medium",
    "buyer": [],
    "redirectURL": "https:/...cropped...lling/",
    "refundAddresses": [],
    "refundAddressRequestPending": false,
    "buyerProvidedEmail": "tota...cropped...ail.com",
    "buyerProvidedInfo": {
        "selectedWallet": null,
        "layer": null,
        "emailAddress": "tot...cropped...ail.com"
    },
    "paymentSubtotals": {
        "BTC": 2319700,
        "BCH": 393229600,
        "ETH": 329117000000000000,
        "GUSD": 50000,
        "PAX": 5e+20,
        "BUSD": 5e+20,
        "USDC": 500000000,
        "DOGE": 613363320700,
        "LTC": 537860000
    },
    "paymentTotals": {
        "BTC": 2322900,
        "BCH": 393229600,
        "ETH": 329117000000000000,
        "GUSD": 50000,
        "PAX": 5e+20,
        "BUSD": 5e+20,
        "USDC": 500000000,
        "DOGE": 613465576100,
        "LTC": 537860000
    },
    "paymentDisplayTotals": {
        "BTC": "0.023229",
        "BCH": "3.932296",
        "ETH": "0.329117",
        "GUSD": "500.00",
        "PAX": "500.00",
        "BUSD": "500.00",
        "USDC": "500.00",
        "DOGE": "6134.655761",
        "LTC": "5.378600"
    },
    "paymentDisplaySubTotals": {
        "BTC": "0.023197",
        "BCH": "3.932296",
        "ETH": "0.329117",
        "GUSD": "500.00",
        "PAX": "500.00",
        "BUSD": "500.00",
        "USDC": "500.00",
        "DOGE": "6133.633207",
        "LTC": "5.378600"
    },
    "exchangeRates": {
        "BTC": {
            "USD": 21554.972999999998,
            "BCH": 167.758443733922,
            "ETH": 14.046262470920194,
            "GUSD": 21554.972999999998,
            "PAX": 21554.972999999998,
            "BUSD": 21554.972999999998,
            "USDC": 21554.972999999998,
            "DOGE": 260792.8922447085,
            "LTC": 229.47911210475885
        },
        "BCH": {
            "USD": 127.15218476142283,
            "BTC": 0.005839800001602335,
            "ETH": 0.08285851067019612,
            "GUSD": 127.15218476142283,
            "PAX": 127.15218476142283,
            "BUSD": 127.15218476142283,
            "USDC": 127.15218476142283,
            "DOGE": 1538.4099033968216,
            "LTC": 1.3536908622396482
        },
        "ETH": {
            "USD": 1519.2143999999996,
            "BTC": 0.06977393496094773,
            "BCH": 11.823770015493132,
            "GUSD": 1519.2143999999996,
            "PAX": 1519.2143999999996,
            "BUSD": 1519.2143999999996,
            "USDC": 1519.2143999999996,
            "DOGE": 18380.92385064966,
            "LTC": 16.1738997125519
        },
        "GUSD": {
            "USD": 1,
            "BTC": 4.5927641918709915e-05,
            "BCH": 0.007782818551149288,
            "ETH": 0.0006516483444873809,
            "PAX": 1,
            "BUSD": 1,
            "USDC": 1,
            "DOGE": 12.098966314859615,
            "LTC": 0.010646225912913872
        },
        "PAX": {
            "USD": 1,
            "BTC": 4.5927641918709915e-05,
            "BCH": 0.007782818551149288,
            "ETH": 0.0006516483444873809,
            "GUSD": 1,
            "BUSD": 1,
            "USDC": 1,
            "DOGE": 12.098966314859615,
            "LTC": 0.010646225912913872
        },
        "BUSD": {
            "USD": 1,
            "BTC": 4.5927641918709915e-05,
            "BCH": 0.007782818551149288,
            "ETH": 0.0006516483444873809,
            "GUSD": 1,
            "PAX": 1,
            "USDC": 1,
            "DOGE": 12.098966314859615,
            "LTC": 0.010646225912913872
        },
        "USDC": {
            "USD": 1,
            "BTC": 4.5927641918709915e-05,
            "BCH": 0.007782818551149288,
            "ETH": 0.0006516483444873809,
            "GUSD": 1,
            "PAX": 1,
            "BUSD": 1,
            "DOGE": 12.098966314859615,
            "LTC": 0.010646225912913872
        },
        "DOGE": {
            "USD": 0.08151775352169041,
            "BTC": 3.743918137610637e-06,
            "BCH": 0.0006344377619882504,
            "ETH": 5.3120908962502596e-05,
            "GUSD": 0.08151775352169041,
            "PAX": 0.08151775352169041,
            "BUSD": 0.08151775352169041,
            "USDC": 0.08151775352169041,
            "LTC": 0.0008678562867939782
        },
        "LTC": {
            "USD": 92.96099999999998,
            "BTC": 0.0042694795204051925,
            "BCH": 0.7234985953333889,
            "ETH": 0.06057788175189141,
            "GUSD": 92.96099999999998,
            "PAX": 92.96099999999998,
            "BUSD": 92.96099999999998,
            "USDC": 92.96099999999998,
            "DOGE": 1124.7320075956645
        }
    },
    "minerFees": {
        "BTC": {
            "satoshisPerByte": 22.054,
            "totalFee": 3200,
            "fiatAmount": 0.69
        },
        "BCH": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "ETH": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "GUSD": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "PAX": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "BUSD": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "USDC": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        },
        "DOGE": {
            "satoshisPerByte": 695615.14,
            "totalFee": 102255400,
            "fiatAmount": 0.08
        },
        "LTC": {
            "satoshisPerByte": 0,
            "totalFee": 0,
            "fiatAmount": 0
        }
    },
    "shopper": [],
    "jsonPayProRequired": false,
    "merchantName": "...cropped...LLC",
    "bitpayIdRequired": false,
    "itemizedDetails": [
        []
    ],
    "shopify": [],
    "supportedTransactionCurrencies": {
        "BTC": {
            "enabled": true
        },
        "BCH": {
            "enabled": true
        },
        "ETH": {
            "enabled": true
        },
        "GUSD": {
            "enabled": true
        },
        "PAX": {
            "enabled": true
        },
        "BUSD": {
            "enabled": true
        },
        "USDC": {
            "enabled": true
        },
        "XRP": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "DOGE": {
            "enabled": true
        },
        "DAI": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "WBTC": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "LTC": {
            "enabled": true
        },
        "SHIB": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "APE": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "EUROC": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "MATIC": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "ETH_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "MATIC_e": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "USDC_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "BUSD_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "DAI_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "WBTC_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "SHIB_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "USDT": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        },
        "USDT_m": {
            "enabled": false,
            "reason": "merchantDisabledByParam"
        }
    },
    "paymentCodes": {
        "BTC": {
            "BIP72b": "bitcoin:?r=https://bitpay.com/i/3f...cropped...Np",
            "BIP73": "https://bitpay.com/i/3fq...cropped...Np"
        },
        "BCH": {
            "BIP72b": "bitcoincash:?r=https://bitpay.com/i/3fq...cropped...Np",
            "BIP73": "https://bitpay.com/i/3fqs...cropped...Np"
        },
        "ETH": {
            "EIP681": "ethereum:?r=https://bitpay.com/i/3f...cropped...Np"
        },
        "GUSD": {
            "EIP681b": "ethereum:?r=https://bitpay.com/i/3fq...cropped...Np"
        },
        "PAX": {
            "EIP681b": "ethereum:?r=https://bitpay.com/i/3fq...cropped...Np"
        },
        "BUSD": {
            "EIP681b": "ethereum:?r=https://bitpay.com/i/3f...cropped...Np"
        },
        "USDC": {
            "EIP681b": "ethereum:?r=https://bitpay.com/i/3f...cropped...Np"
        },
        "DOGE": {
            "BIP72b": "dogecoin:?r=https://bitpay.com/i/3fq...cropped...Np",
            "BIP73": "https://bitpay.com/i/3f...cropped...Np"
        },
        "LTC": {
            "BIP72b": "litecoin:?r=https://bitpay.com/i/3fq...cropped...Np",
            "BIP73": "https://bitpay.com/i/3fq...cropped...Np"
        }
    },
    "universalCodes": {
        "paymentString": "https://link.bitpay.com/i/3fq...cropped...Np"
    },
    "token": "3yjmDksP81m7S...cropped...tsGF3ay8NP86Wa"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions