craftcms/commerce-stripe

Getting unknown property: craft\elements\User::user error when Stripe return_url loads

Opened this issue · 0 comments

Description

After completing a payment successfully, the Stripe API sends back a return_url which loads with the error Getting unknown property: craft\elements\User::user.

I then reload this URL and the page is redirected to the desired 'Order complete' page that I have defined in the payment form, which loads without error.

Any ideas why this initial response from the API would return this error?

Steps to reproduce

  1. Place order with the test card number 4242424242424242
  2. Stripe webhook records successful payment
  3. Stripe API returns URL. Example url: https://craft.website:8890/index.php?p=actions%2Fcommerce%2Fpayments%2Fcomplete-payment&commerceTransactionHash=9e6c4da4a6a1a92b9bb394baf47e6433&commerceTransactionId=pi_3NxUT8IwL7wdg7ui22PhozQh&payment_intent=pi_3NxUT8IwL7wdg7ui22PhozQh&payment_intent_client_secret=pi_3NxUT8IwL7wdg7ui22PhozQh_secret_xjw6yWb6atcyWLj1F4oR2HIJL&redirect_status=succeeded
  4. URL loads with error: Getting unknown property: craft\elements\User::user with reference to /vendor/yiisoft/yii2/base/Component.php at line 154
  5. Reload URL and successfully redirect to order complete page.

Additional info

  • Craft CMS version: Craft Pro 4.5.6.1
  • Craft Commerce version: 4.3.0
  • Stripe for Craft Commerce version: 4.0.1
  • PHP version: 8.2.0
  • Database driver & version: MySQL 5.7.39