大家好,我正在 laravel 中使用omnipay,我想知道如何更改代码以在 paypal 收据中显示每个项目的总数及其描述
$response=$gateway->purchase(
array(
'cancelURL' => $keys->getCancelUrl(),
'returnURL' => $keys->getReturnUrl(),
'description' => Cart::content(),
'amount' => '200.00',
'currency' => $keys->getCurrency()
)
)->send();</i>
最佳答案
我从来没有使用过 OmniPay,顺便说一下,我在 google 上搜索了一下,找到了我认为您在 eMerchantPay driver for the Omnipay 上寻找的东西。 GitHub 上的类(class)。
$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' => '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6bcb9beb896b3aeb7bba6bab3f8b5b9bb" rel="noreferrer noopener nofollow">[email protected]</a>',
)
));
我建议您尝试在脚本中实现该项目数组并测试结果。
PS:也许你错过了,但是有一个 Composer 包实现了 OmniPay into a laravel Facade ;)
关于php - 全方位支付产品系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25068618/