PaymentIntentId must be of type string

Created on 18 August 2023, 11 months ago
Updated 4 October 2023, 9 months ago

Problem/Motivation

When adding Stripe Payment element to webform, settings are input using token values for Custom Amount and when element is saved it throws the error:

Error creating Stripe Payment intent: - 
Unable to render elements, please view the below message(s) and error log.
Drupal\stripe_webform_payment\Plugin\WebformElement\StripeWebformPayment::updateNestedValues():
Argument #3 ($paymentIntentId) must be of type string, null given, called in
/bitnami/drupal/modules/contrib/stripe_webform_payments/src/Plugin/WebformElements/StripeWebformPayment.php on line 233

THIS time I made sure I'm running updated versions of Stripe, Webform, and PHP8 on Drupal 9

Steps to reproduce

Install Stripe library, install Webform, install Stripe Webform Payments, insert element into webform. Use token as Custom Amount, attempt to save element

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jbarone716

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

Comments & Activities

  • Issue created by @jbarone716
  • ๐Ÿ‡ธ๐Ÿ‡พSyria hodba Dubai

    I tested the module again with a custom amount and token. The custom amount element tested against textfield and number webform elements and it worked fine for me.
    Can you export your webform and paste it here so I can test your use case?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jbarone716

    Certainly! I created a simple test webform just to make sure that I could get things running:

    stuff:
      '#type': textfield
      '#title': stuff
    price:
      '#type': number
      '#title': price
      '#min': 0
      '#required': true
    email:
      '#type': email
      '#title': email
    number_that_exists:
      '#type': computed_twig
      '#title': 'number that exists'
      '#template': '{{ 100.00 }}'
      '#whitespace': spaceless
      '#store': true
    value:
      '#type': value
      '#title': value
      '#value': '100.00'
    

    The other configs are quite long but I can provide them if necessary; they should be stock webform configs because I've done nothing but create the webform with the fields above. The different field types are for testing different ways of passing a number in case that was affecting my use case. All fail with the same error and won't let me save the Stripe Payment element.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shreya_98

    Shreya_th โ†’ made their first commit to this issueโ€™s fork.

  • @shreya_th opened merge request.
  • ๐Ÿ‡ธ๐Ÿ‡พSyria hodba Dubai

    Fixed and added to the latest dev branch.

  • ๐Ÿ‡ธ๐Ÿ‡พSyria hodba Dubai
  • ๐Ÿ‡ธ๐Ÿ‡พSyria hodba Dubai
  • Status changed to Fixed 9 months ago
  • ๐Ÿ‡ธ๐Ÿ‡พSyria hodba Dubai
Production build 0.69.0 2024