#.abishek

1 messages ยท Page 1 of 1 (latest)

fiery saffronBOT
neat portal
#

I have the following code

civic nimbus
#

The page can be redirected if the payment method chosen is a redirect-based payment method

neat portal
#

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.
civic nimbus
#

Can you elaborate more what you meant by refreshes the page? I tried in my own integration and it doesn't refresh

neat portal
#

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.

civic nimbus
#

sure!

neat portal
#

So what I have done is.

  1. Created a paymentElement and assigned the mode:'payment and amount:{{productPriceAmount}}
  2. when they hit the Pay button
    2a, I call elements.submit
    2b, create a payment intent from javascript (you will see the line Livewire.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 the payment_intent
    2c, get this payment and pass that to stripe.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.

civic nimbus
#

Am I right to understand that you would like to do following?

  • Use Invoicing
  • Make payment with Payment Element
neat portal
#

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?

civic nimbus
neat portal
#

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?

civic nimbus
#

paymentIntent accepts a subscription why not a price?
The subscription will create a Payment Intent, not another way round

neat portal
#

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?

civic nimbus
#

In this case, Invoicing should work as suggested above

#

the additional charges you mentioned is on top of the stripe fee?
Yup!

neat portal
#

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?

civic nimbus
#

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

neat portal
#

ok, so I just use Payment Element and pass the amount for the price

#

is there docs for this?

civic nimbus
neat portal
#

ok, let me try this. thank you

civic nimbus
#

No problem! Happy to help ๐Ÿ˜„

neat portal
#

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

civic nimbus
#

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

neat portal
#

does the 3DS model open automatically or does it redirect?

#

with web elements

civic nimbus
#

It can be both depending on card issuer's 3DS support, but most of the issuers are on 3DS modal nowadays

neat portal
#

ok

civic nimbus
neat portal
#

is there a demo page for web elements where I can test these to see how I code this further?

civic nimbus
neat portal
#

Thank you

civic nimbus
#

No problem! Happy to help ๐Ÿ˜„

neat portal
#

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?

civic nimbus
#

What is the country of your Stripe account?

neat portal
#

US

civic nimbus
neat portal
#

yes it is enabled

fiery saffronBOT
vivid shadow
#

Hi @neat portal I'm taking over this thread

neat portal
#

hey @vivid shadow thank you. here is my code

#

and here is the output

vivid shadow
#

Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

neat portal
#

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

vivid shadow
#

What kind of checkbox are you expecting? are you following a particular integration guide? can you share with me the link?

neat portal
#

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

neat portal
#

is there a way to show the list of payment methods attached to a customer using web elements?

vivid shadow
#

No

neat portal
#

ok

vivid shadow
#

You need to build your own UI to show the saved payment methods

neat portal
#

ok

neat portal
#

where can I find docs about what payload is received for each webhook?

vivid shadow