-1

我正在为 PayFast 现场集成而苦苦挣扎。

PayFast 在成功付款后无法重定向。看起来好像我的网址正在更改。

$data = [
// Merchant details
'merchant_id' => 'xxx', //required
'merchant_key' => 'xxx', //required
'return_url' => 'https://www.example.co.za/signup/success_temp.php', // optional
'cancel_url' => 'https://www.example.co.za/signup/cancel.php', // optional
'notify_url'=> 'https://www.example.co.za/signup/notify.php', // optional];

$data_subscription = [
// Payment methods
'payment_method' => 'cc', // *optional - Must include for subscriptions

// Subscriptions
'subscription_type' => '1', // required
'billing_date' => $billing_date, // *optional
'recurring_amount' => $recurring_amount, // *optional
'frequency' => '3', // required
'cycles' => '0' // required];

// Add subscription data to $data
if (1 == 1) {
$data = array_merge($data, $data_subscription);
}

从这里我为他们的在线集成运行标准 PayFast 代码,但 return_url 回来了:https:\/\/www.example.co.za\/signup\/success_temp.php

而cancel_url:https:\/\/www.example.co.za\/signup\/cancel.php

我已经测试了到 google.com 的重定向,我遇到了同样的问题。

有什么想法我哪里出错了吗?

4

1 回答 1

0

该错误与 URL 无关。默认的 Payfast 代码回显一个 JSON 对象,其中正斜杠已转义。

我相信我的 notify_url 一定有错误。如果 notify_url 没有返回 200,那么他们不会重定向到您的 return_url。

于 2022-02-21T12:45:33.237 回答