Schema changes for PaymentProcessor and PaymentProcessorType to support apiv4 entities
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 5 Nov 2019 05:18:48 +0000 (16:18 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 5 Nov 2019 05:18:48 +0000 (16:18 +1100)
CRM/Financial/DAO/PaymentProcessor.php
CRM/Financial/DAO/PaymentProcessorType.php
tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php
xml/schema/Financial/PaymentProcessor.xml
xml/schema/Financial/PaymentProcessorType.xml

index 339daccc5e3dfb2d261121c2a5e95aa00e4bbf39..8e54cc76b31747aa58c760a600a94d18666a164c 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:0bd325aff061b6eea4854ef63757772a)
+ * (GenCodeChecksum:55a55af34cd25ec8d69f4145d3fa2870)
  */
 
 /**
@@ -283,6 +283,7 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
           'name' => 'payment_processor_type_id',
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Payment Processor Type ID'),
+          'required' => TRUE,
           'where' => 'civicrm_payment_processor.payment_processor_type_id',
           'table_name' => 'civicrm_payment_processor',
           'entity' => 'PaymentProcessor',
@@ -301,6 +302,7 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
           'title' => ts('Processor is Active?'),
           'description' => ts('Is this processor active?'),
           'where' => 'civicrm_payment_processor.is_active',
+          'default' => '1',
           'table_name' => 'civicrm_payment_processor',
           'entity' => 'PaymentProcessor',
           'bao' => 'CRM_Financial_BAO_PaymentProcessor',
@@ -312,6 +314,7 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
           'title' => ts('Processor Is Default?'),
           'description' => ts('Is this processor the default?'),
           'where' => 'civicrm_payment_processor.is_default',
+          'default' => '0',
           'table_name' => 'civicrm_payment_processor',
           'entity' => 'PaymentProcessor',
           'bao' => 'CRM_Financial_BAO_PaymentProcessor',
@@ -323,6 +326,7 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
           'title' => ts('Is Test Processor?'),
           'description' => ts('Is this processor for a test site?'),
           'where' => 'civicrm_payment_processor.is_test',
+          'default' => '0',
           'table_name' => 'civicrm_payment_processor',
           'entity' => 'PaymentProcessor',
           'bao' => 'CRM_Financial_BAO_PaymentProcessor',
index 7230d340df86d725008e88c37b2213523c86072b..8f54134cb1aabbc04b8f86357b2080c36ebca5f4 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:65231e0b77bcce22bd505b89ace63506)
+ * (GenCodeChecksum:ea2020b03d32e0c0f1a2d4915f2a14b1)
  */
 
 /**
@@ -43,7 +43,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
   public $name;
 
   /**
-   * Payment Processor Name.
+   * Payment Processor Type Title.
    *
    * @var string
    */
@@ -196,6 +196,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_STRING,
           'title' => ts('Payment Processor variable name to be used in code'),
           'description' => ts('Payment Processor Name.'),
+          'required' => TRUE,
           'maxlength' => 64,
           'size' => CRM_Utils_Type::BIG,
           'where' => 'civicrm_payment_processor_type.name',
