#Isantaniello - element layout

1 messages · Page 1 of 1 (latest)

mossy salmon
#

Sounds like you are using the card element. You'd have to use the payment element for that

fathom thicket
#

I'm new, sorry

#

stripe.elements()

#

elements.create('card', {
hidePostalCode: true
});

#

I want to show it

#

but in my page it appears like...

#

is it correct?

mossy salmon
fathom thicket
#

what is the differnce?

#

I need to implement payment into my app

mossy salmon
#

The PaymentElement expands into multiple lines like you described. It also can accept multiple payment methods, whereas the card element can only accept card payments

#

I recommend reading the links I shared

fathom thicket
#

sorry for my question. I read

mossy salmon
#

No worries!

#

We're here to help

#

If you have any questions after reading more about the PaymentElement, then feel free to come back and ask

fathom thicket
#

can I ask other question?

#

I'm developing a mobile app, not web app.

In the docs I read:

const {error} = await stripe.confirmPayment({
//Elements instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: 'https://example.com/order/123/complete',
},
});

if (error) {
// This point will only be reached if there is an immediate error when
// confirming the payment. Show error to your customer (for example, payment
// details incomplete)
const messageContainer = document.querySelector('#error-message');
messageContainer.textContent = error.message;
} else {
// Your customer will be redirected to your return_url. For some payment
// methods like iDEAL, your customer will be redirected to an intermediate
// site first to authorize the payment, then redirected to the return_url.
}

#

return_url is required?

#

because with card element I can catch response in mobile app

mossy salmon
#

But some payment methods require a redirect, that's why you must always pass a return_url

fathom thicket
#

non understood very well

#

this.stripe.confirmPayment({
elements,
confirmParams: {
return_url: 'if_required',
}
})

#

is it correct?

mossy salmon
#

No it needs to be:

#
        elements,
        confirmParams: {
          return_url: '',
        },
        redirect: 'if_required'
      })```
#

You still need a valid url for return_url

#

That will always be required

fathom thicket
#

ah ok