我有以下SuccessPayment方法:
public function getSuccessPayment() {
$gatewayFactory = new \Omnipay\Common\GatewayFactory;
$gateway = $gatewayFactory->create('PayPal_Express');
#Test API Sandbox
$gateway->setUsername('xxxxxxx.de');
$gateway->setPassword('xxxxxxxxx');
$gateway->setSignature('xxxxx.xxxxx.xxxxx.xxxxxxx');
$gateway->setTestMode(true);
# FINALIZZZE PAYPAL PAYMENT
$response = $gateway->completePurchase($this->getApiInfos())->send();
$data = $response->getData();
# IF SUCCESSFULLLLLLL
if($data['ACK'] == 'Success'):
$order = Order::where('paypalToken',$data['TOKEN'])->first();
# Set Status
$order->orderSuccess = 4;
$order->orderPaid = 1;
# Set PP ID
$order->paypalTransactionId = $data['PAYMENTINFO_0_TRANSACTIONID'];
$order->save();
# Destroy Cart
Cart::destroy();
# Send Confirm Mail
$this->sendConfirmOrderMail($order->id, Auth::user()->id);
return View::make('pages.checkout.success', compact(['order','data']));
endif;
} $this->getApiInfos()有凭证和信息,这些凭证和信息将传递到PP,下面是方法:
public function getApiInfos($order = NULL) {
return array(
'amount'=> Cart::total(),
'cancelUrl' => \URL::route('paypal_cancel_order'),
'returnUrl' => \URL::route('paypal_return'),
'description' => 'Your Payment at xxxxxx - Order #',
'currency' => 'EUR'
);
} 看看描述。如何使orderID进入描述,在重定向到Paypal之后,以及在我被重定向回我的页面之后?
我正在失去我的会议和秩序(我猜!),那么我怎么做呢?
另外,你知道,我如何能够发送航运成本,税收和头图像到PayPal通过Omnipay?
发布于 2014-10-27 16:08:43
要获取发送给Paypal的事务引用,可以这样做。
$response->getTransactionReference();关于你问题的后半部分:
PayPal速递网关具有以下设置图像的功能:
$gateway->setHeaderImageUrl()
$gateway->setLogoImageUrl()所有请求都具有以下功能
$request->setTaxAmount()
$request->setShippingAmount()
$request->setHandlingAmount()
$request->setShippingDiscount()
$request->setInsuranceAmount()https://stackoverflow.com/questions/26577385
复制相似问题