#Rodrigo (Tookyer)

1 messages · Page 1 of 1 (latest)

onyx lagoonBOT
topaz elk
#

Hi, what specifically do you need help with?

dense lance
#

Hello pgskc!

#

I am creating one api request to create a payment method

#

the card infos and basic user infos are right

#

but i cant insert the address

#

type=card;
card[number]=card_number;
card[exp_month]=card_exp_month;
card[exp_year]=card_exp_year;
card[cvc]=card_cvc;
billing_details[name]=name;
billing_details[email]=email;
billing_details[phone]=phone;

#

here is ok

topaz elk
dense lance
#

but here, i am having problems

#

billing_details[address.country]=BR;

#

sure

#

one minute

topaz elk
#

You're passing the billing details? What do you mean by 'can't insert the address'?

dense lance
#

yah, i am trying to pass the billing details

#

the card, name, email and phone are working

#

but i cant pass the billing address

topaz elk
#

Ah I see what is happening here. You're passing an unknown parameter, address.country. The nesting is off here and you'd want to pass it like so://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details

dense lance
#

Right, how can I write it?

topaz elk
#

billing_details:{
address: {
country: ...
}
};

#

What language are you using?

dense lance
#

I'm creating it using curl

#

this is my current body

topaz elk
#

With Curl, it should look like this:

-d "billing_details[address][line1]"="1234 Market Street"
-d "billing_details[address][city]"=Philadelphia
-d "billing_details[address][state]"=PA
-d "billing_details[address][postal_code]"=19019
-d "billing_details[address][country]"=US

dense lance
#

nice, gimme a sec please

#

error again =/

topaz elk
#

sorry, meant billing_details, can you try it again with the above corrected Curl?

dense lance
#

sure

#

worked! thank you a lot