我正在使用保存的信用卡和PayPal从我的网站付款。付款工作正常,但我无法在sandbox.paypal.com上的Merchants帐户中看到交易说明。它显示默认消息“fname lname已向您发送50美元的PayPal”。
以下是我的代码:
$cardid=$creditCardId = $card_generated_id;
$creditCardToken = new CreditCardToken();
$creditCardToken->setCredit_card_id($creditCardId);
$creditCardToken->setPayerId($payer_id);
$fi = new FundingInstrument();
$fi->setCredit_card_token($creditCardToken);
$payer = new Payer();
$payer->setPayment_method("credit_card");
$payer->setFunding_instruments(array($fi));
$amount = new Amount();
$amount->setCurrency("USD");
$card_amount = number_format($creaditCardAmt,2,".","");
$amount->setTotal($card_amount);
$transaction = new Transaction();
$transaction->setAmount($amount);
if(isset($itemname) && $itemname != '')
$itemname = $itemname;
else
$itemname="BT Payments";
$transaction->setDescription($itemname);
$payment = new Payment();
$payment->setIntent("sale");
$payment->setPayer($payer);
$payment->setTransactions(array($transaction));
$payment->create($apiContext);
我不知道它有什么问题?