Skip to content

Commit

Permalink
Now each item will be in paypal items
Browse files Browse the repository at this point in the history
  • Loading branch information
webtechnick committed Jan 24, 2011
1 parent de794c3 commit 83787f2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions models/instant_payment_notification.php
Expand Up @@ -134,17 +134,18 @@ function email($options = array()){
function buildAssociationsFromIPN($post){
$retval = array();
$retval['InstantPaymentNotification'] = $post;
if(isset($post['num_cart_items']) && $post['num_cart_items'] >= 1){
if(isset($post['num_cart_items']) && $post['num_cart_items'] > 0){
$retval['PaypalItem'] = array();
for($i=1;$i<=$post['num_cart_items'];$i++){
$retval['PaypalItem'][$i]['item_name'] = $post["item_name$i"];
$retval['PaypalItem'][$i]['item_number'] = $post["item_number$i"];
$retval['PaypalItem'][$i]['item_number'] = $post["item_number$i"];
$retval['PaypalItem'][$i]['quantity'] = $post["quantity$i"];
$retval['PaypalItem'][$i]['mc_shipping'] = $post["mc_shipping$i"];
$retval['PaypalItem'][$i]['mc_handling'] = $post["mc_handling$i"];
$retval['PaypalItem'][$i]['mc_gross'] = $post["mc_gross_$i"];
$retval['PaypalItem'][$i]['tax'] = $post["tax$i"];
$key = $i - 1;
$retval['PaypalItem'][$key]['item_name'] = $post["item_name$i"];
$retval['PaypalItem'][$key]['item_number'] = $post["item_number$i"];
$retval['PaypalItem'][$key]['item_number'] = $post["item_number$i"];
$retval['PaypalItem'][$key]['quantity'] = $post["quantity$i"];
$retval['PaypalItem'][$key]['mc_shipping'] = $post["mc_shipping$i"];
$retval['PaypalItem'][$key]['mc_handling'] = $post["mc_handling$i"];
$retval['PaypalItem'][$key]['mc_gross'] = $post["mc_gross_$i"];
$retval['PaypalItem'][$key]['tax'] = $post["tax$i"];
}
}
return $retval;
Expand Down

0 comments on commit 83787f2

Please sign in to comment.