Hello all,
I use a redirect in order to direct users to my HTTPS site. I have
just discovered that when I direct users to Paypal in order to make
their payments, the returning link doesn't work. It goes to my user
login page instead of the page that it's supposed to. I have done some
testing and discovered that I have been completely logged out of my
site when I return. The application doesn't take long enough for the
session to have timed out. I am just being logged out.
When I go back to the HTTP configuration, it works just fine. I am at
a loss as to what could be happening here.
I am implementing both Paypal and IPN. The IPN works just fine. Here
is some code:
app/config/config.php:
'App' => array(
'encoding' => 'UTF-8',
'baseUrl' => '',
'base' => '',
'dir' => 'app',
'webroot' => 'webroot',
'name' => 'domain.com',
'url' => 'https://www.domain.com',
'timezone' => 'America/New_York',
app/app_controller.php:
if ($this->appConfigurations['forceSSL'] == true) {
if (!env("HTTPS")) {
$this->redirect('https://' . env('SERVER_NAME') . $this-
>here);
}
}
One of my payment controllers:
if(!empty($this->data)) {
if($this->appConfigurations['gateway']) {
// Formating the data
$paypal['url'] =
Configure::read('Paypal.url');
$paypal['business'] = Configure::read('Paypal.email');
$paypal['lc'] =
Configure::read('Paypal.lc');
$paypal['currency_code'] =
$this->appConfigurations['currency'];
$paypal['item_name'] = $auction['Auction']['title'];
$paypal['item_number'] = $auction['Auction']['id'];
$paypal['amount'] = number_format($total, 2);
$paypal['return'] = $this->appConfigurations['url']
. '/
auctions/returning';
$paypal['notify_url'] = $this->appConfigurations['url']
. '/
auctions/ipn';
$paypal['custom'] = $user['User']['id'];
$paypal['first_name'] = $user['User']['first_name'];
$paypal['last_name'] = $user['User']['last_name'];
$paypal['email'] = $user['User']['email'];
$paypal['address1'] =
$userAddress['Billing']['Address']
['address_1'];
$paypal['address2'] =
$userAddress['Billing']['Address']
['address_2'];
$paypal['city'] =
$userAddress['Billing']['Address']
['city'];
$paypal['zip'] =
$userAddress['Billing']['Address']
['postcode'];
$this->Paypal->configure($paypal);
$paypalData = $this->Paypal->getFormData();
$this->set('paypalData', $paypalData);
} else {
// the gateway is not set
if ($auction['Auction']['bids'] > 0) {
// Find user first
$this->__process($auction, $user);
}else {
$auction['Auction']['status_id'] = 2;
$this->Auction->save($auction);
}
}
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php