jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/401817 )
Change subject: Add Citibank International to payment instruments on new
installs.
......................................................................
Add Citibank International to payment instruments on new installs.
There are 2 Citibank payment instruments on live but neither are added via the
install script
for test sites. I have stuck all the code that adds payment instruments into
one function
and it is always called on new installs. A new function needs to be added to
get them onto
live like wmf_civicrm_update_7595. I've removed older instances of the
payment_instrument
adds - I don't feel like it adds some amazing historical value to keep them all.
I also added a few extension installs update functions to the new-install to
make sure
they get enabled
Change-Id: Ib1ca183c597f464d4493bbe754fd482c7d496691
---
A sites/all/modules/wmf_civicrm/update_payment_instruments.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
2 files changed, 110 insertions(+), 158 deletions(-)
Approvals:
jenkins-bot: Verified
Ejegg: Looks good to me, approved
diff --git a/sites/all/modules/wmf_civicrm/update_payment_instruments.php
b/sites/all/modules/wmf_civicrm/update_payment_instruments.php
new file mode 100644
index 0000000..920cb56
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/update_payment_instruments.php
@@ -0,0 +1,101 @@
+<?php
+
+
+/**
+ * Add any missing payment instruments from our master array.
+ */
+function wmf_install_add_missing_payment_instruments() {
+ civicrm_initialize();
+ wmf_civicrm_create_option_values('payment_instrument',
wmf_install_get_payment_instruments());
+}
+
+/**
+ * Get an array of payment instruments.
+ *
+ * @return array
+ */
+function wmf_install_get_payment_instruments() {
+ return array(
+ // ActBlue
+ 'Alipay',
+ 'Amazon',
+ 'Bitcoin',
+ 'Bank Transfer',
+ 'Boleto',
+ 'Bpay',
+ 'Cash',
+ // Cashu exists on live but has no contributions.
+ 'Cashu',
+ 'Check',
+ 'Citibank France',
+ 'Citibank International',
+
+ 'Credit Card',
+ 'Credit Card: American Express',
+ // Credit Card: Argencard is a latin payment method. Only one contribution.
+ 'Credit Card: Argencard',
+ // Credit Card: Bijenkorf exists on live but has no contributions.
+ 'Credit Card: Bijenkorf',
+ 'Credit Card: Carte Bleue',
+ // Chilean credit card Credit Card: CMR Falabella exists on live but no
contributions.
+ 'Credit Card: CMR Falabella',
+ 'Credit Card: Discover',
+ 'Credit Card: JCB',
+ // Credit Card: Laser exists on live but no contributions.
+ 'Credit Card: Laser',
+ // Credit Card: Maestro exists on live but no contributions.
+ 'Credit Card: Maestro',
+ // Chilean credit card Credit Card: Magna exists on live but no
contributions.
+ 'Credit Card: Magna',
+ 'Credit Card: MasterCard',
+ // Chilean credit card Credit Card: Presto exists on live but no
contributions
+ 'Credit Card: Presto',
+ // Credit Card: Solo exists on live but no contributions
+ 'Credit Card: Solo',
+ 'Credit Card: Visa',
+ // Credit Card: Visa Beneficial exists on live but no contributions
+ 'Credit Card: Visa Beneficial',
+ // Credit Card: Visa Electron exists on live but no contributions
+ 'Credit Card: Visa Electron',
+ 'Credit Card: Visa Debit',
+ 'Credit Card: MasterCard Debit',
+ 'Credit Card: Diners',
+ 'Direct Debit',
+ 'Enets',
+ 'EPS',
+ 'iDeal',
+ 'JP Morgan EUR',
+ 'Moneybookers',
+ // Nordea exists on live but no contributions.
+ 'Nordea',
+ 'Paypal',
+ // Does not exist on live.
+ 'Sofort',
+ 'Square Cash',
+ 'Stripe',
+ 'Trilogy',
+ 'Webmoney',
+
+ // Latin payment methods for Astropay
+ 'Credit Card: Elo',
+ 'Credit Card: HiperCard',
+ 'Credit Card: MercadoLivre',
+ 'Credit Card: Cabal',
+ 'Credit Card: Naranja',
+ 'Credit Card: Tarjeta Shopping',
+ 'Credit Card: Nativa',
+ 'Credit Card: Cencosud',
+
+ 'Credit Card: Webpay',
+ 'Banamex',
+ 'Bancomer',
+ 'Davivienda',
+ 'Efecty',
+ 'OXXO',
+ 'Pago Facil',
+ 'Provencia Pagos',
+ 'Red Pagos',
+ 'Rapi Pago',
+ 'Santander',
+ );
+}
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 543b696..4340077 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -21,23 +21,17 @@
wmf_civicrm_update_7015();
wmf_civicrm_update_7016();
wmf_civicrm_update_7017();
- wmf_civicrm_update_7018();
- wmf_civicrm_update_7019();
- wmf_civicrm_update_7020();
wmf_civicrm_update_7021();
wmf_civicrm_update_7022();
wmf_civicrm_update_7023();
wmf_civicrm_update_7024();
wmf_civicrm_update_7025();
- wmf_civicrm_update_7026();
wmf_civicrm_update_7027();
wmf_civicrm_update_7028();
wmf_civicrm_update_7029();
wmf_civicrm_update_7030();
wmf_civicrm_update_7031();
wmf_civicrm_update_7032();
- wmf_civicrm_update_7033();
- wmf_civicrm_update_7034();
wmf_civicrm_update_7060();
wmf_civicrm_update_7061();
wmf_civicrm_update_7062();
@@ -51,7 +45,6 @@
wmf_civicrm_update_7170();
wmf_civicrm_update_7180();
wmf_civicrm_update_7190();
- wmf_civicrm_update_7195();
wmf_civicrm_update_7200();
wmf_civicrm_update_7205();
wmf_civicrm_update_7210();
@@ -63,12 +56,14 @@
wmf_civicrm_update_7310();
wmf_civicrm_update_7455();
wmf_civicrm_update_7460();
- wmf_civicrm_update_7521();
wmf_civicrm_update_7524();
wmf_civicrm_update_7525();
wmf_civicrm_update_7526();
wmf_civicrm_update_7530();
- wmf_civicrm_update_7590();
+ wmf_civicrm_update_7570();
+ wmf_civicrm_update_7575();
+ wmf_civicrm_update_7580();
+ wmf_civicrm_update_7585();
}
/**
@@ -159,38 +154,10 @@
'Cash',
'Benevity',
);
- $payment_instruments = array(
- 'Amazon',
- 'Bank Transfer',
- 'Boleto',
- 'Bpay',
- 'Cash',
- 'Cashu',
- 'Check',
- 'Credit Card',
- 'Credit Card: American Express',
- 'Credit Card: Carte Bleue',
- 'Credit Card: Discover',
- 'Credit Card: JCB',
- 'Credit Card: Laser',
- 'Credit Card: Maestro',
- 'Credit Card: MasterCard',
- 'Credit Card: Solo',
- 'Credit Card: Visa',
- 'Direct Debit',
- 'Enets',
- 'EPS',
- 'iDeal',
- 'Moneybookers',
- 'Nordea',
- 'Paypal',
- 'Sofort',
- 'Webmoney',
- );
-
wmf_civicrm_bootstrap_civi();
+ require_once 'update_payment_instruments.php';
+ wmf_install_add_missing_payment_instruments();
wmf_civicrm_create_financial_types($financial_types);
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
}
/**
@@ -890,45 +857,6 @@
}
/**
- * Add contribution types and payment instruments
- */
-function wmf_civicrm_update_7018() {
- $payment_instruments = array(
- 'Credit Card: Visa Beneficial',
- 'Credit Card: Visa Electron',
- 'Credit Card: Visa Debit',
- 'Credit Card: MasterCard Debit',
- 'Credit Card: Diners',
- );
-
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
-
- return array();
-}
-
-/**
- * Add JP Morgan payment instrument
- */
-function wmf_civicrm_update_7019() {
- $payment_instruments = array(
- 'JP Morgan EUR',
- );
-
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
-}
-
-/**
- * Add Bitcoin payment instrument
- */
-function wmf_civicrm_update_7020() {
- $payment_instruments = array(
- 'Bitcoin',
- );
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
-}
-
-/**
* Create UnrecordedCharge contribution tag
*/
function wmf_civicrm_update_7021() {
@@ -1192,13 +1120,6 @@
}
/**
- * Add Alipay to payment_instrument
- */
-function wmf_civicrm_update_7026() {
- wmf_civicrm_create_option_values('payment_instrument', array('Alipay'));
-}
-
-/**
* Fix year rollup HTML type
*/
function wmf_civicrm_update_7027() {
@@ -1393,22 +1314,6 @@
'Mobile Giving',
'Corp Matching Gift',
));
-}
-
-/**
- * Add "Square Cash" payment instrument.
- */
-function wmf_civicrm_update_7033() {
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', array('Square Cash'));
-}
-
-/**
- * Add "Trilogy" payment instrument.
- */
-function wmf_civicrm_update_7034() {
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', array('Trilogy'));
}
/**
@@ -1930,49 +1835,6 @@
CRM_Core_BAO_SchemaHandler::createIndexes(array(
'civicrm_contribution' => array(array('total_amount', 'receive_date')),
));
-}
-
-/**
- * Add Latin American payment methods for AstroPay
- */
-function wmf_civicrm_update_7195() {
- $payment_instruments = array(
- 'Credit Card: Elo',
- 'Credit Card: HiperCard',
- 'Credit Card: MercadoLivre',
- 'Credit Card: Cabal',
- 'Credit Card: Naranja',
- 'Credit Card: Tarjeta Shopping',
- 'Credit Card: Nativa',
- 'Credit Card: Cencosud',
- 'Credit Card: Argencard',
- 'Credit Card: Webpay',
- 'Banamex',
- 'Bancomer',
- 'Davivienda',
- 'Efecty',
- 'OXXO',
- 'Pago Facil',
- 'Provencia Pagos',
- 'Red Pagos',
- 'Rapi Pago',
- 'Santander',
- );
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
-}
-
-/**
- * Add a few more Chilean credit cards
- */
-function wmf_civicrm_update_7196() {
- $payment_instruments = array(
- 'Credit Card: CMR Falabella',
- 'Credit Card: Magna',
- 'Credit Card: Presto',
- );
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
}
/**
@@ -3016,17 +2878,6 @@
}
/**
- * Add Bijcard
- */
-function wmf_civicrm_update_7521() {
- $payment_instruments = array(
- 'Credit Card: Bijenkorf',
- );
- wmf_civicrm_bootstrap_civi();
- wmf_civicrm_create_option_values('payment_instrument', $payment_instruments);
-}
-
-/**
* Normalize old phone numbers
**/
function wmf_civicrm_update_7522() {
@@ -3434,7 +3285,7 @@
/**
* Add Stripe payment instrument
*/
-function wmf_civicrm_update_7590() {
- civicrm_initialize();
- wmf_civicrm_create_option_values('payment_instrument', array('Stripe'));
+function wmf_civicrm_update_7595() {
+ require_once 'update_payment_instruments.php';
+ wmf_install_add_missing_payment_instruments();
}
--
To view, visit https://gerrit.wikimedia.org/r/401817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1ca183c597f464d4493bbe754fd482c7d496691
Gerrit-PatchSet: 7
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits