質問
ハロー・マイ・ラルヴァイでオムニペと一緒に取り組んでいて、私はPaypalを受信するためにコードを変更する方法を知りたいのですか?
$response=$gateway->purchase(
array(
'cancelURL' => $keys->getCancelUrl(),
'returnURL' => $keys->getReturnUrl(),
'description' => Cart::content(),
'amount' => '200.00',
'currency' => $keys->getCurrency()
)
)->send();</i>
. 解決
私はオムニペイを決して使いました、そして私が周りにして、私があなたが探していると思うことを見つけたことを見つけて見つけた github上のOmnipay クラスのためのemerchantpayドライバ。
$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' => 'john@example.com',
)
));
.
あなたのスクリプトにアイテム配列を実装し、結果をテストしようとすることをお勧めします。
PS:多分あなたはそれを見逃したが、 OmnipayをLaravel Facadeに実装する作曲家パッケージがあります。/ a>;)
他のヒント
ありがとうございました。 PayPalで何かを共有するつもりです。それがSetItems($ array)のアレイを追加する方法があります そしてそれは非常にクールです
foreach (Cart::content() as $content)
{
$items->add(array(
'name' => $content->name,
'quantity' => $content->qty,
'price' => $content->price,
));
}
$items->add(array(
'name' => 'IVA',
'quantity' => '1',
'price' => $iva,
));
$response = $gateway->purchase(
array(
'cancelURL' => $keys->getCancelUrl(),
'returnURL' => $keys->getReturnUrl(),
'description' => 'Venta',
'amount' => $total,
'currency' => $keys->getCurrency()
)
)->setItems($items)->send();
.
私が見つけることができない唯一のものは、アイテムのように追加された税金を追加する方法でした
所属していません StackOverflow