laravel-shopify
laravel-shopify copied to clipboard
Usage Charge Bug
- Package Version: v17.1.1
- Laravel Version: v8.54
- PHP Version: v7.4
- Using a toolset (Vapor):
Failure Logs
Call to a member function getId() on null
{
"exception": {
"class": "Error",
"message": "Call to a member function getId() on null",
"code": 0,
"file": "/var/task/vendor/osiset/laravel-shopify/src/Traits/BillingController.php:112"
}
}
Also experiencing this issue.
As an aside, the wiki contains the following snippet:
$usageChargeRoute = route('billing.usage_charge', array_merge($charge, ['signature' => $signature]));
but I think it should pass $signature->toNative()
or else the signature (as an object) is not packed into the query parameters when building the route and causes an InvalidArgumentException (expecting a string) in Osiset\ShopifyApp\Objects\Values\Hmac::fromNative
vendor/funeralzone/valueobjects/src/Scalars/StringTrait.php:49
With this fixed, usageCharge in the BillingController trait uses $request->user()->getId()
but there is no user attached to the request, so fails with "Call to a member function getId() on null".
Not sure what is the right way to resolve this.
Osiset: 17.1 Laravel: 8.83.13 php: 8.0.20
@pengbo37877 @rajaneeshdwivedi - I've got a fix out for this now, so we should get it into the main branch soon enough.
Duplicate of #1044