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

[#319] Refactor add credit module configuration. #323

Merged
merged 3 commits into from
Feb 28, 2020
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
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'],
cnovak marked this conversation as resolved.
Show resolved Hide resolved
[$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)
arlina-espinoza marked this conversation as resolved.
Show resolved Hide resolved
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