- Issue created by @akramer603
- πΈπΎSyria hodba Dubai
You can set the amount as a token from the field that you need to set the value from. For this to work, you need to put the stripe payment field in a separate page. Otherwise, you need to using the webform hook_alter to trigger an ajax callback to update the amount value on the Stripe element.
- πΊπΈUnited States akramer603
I put the stripe payment option on a separate page.
I tried putting a token in the Amount field in the stripe payment options. I used [webform:element:donation_amount:title], this may not be correct but it is the field I want. Upon saving I got the error "The price amount or currency is not defined, please correct this and try again." When I test the form I get "Oops, something went wrong. Check your browser's developer console for more details." The developer console says there was an ajax error.Is there documentation or examples for setting this up? Thanks
- πΊπΈUnited States akramer603
I got it to pass the webform field for the transaction amount by using the correct token :)
This works: [webform_submission:values:donation_amount] (it does still product the error when saving the field but it does work)
I feel like there should be a way to get the contact fields for the billing information from form fields that are already filled out.
- πΊπΈUnited States imrodmartin
Hi,
I'm working on the same kind of project and I'm getting an error (not sure if it's the same)I have the Stripe Payment field on the 2nd page.
The field token I'm passing is from a computed twig field that combines two numbers from the 1st page. (confirm_amount)I've tried 2 things:
Just the one amount from the first page: [webform_submission:values:amount]
and the computed amount :[webform_submission:values:confirm_amount]both fail with the following error
TypeError: Drupal\stripe_webform_payment\Plugin\WebformElement\StripeWebformPayment::updateNestedValues(): Argument #3 ($paymentIntentId) must be of type string, null given, called in β±β±β±/modules/contrib/stripe_webform_payment/src/Plugin/WebformElement/StripeWebformPayment.php on line 233 in Drupal\stripe_webform_payment\Plugin\WebformElement\StripeWebformPayment->updateNestedValues() (line 478 of modules/contrib/stripe_webform_payment/src/Plugin/WebformElement/StripeWebformPayment.php).Also - I'm seeing the same behavior - whenever I save the form I get the error message when using Custom Payments:
Error message
Error fetching Stripe products: -any help would be so much appreciated. (I'll be happy to do a video on it on my channel once I get it working!)