#Thamila
1 messages · Page 1 of 1 (latest)
hi! what's the error?
so when i use this
curl -u sk_xxx: https://api.stripe.com/v1/tokens \ -d pk_token=ApplePayPaymentToken.paymentData (decoded as JSON) \ -d pk_token_instrument_name=ApplePayPaymentToken.paymentMethod.displayName \ -d pk_token_payment_network=ApplePayPaymentToken.paymentMethod.network \ -d pk_token_transaction_id=ApplePayPaymentToken.transactionIdentifier
i get this
{
"error": {
"message": "You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you need to pass a -u sk_test_xxx: parameter as well — https://stripe.com/docs/api/authentication . Is there more context here? why are you using curl, why are you passing raw Apple Pay details instead of using our frontends?
i passed my key and i have the same error
so i had before a conversation with your collegue and in fact i have to do a payementappelpay without using frontend so i have so convert my tokenappelpay to a stripetoken
try curl https://api.stripe.com/v1/tokens -u sk_xxx: \ -d pk_token=.......... then (the key comes after the URL)
to be clear you don't have to use curl really, you'd use whatever it is you are using to call the Stripe API usually, the example is just in curl so it's agnostic.
that's means that i don't have to use curl to convert ?
well you have to call the API to convert the Apple Pay info to a Stripe Token
you can use whatever it is you are using to call the Stripe API usually, doesn't have to be curl specifically
yes but i cant use payement button or payement request so how can i use stripe api ton convert
i use only a server
you'd make the API call we're discussing in this thread
and how does your server normally call our API? is there a specific library you're using? https://stripe.com/docs/libraries#server-side-libraries
i juste added stripe to my package
not sure what that means
ah ok. Well unfortunately it's really hard to call this API with that library
yeah that's why i use curl
but you can do it by using https://stripe.com/docs/api/tokens/create_card?lang=dotnet , but you need to use options.AddExtraParam("pk_token", "<value>") for instance, since those parameters are not supported in the library
i try to use it like tjis but the AppelPayToken that i get is a string
so i can't have the AppelPayTpken.id
to put it in source
var option_token = new Stripe.ChargeCreateOptions();
option_token.Source = AppelPAyToken.Id;
And I assume that that is erroring out because it is an Apple Pay Token not a stripe one?
Have you been able to try that last suggestion of making a Stripe token with the card create call and options.AddExtraParam("pk_token", "<value>")?
yes
and what can i put on source ?
var options = new CardCreateOptions
{
Source = "?",
};
Good question. Checking in to this.
okey
Apologies I am still having trouble finding a doc on this source call after the token call. Have you tried making a createSource call here?
'cus_123',
{source: 'tok_456'}
);```
in my server ?
Yes
i try somthing, well i cant use curl i used postman so i just did the same thing that i have to do with curl but i have an error like " The certificate used to sign your request is invalid"
so i juste generate a new certificat like i have to do and i have the same error
and when i use this i have this error
parameter_missing
Must provide source or customer.
Hi there. Taking over for Pompey as they have to step out. Can you give a quick summary on what you're blocked on? It's the create source API call that's failing?
hey thank you so am traying to convert a tokenAppelPay to tokenStripe
and i use only a server to do this am with .net
Got it. Where in your integration is this currently failing?
so when i use this like this
Stripe.TokenCreateOptions token = new Stripe.TokenCreateOptions();
token.AddExtraParam("pk_token", "ApplePayPaymentToken.paymentData ");
token.AddExtraParam("pk_token_instrument_name", "ApplePayPaymentToken.paymentMethod.displayName" );
token.AddExtraParam("pk_token_payment_network", "ApplePayPaymentToken.paymentMethod.network ");
token.AddExtraParam("pk_token_transaction_id"," ApplePayPaymentToken.transactionIdentifier ");
var service_token = new TokenService();
Stripe.Token newToken = service_token.Create(token);
var options_token = new ChargeCreateOptions
{
Amount = 1000,
Currency = "eur",
Source = newToken.Id
};
var services = new Stripe.ChargeService();
Stripe.Charge charge = services.Create(options_token);
i have an error like my ios version is not the latest
so i tray to do it whith curl and i got " The certificate used to sign your request is invalid"
so i juste generate a new certificat like i have to do and i have the same error
Ok I re-read the thread. So for this api call, you don't get a certificate error?
Just a missing source/customer param error?
yes
Try passing the customer then
am wondering ("pk_token", "<value>") value is ApplePayPaymentToken.paymentData
how?
It should be, but I recommend inspecting what's the token format is
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i dont have the token's information
i get the token as a string
so i try to do it with curl but i have always that error "The certificate used to sign your request is invalid"
You'll need to find a way to get an updated certificate then. We can help with issues in calling the stripe api, but that's a configuration issue on your end