The website encountered an unexpected error. Please try again later.

Created on 13 November 2022, about 2 years ago
Updated 5 April 2023, over 1 year ago

I got the error on the page after I click the "pay and complete purchase " button on the review page.

The website encountered an unexpected error. Please try again later.

Stripe\Exception\UnexpectedValueException: Could not determine which URL to request: Stripe\PaymentIntent instance has invalid ID: in Stripe\ApiResource::resourceUrl() (line 106 of /home/aaa/public_html/vendor/stripe/stripe-php/lib/ApiResource.php).

Stripe\ApiResource->instanceUrl() (Line: 56)
Stripe\ApiResource->refresh() (Line: 26)
Stripe\PaymentIntent::retrieve(NULL) (Line: 220)
Drupal\commerce_stripe\Plugin\Commerce\PaymentGateway\Stripe->createPayment(Object, 1) (Line: 179)
Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentProcess->buildPaneForm(Array, Object, Array) (Line: 546)
Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm(Array, Object, 'payment')
call_user_func_array(Array, Array) (Line: 531)
Drupal\Core\Form\FormBuilder->retrieveForm('commerce_checkout_flow_multistep_default', Object) (Line: 278)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 219)
Drupal\Core\Form\FormBuilder->getForm(Object, 'payment') (Line: 143)
Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ› Bug report
Status

Closed: works as designed

Component

Stripe Checkout

Created by

πŸ‡¬πŸ‡§United Kingdom freelylw

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    Here is a step by step report on how to reproduce this bug on a new install.

    1. Install commerce stripe with composer (composer did not install the stripe library)
    2. Download stripe library and place it in the libraries/stripe-php folder

    3. Create a stripe payment method
    Add test keys
    Deselect - Collect billing information


    4. Purchase a product and select Stripe payment method

    Add test card details

    5. Review payment

    6. Click on pay and proceed

    The website encountered an unexpected error. Please try again later.

    The error logs

    Type 	commerce_order
    User 	Anonymous (not verified)
    Location 	/checkout/6/payment
    Referrer 	/checkout/6/review
    Message 	InvalidArgumentException: The URI '' is invalid. You must use a valid URI scheme. in Drupal\Core\Url::fromUri() (line 293 of C:\wamp64\www\lovevolution\public_html\core\lib\Drupal\Core\Url.php).
    

    Second error

    Type 	php
    User 	Anonymous (not verified)
    Location 	/checkout/6/payment
    Referrer 	/checkout/6/review
    Message 	Drupal\Core\Entity\EntityStorageException: The URI '' is invalid. You must use a valid URI scheme. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of C:\wamp64\www\lovevolution\public_html\core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
    
  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    The issue was caused not by this module but by webform product module that adds a URI to the checkout process.

    It works as expected

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK
Production build 0.71.5 2024