as title said I'm working with codeigniter (v2.X) and I'm including angelleye's Paypal library. It was pretty hard to understand at first but I manage to make recurring payments.Now I'm facing an other issue relative to that. I need to generate shopping cart array for SetExpressCheckout() and save it into a user's data session to use it after user log into paypal account. Here goes some code
private function _setPaypalPayment($data){ $cart['items'][0] = array('id' => '1','name' => "Payment ",'qty' => '1','price' => (float)$data->money, ); $cart['shopping_cart'] = array('items' => $cart['items'],'subtotal' => (float)$data->money,'shipping' => 0,'handling' => 0,'tax' => 0, ); $cart['shopping_cart']['grand_total'] = (float)$data->money; $this->session->set_userdata('shopping_cart', $cart); $SECFields = array('maxamt' => (float)$data->money,'returnurl' => site_url('payment/confirmTrackPayment'),'cancelurl' => 'http://xxx','hdrimg' => 'http://xxx/assets/images/logo_750X90.png','logoimg' => 'http://xxx/assets/images/logo_190X60.png','brandname' => 'xxx','surveyquestion' => '','customerservicenumber' => '', ); $Payments = array(); $Payment = array('amt' => (float)$data->money, ); array_push($Payments, $Payment); $PayPalRequestData = array('SECFields' => $SECFields,'Payments' => $Payments, ); $PayPalResult = $this->paypal_pro->SetExpressCheckout($PayPalRequestData); if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK'])) { return null; } else { return $PayPalResult['REDIRECTURL']; }}
This part is working just fine, it return the URL and the user can log into his account. But when he return into payment/confirmTrackPayment and I make
$cart = $this->session->userdata('shopping_cart');
or
$all = $this->session->all_userdata();
The info of shopping_cart is not there. I can't find any answer for these, please help me!
Thanks in advance