这里有一个新手,我不知道为什么paypal会给我这个错误。 这是代码:
<?php
require ("private/PayPal/vendor/autoload.php");
use PayPal\Api\Amount;
use PayPal\Api\Details;
use PayPal\Api\Item;
use PayPal\Api\ItemList;
use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Transaction;
$sid = session_id();
$idArtObject = ($_GET['idArtObject']);
$fourdigitid = leadingZero($idArtObject);
$art = find_object_by_id($idArtObject);
$total = $art['price'];
$apiContext = new PayPal\Rest\ApiContext(
new PayPal\Auth\OAuthTokenCredential(Client id, Secret id)
);
$payer = new PayPal\Api\Payer();
$payer->setPaymentMethod('paypal');
$amount = new PayPal\Api\Amount();
$amount->setTotal($total);
$amount->setCurrency('USD');
$transaction = new PayPal\Api\Transaction();
$transaction->setAmount($amount);
$redirectUrls = new PayPal\Api\RedirectUrls();
$redirectUrls>setReturnUrl("https://dev.sandywilsonart.com/ppreturn.php");
$redirectUrls>setCancelUrl("https://dev.sandywilsonart.com/ppcancel.php");
$payment = new PayPal\Api\Payment();
$payment->setIntent('sale');
$payment->setPayer($payer);
$payment->setTransactions(array($transaction));
$payment->setRedirectUrls($redirectUrls);
try {
$payment->create($apiContext);
echo $payment;
echo "\n\nRedirect user to approval url: " . $payment>getApprovalLink() . "\n";
}
catch (PayPal\Exception\PayPalConnectionException $ex) {
echo $ex->getData();
}
?>
<body>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div class="flex-container">
<div class='flex-item'>
<img src="public/images/thumbNails/
<?php echo $art['idArtObject'];>.jpg">
</br>
ID:
<?php
if ($art['category'] != 'wc') {
echo '</br>Title: ';
echo $art['title'];
} else {
echo 'Watercolor';
}
?>
<br/>
<?php
echo $art['height'];
echo " inches by ";
echo $art['width'];
echo " inches<br/>";
echo "Purchase Price: ";
setlocale(LC_MONETARY,"en_US");
if ($art['price']>0) {
$total = $total + $art['price'];
echo money_format('%.2n', $art['price']);
} else {
echo "NFS";
}
?>
</div>
</div>
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="nonote" value="1" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn"
value="public/images/ppbuynowbtn.jpg" />
<input type="hidden" name="firstname" value="Audrea" />
<input type="hidden" name="lastname" value="Elliott" />
<input type="hidden" name="payeremail"
value="wordartlady@gmail.com" />
<input type="hidden" name="idArtObject" value="<?php echo
$idArtObject; ?>" />
<center>
<h4>Total: <?php echo money_format('%.2n', $total) ?></h4>
</br>
<input type="submit" name="submit" value="Submit Payment"/>
</center>
</form>
我收到的错误是:
&#34;我们无法处理此交易,因为存在问题 卖家提供的PayPal电子邮件地址。请联系 卖家解决问题。如果这笔付款是针对易趣的 上市,您可以通过&#34;向卖家询问问题&#34; 列表页面上的链接。如果您拥有正确的电子邮件地址, 付款可以在www.paypal.com进行。&#34;
有人帮忙......拜托?