«Call to a member function getStore() on null in vendor/mage2pro/core/Payment/Currency.php:69»

Hi,
I’ve installed test version (for dev environment) of Stripe Extension.

I’ve configured everything but i have an error on:
http://app-dev.farmakop.it/index.php/rest/V1/carts/mine/shipping-information

{
    "messages": {
        "error": [
            {
                "code": 500,
                "message": "Fatal Error: 'Uncaught Error: Call to a member function getStore() on null in /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Currency.php:69\nStack trace:\n#0 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(885): Df\\Payment\\Currency->oq(NULL)\n#1 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Core/lib/cache.php(215): Df\\Payment\\Method->Df\\Payment\\{closure}()\n#2 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(885): dfc(Object(Dfe\\Stripe\\Method), Object(Closure))\n#3 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(1843): Df\\Payment\\Method->cPayment()\n#4 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Core/lib/array.php(215): Df\\Payment\\Method->Df\\Payment\\{closure}(1, 'BIF,CLP,DJF,GNF...')\n#5 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(1844): df_find(Object(Closure), Array, Array, Array, -1)\n#6 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(246): Df\\Payment\\Method->amountFactor()\n#7 /var/www/app-dev.farmak' in '/var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Currency.php' on line 69",
                "trace": "Trace is not available."
            }
        ]
    }
}

Can you help me?

I attach curl details.

My environment is:
DEV:
www-dev.farmakop.it -> React frontend
app-dev.farmakop.it -> magento

PROD:
www.farmakon.it -> React frontend
app.farmakon.it -> magento

Thanks,
Jacopo

curl -X POST \
  http://app-dev.farmakop.it/index.php/rest/V1/carts/mine/shipping-information \
  -H 'Authorization: Bearer a48ab29d63a127948a9d3768ec7d421d:hd3uxo20uzc56i2jl70k41q5e1nljqjn' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 1838a221-669b-4fd8-8ae7-39f6112bc274' \
  -H 'cache-control: no-cache' \
  -d '{  "addressInformation": {
	  "shipping_address": {
       "region": "Toscana",
       "region_id": 43,
       "region_code": "PT",
       "country_id": "IT",
       "street": [
      "Via Castel de capecchi"
    ],
    "postcode": "51100",
    "city": "Purchase",
    "firstname": "Jane",
    "lastname": "Doe",
    "email": "jdoe@example.com",
    "telephone": "512-555-1111"
  },
  "billing_address": {
  	"region": "Toscana",
    "region_id": 43,
    "region_code": "PT",
    "country_id": "IT",
    "street": [
      "Via castel de capecchi"
    ],
    "postcode": "10577",
    "city": "Purchase",
    "firstname": "Jane",
    "lastname": "Doe",
    "email": "jdoe@example.com",
    "telephone": "512-555-1111"
  },
  "shipping_carrier_code": "freeshipping",
  "shipping_method_code": "freeshipping"
  }
}'```

I am unable to reproduce the issue and have successfully placed the 000000011 order now:

04

Hi,
but I use Magento in headless mode, from cURL there is this problem:

curl -X POST \
  http://app-dev.farmakop.it/index.php/rest/V1/carts/mine/shipping-information \
  -H 'Authorization: Bearer a48ab29d63a127948a9d3768ec7d421d:ln5o9nmdnsfnrdhfry27va5dzcx16r13' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 56b6b2e8-d92a-4f8e-8125-a2768725bd31' \
  -H 'cache-control: no-cache' \
  -d '{  "addressInformation": {
	  "shipping_address": {
       "region": "Toscana",
       "region_id": 43,
       "region_code": "PT",
       "country_id": "IT",
       "street": [
      "Via Castel de capecchi"
    ],
    "postcode": "51100",
    "city": "Purchase",
    "firstname": "Jane",
    "lastname": "Doe",
    "email": "jdoe@example.com",
    "telephone": "512-555-1111"
  },
  "billing_address": {
  	"region": "Toscana",
    "region_id": 43,
    "region_code": "PT",
    "country_id": "IT",
    "street": [
      "Via castel de capecchi"
    ],
    "postcode": "10577",
    "city": "Purchase",
    "firstname": "Jane",
    "lastname": "Doe",
    "email": "jdoe@example.com",
    "telephone": "512-555-1111"
  },
  "shipping_carrier_code": "freeshipping",
  "shipping_method_code": "freeshipping"
  }
}'

This response:

{
    "messages": {
        "error": [
            {
                "code": 500,
                "message": "Fatal Error: 'Uncaught Error: Call to a member function getStore() on null in /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Currency.php:69\nStack trace:\n#0 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(885): Df\\Payment\\Currency->oq(NULL)\n#1 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Core/lib/cache.php(215): Df\\Payment\\Method->Df\\Payment\\{closure}()\n#2 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(885): dfc(Object(Dfe\\Stripe\\Method), Object(Closure))\n#3 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(1843): Df\\Payment\\Method->cPayment()\n#4 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Core/lib/array.php(215): Df\\Payment\\Method->Df\\Payment\\{closure}(1, 'BIF,CLP,DJF,GNF...')\n#5 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(1844): df_find(Object(Closure), Array, Array, Array, -1)\n#6 /var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Method.php(246): Df\\Payment\\Method->amountFactor()\n#7 /var/www/app-dev.farmak' in '/var/www/app-dev.farmakop.it/vendor/mage2pro/core/Payment/Currency.php' on line 69",
                "trace": "Trace is not available."
            }
        ]
    }
}

How can I reproduce it myself?

You can reproduce with my cURL.
If token is expired you can get another one on www-dev.farmakop.it.

Do login with:
user: jacopo@keepup.pro
pass: prova1234!

On network inspection of Chrome you can see HTTP call and you can get the Authorization token with new valid one.

Thanks,
Jacopo

I have fixed it in the 4.0.1 version of the mage2pro/core package:

Your website is already updated:

02