@@ -207,8 +208,9 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
         'title' => [
           'name' => 'title',
           'type' => CRM_Utils_Type::T_STRING,
-          'title' => ts('Payment Processor Title'),
-          'description' => ts('Payment Processor Name.'),
+          'title' => ts('Payment Processor Type Title'),
+          'description' => ts('Payment Processor Type Title.'),
+          'required' => TRUE,
           'maxlength' => 127,
           'size' => CRM_Utils_Type::HUGE,
           'where' => 'civicrm_payment_processor_type.title',
@@ -236,6 +238,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
           'title' => ts('Processor Type Is Active?'),
           'description' => ts('Is this processor active?'),
           'where' => 'civicrm_payment_processor_type.is_active',
+          'default' => '1',
           'table_name' => 'civicrm_payment_processor_type',
           'entity' => 'PaymentProcessorType',
           'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
@@ -247,6 +250,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
           'title' => ts('Processor Type is Default?'),
           'description' => ts('Is this processor the default?'),
           'where' => 'civicrm_payment_processor_type.is_default',
+          'default' => '0',
           'table_name' => 'civicrm_payment_processor_type',
           'entity' => 'PaymentProcessorType',
           'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
@@ -304,6 +308,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
           'name' => 'class_name',
           'type' => CRM_Utils_Type::T_STRING,
           'title' => ts('Suffix for PHP class name implementation'),
+          'required' => TRUE,
           'maxlength' => 255,
           'size' => CRM_Utils_Type::HUGE,
           'where' => 'civicrm_payment_processor_type.class_name',
index 7aaab9e7fcf99064ea4a496ccc12e248dd4c9a7b..d75d94a048f9e9a3245bdfb59a1c699b637f3496 100644 (file)
@@ -43,6 +43,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'name' => 'Test_Payment_Processor',
       'title' => 'Test Payment Processor',
       'billing_mode' => 1,
+      'class_name' => 'Payment_Dummy',
     ];
     $paymentProcessor = CRM_Financial_BAO_PaymentProcessorType::create($params);
     $result = $this->assertDBNotNull(
@@ -63,6 +64,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'name' => 'Test_Retrieve_Payment_Processor',
       'title' => 'Test Retrieve Payment Processor',
       'billing_mode' => 1,
+      'class_name' => 'Payment_Dummy',
     ];
     $defaults = [];
     CRM_Financial_BAO_PaymentProcessorType::create($params);
@@ -79,6 +81,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'Test Set Payment Processor',
       'billing_mode' => 1,
       'is_active' => 1,
+      'class_name' => 'Payment_Dummy',
     ];
 
     $paymentProcessor = CRM_Financial_BAO_PaymentProcessorType::create($params);
@@ -116,6 +119,7 @@ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'Test Del Payment Processor',
       'billing_mode' => 1,
       'is_active' => 1,
+      'class_name' => 'Payment_Dummy',
     ];
 
     $defaults = [];
index ce5e3250abe79117cb51e7cf6cf50b3a08b41605..e1aac7cab3313d3ab3336805edb1a7438879c11b 100644 (file)
@@ -87,6 +87,7 @@
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
     </pseudoconstant>
+    <required>true</required>
     <length>10</length>
     <add>4.3</add>
   </field>
     <type>boolean</type>
     <comment>Is this processor active?</comment>
     <add>1.8</add>
+    <default>1</default>
   </field>
   <field>
     <name>is_default</name>
     <type>boolean</type>
     <comment>Is this processor the default?</comment>
     <add>1.8</add>
+    <default>0</default>
   </field>
   <field>
     <name>is_test</name>
     <type>boolean</type>
     <comment>Is this processor for a test site?</comment>
     <add>1.8</add>
+    <default>0</default>
   </field>
   <index>
     <name>UI_name_test_domain_id</name>
index 3e5de52682177e672cd760d741ec17e2c42a1c2c..27273978a9a1a4fb2eb97aaba4322afec0d1b75c 100644 (file)
     <length>64</length>
     <comment>Payment Processor Name.</comment>
     <add>1.8</add>
+    <required>true</required>
   </field>
   <field>
     <name>title</name>
-    <title>Payment Processor Title</title>
+    <title>Payment Processor Type Title</title>
     <type>varchar</type>
     <length>127</length>
-    <comment>Payment Processor Name.</comment>
+    <comment>Payment Processor Type Title.</comment>
     <add>1.8</add>
+    <required>true</required>
   </field>
   <field>
     <name>description</name>
@@ -47,6 +49,7 @@
     <type>boolean</type>
     <comment>Is this processor active?</comment>
     <add>1.8</add>
+    <default>1</default>
   </field>
   <field>
     <name>is_default</name>
@@ -54,6 +57,7 @@
     <type>boolean</type>
     <comment>Is this processor the default?</comment>
     <add>1.8</add>
+    <default>0</default>
   </field>
   <index>
     <name>UI_name</name>
@@ -95,6 +99,7 @@
     <type>varchar</type>
     <length>255</length>
     <add>1.8</add>
+    <required>true</required>
   </field>
   <field>
     <name>url_site_default</name>