#.abishek
1 messages ยท Page 1 of 1 (latest)
I have the following code
I am following the functionality from https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=payment#dynamic-updates
The page can be redirected if the payment method chosen is a redirect-based payment method
but I am using the card 4242 that wouldn't require a redirect
and the redirect should be to the bank page and not a refresh right?
I do get an the following error on console
Uncaught IntegrationError: We could not retrieve data from the specified Element.
Please make sure the Element you are attempting to use is still mounted.
Can you elaborate more what you meant by refreshes the page? I tried in my own integration and it doesn't refresh
ok, going to have to figure this out, but can I explain to you what I am doing, so you can tell me if there is a simpler way to do this
I have a product that has a Standard Pricing (One Time). A new user signs up, doesn't have a payment method yet. I am trying to use web elements to capture the payment method and make a payment for this product.
sure!
So what I have done is.
- Created a paymentElement and assigned the
mode:'paymentandamount:{{productPriceAmount}} - when they hit the
Paybutton
2a, I callelements.submit
2b, create a payment intent from javascript (you will see the lineLivewire.find, this does an ajax call to get the payment intent. Following is how I get the payment intent secret
a. creating an invoice and attaching an invoice line item with the above priceId
b. finalize the invoice and get thepayment_intent
2c, get this payment and pass that tostripe.confirmPayment
let me know if I am complicating it?
is there a simpler way to do this?
I am trying to follow the code from the above URL
I am trying to get the payment method and make a payment for the product in one go.
Am I right to understand that you would like to do following?
- Use Invoicing
- Make payment with Payment Element
Invoicing is not something I chose. the reason I am using invoicing is because to make a payment for a one-time pricing product, there isn't another way.
Creating a payment Intent doesn't take a price object
the only way is to create an invoice, finalize it and get the payment intent to make a payment against it
am I missing something?
Invoicing incurs additional fee: https://stripe.com/en-gb-us/pricing. I'd only suggest Invoicing when it is required.
If you wish to use one-time pricing product, I'd recommend using Checkout Session (Stripe hosted payment page): https://stripe.com/docs/checkout/quickstart
Payment Intent integration charges to the amount directly without prices to be created.
so, there is no way to make a one time payment to a product without checkout session?
paymentIntent accepts a subscription why not a price?
is there a way to indicate that a payment received using the paymentElement is for product or a price after the payment is received?
It can be done with Invoicing, but additional charges will incur. If you're fine with using Invoicing, the steps will be:
- Use Setup Intent to collect the payment method: https://stripe.com/docs/payments/save-and-reuse
- Set the saved payment method as
default_payment_methodwhen creating the Invoice: https://stripe.com/docs/api/invoices/create#create_invoice-default_payment_method
paymentIntent accepts a subscription why not a price?
The subscription will create a Payment Intent, not another way round
paymentElement is for product or a price after the payment is received?
You can set it in themetadatafield in the Payment Intent for your own reference: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ya, the meta data isn't going to work as the client wants to be able to generate reports against what products are being purchased..
so the payment really needs to happen for a product/price
the additional charges you mentioned is on top of the stripe fee?
In this case, Invoicing should work as suggested above
the additional charges you mentioned is on top of the stripe fee?
Yup!
ok
so the point of the price type "Customer Chooses amount" on "Standard Onetime pricing " is only for Checkouts not for web elements or API integrations
so, if I were to do it without invoice and use web elements, how do I do this?
One time pricing product is only supported in Checkout Session and Invoicing.
Payment Intent using Elements only support direct charging to the amount, but not with one time pricing product. I'm afraid it's not possible to have one time pricing product without Invoicing with Elements
ok, so I just use Payment Element and pass the amount for the price
is there docs for this?
You may refer to the doc here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
ok, let me try this. thank you
No problem! Happy to help ๐
one question though. if the web elements are loaded inside a modal would that affect the process in anyway?
it is just a div element loaded as a modal
If the payment requires 3DS, there will be another modal created. It should be fine to load in a modal, but the user experiences might not be great with multiple modals
It can be both depending on card issuer's 3DS support, but most of the issuers are on 3DS modal nowadays
ok
so on this step https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment the confirmParams has a return_url, if a card issuer uses 3DS modal, will the return_url still be used?
Nope. I'd recommend using with 3DS test cards here https://stripe.com/docs/testing#three-ds-cards to test the user experiences
is there a demo page for web elements where I can test these to see how I code this further?
Example code can be downloaded here and run it directly for the demo: https://stripe.com/docs/payments/quickstart
Thank you
No problem! Happy to help ๐
so, I followed the above code and I get this, but I don't see the checkbox at the bottom to save for link. I have the linkAuthenticationElement setup and the email field is binding correctly
does that work only for setupIntent?
What is the country of your Stripe account?
US
Have you enabled Link in https://dashboard.stripe.com/test/settings/payment_methods?
Hi @neat portal I'm taking over this thread
Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details
and I am missing this and the checkbox at the bottom
account id => acct_1LlHbdJkQCRoh7rJ
not sure why the payment intent is getting created with just card
What kind of checkbox are you expecting? are you following a particular integration guide? can you share with me the link?
this is my code to create the payment intent
I had a checkbox at the bottom of the web elements to save the payment method for Link. now it doesn't show
should I have to do
'automatic_payment_methods' => [
'enabled' => 'true',
],
ah thats it
adding the above to the payment intent did it
is there a way to show the list of payment methods attached to a customer using web elements?
No
ok
You need to build your own UI to show the saved payment methods
ok
where can I find docs about what payload is received for each webhook?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.