vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

Payment's extension boilerplate + short tutorial #923

Closed pkarw closed 6 years ago

pkarw commented 6 years ago

Guys, we're so close to make Your stripe extension the de-facto standard for payment extensions :)

Could You please;

  1. Accept my PR with changes to the docs (regarding installation procedure) - https://github.com/develodesign/vue-storefront-stripe
  2. Change the name of the plugin to "vsf-payment-stripe" - to make the convention name
  3. Change the Component name to "UpperCamelCase" - https://github.com/develodesign/vue-storefront-stripe/tree/master/lib/components
  4. Add some vuex action call instead of https://github.com/develodesign/vue-storefront-stripe/blob/c3fcc524aff3257565c03caaabde669fcd232c6c/index.js#L27
  5. Publish to NPM registry
  6. Create the second repo like "vsf-payment-template" or "vsf-payment-boilerplate" and add some empty module template there + short tutorial inside README.md on how to create the payment module

Would be great IF you can manage this til Thursday as we're releasing the RC2

collymore commented 6 years ago

This has now been published with the changes requested to https://www.npmjs.com/package/vsf-payment-stripe TODO: adding the Vuex updates. We'll work on a template boilerplate and some detailed instructions next.

pkarw commented 6 years ago

Cool!

thomasthune commented 6 years ago

Ok, so for me the only payment method showing up on the checkout page is the default, "cashondelivery". As far as i can see the checkout reads payment methods from a different store, than where the payment methods are added. Checkout reads from the cart store and the payment methods are added to the payment store.

I am a bit unsure as to where it should be placed. It is possible to change the getter in the cart store, to load the payment methods from through the rootStore, but this seems a bit wrong to me. It would look a bit like this:

  paymentMethods (state) {
    return rootStore.state.payment.methods
  }

Instead it would seem more correct that the payment store was used exclusively instead. The naming of the stores would indicate this as well.

thomasthune commented 6 years ago

Using payment store instead of cart, added action and getter. If this is on the track, let me know and i will create a PR. https://github.com/thomasthune/vue-storefront/commit/2f91cbe9782834f9833d5bc95e68029833a33c46

pkarw commented 6 years ago

This seems like good idea to unify this. Please proceed, please test the checkout extensively before pushing out the PR ok?

pkarw commented 6 years ago

@collymore any progress in here? :)

kyvaith commented 6 years ago

Please refer to my comment: https://github.com/DivanteLtd/vue-storefront/issues/792#issuecomment-380360536 and this: https://github.com/DivanteLtd/vue-storefront/pull/822#issuecomment-380362934

MikeSheward commented 6 years ago

@pkarw Is it the docs that are just left that needs doing for this now? We wrote some docs somewhere, possibly in the repo. We can expand upon that and create the example repo. The example payment method at the moment is cash on delivery i think? (the most simplest payment extension example).

pkarw commented 6 years ago

Yes. Please update and put all the docs in one place + create a boilerplate/example extension to show other guys how to create the extensiosn

MikeSheward commented 6 years ago

Will do!

pkarw commented 6 years ago

Maciej here is the task about the payments

pkarw commented 6 years ago

Currently we just need the point 6 to be completed:

Create the second repo like "vsf-payment-template" or "vsf-payment-boilerplate" and add some empty module template there + short tutorial inside README.md on how to create the payment module
pkarw commented 6 years ago

Here is a first step on the docs/boilerplate: Payment Integration Docs