eltrino / magento2-hyva-checkout-stripe

5 stars 2 forks source link

Avoid usage of @hyva/react-checkout in the main branch #1

Closed rajeev-k-tomy closed 2 years ago

rajeev-k-tomy commented 2 years ago

I understand that this payment integration requires an example template to be set up in order to make it work. But, the support for example template should be an addition and the main branch should aim at the Hyvä Checkout repository itself. This is because the example template is one among the solution with which we can setup Hyvä Checkout.

Developers can set up Hyvä Checkout in app/code directory. They can also create a fork from the repo and do customization through the fork. In those cases @hyva/react-checkout would not work.

I recommend moving the current main branch to some other branch, for example, hyva-checkout-example-template so that those who use the example template can still use the current state. Then replace @hyva/react-checkout reference with the relative reference to the original component. See hyva-checkout-example-template from payone repo.

Reference needs to be corrected:

  1. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/components/config.js#L1
  2. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/api/stripe/getClientSecret/modifier.js#L3
  3. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/api/stripe/getClientSecret/restGetClientSecret.js#L1-#L4
  4. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/api/stripe/refreshPaymentIntent/modifier.js#L3
  5. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/api/stripe/refreshPaymentIntent/restRefreshPaymentIntent.js#L1-#L4
  6. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/components/Cards.jsx#L6
  7. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/hooks/useAppContext.js#L3
  8. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/hooks/useCartContext.js#L4
  9. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/hooks/useCheckoutFormContext.js#L3
  10. https://github.com/eltrino/magento2-hyva-checkout-stripe/blob/main/src/hooks/useStripePayments.js#L2-#L4
odi-um commented 2 years ago

@rajeev-k-tomy i've changed structure per your suggestion.