1)我正在尝试一段时间让 Omnipay / Paypal 工作。我的问题是我得到“ACK = Success”,但是当进入沙盒测试账户时,买卖双方都没有将交易显示为已预订。
2) 我也感觉到并非所有 API 都正确传输到 Paypal(例如 Brandname 使用 Angell 库正确显示,但使用 Omnipay 它不使用变量。
任何人都可以帮助解决这两个问题。?- 请参阅下面的代码。我在这里查看了其他文章,它们并没有解决我的问题。
<?php
//
// Input Variables
//
// Config
$domain = "http://localhost";
$directory = "http://localhost/omnipay/";
$returnURL = $directory."success.php";
$cancelURL = $directory."cancel.php";
$landingpage = "Billing";
$brandname = "TEST COMPANY";;
$customerservicenumber = "";
// Purchase Data
$invoiceNumber = "0000200202023939";
$currencyCode = "USD";
// PRODUCT DATA
$subscriptionName = "XXX";
$subscriptionDesc = "ZZZ";
$subscriptionAmt = "5.00";
require 'vendor/autoload.php';
use Omnipay\Omnipay;
$gateway = Omnipay::create('PayPal_Express');
$gateway->setUsername('XXX');
$gateway->setPassword('XXX');
$gateway->setSignature('XXX');
$gateway->setTestMode(true);
$response = $gateway->purchase(
array(
// Settings
'brandname' => '',
'customerservicenumber'=> '',
'cancelURL' => $cancelURL,
'returnURL' => $returnURL,
'reqconfirmshipping' => '0',
'noshipping' => '1',
'allownote' => '0',
// Buyer data
'email' => $email,
'description'=> $subscriptionDesc,
'amount'=> $subscriptionAmt,
'currency'=> $currencyCode,
)
)->send();
$response->redirect();
?>
success.php 是同一个脚本,除了结尾
……
)->send();
$data = $response->getData();
//echo '<pre>'; print_r($data);
if($data['ACK'] == "Success"){
echo "ACK = Success!!!!!!";
}
?>
如前所述,我最后总是得到 ACK = Success,但金额不会从 Sandbox 用户帐户中扣除。所以出了点问题。任何想法?