Skip to content

Commit

Permalink
Merge pull request #323 from arlina-espinoza/319-add-credit-setup
Browse files Browse the repository at this point in the history
[#319] Refactor add credit module configuration.
  • Loading branch information
shadcn authored Feb 28, 2020
2 parents 9784475 + 32c095d commit 57e8d2f
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 338 deletions.
28 changes: 26 additions & 2 deletions apigee_devportal_kickstart.install
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function apigee_devportal_setup_monetization(array &$install_state) {
],
];

// Perform additional tasks for apigee_kickstart_m10n_add_credit.
if (in_array('apigee_kickstart_m10n_add_credit', $config['modules'])) {
// Perform additional tasks for apigee_m10n_add_credit.
if (in_array('apigee_m10n_add_credit', $config['modules'])) {
$operations = array_merge($operations, [
[
[ApigeeDevportalKickstartTasksManager::class, 'importCurrencies'],
Expand All @@ -150,11 +150,22 @@ function apigee_devportal_setup_monetization(array &$install_state) {
[ApigeeDevportalKickstartTasksManager::class, 'createStore'],
[$config['store']],
],
[
[ApigeeDevportalKickstartTasksManager::class, 'createProductType'],
[$config],
],
[
[ApigeeDevportalKickstartTasksManager::class, 'createProducts'],
[$config['supported_currencies']],
],
]);

if (!empty($config['gateway'])) {
$operations[] = [
[ApigeeDevportalKickstartTasksManager::class, 'createPaymentGateway'],
[$config],
];
}
}

$batch = [
Expand Down Expand Up @@ -309,3 +320,16 @@ function apigee_devportal_kickstart_update_8001(&$sandbox) {
'weight' => 3,
])->save();
}

/**
* Disable deprecated module "apigee_kickstart_m10n_add_credit".
*/
function apigee_devportal_kickstart_update_8002(&$sandbox) {
try {
\Drupal::service('module_installer')->uninstall(['apigee_kickstart_m10n_add_credit']);
$context['message'] = t('Uninstalled "apigee_kickstart_m10n_add_credit" module.');
}
catch (\Exception $exception) {
watchdog_exception('apigee_kickstart', $exception);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Apigee Kickstart Monetization
description: "Handles monetization for Apigee Kickstart. Adds and configures a default product type for adding credit."
name: Apigee Kickstart Monetization (Deprecated)
description: "(Deprecated, do not enable) Adds and configures a default product type for adding credit."
type: module
core: 8.x
package: Apigee Kickstart
hidden: true
dependencies:
- apigee_m10n:apigee_m10n
- apigee_m10n_add_credit:apigee_m10n_add_credit

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 57e8d2f

Please sign in to comment.