问题描述
大家好,我在laravel中使用omnipay,我想知道如何更改代码以在Paypal收据中显示每项的总金额及其说明
Hello guys I'm working with omnipay in laravel and I want to know how can I change the code to show in the paypal receip the total of every item and the description of them
$response=$gateway->purchase(
array(
'cancelURL' => $keys->getCancelUrl(),
'returnURL' => $keys->getReturnUrl(),
'description' => Cart::content(),
'amount' => '200.00',
'currency' => $keys->getCurrency()
)
)->send();</i>
推荐答案
我从来没有用过OmniPay,因为我在Google周围搜索并在适用于GitHub上OmniPay类的eMerchantPay驱动程序.
I never used OmniPay, by the way I've googled around and found what I think you are looking for on a eMerchantPay driver for the Omnipay class on GitHub.
$purchase = $gateway->purchase(array(
'currency' => 'GBP',
'transactionReference' => 'referenceID1',
'clientIp' => '95.87.212.88',
'items' => array(
array(
'name' => 10,
'price' => '5.00',
'description' => 'Product 1 Desc',
'quantity' => 2
),
array(
'name' => 12,
'price' => '5.00',
'description' => 'Shipping for Product 1',
'quantity' => 1
),
array(
'name' => 12,
'price' => '0.00',
'description' => 'Promotion',
'quantity' => 1
),
),
'card' => array(
'firstName' => 'Example',
'lastName' => 'User',
'number' => '4111111111111111',
'expiryMonth' => 7,
'expiryYear' => 2013,
'cvv' => 123,
'address1' => '123 Shipping St',
'address2' => 'Shipsville',
'city' => 'Shipstown',
'postcode' => '54321',
'state' => 'NY',
'country' => 'US',
'phone' => '(555) 987-6543',
'email' => '[email protected]',
)
));
我建议您尝试在脚本中实现该items数组并测试结果.
I'd suggest you to try to implement that items array in your script and test the results.
PS:也许您错过了它,但是有一个composer程序包可以将 OmniPay导入laravel Facade ;)
PS: Maybe you missed it, but there's a composer package that implements OmniPay into a laravel Facade ;)
这篇关于全能产品系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!