Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema changes for PaymentProcessor and PaymentProcessorType to suppo… #15733

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CRM/Financial/DAO/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:0bd325aff061b6eea4854ef63757772a)
* (GenCodeChecksum:55a55af34cd25ec8d69f4145d3fa2870)
*/

/**
Expand Down Expand Up @@ -283,6 +283,7 @@ public static function &fields() {
'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',
Expand All @@ -301,6 +302,7 @@ public static function &fields() {
'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',
Expand All @@ -312,6 +314,7 @@ public static function &fields() {
'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',
Expand All @@ -323,6 +326,7 @@ public static function &fields() {
'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',
Expand Down
13 changes: 9 additions & 4 deletions CRM/Financial/DAO/PaymentProcessorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:65231e0b77bcce22bd505b89ace63506)
* (GenCodeChecksum:ea2020b03d32e0c0f1a2d4915f2a14b1)
*/

/**
Expand Down Expand Up @@ -43,7 +43,7 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
public $name;

/**
* Payment Processor Name.
* Payment Processor Type Title.
*
* @var string
*/
Expand Down Expand Up @@ -196,6 +196,7 @@ public static function &fields() {
'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',
Expand All @@ -207,8 +208,9 @@ public static function &fields() {
'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',
Expand Down Expand Up @@ -236,6 +238,7 @@ public static function &fields() {
'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',
Expand All @@ -247,6 +250,7 @@ public static function &fields() {
'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',
Expand Down Expand Up @@ -304,6 +308,7 @@ public static function &fields() {
'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',
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function testCreate() {
'name' => 'Test_Payment_Processor',
'title' => 'Test Payment Processor',
'billing_mode' => 1,
'class_name' => 'Payment_Dummy',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that becaue there is no default value for class_name yet i am setting it as default is the reason for the changes here

];
$paymentProcessor = CRM_Financial_BAO_PaymentProcessorType::create($params);
$result = $this->assertDBNotNull(
Expand All @@ -63,6 +64,7 @@ public function testRetrieve() {
'name' => 'Test_Retrieve_Payment_Processor',
'title' => 'Test Retrieve Payment Processor',
'billing_mode' => 1,
'class_name' => 'Payment_Dummy',
];
$defaults = [];
CRM_Financial_BAO_PaymentProcessorType::create($params);
Expand All @@ -79,6 +81,7 @@ public function testSetIsActive() {
'title' => 'Test Set Payment Processor',
'billing_mode' => 1,
'is_active' => 1,
'class_name' => 'Payment_Dummy',
];

$paymentProcessor = CRM_Financial_BAO_PaymentProcessorType::create($params);
Expand Down Expand Up @@ -116,6 +119,7 @@ public function testDel() {
'title' => 'Test Del Payment Processor',
'billing_mode' => 1,
'is_active' => 1,
'class_name' => 'Payment_Dummy',
];

$defaults = [];
Expand Down
4 changes: 4 additions & 0 deletions xml/schema/Financial/PaymentProcessor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<keyColumn>id</keyColumn>
<labelColumn>title</labelColumn>
</pseudoconstant>
<required>true</required>
<length>10</length>
<add>4.3</add>
</field>
Expand All @@ -102,20 +103,23 @@
<type>boolean</type>
<comment>Is this processor active?</comment>
<add>1.8</add>
<default>1</default>
</field>
<field>
<name>is_default</name>
<title>Processor Is Default?</title>
<type>boolean</type>
<comment>Is this processor the default?</comment>
<add>1.8</add>
<default>0</default>
</field>
<field>
<name>is_test</name>
<title>Is Test Processor?</title>
<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>
Expand Down
9 changes: 7 additions & 2 deletions xml/schema/Financial/PaymentProcessorType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
<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>
Expand All @@ -47,13 +49,15 @@
<type>boolean</type>
<comment>Is this processor active?</comment>
<add>1.8</add>
<default>1</default>
</field>
<field>
<name>is_default</name>
<title>Processor Type is Default?</title>
<type>boolean</type>
<comment>Is this processor the default?</comment>
<add>1.8</add>
<default>0</default>
</field>
<index>
<name>UI_name</name>
Expand Down Expand Up @@ -95,6 +99,7 @@
<type>varchar</type>
<length>255</length>
<add>1.8</add>
<required>true</required>
</field>
<field>
<name>url_site_default</name>
Expand Down