首页 > 解决方案 > Paypal REST API 如何设置账单信息

问题描述

当我创建付款时,有什么方法可以使用 PHP API REST 为非贝宝用户预先填写账单信息?

这是我想预填充数据的地方:

在此处输入图像描述

这是我的测试代码:

$payerinfo=new PayerInfo();
$payerinfo->setEmail("test@test.com")->setFirstName("MyName")->setLastName("MySurname");
$payer = new Payer();
$payer->setPaymentMethod("paypal")->setPayerInfo($payerinfo);
$transaction = new Transaction();
$transaction->setAmount($amount)->setItemList($itemList)->setDescription($descrizione);
$payment = new Payment();
$payment->setIntent("sale")->setPayer($payer)->setTransactions(array($transaction));
$payment->create($this->getApiContext())

似乎“payerInfo”不用于填写账单信息。

标签: phppaypalpaypal-rest-sdk

解决方案


推荐阅读