脚本宝典收集整理的这篇文章主要介绍了php – 使用Omnipay的PayPal Express Checkout未在沙盒帐户中显示订单,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我的代码如下:
use Omnipay\Omnipay; // PayPal Express: if(isset($_POST['paypalexpress'])) { $gateway = GatewayFactory::create('PayPal_Express'); $gateway->setUsername('{myusername}'); $gateway->setPassword('{mypassword}'); $gateway->setSignature('{mysignauture}'); $gateway->settestMode(true); $response = $gateway->purchase( array( 'cancelUrl'=>'http://www.mysITe.COM/?cancelled','returnUrl'=>'http://www.mysite.com/?success','amount' => "12.99",'currency' => 'GBP','Description' => 'Test Purchase for 12.99' ) )->send(); $response->redirect(); }
我在SandBox中创建了两个测试帐户,一个用于上面的API,另一个用于支付.我已尝试使用测试卡详细信息和登录信息付款,但订单详细信息未显示在帐户中.
有人可以帮忙吗?
if(isset($_GET['success'])) { $response = $gateway->completePurchase(array( 'transactionId' => $order->transaction,'transactionReference' => $order->reference,'amount' => $order->total,'currency' => $order->currency,))->send(); if ( ! $response->isSuccessful()) { throw new Exception($response->getMessage()); } }
如果您在返回时需要任何帮助来检索订单详细信息,请与我们联系.它可以在重定向之前存储在会话中,也可以存储在数据库中.如果您还没有,请查看示例代码:https://github.com/omnipay/example/blob/master/index.php
以上是脚本宝典为你收集整理的php – 使用Omnipay的PayPal Express Checkout未在沙盒帐户中显示订单全部内容,希望文章能够帮你解决php – 使用Omnipay的PayPal Express Checkout未在沙盒帐户中显示订单所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。