Ejemplo n.º 1
0
 public function _process($params)
 {
     // ask paypal to generate request url
     $data = array('rm' => '2', 'cmd' => '_xclick', 'business' => $this->settings['paypal_email'], 'return' => $params['return_url'], 'cancel_return' => $params['cancel_url'], 'notify_url' => $params['notify_url'], 'item_name' => $params['reference'], 'amount' => sprintf('%01.2f', $params['amount']), 'currency_code' => $params['currency_code'], 'no_shipping' => 1);
     $post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
     Merchant::redirect_post($post_url, $data);
 }
 public function _process($params)
 {
     $fp_sequence = $params['reference'];
     $time = time();
     $fingerprint = AuthorizeNetSIM_Form::getFingerprint($this->settings['api_login_id'], $this->settings['transaction_key'], $params['amount'], $fp_sequence, $time);
     $data = array('x_amount' => $params['amount'], 'x_delim_data' => 'FALSE', 'x_fp_sequence' => $fp_sequence, 'x_fp_hash' => $fingerprint, 'x_fp_timestamp' => $time, 'x_relay_response' => 'TRUE', 'x_relay_url' => $params['return_url'], 'x_login' => $this->settings['api_login_id'], 'x_show_form' => 'PAYMENT_FORM');
     $sim = new AuthorizeNetSIM_Form($data);
     $post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
     Merchant::redirect_post($post_url, $sim->getHiddenFieldString());
 }
 public function _process($params)
 {
     // post data to 2checkout
     $data = array('sid' => $this->settings['account_no'], 'cart_order_id' => $params['reference'], 'total' => $params['amount'], 'tco_currency' => $params['currency_code'], 'skip_landing' => 1, 'x_Receipt_Link_URL' => $params['return_url']);
     foreach (array('card_holder_name' => 'card_name', 'street_address' => 'address', 'street_address2' => 'address2', 'city' => 'city', 'state' => 'region', 'zip' => 'postcode', 'country' => 'country', 'phone' => 'phone', 'email' => 'email') as $key => $field) {
         if (isset($params[$field])) {
             $data[$key] = $params[$field];
         }
     }
     if ($this->settings['test_mode']) {
         $data['demo'] = 'Y';
     }
     Merchant::redirect_post(self::PROCESS_URL, $data);
 }
Ejemplo n.º 4
0
 public function _process($params)
 {
     $data = array('instId' => $this->settings['installation_id'], 'cartId' => $params['reference'], 'amount' => $params['amount'], 'currency' => $params['currency_code'], 'testMode' => $this->settings['test_mode'] ? 100 : 0, 'MC_callback' => $params['return_url']);
     if (!empty($params['card_name'])) {
         $data['name'] = $params['card_name'];
     }
     if (!empty($params['address'])) {
         $data['address1'] = $params['address'];
     }
     if (!empty($params['address2'])) {
         $data['address2'] = $params['address2'];
     }
     if (!empty($params['city'])) {
         $data['town'] = $params['city'];
     }
     if (!empty($params['region'])) {
         $data['region'] = $params['region'];
     }
     if (!empty($params['postcode'])) {
         $data['postcode'] = $params['postcode'];
     }
     if (!empty($params['country'])) {
         $data['country'] = $params['country'];
     }
     if (!empty($params['phone'])) {
         $data['tel'] = $params['phone'];
     }
     if (!empty($params['email'])) {
         $data['email'] = $params['email'];
     }
     if (!empty($this->settings['secret'])) {
         $data['signatureFields'] = 'instId:amount:currency:cartId';
         $signature_data = array($this->settings['secret'], $data['instId'], $data['amount'], $data['currency'], $data['cartId']);
         $data['signature'] = md5(implode(':', $signature_data));
     }
     $post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
     Merchant::redirect_post($post_url, $data);
 }
 public function _process($params)
 {
     $fp_sequence = $params['reference'];
     $time = time();
     $fingerprint = AuthorizeNetSIM_Form::getFingerprint($this->settings['api_login_id'], $this->settings['transaction_key'], $params['amount'], $fp_sequence, $time);
     $data = array('x_amount' => $params['amount'], 'x_delim_data' => 'FALSE', 'x_fp_sequence' => $fp_sequence, 'x_fp_hash' => $fingerprint, 'x_fp_timestamp' => $time, 'x_invoice_num' => $params['reference'], 'x_relay_response' => 'TRUE', 'x_relay_url' => $params['return_url'], 'x_login' => $this->settings['api_login_id'], 'x_show_form' => 'PAYMENT_FORM', 'x_customer_ip' => $this->CI->input->ip_address());
     // set extra billing details if we have them
     if (isset($params['card_name'])) {
         $names = explode(' ', $params['card_name'], 2);
         $data['x_first_name'] = $names[0];
         $data['x_last_name'] = isset($names[1]) ? $names[1] : '';
     }
     if (isset($params['address']) and isset($params['address2'])) {
         $params['address'] = trim($params['address'] . " \n" . $params['address2']);
     }
     foreach (array('x_company' => 'company', 'x_address' => 'address', 'x_city' => 'city', 'x_state' => 'region', 'x_zip' => 'postcode', 'x_country' => 'country', 'x_phone' => 'phone', 'x_email' => 'email') as $key => $field) {
         if (isset($params[$field])) {
             $data[$key] = $params[$field];
         }
     }
     $sim = new AuthorizeNetSIM_Form($data);
     $post_url = $this->settings['test_mode'] ? self::PROCESS_URL_TEST : self::PROCESS_URL;
     Merchant::redirect_post($post_url, $sim->getHiddenFieldString());
 }