laravel-shopify icon indicating copy to clipboard operation
laravel-shopify copied to clipboard

Usage Charge Bug

Open pengbo37877 opened this issue 2 years ago • 1 comments

  • 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"
  }
}

pengbo37877 avatar Jul 08 '22 18:07 pengbo37877

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

rajaneeshdwivedi avatar Jul 19 '22 14:07 rajaneeshdwivedi

@pengbo37877 @rajaneeshdwivedi - I've got a fix out for this now, so we should get it into the main branch soon enough.

Kyon147 avatar Sep 11 '22 11:09 Kyon147

Duplicate of #1044

Kyon147 avatar Sep 13 '22 14:09 Kyon147