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

Separate Stripe payment into a feature so it can be disabled if other payment provider is desired. (OCC-63) #149

Closed
sarahelsaig opened this issue Aug 15, 2022 · 5 comments · Fixed by #373
Assignees
Labels
enhancement New feature or request technical debt Necessary but not urgent code cleanup or reorganization

Comments

@sarahelsaig
Copy link
Contributor

sarahelsaig commented Aug 15, 2022

This won't be urgent until we have other payment providers. If someone needs it soon because you already have your own payment implementation, please comment on this issue.

  • Refactor the Stripe payment processor logic into a separate project, e.g. OrchardCore.Commerce.PaymentProcessors.Stripe.
  • Create the necessary abstraction to make it provider-based with Stripe being just one provider.
    • Replace the ~/cart's Checkout button with a Checkout with {providerName} button so it's locked down in the order form. Then only display the correct form for that processor.
    • Use the IPaymentProvider and IPayment interfaces.
  • Add a dummy payment processor provider.
    • This should be a separate feature.
    • It should be enabled in the recipe but (if possible) force-disabled in production.
    • Add a sample Order content item to the recipe, whose payment info references this provider.
  • Include which payment provider was used in the OrderPart.
    • Make it read-only if the Order is already created and this has been set.

Also create a unit test of the basic purchase flow using the dummy payment processor.

  • Buy different amounts of the two sample products.
  • Change the amount of one in the cart.
  • Fill the checkout form.
  • Go to the newly created Order item.
  • Verify that the order has the correct products an amounts, and that the correct payment provider name is displayed.

If #155 is resolved, then also set the addresses, and verify that they are valid as well.

Jira issue

@sarahelsaig sarahelsaig added the enhancement New feature or request label Aug 15, 2022
@sarahelsaig sarahelsaig added the technical debt Necessary but not urgent code cleanup or reorganization label Sep 8, 2022
@github-actions github-actions bot changed the title Separate Stripe payment into a feature so it can be disabled if other payment provider is desired. Separate Stripe payment into a feature so it can be disabled if other payment provider is desired. (OCC-63) Sep 18, 2022
@DemeSzabolcs DemeSzabolcs self-assigned this Feb 7, 2023
@hishamco
Copy link
Member

I'm working on a project that uses a sort of eCommerce, I agree to separate Stripe payment but not as a feature. It could be as the following:

  • OCC.Payment.Abstractions
  • OCC.Payment.Core (Stripe Payment Implementation)
  • OCC.Payment (Module)

This way it will be much flexible and extensible

@DemeSzabolcs DemeSzabolcs removed their assignment Jun 15, 2023
@sarahelsaig
Copy link
Contributor Author

It would be important to be able to disable unused payment implementations. For example if we have Stripe for production and a dummy payment processor for UI testing. I suggested using features because that seems like a natural fit for this purpose in OC. Do you have something else in mind?

@hishamco
Copy link
Member

OCC.Payment module will have the default implementation, so it could be enabled and disabled. As a user, I can create OCC.Payments.PayPal enable it and disable the other provider

In another scenario, some websites might support multiple gateway providers

1 similar comment
@hishamco

This comment was marked as duplicate.

@hishamco
Copy link
Member

At the end each module has a default feature which you can enable or disable, but I'd prefer creating modules instead of adding the payment providers into a single one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical debt Necessary but not urgent code cleanup or reorganization
Projects
None yet
3 participants