DEV Community

Discussion on: How to Integrate Paystack payment system

Collapse
 
ijsucceed profile image
Jeremy Ikwuje

Which user wallet are you referring to? is it that of Paystack or your own platform. Please specify.

Collapse
 
oyeh20 profile image
oyeh20 • Edited

I'm talking about my platform. Take for example, a user login to his/her account in my platform, and deposit money, using the paystack payment gateway.. Now I'm looking for the php script to give the user value, (e.g. he/she deposits #500 using paystack, and it was successful,, when he/she come back to my platform, he/she has to see the #500 in her account, to confirm that the payment he/she made was successful)

Thread Thread
 
ijsucceed profile image
Jeremy Ikwuje • Edited

You're to write the script yourself. You do that in the callback file.

if('success' == $tranx->data->status){
// transaction was successful...
// send the value the user made to the database and redirect back to any
// file you want.
}

Hope you get it?

Thread Thread
 
oyeh20 profile image
oyeh20

that is my issue now. have write many php script code with the little knowledge i have, but nothing happen. please i need a sample of already working php code, to learn from. i will be glad if anyone can share with me. regards

Thread Thread
 
kodnificent profile image
Victor Mbamara 🇳🇬

you need to create a webhook url where paystack sends a charge.success event to, if the payment was made successfully. It's in that webhook file you can update the users wallet if a charge.success event was received. Visit paystack documentation page for a better understanding.