diff --git a/CRM/Stripe/Upgrader.php b/CRM/Stripe/Upgrader.php index 509bced4ba8554eb5d2e0b808342f015f0cf82d3..5f53dfd27f7b03b00d0587a7049051edca7e0949 100644 --- a/CRM/Stripe/Upgrader.php +++ b/CRM/Stripe/Upgrader.php @@ -3,6 +3,8 @@ * https://civicrm.org/licensing */ +use CRM_Stripe_ExtensionUtil as E; + /** * Collection of upgrade steps. * DO NOT USE a naming scheme other than upgrade_N, where N is an integer. @@ -424,4 +426,11 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base { return TRUE; } + public function upgrade_5024() { + $this->ctx->log->info('Applying Stripe update 5024. Add the civicrm_stripe_paymentintent database table'); + CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, E::path('/sql/paymentintent_install.sql')); + CRM_Utils_System::flushCache(); + return TRUE; + } + } diff --git a/docs/testing.md b/docs/testing.md index f97bd1398b76c5d2af5ceb497f4860a92d2e53f7..06ab39dac4571ee09ebb9b9b1fa928ce50799988 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -41,12 +41,16 @@ ONLINE contribution, event registration tests ### Manual Tests -1. Test webform submission with payment and user-select, single processor. +1. Test webform submission with payment and user-select , single processor. 1. TODO: Are we testing offline contribution with single/multi-processor properly when stripe is/is not default with katalon tests? 1. Test online contribution page on Wordpress. 1. Test online contribution page on Joomla. -1. Test online event registration. +1. Test online event registration (single processor). +1. Test online event registration (no confirmation page). +1. Test online event registration (multiple participants). +1. Test online event registration (multiple processors, Stripe default). +1. Test online event registration (multiple processors, Stripe not default). 1. Test online event registration (cart checkout). #### Drupal Webform Tests diff --git a/info.xml b/info.xml index 2328c7d4a85a137e40273e2d2220e6bf22445d7e..9cf6b7615f33fa9dc138fa34a54b0799c8b862f4 100644 --- a/info.xml +++ b/info.xml @@ -13,9 +13,9 @@ <author>Matthew Wire (MJW Consulting)</author> <email>mjw@mjwconsult.co.uk</email> </maintainer> - <releaseDate>2019-10-06</releaseDate> - <version>6.1.6</version> - <develStage>stable</develStage> + <releaseDate>2019-10-15</releaseDate> + <version>6.2beta1</version> + <develStage>beta</develStage> <compatibility> <ver>5.13</ver> </compatibility> diff --git a/sql/auto_install.sql b/sql/auto_install.sql deleted file mode 100644 index 0d5adf63aeca6745610b8c2d3a2a4868e8682317..0000000000000000000000000000000000000000 --- a/sql/auto_install.sql +++ /dev/null @@ -1,104 +0,0 @@ --- +--------------------------------------------------------------------+ --- | CiviCRM version 5 | --- +--------------------------------------------------------------------+ --- | Copyright CiviCRM LLC (c) 2004-2019 | --- +--------------------------------------------------------------------+ --- | This file is a part of CiviCRM. | --- | | --- | CiviCRM is free software; you can copy, modify, and distribute it | --- | under the terms of the GNU Affero General Public License | --- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | --- | | --- | CiviCRM is distributed in the hope that it will be useful, but | --- | WITHOUT ANY WARRANTY; without even the implied warranty of | --- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | --- | See the GNU Affero General Public License for more details. | --- | | --- | You should have received a copy of the GNU Affero General Public | --- | License and the CiviCRM Licensing Exception along | --- | with this program; if not, contact CiviCRM LLC | --- | at info[AT]civicrm[DOT]org. If you have questions about the | --- | GNU Affero General Public License or the licensing of CiviCRM, | --- | see the CiviCRM license FAQ at http://civicrm.org/licensing | --- +--------------------------------------------------------------------+ --- --- Generated from schema.tpl --- DO NOT EDIT. Generated by CRM_Core_CodeGen --- - - --- +--------------------------------------------------------------------+ --- | CiviCRM version 5 | --- +--------------------------------------------------------------------+ --- | Copyright CiviCRM LLC (c) 2004-2019 | --- +--------------------------------------------------------------------+ --- | This file is a part of CiviCRM. | --- | | --- | CiviCRM is free software; you can copy, modify, and distribute it | --- | under the terms of the GNU Affero General Public License | --- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | --- | | --- | CiviCRM is distributed in the hope that it will be useful, but | --- | WITHOUT ANY WARRANTY; without even the implied warranty of | --- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | --- | See the GNU Affero General Public License for more details. | --- | | --- | You should have received a copy of the GNU Affero General Public | --- | License and the CiviCRM Licensing Exception along | --- | with this program; if not, contact CiviCRM LLC | --- | at info[AT]civicrm[DOT]org. If you have questions about the | --- | GNU Affero General Public License or the licensing of CiviCRM, | --- | see the CiviCRM license FAQ at http://civicrm.org/licensing | --- +--------------------------------------------------------------------+ --- --- Generated from drop.tpl --- DO NOT EDIT. Generated by CRM_Core_CodeGen --- --- /******************************************************* --- * --- * Clean up the exisiting tables --- * --- *******************************************************/ - -SET FOREIGN_KEY_CHECKS=0; - -DROP TABLE IF EXISTS `civicrm_stripe_paymentintent`; - -SET FOREIGN_KEY_CHECKS=1; --- /******************************************************* --- * --- * Create new tables --- * --- *******************************************************/ - --- /******************************************************* --- * --- * civicrm_stripe_paymentintent --- * --- * Stripe PaymentIntents --- * --- *******************************************************/ -CREATE TABLE `civicrm_stripe_paymentintent` ( - - - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', - `paymentintent_id` varchar(255) COMMENT 'The PaymentIntent ID', - `contribution_id` int unsigned COMMENT 'FK ID from civicrm_contribution', - `payment_processor_id` int unsigned COMMENT 'Foreign key to civicrm_payment_processor.id', - `description` varchar(255) NULL COMMENT 'Description of this paymentIntent', - `status` varchar(25) NULL COMMENT 'The status of the paymentIntent', - `identifier` varchar(255) NULL COMMENT 'An identifier that we can use in CiviCRM to find the paymentIntent if we do not have the ID (eg. session key)', - `contact_id` int unsigned COMMENT 'FK to Contact', - `created_date` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'When was paymentIntent created', - `flags` varchar(100) NULL COMMENT 'Flags associated with this PaymentIntent (NC=no contributionID when doPayment called)' -, - PRIMARY KEY (`id`) - - , UNIQUE INDEX `UI_paymentintent_id`( - paymentintent_id - ) - -, CONSTRAINT FK_civicrm_stripe_paymentintent_payment_processor_id FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor`(`id`) ON DELETE SET NULL, CONSTRAINT FK_civicrm_stripe_paymentintent_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE -) ; - - diff --git a/sql/customers_install.sql b/sql/customers_install.sql new file mode 100644 index 0000000000000000000000000000000000000000..1ec81db09ec89c1f97bc23c6fcef2b9424ac1046 --- /dev/null +++ b/sql/customers_install.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS `civicrm_stripe_customers` ( + `id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `contact_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'FK ID from civicrm_contact', + `processor_id` int(10) DEFAULT NULL COMMENT 'ID from civicrm_payment_processor', + UNIQUE KEY `id` (`id`), + CONSTRAINT `FK_civicrm_stripe_customers_contact_id` FOREIGN KEY (`contact_id`) + REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/sql/paymentintent_install.sql b/sql/paymentintent_install.sql new file mode 100644 index 0000000000000000000000000000000000000000..74dde10b21933eb217a87edb125051089b011375 --- /dev/null +++ b/sql/paymentintent_install.sql @@ -0,0 +1,22 @@ +CREATE TABLE IF NOT EXISTS `civicrm_stripe_paymentintent` ( + + + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', + `paymentintent_id` varchar(255) COMMENT 'The PaymentIntent ID', + `contribution_id` int unsigned COMMENT 'FK ID from civicrm_contribution', + `payment_processor_id` int unsigned COMMENT 'Foreign key to civicrm_payment_processor.id', + `description` varchar(255) NULL COMMENT 'Description of this paymentIntent', + `status` varchar(25) NULL COMMENT 'The status of the paymentIntent', + `identifier` varchar(255) NULL COMMENT 'An identifier that we can use in CiviCRM to find the paymentIntent if we do not have the ID (eg. session key)', + `contact_id` int unsigned COMMENT 'FK to Contact', + `created_date` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'When was paymentIntent created', + `flags` varchar(100) NULL COMMENT 'Flags associated with this PaymentIntent (NC=no contributionID when doPayment called)' +, + PRIMARY KEY (`id`) + + , UNIQUE INDEX `UI_paymentintent_id`( + paymentintent_id + ) + +, CONSTRAINT FK_civicrm_stripe_paymentintent_payment_processor_id FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor`(`id`) ON DELETE SET NULL, CONSTRAINT FK_civicrm_stripe_paymentintent_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE +) ;