/** * 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; }
/** * 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; }
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; }
/** * Init single payment call to webservice * Invoice id is passed via notify_url * * @return string */ public function singlePayment(Payment_Invoice $invoice) { $buyer = $invoice->getBuyer(); return WebToPay::buildRequest(array('projectid' => $this->getParam('projectid'), 'sign_password' => $this->getParam('sign_password'), 'orderid' => $invoice->getNumber(), 'amount' => $this->moneyFormat($invoice->getTotalWithTax()), 'currency' => $invoice->getCurrency(), 'accepturl' => $this->getParam('return_url'), 'cancelurl' => $this->getParam('cancel_url'), 'callbackurl' => $this->getParam('notify_url'), 'paytext' => $invoice->getTitle(), 'p_firstname' => $buyer->getFirstName(), 'p_lastname' => $buyer->getLastName(), 'p_email' => $buyer->getEmail(), 'p_street' => $buyer->getAddress(), 'p_city' => $buyer->getCity(), 'p_state' => $buyer->getState(), 'p_zip' => $buyer->getZip(), 'p_countrycode' => $buyer->getCountry(), 'lang' => 'ENG', 'test' => $this->testMode)); }
/** * 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()); }
/** * @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; }
/** * @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; }