Example #1
0
 /**
  * Init call to webservice or return form params
  * 
  * @see http://www.onebip.com/website/docs/Onebip_API.pdf
  * @param Payment_Invoice $invoice
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     $data = array();
     $data['username'] = $this->getParam('username');
     $data['description'] = $invoice->getTitle();
     $data['price'] = $invoice->getTotalWithTax() * 100;
     $data['currency'] = $invoice->getCurrency();
     $data['command'] = 'standard_pay';
     $data['item_code'] = $invoice->getId();
     $data['return_url'] = $this->getParam('return_url');
     $data['notify_url'] = $this->getParam('notify_url');
     $data['cancel_url'] = $this->getParam('cancel_url');
     $c = $invoice->getBuyer();
     $data['customer_email'] = $c->getEmail();
     $data['customer_firstname'] = $c->getFirstName();
     $data['customer_lastname'] = $c->getLastName();
     if ($c->getPhone()) {
         $data['customer_cell'] = $c->getPhone();
     }
     if ($c->getCountry()) {
         $data['customer_country'] = $c->getCountry();
     }
     if ($this->testMode) {
         $data['debug'] = 1;
         $data['debug_url'] = $this->getParam('notify_url');
     }
     $data['logo_url'] = $this->getParam('logo_url');
     return $data;
 }
 /**
  * @see http://integrate-payment-gateway.blogspot.in/2012/01/ccavenue-payment-integration-php.html
  * @param Payment_Invoice $invoice
  * @return array
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     $buyer = $invoice->getBuyer();
     $Merchant_Id = $this->getParam('merchantid');
     $WorkingKey = $this->getParam('workingkey');
     $Amount = $invoice->getTotalWithTax();
     $Order_Id = $invoice->getId();
     $Redirect_Url = $this->getParam('redirect_url');
     $Checksum = getCheckSum($Merchant_Id, $Amount, $Order_Id, $Redirect_Url, $WorkingKey);
     $data = array();
     $data['Merchant_Id'] = $Merchant_Id;
     $data['Amount'] = $Amount;
     $data['Order_Id'] = $Order_Id;
     $data['Redirect_Url'] = $Redirect_Url;
     $data['Checksum'] = $Checksum;
     $data['TxnType'] = 'A';
     $data['ActionID'] = 'TXN';
     $data['billing_cust_name'] = $buyer->getFirstName() . ' ' . $buyer->getLastName();
     $data['billing_cust_address'] = $buyer->getAddress();
     $data['billing_cust_country'] = $buyer->getCountry();
     $data['billing_cust_state'] = $buyer->getState();
     $data['billing_cust_city'] = $buyer->getCity();
     $data['billing_zip'] = $buyer->getZip();
     $data['billing_zip_code'] = $buyer->getZip();
     $data['billing_cust_tel'] = $buyer->getPhone();
     $data['billing_cust_email'] = $buyer->getEmail();
     $data['delivery_cust_name'] = $buyer->getFirstName() . ' ' . $buyer->getLastName();
     $data['delivery_cust_address'] = $buyer->getAddress();
     $data['delivery_cust_city'] = $buyer->getCity();
     $data['delivery_cust_country'] = $buyer->getCountry();
     $data['delivery_cust_state'] = $buyer->getState();
     $data['delivery_cust_tel'] = $buyer->getPhone();
     $data['delivery_cust_notes'] = $invoice->getTitle();
     return $data;
 }
Example #3
0
 /**
  * Authorize.net SIM integration.
  * Requires to setup ONLY "Silent Post URL" at mechants account
  * 
  * @param Payment_Invoice $invoice
  * @return array
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     $b = $invoice->getBuyer();
     $fp_sequence = uniqid();
     $fp_timestamp = time();
     $finger = $this->_getFingerprint($invoice->getTotalWithTax(), $invoice->getCurrency(), $fp_sequence, $fp_timestamp);
     $params = array('x_fp_hash' => $finger, 'x_fp_sequence' => $fp_sequence, 'x_fp_timestamp' => $fp_timestamp, 'x_login' => $this->getParam('apiLoginId'), 'x_version' => '3.1', 'x_show_form' => 'PAYMENT_FORM', 'x_method' => 'CC', 'x_amount' => $invoice->getTotalWithTax(), 'x_currency_code' => $invoice->getCurrency(), 'x_invoice_id' => $invoice->getId(), 'x_invoice_num' => $invoice->getNumber(), 'x_test_request' => $this->testMode ? 'TRUE' : 'FALSE', 'x_address' => $b->getAddress(), 'x_city' => $b->getCity(), 'x_country' => $b->getCountry(), 'x_email' => $b->getEmail(), 'x_first_name' => $b->getFirstName(), 'x_last_name' => $b->getLastName(), 'x_phone' => $b->getPhone(), 'x_company' => $b->getCompany(), 'x_state' => $b->getState(), 'x_zip' => $b->getZip(), 'x_delim_data' => 'FALSE', 'x_relay_response' => 'FALSE', 'x_receipt_link_method' => 'GET', 'x_receipt_link_text' => 'Go back merchant', 'x_receipt_link_url' => $this->getParam('return_url'));
     return $params;
 }
Example #4
0
 /**
  * Init call to webservice or return form params
  * @param Payment_Invoice $invoice
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     $parameters = array('terminalId' => $this->getParam('terminalId'), 'userName' => $this->getParam('userName'), 'userPassword' => $this->getParam('userPassword'), 'orderId' => $invoice->getId() . rand(1, 9999), 'amount' => $invoice->getTotalWithTax(), 'localDate' => date('Ynd'), 'localTime' => date('His'), 'additionalData' => $invoice->getTitle(), 'callBackUrl' => $this->getParam('redirect_url'), 'payerId' => "0");
     $client = $this->_getSoapClient();
     $result = $client->bpPayRequest($parameters);
     $res = explode(',', $result->return);
     $code = isset($res[0]) ? $res[0] : NULL;
     $refid = isset($res[1]) ? $res[1] : NULL;
     if ($code !== '0') {
         throw new Exception('Mellat error requesting bpPayRequest: ' . $code);
     }
     $data = array('RefId' => $refid);
     return $data;
 }
Example #5
0
 public function singlePayment(Payment_Invoice $invoice)
 {
     $c = $invoice->getBuyer();
     $params = array('ap_merchant' => $this->getParam('email'), 'ap_purchasetype' => 'service', 'ap_currency' => $invoice->getCurrency(), 'ap_alerturl' => $this->getParam('notify_url'), 'ap_returnurl' => $this->getParam('return_url'), 'ap_cancelurl' => $this->getParam('cancel_url'), 'ap_fname' => $c->getFirstName(), 'ap_lname' => $c->getLastName(), 'ap_contactemail' => $c->getEmail(), 'ap_contactphone' => $c->getPhone(), 'ap_addressline1' => $c->getAddress(), 'ap_city' => $c->getCity(), 'ap_stateprovince' => $c->getState(), 'ap_zippostalcode' => $c->getZip(), 'ap_country' => $c->getCountry(), 'apc_1' => $invoice->getId(), 'apc_2' => $invoice->getNumber());
     $i = 1;
     foreach ($invoice->getItems() as $item) {
         $params['ap_itemcode_' . $i] = $item->getId();
         $params['ap_itemname_' . $i] = $item->getTitle();
         $params['ap_description_' . $i] = $item->getDescription();
         $params['ap_amount_' . $i] = $item->getPrice() + $item->getTax();
         $params['ap_quantity_' . $i] = $item->getQuantity();
         $i++;
     }
     return $params;
 }
Example #6
0
 public function singlePayment(Payment_Invoice $invoice)
 {
     $client = $invoice->getBuyer();
     $contract = $this->getParam('type');
     switch ($contract) {
         case '0':
             $service = 'trade_create_by_buyer';
             break;
         case '1':
             $service = 'create_direct_pay_by_user';
             break;
         case '2':
             $service = 'create_partner_trade_by_buyer';
             break;
     }
     $parameter = array('service' => $service, 'partner' => $this->getParam('partner'), '_input_charset' => $this->getParam('charset'), 'notify_url' => $this->getParam('notify_url'), 'return_url' => $this->getParam('thankyou_url'), 'subject' => $invoice->getTitle(), 'out_trade_no' => $invoice->getId(), 'price' => $invoice->getTotalWithTax(), 'quantity' => 1, 'payment_type' => 1, 'logistics_type' => 'EXPRESS', 'logistics_fee' => 0, 'logistics_payment' => 'BUYER_PAY_AFTER_RECEIVE', 'seller_email' => $this->getParam('seller_email'));
     ksort($parameter);
     reset($parameter);
     $data = $parameter;
     $data['sign'] = $this->_generateSignature($parameter);
     $data['sign_type'] = 'MD5';
     return $data;
 }
 public function recurrentPayment(Payment_Invoice $invoice)
 {
     $recurrenceInfo = $invoice->getSubscription();
     $amount = $invoice->getCurrency() . ' ' . $invoice->getTotalWithTax();
     $description = $invoice->getTitle();
     $promotionAmount = 0;
     $processImmediate = true;
     $immediateReturn = true;
     $referenceId = $invoice->getId();
     $recurringStartDate = "";
     $recurringFrequency = $this->_getRecurringFrequency($recurrenceInfo);
     // '1 month'
     $subscriptionPeriod = "";
     //'12 months';
     $formHiddenInputs['accessKey'] = $this->getParam('AWSAccessKeyId');
     $formHiddenInputs['amount'] = $amount;
     $formHiddenInputs['description'] = $description;
     $formHiddenInputs['recurringFrequency'] = $recurringFrequency;
     $formHiddenInputs['subscriptionPeriod'] = $subscriptionPeriod;
     $formHiddenInputs['recurringStartDate'] = $recurringStartDate;
     $formHiddenInputs['promotionAmount'] = $promotionAmount;
     $formHiddenInputs['referenceId'] = $referenceId;
     $formHiddenInputs['immediateReturn'] = true;
     $formHiddenInputs['ipnUrl'] = $this->getParam('notify_url');
     $formHiddenInputs['returnUrl'] = $this->getParam('return_url');
     $formHiddenInputs['abandonUrl'] = $this->getParam('cancel_url');
     $formHiddenInputs['processImmediate'] = $processImmediate;
     uksort($formHiddenInputs, "strnatcasecmp");
     $stringToSign = "";
     foreach ($formHiddenInputs as $formHiddenInputName => $formHiddenInputValue) {
         $stringToSign = $stringToSign . $formHiddenInputName . $formHiddenInputValue;
     }
     $formHiddenInputs['signature'] = $this->_getSignature($stringToSign);
     //throw new Exception(print_r($formHiddenInputs, 1));
     return $formHiddenInputs;
 }
Example #8
0
 /**
  * Init single payment call to webservice
  * Invoice id is passed via notify_url
  *
  * @param Payment_Invoice $invoice
  * @return array
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     return array('ik_co_id' => $this->getParam('ik_co_id'), 'ik_pm_no' => $invoice->getId(), 'ik_am' => $invoice->getTotal(), 'ik_desc' => $invoice->getTitle(), 'ik_cur' => $invoice->getCurrency(), 'ik_ia_u' => $this->getParam('notify_url'), 'ik_ia_m' => 'post', 'ik_suc_u' => $this->getParam('return_url'), 'ik_suc_m' => 'get', 'ik_pnd_u' => $this->getParam('return_url'), 'ik_pnd_m' => 'get', 'ik_fal_u' => $this->getParam('cancel_url'), 'ik_fal_m' => 'get', 'ik_x_iid' => $invoice->getId());
 }
 /**
  * Perform recurent payment
  * @param Payment_Invoice $invoice
  * @see http://www.2checkout.com/blog/knowledge-base/merchants/tech-support/3rd-party-carts/parameter-sets/pass-through-product-parameter-set/
  */
 public function recurrentPayment(Payment_Invoice $invoice)
 {
     $subs = $invoice->getSubscription();
     $buyer = $invoice->getBuyer();
     $data['sid'] = $this->getParam('vendor_nr');
     $data['mode'] = '2CO';
     foreach ($invoice->getItems() as $i => $item) {
         $data['li_' . $i . '_type'] = 'product';
         $data['li_' . $i . '_name'] = $item->getTitle();
         $data['li_' . $i . '_quantity'] = $item->getQuantity();
         $data['li_' . $i . '_tangible'] = 'N';
         $data['li_' . $i . '_description'] = $item->getDescription();
         $data['li_' . $i . '_recurrence'] = $subs->getCycle() . ' ' . ucfirst($subs->getUnit());
         $data['li_' . $i . '_price'] = $item->getTotalWithTax();
     }
     $data['merchant_order_id'] = $invoice->getId();
     $data['invoice_hash'] = $invoice->getId();
     $data['invoice_id'] = $invoice->getId();
     $data['fixed'] = 1;
     $data['lang'] = 'en';
     $data['skip_landing'] = 0;
     $data['id_type'] = 1;
     $data['x_receipt_link_URL'] = $this->getParam('return_url');
     $data['card_holder_name'] = $buyer->getFirstName() . ' ' . $buyer->getLastName();
     $data['phone'] = $buyer->getPhone();
     $data['phone_extension'] = '';
     $data['email'] = $buyer->getEmail();
     $data['street_address'] = $buyer->getAddress();
     $data['city'] = $buyer->getCity();
     $data['state'] = $buyer->getState();
     $data['zip'] = $buyer->getZip();
     $data['country'] = $buyer->getCountry();
     $data['subscription'] = 1;
     if ($this->testMode) {
         $data['demo'] = 'Y';
     }
     return $data;
 }
 /**
  * @see http://www.libertyreserve.com/en/help/sciguide
  * @param Payment_Invoice $invoice
  * @return array - list of parameters to be posted to serviceUrl via POST method
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     $params = array('lr_acc' => $this->getParam('accountNumber'), 'lr_amnt' => $invoice->getTotal(), 'lr_currency' => 'LR' . $invoice->getCurrency(), 'lr_merchant_ref' => $invoice->getNumber(), 'lr_success_url' => $this->getParam('return_url'), 'lr_success_url_method' => 'GET', 'lr_fail_url' => $this->getParam('cancel_url'), 'lr_fail_url_method' => 'GET', 'lr_status_url' => $this->getParam('notify_url'), 'lr_status_url_method' => 'POST', 'lr_comments' => $invoice->getTitle(), 'bb_invoice_id' => $invoice->getId());
     return $params;
 }