DEV Community

Discussion on: How to Integrate Paystack payment system

 
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.