Skip to content

Commit

Permalink
Merge pull request #141 from tunderdomb/patch-1
Browse files Browse the repository at this point in the history
check item class
  • Loading branch information
delatbabel authored Sep 6, 2016
2 parents 3a88895 + d6f345a commit bc16ae6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Omnipay\PayPal\Message;

use Omnipay\Common\ItemBag;
use Omnipay\PayPal\PayPalItem;
use Omnipay\PayPal\PayPalItemBag;

/**
Expand Down Expand Up @@ -305,7 +306,9 @@ protected function getItemData()
$data["L_PAYMENTREQUEST_0_DESC$n"] = $item->getDescription();
$data["L_PAYMENTREQUEST_0_QTY$n"] = $item->getQuantity();
$data["L_PAYMENTREQUEST_0_AMT$n"] = $this->formatCurrency($item->getPrice());
$data["L_PAYMENTREQUEST_0_NUMBER$n"] = $item->getCode();
if ($item instanceof PayPalItem) {
$data["L_PAYMENTREQUEST_0_NUMBER$n"] = $item->getCode();
}

$data["PAYMENTREQUEST_0_ITEMAMT"] += $item->getQuantity() * $this->formatCurrency($item->getPrice());
}
Expand Down

0 comments on commit bc16ae6

Please sign in to comment.