Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbatista committed Oct 2, 2017
1 parent 71a2101 commit 4c4b69e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ $ npm install --save loopback-component-paypal
```

## Usage
Add configuration in file component-config.json
Define new datasourc configuration for your PayPal account (file datasources.json)
```js
{
"loopback-component-paypal": {
"paypal": {
"clientID": "CLIENT_ID",
"clientSecret": "CLIENT_SECRET",
"mode": "sandbox",
Expand All @@ -28,8 +28,22 @@ Add configuration in file component-config.json
}
}
}
```

Define new model in file model-config.json with datasource `paypal`

var PayPal = app.models.PayPal;
```js
{
"PayPal": {
"dataSource": "paypal",
"public": false
}
}
```

use model `PayPal` in your application:

```js
PayPal.payment.create(create_payment_json, function (error, payment) {
if (error) {
console.log(error.response);
Expand All @@ -40,6 +54,7 @@ PayPal.payment.create(create_payment_json, function (error, payment) {
}
});
```

## License

MIT © [Matteo Padovano](https://github.com/mrbatista)
Expand Down

0 comments on commit 4c4b69e

Please sign in to comment.