如何使用支付网关的重定向链接更新mysql数据库?

时间:2022-12-16 13:04:36

On my site, expiry.php script checks expiry date of member from cron job and if it is between 12 days from today, email is sent to member.

在我的网站上,expiry.php脚本检查来自cron作业的成员的到期日期,如果是从今天起12天之内,则会向成员发送电子邮件。

That email contains a renewal link with variables related to member.

该电子邮件包含与成员相关的变量的续订链接。

I am using Instamojo payment gateway with API details on https://www.instamojo.com/developers/request-a-payment-api/

我在https://www.instamojo.com/developers/request-a-payment-api/上使用带有API详细信息的Instamojo支付网关

e.g. my code and current link for payment in expiry.php to send email is like

例如我的代码和expiry.php中付款的当前链接发送电子邮件就像

<?php
include("db.php");
$sql=".......";
$name = $data['name']; //fetched from database
$email = $data['email'];
$mobile = $data['mobile'];
$payment_fees = "520";
$url = "https://paymentgateway-website.com/myaccountname/?data_name=".$name."&data_email=".$email."&data_phone=".$mobile."&data_amount=".$payment_fees."&data_readonly=data_name&data_readonly=data_email&data_readonly=data_phone&data_readonly=data_amount";

$url = htmlentities($url);
ob_start();
?>


    <div>
Hello <?=$data['name']?>,
<a href="<?php $url;?>">Click Here</a> To pay Now.
    </div>

<?php 
   $body=ob_get_clean();


    $to = $data["email"];
    .
    .

 ?>

This email is sent perfectly with payment link specifically for member with included member name, email and mobile in it and payment form is populated in browser with readonly fields containing user name, email, mobile, amount.

此电子邮件与支付链接完全一起发送,其中包含会员姓名,电子邮件和移动电话的会员,支付表格填写在浏览器中,其中包含用户名,电子邮件,手机,金额的只读字段。

This payment link has success redirect link with thanks.php on my site.

此付款链接已在我的网站上与thanks.php成功重定向链接。

I want to update my database when user pays fees and get redirected to my site's thanks.php page.

我想在用户支付费用时更新我的​​数据库并重定向到我的网站的thanks.php页面。

I think , I can not create session as user is going to payment link from email and returning back to my site after successful payment.

我想,我无法创建会话,因为用户从电子邮件转到付款链接并在成功付款后返回我的网站。

What can be solution to put in thanks.php on my site to update my mysql database like

什么可以解决方案放在我的网站上的thanks.php更新我的mysql数据库之类的

$sql = "update tablename SET `payment_status` = "1" where reg_id = "????(what to enter)?" 

How to get reg_id in mysql database when user pays successfully ?

用户付费成功后如何在mysql数据库中获取reg_id?

1 个解决方案

#1


-1  

You can use the webhook url feature of instamojo. It will give all details of transaction and on that page you can write your MySQL query to store response.

您可以使用instamojo的webhook网址功能。它将提供事务的所有详细信息,在该页面上,您可以编写MySQL查询以存储响应。

#1


-1  

You can use the webhook url feature of instamojo. It will give all details of transaction and on that page you can write your MySQL query to store response.

您可以使用instamojo的webhook网址功能。它将提供事务的所有详细信息,在该页面上,您可以编写MySQL查询以存储响应。