globals('core.eol'); $order = $this->globals('ecom.order_summary'); // +-- // | Printable form instructions. // +-- $instructions = "After verifying your order information and clicking the 'Continue' button, you will be directed to PayPal's secure site to enter your payment information. Once your payment information is entered and verified, you will be directed back to this web site for your order confirmation."; // +-- // | Create our relay URLs. // +-- $url_relay = $this->globals('core.url_ssl') . '/utilities/ecomrelay.php'; $url_good = $url_relay . '?payment_status=Completed&item_number=' . $order['order']['id']; $url_bad = $url_relay . '?payment_status=Cancel&item_number=' . $order['order']['id']; // +-- // | Set up the olpform array. // +-- $olpform = array('url' => 'https://www.paypal.com/cgi-bin/webscr', 'button' => 'Continue', 'fields' => array()); // +-- // | Create the HIDDEN fields for the form. // +-- $olpform['fields']['HIDDEN'][] = array('name' => 'business', 'value' => $order['gateway']['userid']); $olpform['fields']['HIDDEN'][] = array('name' => 'bn', 'value' => 'KRYPTRONIC_PS'); $olpform['fields']['HIDDEN'][] = array('name' => 'undefined_quantity', 'value' => '0'); $olpform['fields']['HIDDEN'][] = array('name' => 'item_name', 'value' => 'Online Order'); $olpform['fields']['HIDDEN'][] = array('name' => 'item_number', 'value' => $order['order']['id']); $olpform['fields']['HIDDEN'][] = array('name' => 'custom', 'value' => $this->globals('core_session.sid')); $olpform['fields']['HIDDEN'][] = array('name' => 'first_name', 'value' => $order['order']['fname']); $olpform['fields']['HIDDEN'][] = array('name' => 'last_name', 'value' => $order['order']['lname']); $olpform['fields']['HIDDEN'][] = array('name' => 'address1', 'value' => $order['order']['addone']); $olpform['fields']['HIDDEN'][] = array('name' => 'address2', 'value' => $order['order']['addtwo']); $olpform['fields']['HIDDEN'][] = array('name' => 'city', 'value' => $order['order']['city']); $olpform['fields']['HIDDEN'][] = array('name' => 'state', 'value' => $order['order']['stateabbus']); $olpform['fields']['HIDDEN'][] = array('name' => 'country', 'value' => $order['order']['countryabb']); $olpform['fields']['HIDDEN'][] = array('name' => 'zip', 'value' => $order['order']['postalcode']); $olpform['fields']['HIDDEN'][] = array('name' => 'email', 'value' => $order['order']['email']); $olpform['fields']['HIDDEN'][] = array('name' => 'notify_url', 'value' => $url_good); $olpform['fields']['HIDDEN'][] = array('name' => 'currency_code', 'value' => $this->globals('core_settings.core.basecurrency')); // +-- // | Define totals fields based on whether we have a recurring // | order amount or not. // +-- if ($order['order']['recurtotal'] > 0) { $olpform['fields']['HIDDEN'][] = array('name' => 'cmd', 'value' => '_xclick-subscriptions'); $olpform['fields']['HIDDEN'][] = array('name' => 'a3', 'value' => $order['order']['recurtotal']); $olpform['fields']['HIDDEN'][] = array('name' => 'p3', 'value' => '1'); $olpform['fields']['HIDDEN'][] = array('name' => 't3', 'value' => 'M'); $olpform['fields']['HIDDEN'][] = array('name' => 'src', 'value' => '1'); $olpform['fields']['HIDDEN'][] = array('name' => 'no_note', 'value' => '1'); $olpform['fields']['HIDDEN'][] = array('name' => 'return', 'value' => $url_good); $olpform['fields']['HIDDEN'][] = array('name' => 'cancel_return', 'value' => $url_bad); if ($order['order']['ordertotal'] > 0) { $olpform['fields']['HIDDEN'][] = array('name' => 'a1', 'value' => $order['order']['ordertotal']); $olpform['fields']['HIDDEN'][] = array('name' => 'p1', 'value' => '1'); $olpform['fields']['HIDDEN'][] = array('name' => 't1', 'value' => 'D'); } // End of if statement. } else { $olpform['fields']['HIDDEN'][] = array('name' => 'cmd', 'value' => '_ext-enter'); $olpform['fields']['HIDDEN'][] = array('name' => 'amount', 'value' => $order['order']['ordertotal']); $olpform['fields']['HIDDEN'][] = array('name' => 'redirect_cmd', 'value' => '_xclick'); $olpform['fields']['HIDDEN'][] = array('name' => 'return', 'value' => $url_good); $olpform['fields']['HIDDEN'][] = array('name' => 'cancel_return', 'value' => $url_bad); } // End of if statement. // +-- // | Create the DISPLAY fields for the form. // +-- $olpform['fields']['DISPLAY'][] = array('type' => 'PAYFORMCONTINUE', 'params' => array('name' => 'ecom_continue', 'required' => 1, 'display' => 'Payment Information', 'desc' => $instructions, 'option' => 'Enter Payment Information')); // +-- // | Globalize the $olpform array and return. // +-- $this->globals('ecom.olpform',$olpform); ?>