當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams方法代碼示例

本文整理匯總了PHP中CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams方法的具體用法?PHP CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams怎麽用?PHP CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Contribute_BAO_Contribution的用法示例。


在下文中一共展示了CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: formatParamsForPaymentProcessor

 /**
  * Format the fields for the payment processor.
  *
  * In order to pass fields to the payment processor in a consistent way we add some renamed
  * parameters.
  *
  * @param array $fields
  *
  * @return array
  */
 protected function formatParamsForPaymentProcessor($fields)
 {
     // also add location name to the array
     $this->_params["address_name-{$this->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_last_name', $this->_params);
     $this->_params["address_name-{$this->_bltID}"] = trim($this->_params["address_name-{$this->_bltID}"]);
     // Add additional parameters that the payment processors are used to receiving.
     if (!empty($this->_params["billing_state_province_id-{$this->_bltID}"])) {
         $this->_params['state_province'] = $this->_params["state_province-{$this->_bltID}"] = $this->_params["billing_state_province-{$this->_bltID}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($this->_params["billing_state_province_id-{$this->_bltID}"]);
     }
     if (!empty($this->_params["billing_country_id-{$this->_bltID}"])) {
         $this->_params['country'] = $this->_params["country-{$this->_bltID}"] = $this->_params["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($this->_params["billing_country_id-{$this->_bltID}"]);
     }
     list($hasAddressField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID);
     if ($hasAddressField) {
         $this->_params = array_merge($this->_params, $addressParams);
     }
     $nameFields = array('first_name', 'middle_name', 'last_name');
     foreach ($nameFields as $name) {
         $fields[$name] = 1;
         if (array_key_exists("billing_{$name}", $this->_params)) {
             $this->_params[$name] = $this->_params["billing_{$name}"];
             $this->_params['preserveDBName'] = TRUE;
         }
     }
     return $fields;
 }
開發者ID:hoegrammer,項目名稱:civicrm-core,代碼行數:36,代碼來源:Form.php

示例2: processBillingAddress

 /**
  * Add the billing address to the contact who paid.
  */
 protected function processBillingAddress()
 {
     $fields = array();
     // set email for primary location.
     $fields['email-Primary'] = 1;
     $this->_params['email-5'] = $this->_params['email-Primary'] = $this->_contributorEmail;
     // also add location name to the array
     $this->_params["address_name-{$this->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_last_name', $this->_params);
     $this->_params["address_name-{$this->_bltID}"] = trim($this->_params["address_name-{$this->_bltID}"]);
     $fields["address_name-{$this->_bltID}"] = 1;
     $fields["email-{$this->_bltID}"] = 1;
     list($hasBillingField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID);
     $addressParams['preserveDBName'] = TRUE;
     if ($hasBillingField) {
         $addressParams = array_merge($this->_params, $addressParams);
         //here we are setting up the billing contact - if different from the member they are already created
         // but they will get billing details assigned
         CRM_Contact_BAO_Contact::createProfileContact($addressParams, $fields, $this->_contributorContactID, NULL, NULL, CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactID, 'contact_type'));
     }
 }
開發者ID:rajeshrhino,項目名稱:civicrm-core,代碼行數:23,代碼來源:MembershipRenewal.php

示例3: processBillingAddress

 /**
  * Add the billing address to the contact who paid.
  *
  * Note that this function works based on the presence or otherwise of billing fields & can be called regardless of
  * whether they are 'expected' (due to assumptions about the payment processor type or the setting to collect billing
  * for pay later.
  */
 protected function processBillingAddress()
 {
     $fields = array();
     $fields['email-Primary'] = 1;
     $this->_params['email-5'] = $this->_params['email-Primary'] = $this->_contributorEmail;
     // now set the values for the billing location.
     foreach (array_keys($this->_fields) as $name) {
         $fields[$name] = 1;
     }
     // also add location name to the array
     $this->_params["address_name-{$this->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $this->_params) . ' ' . CRM_Utils_Array::value('billing_last_name', $this->_params);
     $this->_params["address_name-{$this->_bltID}"] = trim($this->_params["address_name-{$this->_bltID}"]);
     $fields["address_name-{$this->_bltID}"] = 1;
     //ensure we don't over-write the payer's email with the member's email
     if ($this->_contributorContactID == $this->_contactID) {
         $fields["email-{$this->_bltID}"] = 1;
     }
     list($hasBillingField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID);
     $nameFields = array('first_name', 'middle_name', 'last_name');
     foreach ($nameFields as $name) {
         $fields[$name] = 1;
         if (array_key_exists("billing_{$name}", $this->_params)) {
             $this->_params[$name] = $this->_params["billing_{$name}"];
             $this->_params['preserveDBName'] = TRUE;
         }
     }
     if ($hasBillingField) {
         $addressParams = array_merge($this->_params, $addressParams);
         //here we are setting up the billing contact - if different from the member they are already created
         // but they will get billing details assigned
         CRM_Contact_BAO_Contact::createProfileContact($addressParams, $fields, $this->_contributorContactID, NULL, NULL, CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactID, 'contact_type'));
     }
     // Add additional parameters that the payment processors are used to receiving.
     if (!empty($this->_params["billing_state_province_id-{$this->_bltID}"])) {
         $this->_params["state_province-{$this->_bltID}"] = $this->_params["billing_state_province-{$this->_bltID}"] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($this->_params["billing_state_province_id-{$this->_bltID}"]);
     }
     if (!empty($this->_params["billing_country_id-{$this->_bltID}"])) {
         $this->_params["country-{$this->_bltID}"] = $this->_params["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($this->_params["billing_country_id-{$this->_bltID}"]);
     }
 }
開發者ID:rollox,項目名稱:civicrm-core,代碼行數:47,代碼來源:AbstractEditPayment.php

示例4: processBillingAddress

 /**
  * Add the billing address to the contact who paid.
  *
  * Note that this function works based on the presence or otherwise of billing fields & can be called regardless of
  * whether they are 'expected' (due to assumptions about the payment processor type or the setting to collect billing
  * for pay later.
  */
 protected function processBillingAddress()
 {
     $fields = array();
     $fields['email-Primary'] = 1;
     $this->_params['email-5'] = $this->_params['email-Primary'] = $this->_contributorEmail;
     // now set the values for the billing location.
     foreach (array_keys($this->_fields) as $name) {
         $fields[$name] = 1;
     }
     $fields["address_name-{$this->_bltID}"] = 1;
     //ensure we don't over-write the payer's email with the member's email
     if ($this->_contributorContactID == $this->_contactID) {
         $fields["email-{$this->_bltID}"] = 1;
     }
     list($hasBillingField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID);
     $fields = $this->formatParamsForPaymentProcessor($fields);
     if ($hasBillingField) {
         $addressParams = array_merge($this->_params, $addressParams);
         // CRM-18277 don't let this get passed in because we don't want contribution source to override contact source.
         // Ideally we wouldn't just randomly merge everything into addressParams but just pass in a relevant array.
         // Note this source field is covered by a unit test.
         if (isset($addressParams['source'])) {
             unset($addressParams['source']);
         }
         //here we are setting up the billing contact - if different from the member they are already created
         // but they will get billing details assigned
         CRM_Contact_BAO_Contact::createProfileContact($addressParams, $fields, $this->_contributorContactID, NULL, NULL, CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactID, 'contact_type'));
     }
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:36,代碼來源:AbstractEditPayment.php

示例5: processBillingAddress

 /**
  * Add the billing address to the contact who paid.
  *
  * Note that this function works based on the presence or otherwise of billing fields & can be called regardless of
  * whether they are 'expected' (due to assumptions about the payment processor type or the setting to collect billing
  * for pay later.
  */
 protected function processBillingAddress()
 {
     $fields = array();
     $fields['email-Primary'] = 1;
     $this->_params['email-5'] = $this->_params['email-Primary'] = $this->_contributorEmail;
     // now set the values for the billing location.
     foreach (array_keys($this->_fields) as $name) {
         $fields[$name] = 1;
     }
     $fields["address_name-{$this->_bltID}"] = 1;
     //ensure we don't over-write the payer's email with the member's email
     if ($this->_contributorContactID == $this->_contactID) {
         $fields["email-{$this->_bltID}"] = 1;
     }
     list($hasBillingField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $this->_bltID);
     $fields = $this->formatParamsForPaymentProcessor($fields);
     if ($hasBillingField) {
         $addressParams = array_merge($this->_params, $addressParams);
         //here we are setting up the billing contact - if different from the member they are already created
         // but they will get billing details assigned
         CRM_Contact_BAO_Contact::createProfileContact($addressParams, $fields, $this->_contributorContactID, NULL, NULL, CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactID, 'contact_type'));
     }
 }
開發者ID:saurabhbatra96,項目名稱:civicrm-core,代碼行數:30,代碼來源:AbstractEditPayment.php


注:本文中的CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。