#thamila-applepay-web

1 messages · Page 1 of 1 (latest)

shadow frigateBOT
silver birch
#

Hey @lucid lance what's your question?

lucid lance
#

hey it's about appelpay payement with stripe

#

when i get a token appel pay that i convert it to a stripe token but when i get my resulat how can i use it to do the payement

silver birch
#

Which doc are you following?

lucid lance
#

stripe ..

silver birch
#

"stripe .." is not really a doc

lucid lance
silver birch
#

that's just an overview page

#

Sorry to push but I assume you're a developer and integrating Stripe, so you must have started with a real doc, with end to end examples.
If not, how did you know to create a Token?
You didn't explain much yet unfortunately. Like what platform do you use? Is this an iOS app? A Flutter app? A web app? Something else?

lucid lance
#

am using a web app

#

i know how to create a token and how to do a payement with it

silver birch
#

Please try to take a step back and provide detailed information all in one unique message

lucid lance
#

i have a token as a string i want to use it to do a payement howa can i use it , am not the one how create that token i got it when i use appelpay

silver birch
#

thamila-applepay-web

lucid lance
#

okey thank you

silver birch
#

I can help, I just need you to provide more actionable information

lucid lance
#

the thing is that when i use a appelpay payement i don't use any of js methods like payement button or payement request i use only server so when i got a token by appelpay i convert it to a stripe token my self using Http request now when i get my stripetoken i wonder if i have to create a tokenOptions with it or no

silver birch
#

see, you clearly have a ton of information that you haven't shared with me in 20 minutes. Please help me help you and provide a lot more specific details.

#

Why do you create a Token server-side? How? Who sends you the Apple Pay information like the DPAN for you to do this? Where did you get the code for it? Please give me real details

lucid lance
#

u

silver birch
#

?

lucid lance
#

so i create a token server side because infact in my app i have another providers like paypal so i juste do a payement in my application and that give me a ton of information like card information and costumer id and else now when i use appelpay that give me the token that appelpay generate so i allready asked your collegue and he told me how to do it
i need to convert Apple Pay token to Stripe token. i can do it like this:i use this undocumented parameter in Tokens API

silver birch
#

Okay, sorry but it's been 30 minutes and it's the first time you mentioned any of this

lucid lance
#

tok_122 is it a token id.

#

?

silver birch
#

yes

lucid lance
#

but when i convert it i got it like a string

#

i juste can't do token.id because it's a string

silver birch
#

I have no idea what this means

lucid lance
#

no that's not the thing i mean yes i do a convert but the object i get a last is a string

#

so that's why i ask

silver birch
#

Okay I'm sorry but it's been almost an hour with no information. I'm sorry @lucid lance but I need you to provide real information and questions.
Please share the exact code you are using to create a Token and what you get back

lucid lance
#

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

#

that what i use

#

i got this

#

"id": "tok_1MEZmSFVCCFguyvQuq4RH0LE",
"object": "token",
"card": {
"id": "card_1MEZmSFVCCFguyvQwDPVnHC7",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "MasterCard",
"country": "FR",
"cvc_check": null,
"dynamic_last4": "3291",
"exp_month": 12,
"exp_year": 2025,
"fingerprint": "ZA6tpxRaD4cCek51",
"funding": "prepaid",
"last4": "2450",
"metadata": {
},
"name": null,
"tokenization_method": "apple_pay"
},
"client_ip": "185.246.18.160",
"created": 1670942908,
"livemode": false,
"type": "card",
"used": false
}

silver birch
#

but that's just a curl call. Are you just testing by hand? Because no one would write a curl command in a terminal for a real web application

lucid lance
#

am testing it juste to see what will i get

silver birch
#

but then there's no issue with "returning" a string? It's just an example. You're the human here and you can see the Token id right there in what you told me

#

"id": "tok_1MEZmSFVCCFguyvQuq4RH0LE",

#

so really you take tok_1MEZmSFVCCFguyvQuq4RH0LE and that's the value you want

#

Also that request was made via Postman, not via curl but you said you used curl

#

I'm sorry, it's really hard to help with 10% of the info

lucid lance
#

i used it all i used also a http request

silver birch
#

Okay, so what's the problem?

lucid lance
#

var url = new Uri("https://api.stripe.com/v1/tokens");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", key);

        var values = new Dictionary<string, string>
            {
        {pk_token_instrument_name=ApplePayPaymentToken.paymentMethod.displayName  
                  },
                { "pk_token_instrument_name", "Mastercard  xxx },
                { "pk_token_payment_network", "Mastercxxx"},
                { "pk_token_transaction_id", "idxxxx"}

            };

        var data = new FormUrlEncodedContent(values);

        var result = await client.PostAsync(url, data);
#

it's like this so now how can i juste do apyement with my result

silver birch
#

what's apyement?

#

like the result seems to be in the result variable right? And we return JSON

lucid lance
#

payement excyse me *

silver birch
#

so your code can deserialize the JSON and access the id right?

lucid lance
#

i dont get i resulat.id i gest get a result.content

#

that the problem

silver birch
#

I have no idea what this means again

#

this is your own code in a programming language you are likely familiar with

#

the last line does an HTTP POST request

#

so you get the result back. This isn't really a Stripe question so I assume you have done HTTP POST requests before in that language. If not can you give me more details? Which language is this? Which doc are you following?

lucid lance
#

okey thank you excuse me i dont realy talk english well so somtimes i mix things up

silver birch
#

No worries your English is totally fine! Earlier I just got confused by the typo because your code didn't reference a "payment" variable

#

If it were me, I'd pause all of this and use our official stripe-dotnet library instead. You seem quite lost with all of this, and at least our library makes the request for you and since you'll need it for Charge creation too it will be way simpler: https://github.com/stripe/stripe-dotnet/

lucid lance
#

i see, i have to do an AddExtraParam() in place of httprequest thats it ?

silver birch
#

yeah that will be a lot simpler so that's what I'd do

lucid lance
#

okey thank you

silver birch
#

Sure!