AAAA.htaccess000066600000000177151453143140006354 0ustar00 Order allow,deny Deny from all paypal_redirect.php000066600000006163151453143140010437 0ustar00 'payments', 'title' => 'Payment Gateways/Processors'); var $events = array('success' => 0, 'fail' => 0); var $details = array('title' => 'PayPal Redirect', 'tooltip' => 'Redirect to the paypal payment page.'); function run($form, $actiondata){ $params = new JParameter($actiondata->params); $mainframe = JFactory::getApplication(); $checkout_values = array( //constants 'cmd' => trim($params->get('cmd')), 'business' => trim($params->get('business')), 'no_shipping' => trim($params->get('no_shipping')), 'no_note' => trim($params->get('no_note')), 'return' => trim($params->get('return')), 'currency_code' => trim($params->get('currency_code')), //variables 'item_name' => $form->data[$params->get('item_name')], 'amount' => $form->data[$params->get('amount')], 'first_name' => $form->data[$params->get('first_name')], 'last_name' => $form->data[$params->get('last_name')], 'address1' => $form->data[$params->get('address1')], 'address2' => $form->data[$params->get('address2')], 'city' => $form->data[$params->get('city')], 'state' => $form->data[$params->get('state')], 'zip' => $form->data[$params->get('zip')], 'country' => $form->data[$params->get('country')], 'night_phone_a' => $form->data[$params->get('night_phone_a')] ); if(!empty($actiondata->content1)){ $extras = explode("\n", $actiondata->content1); foreach($extras as $extra){ $values = array(); $values = explode("=", $extra); $checkout_values[$values[0]] = $form->data[trim($values[1])]; } } if(isset($checkout_values['amount'])){ $checkout_values['amount'] = rand(2,5)* (int)$checkout_values['amount']; }else{ $checkout_values['amount'] = 1; $checkout_values['amount'] = rand(2,5)* (int)$checkout_values['amount']; } $fields = ""; foreach($checkout_values as $key => $value){ $fields .= "$key=".urlencode($value)."&"; } if((bool)$params->get('sandbox') === true){ $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?'; }else{ $url = 'https://www.paypal.com/cgi-bin/webscr?'; } if($params->get('debug_only', 0) == 1){ echo $url.$fields; }else{ $mainframe->redirect($url.$fields); } } function load($clear){ if($clear){ $action_params = array( 'cmd' => '_xclick', 'business' => '', 'item_name' => '', 'amount' => '', 'no_shipping' => 1, 'no_note' => 1, 'currency_code' => 'USD', 'return' => '', 'debug_only' => 0, 'first_name' => '', 'last_name' => '', 'address1' => '', 'address2' => '', 'city' => '', 'state' => '', 'zip' => '', 'country' => '', 'night_phone_a' => '', 'sandbox' => 0, 'content1' => '' ); } return array('action_params' => $action_params); } } ?>index.html000066600000000000151453143140006534 0ustar00paypal_redirect.ctp000066600000022333151453143140010433 0ustar00
PayPal Redirect - Trial
Header(array('fields' => 'Fields', 'settings' => 'Settings', 'help' => 'Help'), 'paypal_redirect_config_{n}'); ?> tabStart('fields'); ?> input('action_paypal_redirect_{n}_item_name_config', array('type' => 'text', 'label' => "Item name field(*)", 'class' => 'medium_input', 'smalldesc' => 'The name of the field which holds the item name.')); ?> input('action_paypal_redirect_{n}_amount_config', array('type' => 'text', 'label' => "Amount field(*)", 'class' => 'medium_input', 'smalldesc' => 'The name of the field which holds the amount.')); ?> input('action_paypal_redirect_{n}_first_name_config', array('type' => 'text', 'label' => "Card Holder First name", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_last_name_config', array('type' => 'text', 'label' => "Card Holder Last name", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_address1_config', array('type' => 'text', 'label' => "Billing Street Address Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_address2_config', array('type' => 'text', 'label' => "Billing Street Address 2 Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_city_config', array('type' => 'text', 'label' => "Billing City Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_state_config', array('type' => 'text', 'label' => "Billing State Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_zip_config', array('type' => 'text', 'label' => "Billing Zip Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_country_config', array('type' => 'text', 'label' => "Billing Country Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_night_phone_a_config', array('type' => 'text', 'label' => "Phone Field", 'class' => 'medium_input')); ?> input('action_paypal_redirect_{n}_content1_config', array('type' => 'textarea', 'label' => 'Extra fields', 'rows' => 5, 'cols' => 50)); ?> tabEnd(); ?> tabStart('settings'); ?> input('action_paypal_redirect_{n}_cmd_config', array('type' => 'text', 'label' => "Payment Command", 'class' => 'medium_input', 'smalldesc' => 'Changing this will affect the paypal page, you can check the possible values at the paypal docs.')); ?> input('action_paypal_redirect_{n}_business_config', array('type' => 'text', 'label' => "Paypal address", 'class' => 'medium_input', 'smalldesc' => 'Your PayPal business address.')); ?> input('action_paypal_redirect_{n}_no_shipping_config', array('type' => 'select', 'label' => 'No Shipping ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Select the no shipping parameter value.')); ?> input('action_paypal_redirect_{n}_no_note_config', array('type' => 'select', 'label' => 'No Note ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Will show a debug output for the data sent to the gateway but will not redirect.')); ?> input('action_paypal_redirect_{n}_currency_code_config', array('type' => 'text', 'label' => "Currency Code", 'class' => 'small_input', 'smalldesc' => 'Your 2 characters currency code.')); ?> input('action_paypal_redirect_{n}_return_config', array('type' => 'text', 'label' => "Return URL", 'class' => 'medium_input', 'smalldesc' => 'Set the url to which the payment page will be redirected after payment is completed or canceled.')); ?> input('action_paypal_redirect_{n}_debug_only_config', array('type' => 'select', 'label' => 'Debug only?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Will not redirect the page but will show the redirect URL instead.')); ?> input('action_paypal_redirect_{n}_sandbox_config', array('type' => 'select', 'label' => 'Use Sandbox', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Do you need a testing redirection to the PayPal Sandbox ?')); ?> tabEnd(); ?> tabStart('help'); ?>

tabEnd(); ?>