#maxitrol_code

1 messages ยท Page 1 of 1 (latest)

torpid geodeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1317175326945841224

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

gray gyro
#

is this real people helping or bot?

signal patio
#

Hey! I'm here to help out. The bot is just there to give you that one autogenerated message, I'm a real person.

#

Looking into your question now

#

Can you share an example charge ID from when you made a request but couldn't see the result in your dashboard? Also can you double check that you're both using the test API key and have the test mode toggle set in the dashboard?

gray gyro
#

hello

#

ok i will perform another charge now and i will paste response to you, is that ok?

#

and let me check for API key

#

dashboard is set to TEST mode

#

in dashboard i see two keys:

Publishable key
Secret key

#

and in my code i am using "Secret key"

#

so now i will perform $4.50 tx and i will show you the output i receive back from stripe

#

i will call this:

$xResult_stripe_charge = \Stripe\Charge::create(array(
"amount" => $xAmount_in_cents,
"currency" => "usd",
"description" => "Deposit",
"source" => $token,
));

signal patio
#

Yep! If you're seeing sk_test at the beginning of the key you're using in your dev environment that should be the correct one.

gray gyro
#

ok now i performed that call \Stripe\Charge and i received this back from Stripe (to my php)

#

i was using test visa card: 4242 4242 4242 4242

#

if i refresh the dashboard i dont see this tx anywhere. by the way, are you from Stripe?

#

you know on main screen, nr of API request IS increasing but when i click on "View all requests" i dont see any new ones

#

oh maybe i was using wrong key

#

trying again

signal patio
#

FYI I wouldn't recommend sharing your key (even the test one) here or anywhere else. I would recommend deleting or editing that message (I just need the charge ID ch_3QVcWoCNmu739PBZ1Zn1Id8G) and rolling your API key ASAP.

gray gyro
#

now nothing works.... i took keys from dashboard and put it in my php code (looks like i was using wrong keys) but when i try to process cc now i get error in your dashboard saying "message":
"No such token: 'tok_1QVcdVCNmu739PBZvbmRxql8'",

#

you know i am using 6 yr old code.... but i downloaded new stripe php lib

#

i dont know if that token thing should be there let me show oyu

signal patio
gray gyro
gray gyro
#

wait let me perform another charge. i added those keys to my code.... lets try again, please wait

#

it worked. i mean i got a response

#

"id": "ch_3QVckSCacZAIV0DJ12qL2KiJ",
"object": "charge",
"amount": 800,
"amount_captured": 800,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3QVckSCacZAIV0DJ1fVuORB6",
"billing_details": {

#

and i can see it in dashboard!!!!

#

i guess it was the key that was wrong? ๐Ÿ˜ฆ

#

i spent so many hours

#

i have two more questions for you....

#
  1. what is the difference between these keys and when should i use them? this is in TEST mode:

Publishable key
Secret key

#
  1. the last charge i did i see details in dashboard BUT i dont see the ADDRESS of the person in your dashboard when i am looking at this transaction while i did receive person's name back to my PHP from stripe response. why i dont see it in dashboard too?
#

and last question
3) fee data is not found at the transaction info in dashboard. for example i charged my user for $8.00 but i need to know how much did Stripe take. because i need to know how much i got. should i perform another API call for that (since I can't find this number in the response i got when calling "Charge" method in php

signal patio
#
  1. For which key is which, this public doc has a really good rundown of each of the keys and when to use each (test vs live, secret vs publishable):
    https://docs.stripe.com/keys

I recommend giving that a quick look and if you have more specific questions that aren't handled in the doc I can help you out.

gray gyro
#

aha... ok because i dont get it why i need 2 keys for TEST and 2 for live. i will read the doc, thanks

signal patio
#

Gonna revisit 2. in a little bit, I'll circle back to that

gray gyro
signal patio
gray gyro
#

aha so Stripe wont return fees in response to "Charge" call in php, i must first save that transaction ID and then make another API call to retrieve fees?

#

tx id is the one starting with "ch"? "id": "ch_3QVckSCacZAIV0DJ12qL2KiJ",

#

oh sorry, probably this one -
"balance_transaction": "txn_3QVckSCacZAIV0DJ1fVuORB6",

#

oh yes i can call API for that and it returns me "fee" 53
means fee was 53 cents i guess

#

ok.... thank you. please leave me a msg how i retrieve ADDRESS user entered before he entered credit card data. should i query API for that charge of transaction

#

thank you very much!!!

#

i will be back in 1h

signal patio
#

No worries! Looking into the address question now.

#

FYI the thread will be closed in an hour so for now I will give you a partial answer to the address question, and if you need more help you're welcome to reach back out.

I think I might need a bit more clarification as to what you need the address for. For example, we do actually give you the address in the response to creating the charge. You can see it the billing_details prop.

#

So depending on your needs you could just save that and re-use it later.

#

I also want to give you a suggestion that you look into implementing Payment Intents rather than Charges, assuming this is a new integration and not an old one. Charges is our older flow for accepting payments and it is currently deprecated, meaning it will be harder and harder to support and update over time. Our support pages have a really good walkthrough on how to set up a simple payment intents flow:
https://docs.stripe.com/payments/accept-a-payment