【发布时间】:2015-11-05 05:08:01
【问题描述】:
我是 Rest Api 的新手。我正在尝试通过 php sdk rest api 使用 paypal express checkout 创建付款。我已经下载并安装了他们的官方 sdk。
现在我可以创建正常付款,一切正常。现在我想将登录页面类型设置为计费。在文档页面中,有人告诉我将landing_page_type 设置为计费。我怎样才能在我的 php 脚本中做到这一点。
链接:https://developer.paypal.com/docs/api/#flowconfig-object
我的 php 脚本看起来像
$transaction = new Transaction();
$transaction->setAmount($amount)
->setItemList($itemList)
->setDescription("Payment description")
->setInvoiceNumber(uniqid());
$payment = new Payment();
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction));
$payment->create($apiContext);
所以据我了解,我必须创建名为 flow config 的新对象并向其添加登录页面。我尝试了类似
$billing = new FlowConfig();
$billing->setLandingPageType("billing");
接下来要做什么?如何将此 $billing 集成到我的 $payment 中
【问题讨论】: