#alexelba-paymentlink

1 messages ยท Page 1 of 1 (latest)

supple quail
#

hello! you can use a PaymentLink for that

tame lava
#

payment link will not work can not attach correct tax

supple quail
#

ah yeah then you'd def need a client+ server-side integration as well

tame lava
#

if doing server client side what will be best way. For email,phone, name, stripe credit card collection form. Click subscribe. Client Site Collect Payment on success submit form> Create a customer/ create subscription

supple quail
#

the best way? Checkout in my opinion, it collects most of those things for you

tame lava
#

it will be great, is it possible to collect meta during checkout as well?

#

is there document to see what fields I can collect with javascript

supple quail
#

yep the API ref, and yes you can collect metadata, let me link to you

#

metadata is a field there too

tame lava
#

so all done on client side?

#

or server side

#

this link looks like all done server side

supple quail
#

server-side

#

if it was done client-side, a malicious customer could make arbitrary API requests on your account using your publishable key

#

very few things are possible with your publishable key

tame lava
#

will this create duplicate customer?

supple quail
#

it will but you can pass a customer to not make Checkout create one

tame lava
#

do I need to attach after to the customer or I can pass customer to it?

supple quail
#

why are you using that API endpoint?

#

that is PaymentMethod create

#

you don't need that

#

you should be using Checkout otherwise you're making this a complicated integration

tame lava
#

users are not logged in

#

so they checkout as guest need make sure I don't create duplicate

#

clients

supple quail
#

@tame lava also going to continue with your other questions here too

#

let me paste them in

tame lava
#

what are allowed characters in email

supple quail
#

Hello, I am trying to debug issue with customer emails, when creating customer it has + in it the stripe throws error

#

do you have an example of that email issue? is that in Stripe Checkout? somewhere else?

tame lava
#

Uncaught (Status 400) (Request req_mELIB9IFGJdzTx) Invalid email address:

supple quail
#

so they checkout as guest need make sure I don't create duplicate
so how would that work? it is a guest customer so you cannot identify if that is cus_123 or cus_456 so how would you deduplicate?

tame lava
#

here is request id

supple quail
#

thanks for request ID! looking

tame lava
#

this email address is fully valid based on rfc2822

#

specs

supple quail
#

you need to pass the full raw string, which you aren't passing currently

tame lava
#

for the email?

supple quail
#

see the link I sent you

#

look at the request params your integration passed

tame lava
#

one sec

supple quail
#

I'm not pasting it here as this is a public channel

#

don't want to leak the email there

#

but look at the request/response in the Dashboard Request Log link

#

and you'll see the issue

#

you are not passing hello+pizza@gmail.com , your + and @ are url encoded which they do not need to be

tame lava
#

I am using the stripe php client

#

$customer = $stripe->customers->create([
'description' => ' Customer',
'email' => $email,
'phone' => $phone,
'name' => $name,
]);

#

this parameters are plan text not encoded

#

I just made sure the $email is not encoded

#

it works fine

supple quail
#

yeah because the issue is before this

#

where-ever you're getting $email from

#

because $name is fine

#

and others are fine too

tame lava
#

I just did hard coded

supple quail
#

yes hardcoding should work and it doe

#

does

#

that is expected

#

my point is

#

add a log to print out $email in your code, before that customer->create() API call

#

log out all your variables, $phone and $name as well

#

and you'll see the difference in what you're passing to the Stripe API

#

my point is, something in your code before that API call is url encoding the email

#

I'm stepping away but a colleague is around to help out

desert minnow
#

๐Ÿ‘‹ that would be me!

tame lava
#

thanks will check it out

#

hey Karbi

tame lava
desert minnow
tame lava
#

this will make a border for all together

#

I want saparate border for each element

#

card number to have own border

#

zip own border etc

desert minnow
#

Are you using the card Element, or the separate cardNumber , cardExpiry, cardCvc elements?

tame lava
#

card

#

var stripeElements = stripe.elements();
var stripeCard = stripeElements.create('card', {style: style, hidePostalCode:true});

#

should I create saparate elements ?

#

I can do it if this only way

desert minnow
#

If you want each of them to have their own border then the only way to do it would be with the three separate elements

tame lava
#

where can i find full list of card components I can create separately? (cardNumber , cardExpiry, cardCvc)

desert minnow
#

Those three are it ๐Ÿ‘

#

(at least for cards)

tame lava
#

should I use card or payment method to collect payments for subscriptions?

#

I am not clear when should I use payment when I used card

desert minnow
#

The card element is what you use to create a Payment Method

tame lava
#

I mean this

desert minnow
#

Ah, so you're asking about the difference between the Payment element and card elements

tame lava
#

Yup ๐Ÿ™‚

desert minnow
#

Either one will work! Payment Element is a newer offering and is meant to make it easier to ask multiple payment method types in a single element (not just card).

tame lava
#

I was looking at it, but I can not see any parameter which I can spacify if I want lets say alipay,card and wechat

#

it says I can pick order but

#

does not say which one i want to show

desert minnow
tame lava
#

thanks will cehck it out