php - 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”不用于填写账单信息。
解决方案
推荐阅读
- r - 使用嵌套的应用函数而不是嵌套的 for 循环
- javascript - 'process.env.NODE_ENV' 替换为字符串或进程对象在运行时可在 create-react-app 中使用
- python - Django如何添加表单以外的模型
- python - 将 QA 数据加载到 python 聊天机器人工具
- jenkins - Kubectl 命令的使用和使用 Kubernetes 和 Jenkins 部署 Pod
- jquery - Bootstrap 4 - 打开模态 A;关闭模态A;打开模态 B - A 未关闭
- java - Weblogic 12.2 上的 Swagger 引导程序
- android - Android Mobile Vision 文本识别缩放到找到的坐标
- php - 在登录页面简单的php添加cookie
- angular - 你能从 Angular 服务中连续生成正弦波数据并将其注入到组件中吗?