Hello bro,
Please how do you go about the integration. I have downloaded and activated the gravity form, downloaded and activated the paystack addon for gravity form but when I create the form and they submit, how do they then pay?
what do I need to add to the form?
@danieltobs firstly you need to change your currency from gravityforms settings , secondly to solve the redirection issues then you can try to use paystack callbacks to verify transaction cause it carrys back some params such as https://yoursite.com/?gf_paystack_return=aWRzPTZ8MXwxJmhhc2g9MTdhMjQ3YWY3YjRkODlhYzM4OTEwZjI1ZmI2ZDQ5YWM&trxref=gf-6-60e5ae3037337&reference=gf-6-60e5ae3037337
All you need to do is create a page called “/success” then go add this page on your paystack dashboard then download and activate code snippets plugin and paste the below code in the code snippets or your functions.php
function success(){
$trxref = $GET['trxref'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.paystack.co/transaction/verify/:$trxref",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer sk_live_YOUR KEYS",
"Cache-Control: no-cache",
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
}
add_shortcode('success','success');
Then add [success] shortcode to the page !
you then customize your response in the above code to get your json response as html
@omo9jatoja Thanks so much for your input.
Please, this part:
“Then add [success] shortcode to the page !
you then customize your response in the above code to get your json response as html”
Where are we to customise the response and…
Is it possible to edit the success page with a page builder and use a different response?