{include file='../CRM/Upgrade/4.7.alpha1.msg_template/civicrm_msg_template.tpl'}
UPDATE civicrm_state_province SET name = 'Bataan' WHERE name = 'Batasn';
+
+--CRM-16914
+ALTER TABLE civicrm_payment_processor
+ADD COLUMN
+`payment_instrument_id` int unsigned DEFAULT 1 COMMENT 'Payment Instrument ID';
+
+ALTER TABLE civicrm_payment_processor_type
+ADD COLUMN
+`payment_instrument_id` int unsigned DEFAULT 1 COMMENT 'Payment Instrument ID';
+
* @return array
*/
function civicrm_api3_payment_processor_create($params) {
+ if (empty($params['id']) && empty($params['payment_instrument_id'])) {
+ $params['payment_instrument_id'] = civicrm_api3('PaymentProcessorType', 'getvalue', array(
+ 'id' => $params['payment_processor_type_id'],
+ 'return' => 'payment_instrument_id',
+ ));
+ }
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
// FIXME bool support // $params['is_recur']['api.required'] = 1;
$params['name']['api.required'] = 1;
$params['title']['api.required'] = 1;
+ $params['payment_instrument_id']['api.default'] = 'Credit Card';
}
/**
<title>Processor Billing Mode</title>
<type>int unsigned</type>
<required>true</required>
- <comment>Billing Mode</comment>
+ <comment>Billing Mode (deprecated)</comment>
<add>1.8</add>
</field>
<field>
<title>Payment Type</title>
<type>int unsigned</type>
<default>1</default>
- <comment>Payment Type: Credit or Debit</comment>
+ <comment>Payment Type: Credit or Debit (deprecated)</comment>
<add>3.0</add>
</field>
+ <field>
+ <name>payment_instrument_id</name>
+ <title>Payment Instrument</title>
+ <type>int unsigned</type>
+ <default>1</default>
+ <comment>Payment Instrument ID</comment>
+ <pseudoconstant>
+ <optionGroupName>payment_instrument</optionGroupName>
+ </pseudoconstant>
+ <add>4.7</add>
+ </field>
</table>
<name>billing_mode</name>
<type>int unsigned</type>
<required>true</required>
- <comment>Billing Mode</comment>
+ <comment>Billing Mode (deprecated)</comment>
<pseudoconstant>
<callback>CRM_Core_SelectValues::billingMode</callback>
</pseudoconstant>
<title>Processor Type Payment Type</title>
<type>int unsigned</type>
<default>1</default>
- <comment>Payment Type: Credit or Debit</comment>
+ <comment>Payment Type: Credit or Debit (deprecated)</comment>
<add>3.0</add>
</field>
+ <field>
+ <name>payment_instrument_id</name>
+ <title>Payment Instrument</title>
+ <type>int unsigned</type>
+ <default>1</default>
+ <comment>Payment Instrument ID</comment>
+ <pseudoconstant>
+ <optionGroupName>payment_instrument</optionGroupName>
+ </pseudoconstant>
+ <add>4.7</add>
+ </field>
</table>