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

[DRUP-728] Apigee Monetization for Kickstart #88

Merged
merged 28 commits into from Apr 26, 2019

Conversation

shadcn
Copy link
Contributor

@shadcn shadcn commented Apr 19, 2019

This PR adds an installation task to enable and configure Apigee Monetization for Kickstart.

During installation, if a user provides a valid Edge connection, we check if the configured organization has monetization enabled. If yes, the user can enable monetization for kickstart.

A form to configure a store and supported currencies is also provided during installation. The form is pre-populated with values from the Apigee API.

Note: the monetization task is optional and can be skipped. It is only available if the required modules apigee_m10n and dependencies are available.

apigee-kickstart-DRUP-728

This will automatically:

  1. Create an add credit product type, product variation type and order item type.
  2. Configure all form displays and field types for product, variation and order item.
  3. Create a default store with the Apigee organization address (configurable).
  4. Import all supported currencies to the commerce store.
  5. Create an add credit product for each currency.
  6. Set the minimum and default top up amount from the supported currency minimum top up amount.
  7. Set a product for each supported currency under the add credit config.

The only config left will be the payment gateway which we cannot configure automatically.

How to test this PR without Monetization modules:

  1. Clone the composer project git clone git@github.com:apigee/devportal-kickstart-project-composer.git kickstart
  2. Edit composer.json and add the following patch:
"patches": {
  "apigee/apigee_devportal_kickstart": {
    "Add monetization to kickstart": "https://patch-diff.githubusercontent.com/raw/apigee/apigee-devportal-kickstart-drupal/pull/88.diff"
  }
}
  1. Run composer require apigee/apigee_devportal_kickstart:dev-8.x-1.x This will pull in the latest kickstart with this PR.

Run the installer. It should install the profile and not ask you about monetization.

How to test this PR with Monetization modules:

  1. Do step 1 to 3 above.
  2. Run composer require drupal/apigee_m10n drupal/commerce to pull in the monetization modules and dependencies.
  3. Re-run the installer. You should now see two additional tasks for setting up monetization.

Copy link
Contributor

@jacine jacine left a comment

Choose a reason for hiding this comment

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

This is amazing work @arshad! I know there were many challenges here, so I appreciate the end result that much more. I've tested this a bunch of ways so far, and all have worked great, except for one, and I know this is still in progress, so I'll just log what I've tested so far.

Install via browser, skipping M10n option.

✅This worked as expected, which is to install the Kickstart in its current state (as if no m10n module exists). I also tried this with and without demo content.

Install via Drush, skipping M10n option.

✅This worked as expected (same as above). The argument to Drush is apigee_devportal_kickstart_configuration_form.op='Skip this step'

Install via browser, after removing m10n/commerce/address modules from the file system

✅ 🎉 👏 This is beyond expectations!!! The installer task doesn't even show up. Great job!

Install via Drush, after removing m10n/commerce/address modules from the file system

✅ Works as expected. Same as above.

Install with m10n

✅ Works as (really better than) expected. It's so nice to skip all the configuration that these modules require. I recorded a screencast for this, which I'll try to upload on Monday.
⚠️ There is an issue with the Address module. On the configuration screen for m10n, if you change the country, to US for example, the form does not update to include the fields required (showing the State field, and changing the validation on the zip code). The front end validation can be bypassed for the zip, by using 4 digits (it's on Hungary by default), and then the backend validation kicks in with the updated form, including state and zip on the next screen, which can then be input, and the installer continues successfully.

IMO, the Address issue can be dealt with in a follow up, as this is a massive improvement, and we can document the above issue in the meantime, so I'm approving this.

@jacine
Copy link
Contributor

jacine commented Apr 26, 2019

I just finished re-testing everything, and the address issue mentioned in my previous review is now resolved.

The only improvement I would suggest is specifying in the field label, description that a code is wanted for the administrative area (usually State), CA vs California. There IS currently placeholder text that indicates this, but I never saw it during install, thanks to autofill. Or potentially handing this on the backend. We can make a ticket to address this later.

Thanks again @arshad! Really great work here. 🥇

@jacine jacine merged commit 1dcaf8c into apigee:8.x-1.x Apr 26, 2019
@jacine jacine deleted the DRUP-728-m10n-kickstart branch April 26, 2019 21:38
@jacine jacine added this to the 8.x-1.3 milestone Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants