在PAYPAL PHP REST API SDK中使用对象
我是RESTAPI的新手。我正在尝试通过php sdk rest api使用paypal express checkout创建支付。我已经下载并安装了他们的官方sdk 现在我可以创建一个正常的付款,一切正常。现在我想将登录页类型设置为billing。在文档页面中,我被告知将登录页类型设置为billing。如何在php脚本中实现这一点 链接: 我的php脚本看起来像在PAYPAL PHP REST API SDK中使用对象,php,api,rest,paypal,Php,Api,Rest,Paypal,我是RESTAPI的新手。我正在尝试通过php sdk rest api使用paypal express checkout创建支付。我已经下载并安装了他们的官方sdk 现在我可以创建一个正常的付款,一切正常。现在我想将登录页类型设置为billing。在文档页面中,我被告知将登录页类型设置为billing。如何在php脚本中实现这一点 链接: 我的php脚本看起来像 $transaction = new Transaction(); $transaction->setAmount($amou
$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);
$billing = new FlowConfig();
$billing->setLandingPageType("billing");
据我所知,我必须创建一个名为flow config的新对象,并向其中添加登录页
$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);
$billing = new FlowConfig();
$billing->setLandingPageType("billing");
下一步怎么办?如何将此$billing集成到my$payment中要设置登录页类型,您应该创建一个支付体验并在请求中指定登录页: PHP SDK示例: 响应中有一个付款体验配置文件ID。 然后将ExperienceProfileId添加到创建付款的请求中,如下所示:
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction));
->setExperienceProfileId(**********)
要设置登录页类型,您应创建付款体验并在请求中指定登录页: PHP SDK示例: 响应中有一个付款体验配置文件ID。 然后将ExperienceProfileId添加到创建付款的请求中,如下所示:
$payment->setIntent("sale")
->setPayer($payer)
->setRedirectUrls($redirectUrls)
->setTransactions(array($transaction));
->setExperienceProfileId(**********)