#test9

1 messages · Page 1 of 1 (latest)

gleaming sailBOT
hardy bone
#

Ah never mind I found it req_xaZ2jriQdnMI4z, let me check this...

languid plank
#

?

#

i want to try the postman method, but not sure what parma / key to bechanged

hardy bone
#

Actually you are sending POST /v1/payment_methods/<string> as a request without any body

languid plank
#

yeah , i need sample body. , and even before do i need a paymethod so i can update it

hardy bone
#

You need to fix your request call

hardy bone
languid plank
#

i forgot my mail /mob , can u able to tell me mine id

#

i m doing integration for update method

#

from our salesforce platform

#

i ll login first with creds

#

could u pls give me a sample create and update payload, which is working fine

#

@hardy bone ??

hardy bone
languid plank
#

payment method create and update

#

{{baseUrl}}/v1/payment_methods

#

{{baseUrl}}/v1/payment_methods/:payment_method

hardy bone
languid plank
#

i need to try it on test env, and then make those calls prgrmatically after manual postman call

#

i alrady went thru the docs

#

pls give valid payload

#

sample which is working

#

@hardy bone ?

hardy bone
#

Please be mindful and stop using the mention, it's a quiet busy, I'm with you just a moment

#

As I said, I can't give a sample example, if I still don't understand what you want to achieve, rather than doing API call. What do you want to achieve by doing the API call ? what is your business requirement?

languid plank
#

we want to save payment methods and get back the toekn to store in our db

#

when update paymethod like expiry cvv , we will pass thru all creds whcih we get from client to our platfrom and make a call to ur update method

#

so its ecommerce feature where saved paymethod will be updated

hardy bone
#

Are you PCI-DSS compliant ?

languid plank
#

yes

hardy bone
#

Choose curl for example and copy past it

languid plank
#

cant i get the postman payload

#

i ve already download ed the collection and there where. im getting the vaoved pinged error

#

could u pls convert the curl body into a valid postman post json payload

hardy bone
languid plank
#

if i convert it to json i m getting below error

#

{
"error": {
"message": "Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}

latent oak
#

👋 taking over for my colleague. Let me catch up.

languid plank
#

@latent oak ?

latent oak
languid plank
#

already imported as u can see above msgs

latent oak
#

sorry I didn't see that in the thread

#

you need to use the body as x-www-form-urlencoded and you would pass metada.order_id: xxxx

languid plank
#

ccant we used json here ?

latent oak
#

no, as mentioned here https://stripe.com/docs/api
The Stripe API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

#

we only accept form-encoded request bodies

languid plank
#

but this one worked fine

#

how come some work and some donbt

latent oak
#

because that request doesn't take a body

#

so the body is disregarded

languid plank
#

it is post

#

and need type of account as manadatory filed

latent oak
#

you've passed it in the url

languid plank
#

infact now the old also working

#

with json

#

jut by appending the extra header

#

how this is supoosed to work ?

latent oak
#

what extra header?

languid plank
#

how can application type can be both at a time ? xml form and the json also

#

however this is working fine without strike overwrite, if same geader iappend on a request impported out side it shows crossed line

latent oak
#

you changed the Content-Type to application/x-www-form-urlencoded that's why it's working

languid plank
#

but i m still passing json

#

not xml form

#

and why the strike is not appearing in stripe managed collectin ?

latent oak
#

Postman is converting your JSON (which is in raw form) to the Content-Type you're specifying

#

which is form-encoded

languid plank
#

no ! i m not passing xml converted at all

#

as u see in pic

latent oak
#

I'm not saying you are, I'm saying Postman is converting your JSON to form-encoded

languid plank
#

ok , so when making programatical http call from java using rest client , w e need to pass both types or only xml form

#

?

latent oak
#

if you're using the stripe-java SDK you don't need to worry about all of this

languid plank
#

header i mean

latent oak
#

you would simply need to use the classes that we provide

languid plank
#

i m using open source http client lib

latent oak
#

and we will take care of the rest

latent oak
languid plank
#

ok , i ll look our current code base to find how its done for old calls

#

thanks !

latent oak
#

let me know if you need any more help

languid plank
#

sure