public function ipn($data, Payment_Invoice $invoice) { $tx = new Payment_Transaction(); $tx->setAmount($invoice->getTotal()); $tx->setCurrency($invoice->getCurrency()); $tx->setId(md5(uniqid($invoice->getNumber()))); $tx->setIsValid(true); $tx->setStatus(Payment_Transaction::STATUS_COMPLETE); $tx->setType(Payment_Transaction::TXTYPE_PAYMENT); return $tx; }
public function singlePayment(Payment_Invoice $invoice) { $params = array('merchantID' => $this->getParam('merchantId'), 'SubID' => (int) $this->getParam('subId'), 'amount' => (int) ($invoice->getTotal() * 100), 'purchaseID' => $invoice->getNumber(), 'currency' => $invoice->getCurrency(), 'hash' => $this->_getHash($invoice), 'paymentType' => 'iDEAL', 'validUntil' => $this->_getValidUntil(), 'urlSuccess' => $this->getParam('return_url'), 'urlCancel' => $this->getParam('cancel_url'), 'urlError' => $this->getParam('return_url'), 'urlService' => $this->getParam('notify_url')); $i = 1; foreach ($invoice->getItems() as $item) { $params['itemNumber' . $i] = $item->getId(); $params['itemDescription' . $i] = $item->getDescription(); $params['itemQuantity' . $i] = $item->getQuantity(); $params['itemPrice' . $i] = (int) ($item->getPrice() * 100); $i++; } return $params; }
/** * 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()); }
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; }
/** * @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; }