Alipay notify_url issue | PHP

559 Views Asked by At

I have been trying to build a woocommerce plugin for Alipay from what I understand from their docs is:

  1. I have request a payment through an url(consist of several params, like notify_url, return_url etc.)
  2. Pay through their websit by loggin in.
  3. Then they redirect me to the return_url submitted in the first step (with several new params along with old ones)
  4. They send another request to notify_url with a notify_id and a notify_status and some other params.
  5. After that I have to confirm I got the notification.

Now the issue here is, I am being redirected to return_url and getting expected values. But the code supposed to be triggered by notify_url is not being executed. But if I replace the return_url with notify_url, when alipay redirects me to return_url(in this case reuthn_url = notify_url) notification verification code executes properly.

I am using their demo code.

Here is the configuration:

$gateway = "https://openapi.alipaydev.com/gateway.do?";
$partner = "";
$security_code = "";
$_input_charset = "utf-8"; 
$sign_type = "MD5"; 
$transport= "http";
$notify_url = "http://localhost/code/notify_url.php";
$return_url = "http://localhost/code/return_url.php";

N.B. They say payment process is successful in thier website, before redirecting me to return_url.

0

There are 0 best solutions below