title: not getting paypal return value
body: <p>i have two type of payments in my system built in phpfox </p>
  
  <p>one is recurring method and other is parallel payment </p>
  
  <p>i dint get return values in parallel payment but i get return parameters in recurring option</p>
  
  <p>the following is the sample output i got in parallel payment option</p>
  
  <pre><code>Array ( [do] =&gt; /subscribe/complete/ [PHPSESSID] =&gt; 74b50226b0076bd66e1ddbc8baecd23d [corecf2bvisit] =&gt; 1400432842 [corecf2binvited_by_email_form] =&gt; akhil@wdstech.com [corecf2bcur_mailid] =&gt; akhil@wdstech.com [corecf2binvited_by_user] =&gt; 0 [corecf2binvited_by_email] =&gt; 0 )
  </code></pre>
  
  <p>but i got returnvalues including amount in recurring option</p>
  
  <p>how can i solve it</p>
  
  <p>a detailed view of my code is given below</p>
  
  <pre><code>public function getForm()
  {       
      $bCurrencySupported = true;
      echo "&lt;script&gt;console.log('within-paypal')&lt;/script&gt;";
      if (!in_array($this-&gt;_aParam['currency_code'], $this-&gt;_aCurrency))
      {
          if (!empty($this-&gt;_aParam['alternative_cost']))
          {
              $aCosts = unserialize($this-&gt;_aParam['alternative_cost']);
              foreach ($aCosts as $aCost)
              {
                  $sCode = key($aCost);
                  $iPrice = $aCost[key($aCost)];
  
                  if (in_array($sCode, $this-&gt;_aCurrency))
                  {
                      $this-&gt;_aParam['amount'] = $iPrice;
                      $this-&gt;_aParam['currency_code'] = $sCode;
                      $bCurrencySupported = false;
                      break;
                  }
              }
  
              if ($bCurrencySupported === true)
              {
                  return false;
              }
          }
          else
          {
              return false;
          }
      } #//by son
              $package_id = $this-&gt;_aParam['package_id']; //purchased package id - 2:Good Friend
              echo "&lt;script&gt;console.log('packageId-in-paypalclass-$package_id')&lt;/script&gt;";
              if($package_id == 2){
                  #//chk if its an upgrade
                  $isUpgrad = $this-&gt;_aParam['is_upgrade'];
                  if(isset($isUpgrad) &amp;&amp; $isUpgrad==1){
                      return Phpfox_Error::display('Need invitation to upgrade to this subscription level!!');
                  }
                  #//get the details of the inviter users end */
                  $pay_ids = $this-&gt;_aParam['pay_ids'];
                  echo "&lt;script&gt;console.log('payid-count-".  count($pay_ids)."')&lt;/script&gt;";
                  #//echo '&lt;pre&gt;'; print_r($pay_ids); echo '&lt;/pre&gt;';
                  if($pay_ids[0] == 'admin'){
                      $rec_dtl[0]['rec_email'] = $this-&gt;_aParam['setting']['paypal_email'];
                      $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount'];
                      $rec_dtl[0]['primary_recvr'] = "false";}else{
                      if(count($pay_ids) &gt;0){
                          $j = 0;
                          foreach($pay_ids as $pay){
                              if($pay[$j] != 'NULL'){
                                  $rec_dtl[$j]['rec_email'] = $pay;
                                  $rec_dtl[$j]['primary_recvr'] = 'false';                        }
                              $j++;
                          }      
                      }
                      switch (count($pay_ids)) {
                          case 1:
                              $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount'];
                              break;
                          case 2:
                              if($pay_ids[1] == 'NULL'){
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount'];
                              }else{
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount']-1;
                                  $rec_dtl[1]['rec_amount'] = '1.00';
                              }
                              break;
                          case 3:
                              if($pay_ids[1]=='NULL' &amp;&amp; $pay_ids[2]=='NULL'){
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount'];
                              }
                              if($pay_ids[2] == 'NULL'){
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount']-1;
                                  $rec_dtl[1]['rec_amount'] = '1.00';
                              }
                              if($pay_ids[1] == 'NULL'){
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount'];
                              }else{
                                  $rec_dtl[0]['rec_amount'] = $this-&gt;_aParam['amount']-2;
                                  $rec_dtl[1]['rec_amount'] = '1.00';
                                  $rec_dtl[2]['rec_amount'] = '1.00';
                              }
                              break;
  
                          default:
                              break;
                      }
                  }
                  $receiver = array();
                  $recvr_dtls = $rec_dtl;
                  $currencyCode = $this-&gt;_aParam['currency_code'];
                  $returnUrl = $cancelUrl = $this-&gt;_aParam['return'];
                  for($i=0; $i&lt;count($recvr_dtls); $i++) {
                      $receiver[$i] = new Receiver();
                      $receiver[$i]-&gt;email = $recvr_dtls[$i]['rec_email'];
                      $receiver[$i]-&gt;amount = $recvr_dtls[$i]['rec_amount'];
                      $receiver[$i]-&gt;primary = $recvr_dtls[$i]['primary_recvr'];
                  }
                  $receiverList = new ReceiverList($receiver);
                  $payRequest = new PayRequest(new RequestEnvelope("en_US"), "PAY", $cancelUrl, $currencyCode, $receiverList, $returnUrl);$payRequest-&gt;returnUrl = $returnUrl;
                  $payRequest-&gt;currencyCode = $currencyCode;
                  $payRequest-&gt;receiverList = $receiverList;
                  $service = new AdaptivePaymentsService(Configuration::getAcctAndConfig());
                  $response = $service-&gt;Pay($payRequest);
  
                  $ack = strtoupper($response-&gt;responseEnvelope-&gt;ack);
  
                  if($ack == "SUCCESS"){$payKey = $response-&gt;payKey;
                      $aForm = array(
                          'url' =&gt; ($this-&gt;_aParam['is_test'] ? 'https://www.sandbox.paypal.com/cgi-bin/webscr&amp;cmd=_ap-payment&amp;paykey='.$payKey : 'https://www.paypal.com/cgi-bin/webscr&amp;cmd=_ap-payment&amp;paykey=' . $payKey),
                          'item_name' =&gt; $this-&gt;_aParam['item_name'],
                          'item_number' =&gt; $this-&gt;_aParam['item_number'],
                          'currency_code' =&gt; $this-&gt;_aParam['currency_code'],
                          'amount' =&gt; $this-&gt;_aParam['amount'],
                          'notify_url' =&gt; Phpfox::getLib('gateway')-&gt;url('paypal'),
                          'return' =&gt; $this-&gt;_aParam['return'],'rm'=&gt; '2',
                          'no_shipping' =&gt; '1',
                          'no_note' =&gt; '1'
                      );
                  }else{$aForm = array('url' =&gt; '#');
                      return Phpfox_Error::display('Failed Registration!!');
                  }}else{$aForm = array(
          'url' =&gt; ($this-&gt;_aParam['is_test'] ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr'),
          'param' =&gt; array(
              'business' =&gt; $this-&gt;_aParam['setting']['paypal_email'],
              'item_name' =&gt; $this-&gt;_aParam['item_name'],
              'item_number' =&gt; $this-&gt;_aParam['item_number'],
              'currency_code' =&gt; $this-&gt;_aParam['currency_code'],
              'notify_url' =&gt; Phpfox::getLib('gateway')-&gt;url('paypal'),
              'return' =&gt; $this-&gt;_aParam['return'],
              'no_shipping' =&gt; '1',
              'no_note' =&gt; '1'
          )
      );if ($this-&gt;_aParam['recurring'] &gt; 0)
      {
          switch ($this-&gt;_aParam['recurring'])
          {
              case '1':
                  $t3 = 'M'; 
                  $p3 = 1;
                  break;
              case '2':
                  $t3 = 'M'; 
                  $p3 = 3;
                  break;
              case '3':
                  $t3 = 'M'; 
                  $p3 = 6;
                  break;
              case '4':
                  $t3 = 'Y'; 
                  $p3 = 1;
                  break;              
          }           
  
          if (!empty($this-&gt;_aParam['alternative_recurring_cost']))
          {
              $aCosts = unserialize($this-&gt;_aParam['alternative_recurring_cost']);
              $bPassed = false;
              foreach ($aCosts as $sKey =&gt; $iCost)
              {
                  if (in_array($sKey, $this-&gt;_aCurrency))
                  {
                      $this-&gt;_aParam['recurring_cost'] = $iCost;
                      if (is_array($this-&gt;_aParam['recurring_cost']))
                      {
                          $aRec = array_values($this-&gt;_aParam['recurring_cost']);
                          $this-&gt;_aParam['recurring_cost'] = array_shift($aRec);
                      }
                      $bPassed = true;
                      break;
                  }
              }
  
              if ($bPassed === false)
              {
                  return false;
              }
          }
  
          /* 
              a1 is optional an price for the trial period @see https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&amp;content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables#id08A6HI00JQU 
              a3 is the price of the transaction required
          */
  
                      $aForm['param']['cmd'] = '_xclick-subscriptions';
                      $aForm['param']['a1'] = $this-&gt;_aParam['amount'];
                      $aForm['param']['a3'] = $this-&gt;_aParam['recurring_cost']; // $aCosts[$this-&gt;_aParam['currency_code']]; change made for 3.7.1
                      $aForm['param']['t1'] = $t3;
                      $aForm['param']['p1'] = $p3;
                      $aForm['param']['t3'] = $t3;
                      $aForm['param']['p3'] = $p3;            
                      $aForm['param']['src'] = '1';
                      $aForm['param']['sra'] = '1';
      }
      else 
      {
                      $aForm['param']['cmd'] = '_xclick';
                      $aForm['param']['amount'] = $this-&gt;_aParam['amount'];       
      }
          }
  
      return $aForm;
  }
  </code></pre>