コード例 #1
0
 public function getFormFields()
 {
     if (is_null($this->formFields)) {
         $this->formFields = array();
         $items = $this->invoice->getPropertyValue('items');
         $taxInfo = $this->invoice->getPropertyValue('tax_info');
         if ($this->invoice->isRecurring()) {
             $i = 0;
             $this->formFields['notify_url'] = SJB_System::getSystemSettings('SITE_URL') . '/system/payment/notifications/' . self::GATEWAY_ID . '/';
             if (!empty($items['products'])) {
                 foreach ($items['products'] as $key => $product) {
                     $productInfo = $this->invoice->getItemValue($key);
                     if ($taxInfo) {
                         $productInfo['price'] += SJB_TaxesManager::getTaxAmount($productInfo['price'], $taxInfo['tax_rate'], $taxInfo['price_includes_tax']);
                     }
                     if (!empty($productInfo['recurring'])) {
                         $this->formFields['recurring'][$i] = $productInfo;
                     } else {
                         $this->formFields['products'][$i] = $productInfo;
                     }
                     $i += 1;
                 }
             }
         }
         $this->formFields['address'] = SJB_Request::getVar('address', false);
         $this->formFields['zip'] = SJB_Request::getVar('zip', false);
         $this->formFields['country'] = SJB_Request::getVar('country', false);
         $this->formFields['city'] = SJB_Request::getVar('city', false);
         $this->formFields['state'] = SJB_Request::getVar('state', false);
         $this->formFields['email'] = SJB_Request::getVar('email', false);
         $this->formFields['phone'] = SJB_Request::getVar('phone', false);
         $this->formFields['amount'] = SJB_Request::getVar('amount', false);
         $this->formFields['item_name'] = SJB_Request::getVar('item_name', false);
         $this->formFields['item_number'] = SJB_Request::getVar('item_number', false);
         $this->formFields['card_number'] = SJB_Request::getVar('card_number', false);
         $this->formFields['exp_date_mm'] = SJB_Request::getVar('exp_date_mm', false);
         $this->formFields['exp_date_yy'] = SJB_Request::getVar('exp_date_yy', false);
         $this->formFields['csc_value'] = SJB_Request::getVar('csc_value', false);
         $this->formFields['first_name'] = SJB_Request::getVar('first_name', false);
         $this->formFields['last_name'] = SJB_Request::getVar('last_name', false);
         $this->formFields['currency_code'] = SJB_Payment_PaypalProFillPaymentCard::getCurrencyCode();
     }
     return $this->formFields;
 }