Open dangtrinhtran opened 1 year ago
@dangtrinhtran Thank you for asking this question. I am answering your questions below:
However, changing the code in paymentMethods/braintree is not a good solution because it will be overridden when I run npm install.
You are wrong here. Once you have paymentMethods/braintree
present in your reactapp, any further npm install
do not overwrite your modifications. This is how you are supposed to modify the braintree payment method as well. It is totally fine and intended to modify in this way.
If you have time, can you please create a PR to braintree repository with the changes you mentioned above. This will help others to have a smooth payment integration in the future.
Thank you.
Hello,
Preconditions (*)
hyva-themes/magento2-default-theme
-> 1.2hyva-themes/magento2-react-checkout
-> 1.1.2 (installed via Composer)hyva-themes/magento2-checkout-example
-> the latest versionnode v16.15.1
andnpm v8.11.0
Steps to reproduce (*)
hyva-themes/magento2-react-checkout
via Composerapp/code/Hyva/CheckoutExample
cd app/code/Hyva/CheckoutExample/reactapp
npm install braintree-web
app/code/Hyva/CheckoutExample/reactapp/package.json
npm install
npm run build
Actual result (*)
Following this guide https://github.com/hyva-themes/magento2-checkout-example#payment-integrations, I have changed
../../../../..
to@hyva/react-checkout
inapp/code/Hyva/CheckoutExample/reactapp/src/paymentMethods/braintree
folder, and then it worked.hyva-themes/magento2-hyva-checkout-braintree/blob/main/src/components/BraintreeApplePay/ApplePay.jsx
However, changing the code in
paymentMethods/braintree
is not a good solution because it will be overridden when I runnpm install
.Do we have any solution to solve that?
Thank you.