#Naveed

1 messages · Page 1 of 1 (latest)

ashen ridgeBOT
fresh bobcat
#

👋 how may I help?

#

@misty vortex please use this thread

#

for your subsequent messages

#

@misty vortex please move your message here

misty vortex
#

https://api.stripe.com/v1/ephemeral_keys

this api is working fine at postmen when I tried to call from my code it's returning an error

Error:

message
:
"Must provide exactly one of these parameters: [:customer, :issuing_card]."
request_log_url
:
"https://dashboard.stripe.com/test/logs/req_N8KKxS9aywMINY?t=1696594597"
type
:
"invalid_request_error"

#

lemme know if you are confused to anywhere?

fresh bobcat
#

the request you shared doesn't have a body

#

would you mind sharing your code?

misty vortex
#

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Stripe-Version", "2023-08-16");
myHeaders.append("Authorization", "Bearer sk_test_51NqFvOEOIiSwB6cJFXvBtLbH0yZuGambZ9LZ2sCHgDD8GhZ9yfzPYONUJaKw1cwkUPLc7KZ3QtWPOkDBcmOd2pLm00VhQAdPTF");

var urlencoded = new URLSearchParams();
urlencoded.append("customer", "cus_OlNlWDfaNsmyTj");

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};

fetch("https://api.stripe.com/v1/ephemeral_keys", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

#

this is the above request code

#

which is working fine on postmen but not works at the component

fresh bobcat
#

would you mind trying again?

misty vortex
#

at where??

fresh bobcat
#

in your code

misty vortex
#

ok let me try

#

yes i tried but issue is still same

fresh bobcat
#

why aren't you just using stripe-node SDK?

misty vortex
#

the because I only have access to react native project and backend is developed in php

#

that's why I am trying to integrate to be in react native side

fresh bobcat
#

the ephemeral key needs to be created on the backend

#

using the secret key

misty vortex
#

so is there any way to create on the front end

misty vortex
#

actually, I need solution for that

fresh bobcat
#

you need to create them in your PHP code then

misty vortex
#

i dont have acces of the php code. this is the major issue

fresh bobcat
#

there's nothing we can do about it

misty vortex
#

is there any other way to integrate it at the front end I already spend two days on that,... Now I wanted to fix it asap.

fresh bobcat
#

unfortunately no

misty vortex