Skip to content

Commit

Permalink
PayPal docs vuestorefront#793
Browse files Browse the repository at this point in the history
  • Loading branch information
pkarw committed Oct 3, 2018
1 parent a47d73a commit 5f092f2
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Tutorial series on creating themes for Vue Storefront:
* [Vue Storefront + with Magento checkout](https://github.com/DivanteLtd/magento2-external-checkout)
* [Vue Storefront + Pimcore](https://github.com/DivanteLtd/pimcore2vuestorefront)
* [Magento2 Product Reviews](https://github.com/DivanteLtd/vue-storefront/blob/develop/doc/Reviews.md)
* [PayPal Payments integration](https://github.com/DivanteLtd/vue-storefront/blob/develop/doc/PayPal%20payments%20support.md)
* [Direct prices sync with Magento](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Direct%20Prices.md)
* [Tier prices sync with Magento](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Tier%20prices.md)
* [Shopping carts, totals and orders sync](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Totals%2C%20cart%2C%20orders%20sync%20with%20Magento.md)
Expand Down
75 changes: 75 additions & 0 deletions doc/PayPal payments support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# PayPal payments support

Vue Storefront is supporting PayPal payments with PayPal Payment extension for [vue-storefront](https://github.com/DivanteLtd/vue-storefront), by [Develo Design](https://www.develodesign.co.uk).

## The architecture
![Architecture diagram](https://raw.githubusercontent.com/develodesign/vsf-payment-paypal/master/doc/executing-paypal-payment-server-integration.svg)

## Installation using NPM:

Add the extension to your Vue Storefront `package.json` using:
```shell
$ npm install vsf-payment-paypal --save
```

Add `vsf-payment-paypal` to the `extensions/index.js`
```js
export default [
require('@vue-storefront/extension-droppoint-shipping/index.js'),
require('@vue-storefront/extension-google-analytics/index.js'),
require('@vue-storefront/extension-mailchimp-subscribe/index.js'),
require('@vue-storefront/extension-payment-backend-methods/index.js'),
require('@vue-storefront/extension-payment-cash-on-delivery/index.js'),
require('@vue-storefront/extension-template/index.js'),
require('vsf-payment-stripe/index.js'),
require('src/extensions/cms/index.js'),

require('vsf-payment-paypal/index.js')
]
```

Add the following also to your `config/local.json` need set `paypal.env` to `sandbox` or `production`.
```js
"paypal": {
"env": "sandbox",
"create_endpoint": "http://localhost:8080/api/ext/paypal-payment/create",
"execute_endpoint": "http://localhost:8080/api/ext/paypal-payment/execute",
"style": {
"size": "small",
"color": "gold",
"shape": "pill"
}
}
```

Also we can use `paypal.style` option for more customizable PayPal button view. For more info [PayPal](https://developer.paypal.com/demo/checkout/#/pattern/checkout).

## Vue Storefront API

After setting up the Vue Storefront extension - please setup the API with [https://github.com/develodesign/vsf-payment-paypal-api#readme](vsf-payment-paypal-api).

This API extension execute payment to PayPal gateway.
It use [`develodesign/m2-paypal-payment`](https://github.com/develodesign/m2-paypal-payment) composer module so you have to install it in your Magento instance.

in your `local.json` file you should register the extension:
`"registeredExtensions": ["mailchimp-subscribe", "example-magento-api", "paypal-payment"],`

And need add the `paypal` settings to `extensions` key in `local.json`:
```
"extensions": {
"mailchimp": {
...
},
"paypal": {
"api": "https://api.sandbox.paypal.com",
"client": "",
"secret": ""
}
}
```

The API endpoitns are:
```
/api/ext/paypal-payment/create
/api/ext/paypal-payment/execute
```

0 comments on commit 5f092f2

Please sign in to comment.