/** * @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; }
/** * 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; }
/** * 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; }
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; }
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; }
/** * 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)); }
/** * 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; }
public function singlePayment(Payment_Invoice $invoice) { $c = $invoice->getBuyer(); $params = array('pay_to_email' => $this->getParam('email'), 'transaction_id' => $invoice->getNumber(), 'return_url' => $this->getParam('return_url'), 'cancel_url' => $this->getParam('cancel_url'), 'status_url' => $this->getParam('notify_url'), 'merchant_fields' => 'invoice_id', 'invoice_id' => $invoice->getNumber(), 'pay_from_email' => $c->getEmail(), 'firstname' => $c->getFirstname(), 'lastname' => $c->getLastname(), 'address' => $c->getAddress(), 'phone_number' => $c->getPhone(), 'postal_code' => $c->getZip(), 'city' => $c->getCity(), 'state' => $c->getState(), 'country' => $c->getCountry(), 'amount' => $invoice->getTotal(), 'currency' => $invoice->getCurrency()); return $params; }