0

我正在尝试使用我的网店并执行必要的步骤。我试图在商家支持中问同样的问题,但他们花了 10 多天没有回复,所以我在这里尝试。

它在上线清单中说: - 确保您的 PayPal API 调用针对 PayPal 的生产环境。 那么我要把这个https://api-3t.paypal.com/nvp放在哪里呢?在创建按钮的代码中还是在调用的 PDT 中?这些是我能想到的唯一会有所作为的地方

它还说: - 获取您的实时 API 凭证,并在您调用 PayPal API 操作的任何地方使用它们。 我已经生成了它们,但是在哪里使用它们?在购买后将客户重定向到的 PDT 中还是在按钮中?应该https://api-3t.paypal.com/nvp吗?也在某个地方吗?

最后一个问题。我也必须“注册”我的“应用程序”吗?我试图阅读但不明白。我有一个网站,我将在其中使用您的按钮。我也需要注册吗?我该怎么做呢?

这是我的一些 pdt.php 代码:

<?php

/*
update: 06/27/2011
- updated to use cURL for better security, assumes PHP version 5.3
*/

// read the post from PayPal system and add 'cmd'

$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];

$pp_hostname = "www.sandbox.paypal.com"; 

// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];
$auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
// real xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$req .= "&tx=$tx_token&at=$auth_token";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://$pp_hostname/cgi-bin/webscr");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
//set cacert.pem verisign certificate path in curl using 'CURLOPT_CAINFO' field here,
//if your server does not bundled with default verisign certificates.
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: $pp_hostname"));
$res = curl_exec($ch);
curl_close($ch);
4

1 回答 1

1

您正在查看与 PayPal API 调用一起上线的清单——您正在使用 PayPal 按钮,因此您无需担心这一点。

对您来说,您唯一需要更改的是:
- PDT 脚本
的 $pp_hostname - IPN 脚本的 $pp_hostname(如果您使用它)
- 按钮的“操作”部分(来自https://www .sandbox.paypal.com/cgi-bin/webscrhttps://www.paypal.com/cgi-bin/webscr )

于 2013-03-11T15:00:14.390 回答