本文整理汇总了PHP中Invoice::getLineDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::getLineDescription方法的具体用法?PHP Invoice::getLineDescription怎么用?PHP Invoice::getLineDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invoice
的用法示例。
在下文中一共展示了Invoice::getLineDescription方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$a = new Am_Paysystem_Action_Redirect(self::URL);
$result->setAction($a);
$a->ok_receiver = $this->getConfig('wallet_id');
$a->ok_invoice = $invoice->public_id;
$a->ok_currency = strtoupper($invoice->currency);
if (!(double) $invoice->second_total) {
$a->ok_kind = 'payment';
$a->ok_item_1_name = $invoice->getLineDescription();
$a->ok_item_1_price = $invoice->first_total;
} else {
$a->ok_kind = 'subscription';
$a->ok_s_title = $invoice->getLineDescription();
if ($invoice->first_total != $invoice->second_total || $invoice->first_period != $invoice->second_period) {
$p = new Am_Period($invoice->first_period);
$a->ok_s_trial_price = $invoice->first_total;
$a->ok_s_trial_cycle = sprintf('%d %s', $p->getCount(), strtoupper($p->getUnit()));
}
$p = new Am_Period($invoice->second_period);
$a->ok_s_regular_price = $invoice->second_total;
$a->ok_s_regular_cycle = sprintf('%d %s', $p->getCount(), strtoupper($p->getUnit()));
$a->ok_s_regular_count = $invoice->rebill_times == IProduct::RECURRING_REBILLS ? 0 : $invoice->rebill_times;
}
$a->ok_payer_first_name = $invoice->getFirstName();
$a->ok_payer_last_name = $invoice->getLastName();
$a->ok_payer_street = $invoice->getStreet();
$a->ok_payer_city = $invoice->getCity();
$a->ok_payer_state = $invoice->getState();
$a->ok_payer_zip = $invoice->getZip();
$a->ok_payer_country = $invoice->getCountry();
$a->ok_ipn = $this->getPluginUrl('ipn');
$a->ok_return_success = $this->getReturnUrl();
$a->ok_return_fail = $this->getCancelUrl();
}
示例2: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$action = new Am_Paysystem_Action_Form();
$action->setUrl('https://www.cashu.com/cgi-bin/pcashu.cgi');
$action->merchant_id = $this->getConfig('merchant_id');
$action->amount = $invoice->first_total;
$action->currency = $invoice->currency;
$action->language = 'en';
$action->display_text = $invoice->getLineDescription();
$action->token = md5(strtolower($action->merchant_id . ":" . sprintf("%.2f", $action->amount) . ":" . $action->currency . ":") . $this->getConfig('secret'));
$action->txt1 = $invoice->getLineDescription();
$action->txt2 = $invoice->public_id;
$action->test_mode = $this->getConfig('testing');
$result->setAction($action);
}
示例3: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$periods = array('y' => 'years', 'm' => 'months', 'd' => 'days', 'fixed' => 'years');
$u = $invoice->getUser();
$a = new Am_Paysystem_Action_Form(self::LIVE_URL);
$a->language = $this->getDi()->app->getDefaultLocale();
$order = array();
$a->__set('order[shop_id]', $this->getConfig('shop_id'));
$a->__set('order[currency]', $invoice->currency);
$a->__set('order[email]', $u->email);
$a->__set('order[success_url]', $this->getReturnUrl($request));
$a->__set('order[cancel_url]', $this->getCancelUrl($request));
$a->__set('order[fail_url]', $this->getCancelUrl($request));
$a->__set('order[notification_url]', $this->getPluginUrl('ipn'));
$a->__set('order[billing_address_attributes][first_name]', $u->name_f);
$a->__set('order[billing_address_attributes][last_name]', $u->name_l);
$a->__set('order[billing_address_attributes][address]', $u->street);
$a->__set('order[billing_address_attributes][country]', $u->country);
$a->__set('order[billing_address_attributes][city]', $u->city);
$a->__set('order[billing_address_attributes][zip]', $u->zip);
$a->__set('order[billing_address_attributes][state]', $u->state);
$a->__set('order[billing_address_attributes][zip]', $u->zip);
//recurring
if (!is_null($invoice->second_period)) {
$a->__set('order[subscription_attributes][description]', $invoice->getLineDescription());
$a->__set('order[subscription_attributes][trial_amount]', $invoice->first_total * 100);
$first_period = new Am_Period($invoice->first_period);
$a->__set('order[subscription_attributes][trial_interval_unit]', $periods[$first_period->getUnit()]);
$a->__set('order[subscription_attributes][trial_interval]', $first_period->getCount() == Am_Period::MAX_SQL_DATE ? '25' : $first_period->getCount());
$a->__set('order[subscription_attributes][amount]', $invoice->second_total * 100);
$second_period = new Am_Period($invoice->second_period);
$a->__set('order[subscription_attributes][interval_unit]', $periods[$second_period->getUnit()]);
$a->__set('order[subscription_attributes][interval]', $second_period->getCount() == Am_Period::MAX_SQL_DATE ? '25' : $second_period->getCount());
if ($invoice->rebill_times) {
$a->__set('order[subscription_attributes][rebill_limit]', $invoice->rebill_times);
}
} else {
$a->__set('order[line_items_attributes][][name]', $invoice->getLineDescription());
$a->__set('order[line_items_attributes][][amount]', $invoice->first_total * 100);
$a->__set('order[line_items_attributes][][quantity]', 1);
$a->__set('order[tax_amount]', $invoice->first_tax * 100);
}
$a->__set('order[tracking_params_attributes][][name]', 'invoice_id');
$a->__set('order[tracking_params_attributes][][value]', $invoice->public_id);
$a->filterEmpty();
$a->__set('order[signature]', hash('sha256', $sha = $a->__get('order[subscription_attributes][trial_amount]') . $a->__get('order[line_items_attributes][][amount]') . $a->__get('order[cancel_url]') . $a->__get('order[currency]') . $a->__get('order[email]') . $a->__get('order[fail_url]') . $a->__get('order[success_url]') . $invoice->public_id . $a->__get('order[subscription_attributes][amount]') . $a->__get('order[subscription_attributes][description]') . $a->__get('order[subscription_attributes][interval]') . $a->__get('order[subscription_attributes][interval_unit]') . $a->__get('order[subscription_attributes][rebill_limit]') . $a->__get('order[subscription_attributes][trial_amount]') . $a->__get('order[subscription_attributes][trial_interval]') . $a->__get('order[subscription_attributes][trial_interval_unit]') . $this->getConfig('secret_key')));
$result->setAction($a);
}
示例4: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$a = new Am_Paysystem_Action_Form($this->getConfig('testing') ? self::TEST_URL : self::LIVE_URL);
$a->vendor_name = $this->getConfig('vendor_name');
$a->payment_alert = $this->getDi()->config->get('admin_email');
$a->__set($invoice->getLineDescription(), $invoice->first_total);
$a->payment_reference = $invoice->public_id;
$a->receipt_address = $invoice->getEmail();
if (floatval($invoice->first_tax) > 0) {
$a->gst_rate = $invoice->tax_rate;
$a->gst_added = 'true';
}
$if = array();
$a->__set($if[] = 'E-Mail', $invoice->getEmail());
$a->__set($if[] = 'Country', $this->getCountry($invoice));
$a->__set($if[] = 'Name', $invoice->getName());
$a->__set($if[] = 'Street/PO Box', $invoice->getStreet());
$a->__set($if[] = 'City', $invoice->getCity());
$a->__set($if[] = 'State', $this->getState($invoice));
$a->__set($if[] = 'Post Code', $invoice->getZip());
$a->__set($if[] = 'Telephone Number', $invoice->getPhone());
$a->information_fields = implode(',', $if);
$a->return_link_url = $this->getReturnUrl();
$a->reply_url = $this->getPluginUrl('ipn') . '?invoice=' . $invoice->public_id;
$a->reply_link_url = $this->getPluginUrl('ipn') . '?invoice=' . $invoice->public_id;
$result->setAction($a);
}
示例5: _doBill
public function _doBill(Invoice $invoice, $doFirst, CcRecord $cc, Am_Paysystem_Result $result)
{
$xml = new SimpleXMLElement('<ewaygateway></ewaygateway>');
$xml->ewayCustomerID = $this->getConfig('customer_id');
$xml->ewayTotalAmount = $doFirst ? $invoice->first_total * 100 : $invoice->second_total * 100;
$xml->ewayCustomerFirstName = $cc->cc_name_f;
$xml->ewayCustomerLastName = $cc->cc_name_l;
$xml->ewayCustomerEmail = $invoice->getUser()->email;
$xml->ewayCustomerAddress = $cc->cc_street;
$xml->ewayCustomerPostcode = $cc->cc_zip;
$xml->ewayCustomerInvoiceDescription = $invoice->getLineDescription();
$xml->ewayCustomerInvoiceRef = $invoice->public_id;
$xml->ewayCardHoldersName = sprintf('%s %s', $cc->cc_name_f, $cc->cc_name_l);
$xml->ewayCardNumber = $cc->cc_number;
$xml->ewayCardExpiryMonth = $cc->getExpire('%1$02d');
$xml->ewayCardExpiryYear = $cc->getExpire('%2$02d');
$xml->ewayTrxnNumber = $invoice->public_id;
$xml->ewayOption1 = '';
$xml->ewayOption2 = '';
$xml->ewayOption3 = '';
$xml->ewayCVN = $cc->getCvv();
$request = new Am_HttpRequest($this->getGateway(), Am_HttpRequest::METHOD_POST);
$request->setBody($xml->asXML());
$request->setHeader('Content-type', 'text/xml');
$tr = new Am_Paysystem_Transaction_CreditCard_Eway($this, $invoice, $request, $doFirst);
$tr->run($result);
}
示例6: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
if (!$this->getConfig('wallet_id')) {
throw new Am_Exception_Configuration("There is a configuration error in [okpay] plugin - no [wallet_id] Wallet ID or e-mail");
}
$a = new Am_Paysystem_Action_Redirect(self::URL);
$result->setAction($a);
# Payment config
$a->ok_receiver = $this->getConfig('wallet_id');
$a->ok_invoice = $invoice->getRandomizedId();
$a->ok_currency = strtoupper($invoice->currency);
$a->ok_item_1_name = $invoice->getLineDescription();
$a->ok_item_1_price = $invoice->first_total;
# Payer data
$a->ok_payer_first_name = $invoice->getFirstName();
$a->ok_payer_last_name = $invoice->getLastName();
$a->ok_payer_street = $invoice->getStreet();
$a->ok_payer_city = $invoice->getCity();
$a->ok_payer_state = $invoice->getState();
$a->ok_payer_zip = $invoice->getZip();
$a->ok_payer_country = $invoice->getCountry();
# IPN and Return URLs
$a->ok_ipn = $this->getPluginUrl('ipn');
$a->ok_return_success = $this->getReturnUrl();
$a->ok_return_fail = $this->getCancelUrl();
}
示例7: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$req = new Am_HttpRequest(sprintf('https://gateway-japa.americanexpress.com/api/rest/version/23/merchant/%s/session', $this->getConfig('merchant')), Am_HttpRequest::METHOD_POST);
$req->setAuth('merchant.' . $this->getConfig('merchant'), $this->getConfig('password'));
$req->setBody(Am_Controller::getJson(array('apiOperation' => 'CREATE_PAYMENT_PAGE_SESSION', 'order' => array('id' => $invoice->public_id, 'amount' => $invoice->first_total, 'currency' => $invoice->currency), 'paymentPage' => array('cancelUrl' => $this->getCancelUrl(), 'returnUrl' => $this->getPluginUrl('thanks')))));
$this->logRequest($req);
$res = $req->send();
$this->logResponse($res);
if ($res->getStatus() != 201) {
$result->setFailed(sprintf('Incorrect Responce Status From Paysystem [%s]', $res->getStatus()));
return;
}
$msg = Am_Controller::decodeJson($res->getBody());
if ($msg['result'] == 'ERROR') {
$result->setFailed($msg['error']['explanation']);
return;
}
$invoice->data()->set(self::DATA_KEY, $msg['successIndicator'])->update();
$a = new Am_Paysystem_Action_Redirect(self::URL);
$a->{'merchant'} = $this->getConfig('merchant');
$a->{'order.description'} = $invoice->getLineDescription();
$a->{'paymentPage.merchant.name'} = $this->getDi()->config->get('site_title');
$a->{'session.id'} = $msg['session']['id'];
$this->logRequest($a);
$result->setAction($a);
}
示例8: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$a = new Am_Paysystem_Action_Form(self::LIVE_URL);
$u = $invoice->getUser();
$a->intInstID = $this->config['installation_id'];
$a->strCartID = $invoice->public_id;
$a->strCurrency = $invoice->currency;
$a->strDesc = $invoice->getLineDescription();
$a->strEmail = $u->email;
$a->strCardHolder = $u->getName();
$a->strAddress = $u->street;
$a->strCity = $u->city;
$a->strState = $u->state;
$a->strCountry = $u->country;
$a->strPostcode = $u->zip;
$a->intTestMode = $this->getConfig('testing') ? '1' : '';
$a->fltAmount = sprintf('%.3f', $invoice->first_total);
//recurring
if (!is_null($invoice->second_period)) {
$a->intRecurs = '1';
$a->intCancelAfter = substr($invoice->rebill_times, 3);
$a->fltSchAmount1 = sprintf('%.3f', $invoice->second_total);
$a->strSchPeriod1 = $this->metacharge_get_period($invoice->first_period);
$a->fltSchAmount = sprintf('%.3f', $invoice->first_total);
$a->strSchPeriod = $this->metacharge_get_period($invoice->second_period);
}
$a->filterEmpty();
$result->setAction($a);
}
示例9: _doBill
public function _doBill(Invoice $invoice, $doFirst, CcRecord $cc, Am_Paysystem_Result $result)
{
if (!$doFirst) {
throw new Am_Exception_InternalError('Cannot to run rebill from aMember');
}
$post = array('approvedPage' => $this->getReturnUrl(), 'declinedPage' => $this->getCancelUrl(), 'errorPage' => $this->getCancelUrl(), 'merchant_id' => $this->getConfig('merchant_id'), 'trnOrderNumber' => $invoice->public_id, 'trnAmount' => $invoice->first_total, 'ordEmailAddress' => $invoice->getUser()->email, 'ordName' => $invoice->getUser()->getName(), 'trnComments' => $invoice->getLineDescription());
if ($invoice->second_total > 0) {
if ($invoice->first_total != $invoice->second_total) {
throw new Am_Exception_InternalError('First price must be the same second price');
}
if ($invoice->first_period != $invoice->second_period) {
throw new Am_Exception_InternalError('First period must be the same second period');
}
list($period, $period_unit) = self::parsePeriod($invoice->first_period);
$post['trnRecurring'] = 1;
$post['rbBillingPeriod'] = $period_unit;
$post['rbBillingIncrement'] = $period;
}
$post['trnCardOwner'] = $cc->cc_name_f . " " . $cc->cc_name_l;
$post['trnCardNumber'] = $cc->cc_number;
$post['trnExpMonth'] = substr($cc->cc_expire, 0, 2);
$post['trnExpYear'] = substr($cc->cc_expire, 2);
$post['ordAddress1'] = $cc->cc_street;
$post['ordCity'] = $cc->cc_city;
$post['ordCountry'] = $cc->cc_country;
$post['ordProvince'] = $cc->cc_state;
$post['ordPostalCode'] = $cc->cc_zip;
$post['ordPhoneNumber'] = $cc->cc_phone;
$action = new Am_Paysystem_Action_Form(self::URL_PT);
foreach ($post as $k => $v) {
$action->{$k} = $v;
}
$result->setAction($action);
}
示例10: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$u = $invoice->getUser();
$request = $this->createHttpRequest();
$vars = array('VPSProtocol' => '2.23', 'TxType' => 'PAYMENT', 'Vendor' => $this->getConfig('login'), 'VendorTxCode' => $invoice->public_id . '-AMEMBER', 'Amount' => number_format($invoice->first_total, 2, '.', ''), 'Currency' => $invoice->currency ? $invoice->currency : 'USD', 'Description' => $invoice->getLineDescription(), 'NotificationURL' => $this->getPluginUrl('ipn'), 'SuccessURL' => $this->getReturnUrl(), 'RedirectionURL' => $this->getReturnUrl(), 'BillingFirstnames' => $u->name_f, 'BillingSurname' => $u->name_l, 'BillingAddress1' => $u->street, 'BillingCity' => $u->city, 'BillingPostCode' => $u->zip, 'BillingCountry' => $u->country, 'DeliveryFirstnames' => $u->name_f, 'DeliverySurname' => $u->name_l, 'DeliveryAddress1' => $u->street, 'DeliveryCity' => $u->city, 'DeliveryPostCode' => $u->zip, 'DeliveryCountry' => $u->country, 'CustomerEMail' => $u->email, 'Profile' => 'NORMAL');
if ($u->country == 'US') {
$vars['BillingState'] = $u->state;
$vars['DeliveryState'] = $u->state;
}
$request->addPostParameter($vars);
$request->setUrl($this->getConfig('testing') ? self::TEST_URL : self::LIVE_URL);
$request->setMethod(Am_HttpRequest::METHOD_POST);
$this->logRequest($request);
$response = $request->send();
$this->logResponse($response);
if (!$response->getBody()) {
throw new Am_Exception_InputError("An error occurred while payment request");
}
$res = array();
foreach (split(PHP_EOL, $response->getBody()) as $line) {
list($l, $r) = explode('=', $line, 2);
$res[trim($l)] = trim($r);
}
if ($res['Status'] == 'OK') {
$invoice->data()->set('sagepay_securitykey', $res['SecurityKey']);
$invoice->update();
$a = new Am_Paysystem_Action_Form($res['NextURL']);
$result->setAction($a);
} else {
throw new Am_Exception_InputError($res['StatusDetail']);
}
}
示例11: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$a = new Am_Paysystem_Action_Redirect($this->getConfig('testing') ? self::TEST_URL : self::URL);
$a->instId = $this->getConfig('installation_id');
$a->cartId = $invoice->public_id;
$a->currency = $invoice->currency;
$a->desc = $invoice->getLineDescription();
$a->email = $invoice->getEmail();
$a->name = $invoice->getName();
$a->address = $invoice->getStreet();
$a->city = $invoice->getCity();
$a->state = $invoice->getState();
$a->postcode = $invoice->getZip();
//$a->MC_callback = preg_replace('|^https?://|', '', $this->getPluginUrl('ipn'));
$a->amount = $invoice->first_total;
if ($this->getConfig('testing')) {
$a->testMode = 100;
$a->name = 'CAPTURE';
}
if ($invoice->rebill_times) {
if ($invoice->rebill_times != IProduct::RECURRING_REBILLS) {
$a->noOfPayments = $invoice->rebill_times;
}
$a->futurePayType = 'regular';
list($c, $u) = $this->period2Wp($invoice->second_period);
$a->intervalUnit = $u;
$a->intervalMult = $c;
$a->normalAmount = $invoice->second_total;
$a->option = 0;
list($c, $u) = $this->period2Wp($invoice->first_period);
$a->startDelayMult = $c;
$a->startDelayUnit = $u;
}
$result->setAction($a);
}
示例12: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$user = $invoice->getUser();
$a = new Am_Paysystem_Action_Form(self::LIVE_URL);
$a->Merchant = $this->getConfig('merchant_id');
$a->Site = $this->getConfig('site_id');
$a->DirectTransfer = 'true';
$a->Amount = $invoice->first_total;
$a->Currency = $invoice->currency;
$a->TransRef = $invoice->public_id;
$a->Product = $invoice->getLineDescription();
$a->PaymentType = 'cup';
$a->AttemptMode = '1';
$a->TestTrans = $this->getConfig('testing') ? '1' : '0';
$a->__set("customer[email]", $user->email);
$a->__set("customer[first_name]", $user->name_f);
$a->__set("customer[last_name]", $user->name_l);
$a->__set("customer[address1]", $user->street);
$a->__set("customer[address2]", $user->street2);
$a->__set("customer[city]", $user->city);
$a->__set("customer[state]", $user->state);
$a->__set("customer[postcode]", $user->postcode);
$a->__set("customer[country]", $user->country);
$a->__set("customer[phone]", $user->phone);
$a->ReturnUrlFailure = $this->getCancelUrl();
$a->ReturnUrlSuccess = $this->getPluginUrl('thanks');
$result->setAction($a);
}
示例13: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$a = new Am_Paysystem_Action_Redirect($this->getConfig('testing') ? self::SANDBOX_URL : self::LIVE_URL);
$result->setAction($a);
$u = $invoice->getUser();
$vars = array();
$vars['PSPID'] = $this->config['pspid'];
$vars['ORDERID'] = $invoice->public_id;
$vars['AMOUNT'] = $invoice->first_total * 100;
$vars['CURRENCY'] = $invoice->currency;
$vars['LANGUAGE'] = 'en_US';
$vars['CN'] = $u->getName();
$vars['EMAIL'] = $u->email;
$vars['OWNERZIP'] = $u->zip;
$vars['OWNERADDRESS'] = $u->street;
$vars['OWNERCTY'] = $u->city;
$vars['COM'] = $invoice->getLineDescription();
$vars['HOMEURL'] = $this->getReturnUrl();
$vars['ACCEPTURL'] = $this->getPluginUrl('thanks');
$vars['DECLINEURL'] = $this->getCancelUrl();
$vars['CANCELURL'] = $this->getCancelUrl();
$vars = array_filter($vars);
ksort($vars);
foreach ($vars as $k => $v) {
$sha .= "{$k}={$v}" . $this->config['sha_in'];
$a->addParam($k, $v);
}
$a->SHASIGN = sha1($sha);
$result->setAction($a);
}
示例14: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$vars = $this->getConfig();
$vars['Amount'] = $invoice->first_total;
$vars['Currency'] = $invoice->currency;
$vars['ReturnUrl'] = $this->getPluginUrl('thanks');
$vars['CancelUrl'] = $this->getCancelUrl();
$vars['MerchantInvoice'] = $invoice->public_id;
$vars['MerchantReference'] = $invoice->public_id;
$vars['CustomerFirstName'] = $invoice->getFirstName();
$vars['CustomerLastName'] = $invoice->getLastName();
$vars['CustomerAddress'] = $invoice->getStreet();
$vars['CustomerCity'] = $invoice->getCity();
$vars['CustomerState'] = $invoice->getState();
$vars['InvoiceDescription'] = $invoice->getLineDescription();
$vars['CustomerCountry'] = $invoice->getCountry();
$vars['CustomerPhone'] = $invoice->getPhone();
$vars['CustomerEmail'] = $invoice->getEmail();
$r = new Am_HttpRequest($this->getUrl() . '?' . http_build_query($vars, '', '&'));
$response = $r->send()->getBody();
if (!$response) {
$this->getDi()->errorLogTable->log('Plugin eWAY: Got empty response from API server');
$result->setErrorMessages(array(___("An error occurred while handling your payment.")));
return;
}
$xml = simplexml_load_string($response);
if (!empty($xml->Error)) {
$this->getDi()->errorLogTable->log('Plugin eWAY: Got error from API: ' . (string) $xml->Error);
$result->setErrorMessages(array(___("An error occurred while handling your payment.")));
return;
}
$action = new Am_Paysystem_Action_Redirect($xml->URI);
$result->setAction($action);
}
示例15: _process
public function _process(Invoice $invoice, Am_Request $request, Am_Paysystem_Result $result)
{
$u = $invoice->getUser();
$a = new Am_Paysystem_Action_Redirect(self::LIVE_URL);
$a->pay_to_email = $this->getConfig('business');
$a->pay_from_email = $u->email;
$a->transaction_id = $invoice->public_id;
$a->amount = $invoice->first_total;
$a->currency = $invoice->currency;
$a->language = $u->lang;
$a->return_url = $this->getReturnUrl();
$a->cancel_url = $this->getCancelUrl();
$a->status_url = $this->getPluginUrl('ipn');
$a->detail1_text = $invoice->getLineDescription();
$a->firstname = $u->name_f;
$a->lastname = $u->name_l;
$a->address = $u->street;
$a->postal_code = $u->zip;
$a->city = $u->city;
$a->state = $u->state;
$a->country = $u->country;
if ($invoice->second_total > 0) {
$a->rec_amount = $invoice->second_total;
$periods = array('m' => 'month', 'y' => 'year', 'd' => 'day');
$second_period = new Am_Period($invoice->second_period);
$a->rec_cycle = $periods[$second_period->getUnit()];
$a->rec_period = $second_period->getCount();
$a->rec_start_date = date('Y/m/d', strtotime($invoice->calculateRebillDate(1)));
$a->rec_status_url = $this->getPluginUrl('ipn');
}
$result->setAction($a);
}