Stripe Payment module for Vue Storefront
Stripe Payment extension for vue-storefront, by Develo Design.
Installation
By hand (preferred):
git clone https://github.com/develodesign/vsf-payment-stripe.git ./vue-storefront/src/modules/payment-stripe
By yarn:
cd storefront/src/themes/default
yarn add https://github.com/develodesign/payment-stripe
Add the following Publishable API key also to your config/local.json
and configure the stripe.apiKey
to point to your Stripe details.
"stripe": {
"apiKey": "my_publishable_api_key"
}
Registering the Stripe module
Add script import to ./src/modules/client.ts
import { PaymentStripeModule } from './payment-stripe'
export function registerClientModules () {
...
registerModule(PaymentStripeModule)
}
Integrating the Stripe component with your theme
Go to storefront/src/themes/defalt/components/core/blocks/Checkout/Payment.vue
import { mapGetters } from 'vuex'
import PaymentStripe from 'src/modules/payment-stripe/components/PaymentStripe'
export default {
components: {
...,
PaymentStripe
},
computed: {
...mapGetters({
paymentDetails: 'checkout/getPaymentDetails'
})
},
Then need add the component instance
to template section with check on payment method v-if="paymentDetails.paymentMethod === 'stripe_payments'"
: