payjp 2.0.8 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tsconfig.json CHANGED
@@ -2,7 +2,9 @@
2
2
  "compilerOptions": {
3
3
  "target": "ESNext",
4
4
  "module": "commonjs",
5
- "lib": ["dom"],
5
+ "lib": [
6
+ "dom"
7
+ ],
6
8
  "outDir": "./built",
7
9
  "declaration": true
8
10
  },
package/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - "6"
4
- - "8"
5
- - "10"
6
- - "node"
7
- sudo: false
8
- install: yarn --frozen-lockfile
9
- after_success: npm run report && npm run coverage
@@ -1,216 +0,0 @@
1
- export interface CustomerResponse {
2
- cards: {
3
- count: number;
4
- data: CardResponse[];
5
- has_more: boolean;
6
- object: string;
7
- url: string;
8
- };
9
- created: number;
10
- default_card: string | null;
11
- description: string;
12
- email: string | null;
13
- id: string;
14
- livemode: boolean;
15
- metadata: object;
16
- object: string;
17
- subscriptions: {
18
- count: number;
19
- data: SubscriptionResponse[];
20
- has_more: boolean;
21
- object: string;
22
- url: string;
23
- };
24
- }
25
- export interface CustomerDeleted {
26
- deleted: boolean;
27
- id: string;
28
- livemode: boolean;
29
- }
30
- export interface PlanResponse {
31
- amount: number;
32
- billing_day: number | null;
33
- created: number;
34
- currency: string;
35
- id: string;
36
- interval: string;
37
- livemode: boolean;
38
- metadata: object;
39
- name: string | null;
40
- object: string;
41
- trial_days: number;
42
- }
43
- export interface PlanDeleted {
44
- deleted: boolean;
45
- id: string;
46
- livemode: boolean;
47
- }
48
- export interface SubscriptionResponse {
49
- canceled_at: number | null;
50
- created: number;
51
- current_period_end: number;
52
- current_period_start: number;
53
- customer: string;
54
- id: string;
55
- livemode: boolean;
56
- metadata: object;
57
- object: string;
58
- paused_at: number | null;
59
- plan: PlanResponse;
60
- resumed_at: number | null;
61
- start: number;
62
- status: string;
63
- trial_end: number | null;
64
- trial_start: number | null;
65
- prorate: boolean;
66
- }
67
- export interface SubscriptionDeleted {
68
- deleted: boolean;
69
- id: string;
70
- livemode: boolean;
71
- }
72
- export interface TransferResponse {
73
- amount: number;
74
- carried_balance: number | null;
75
- charges: {
76
- count: number;
77
- data: ChargeResponse[];
78
- has_more: boolean;
79
- object: string;
80
- url: string;
81
- };
82
- created: number;
83
- currency: string;
84
- description: string | null;
85
- id: string;
86
- livemode: boolean;
87
- object: string;
88
- scheduled_date: string;
89
- status: string;
90
- summary: {
91
- charge_count: number;
92
- charge_fee: number;
93
- charge_gross: number;
94
- net: number;
95
- refund_amount: number;
96
- refund_count: number;
97
- };
98
- term_end: number;
99
- term_start: number;
100
- transfer_amount: number | null;
101
- transfer_date: number | null;
102
- }
103
- export interface TokenResponse {
104
- id: string;
105
- livemode: boolean;
106
- object: string;
107
- used: boolean;
108
- card: CardResponse;
109
- }
110
- export interface EventResponse {
111
- created: number;
112
- data: {
113
- cards: {
114
- count: number;
115
- data: CardResponse[];
116
- has_more: boolean;
117
- object: string;
118
- url: string;
119
- };
120
- created: number;
121
- default_card: string | null;
122
- description: string;
123
- email: string | null;
124
- id: string;
125
- livemode: boolean;
126
- object: string;
127
- subscriptions: {
128
- count: number;
129
- data: SubscriptionResponse[];
130
- has_more: boolean;
131
- object: string;
132
- url: string;
133
- };
134
- };
135
- id: string;
136
- livemode: boolean;
137
- object: string;
138
- pending_webhooks: number;
139
- type: string;
140
- }
141
- export interface CardResponse {
142
- address_city: string | null;
143
- address_line1: string | null;
144
- address_line2: string | null;
145
- address_state: string | null;
146
- address_zip: string | null;
147
- address_zip_check: string;
148
- brand: string;
149
- country: string | null;
150
- created: number;
151
- customer: null;
152
- cvc_check: string;
153
- exp_month: number;
154
- exp_year: number;
155
- fingerprint: string;
156
- id: string;
157
- last4: string;
158
- livemode: boolean;
159
- metadata: object;
160
- name: string;
161
- object: string;
162
- }
163
- export interface CardDeleted {
164
- deleted: boolean;
165
- id: string;
166
- livemode: boolean;
167
- }
168
- export interface AccountResponse {
169
- created: number;
170
- email: string;
171
- id: string;
172
- merchant: {
173
- bank_enabled: boolean;
174
- brands_accepted: string[];
175
- business_type: string | null;
176
- charge_type: string[] | null;
177
- contact_phone: string | null;
178
- country: string;
179
- created: number;
180
- currencies_supported: string[];
181
- default_currency: string;
182
- details_submitted: boolean;
183
- id: string;
184
- livemode_activated_at: number | null;
185
- livemode_enabled: boolean;
186
- object: string;
187
- product_detail: string;
188
- product_name: string;
189
- product_type: string[];
190
- site_published: boolean;
191
- url: string | null;
192
- };
193
- object: string;
194
- }
195
- export interface ChargeResponse {
196
- amount: number;
197
- amount_refunded: number;
198
- captured: true;
199
- captured_at: number | null;
200
- card: CardResponse;
201
- created: number;
202
- currency: string;
203
- customer: string | null;
204
- description: string | null;
205
- expired_at: number | null;
206
- failure_code: string | null;
207
- failure_message: string | null;
208
- id: string;
209
- livemode: boolean;
210
- metadata: object;
211
- object: string;
212
- paid: boolean;
213
- refund_reason: string | null;
214
- refunded: boolean;
215
- subscription: SubscriptionResponse | null;
216
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- export default class Requestor {
2
- apikey: string;
3
- apibase: string;
4
- config: any;
5
- constructor(apikey: string, apibase: string, config?: any);
6
- buildHeader(method: string): object;
7
- buildUrl(endpoint: string): string;
8
- request(method: string, endpoint: string, query?: object, headers?: object): Promise<any>;
9
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- /* global Buffer */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var superagent = require("superagent");
5
- var Requestor = /** @class */ (function () {
6
- function Requestor(apikey, apibase, config) {
7
- if (config === void 0) { config = {}; }
8
- this.apikey = apikey;
9
- this.apibase = apibase;
10
- this.config = config;
11
- }
12
- Requestor.prototype.buildHeader = function (method) {
13
- var encodedKey = Buffer.from(this.apikey + ":").toString('base64');
14
- var headers = {
15
- Accept: 'application/json',
16
- Authorization: "Basic " + encodedKey
17
- };
18
- if (method === 'POST') {
19
- headers['Content-Type'] = 'application/x-www-form-urlencoded';
20
- }
21
- return headers;
22
- };
23
- Requestor.prototype.buildUrl = function (endpoint) {
24
- return this.apibase + "/" + endpoint;
25
- };
26
- Requestor.prototype.request = function (method, endpoint, query, headers) {
27
- var _this = this;
28
- if (query === void 0) { query = {}; }
29
- if (headers === void 0) { headers = {}; }
30
- var url = this.buildUrl(endpoint);
31
- var fixed_header = this.buildHeader(method);
32
- var header = Object.assign(fixed_header, headers);
33
- return new Promise(function (resolve, reject) {
34
- var request = superagent(method, url).set(header);
35
- if (method === 'GET' || method === 'DELETE') {
36
- request.query(query);
37
- }
38
- else if (method === 'POST' || method === 'PUT') {
39
- request.send(query);
40
- }
41
- if (_this.config.cert !== null) {
42
- request.ca(_this.config.cert);
43
- }
44
- request.end(function (err, res) {
45
- if (res.status === 200) {
46
- resolve(res.body);
47
- }
48
- else {
49
- reject(res);
50
- }
51
- });
52
- });
53
- };
54
- return Requestor;
55
- }());
56
- exports.default = Requestor;
package/lib/account.js DELETED
@@ -1,44 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _resource = require('./resource');
10
-
11
- var _resource2 = _interopRequireDefault(_resource);
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
-
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
-
21
- var Account = function (_Resource) {
22
- _inherits(Account, _Resource);
23
-
24
- function Account(payjp) {
25
- _classCallCheck(this, Account);
26
-
27
- var _this = _possibleConstructorReturn(this, (Account.__proto__ || Object.getPrototypeOf(Account)).call(this, payjp));
28
-
29
- _this.resource = 'accounts';
30
- return _this;
31
- }
32
-
33
- _createClass(Account, [{
34
- key: 'retrieve',
35
- value: function retrieve() {
36
- return this.request('GET', '' + this.resource);
37
- }
38
- }]);
39
-
40
- return Account;
41
- }(_resource2.default);
42
-
43
- exports.default = Account;
44
- module.exports = exports['default'];
package/lib/card.js DELETED
@@ -1,70 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _resource = require('./resource');
10
-
11
- var _resource2 = _interopRequireDefault(_resource);
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
-
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
-
21
- var Card = function (_Resource) {
22
- _inherits(Card, _Resource);
23
-
24
- function Card(payjp) {
25
- _classCallCheck(this, Card);
26
-
27
- var _this = _possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).call(this, payjp));
28
-
29
- _this.resource = 'cards';
30
- return _this;
31
- }
32
-
33
- _createClass(Card, [{
34
- key: 'list',
35
- value: function list(customer_id) {
36
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
-
38
- return this.request('GET', 'customers/' + customer_id + '/' + this.resource, query);
39
- }
40
- }, {
41
- key: 'create',
42
- value: function create(customer_id) {
43
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
44
-
45
- return this.request('POST', 'customers/' + customer_id + '/' + this.resource, query);
46
- }
47
- }, {
48
- key: 'retrieve',
49
- value: function retrieve(customer_id, id) {
50
- return this.request('GET', 'customers/' + customer_id + '/' + this.resource + '/' + id);
51
- }
52
- }, {
53
- key: 'update',
54
- value: function update(customer_id, id) {
55
- var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
56
-
57
- return this.request('POST', 'customers/' + customer_id + '/' + this.resource + '/' + id, query);
58
- }
59
- }, {
60
- key: 'delete',
61
- value: function _delete(customer_id, id) {
62
- return this.request('DELETE', 'customers/' + customer_id + '/' + this.resource + '/' + id);
63
- }
64
- }]);
65
-
66
- return Card;
67
- }(_resource2.default);
68
-
69
- exports.default = Card;
70
- module.exports = exports['default'];
package/lib/charge.js DELETED
@@ -1,79 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _resource = require('./resource');
10
-
11
- var _resource2 = _interopRequireDefault(_resource);
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
-
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
-
21
- var Charge = function (_Resource) {
22
- _inherits(Charge, _Resource);
23
-
24
- function Charge(payjp) {
25
- _classCallCheck(this, Charge);
26
-
27
- var _this = _possibleConstructorReturn(this, (Charge.__proto__ || Object.getPrototypeOf(Charge)).call(this, payjp));
28
-
29
- _this.resource = 'charges';
30
- return _this;
31
- }
32
-
33
- _createClass(Charge, [{
34
- key: 'list',
35
- value: function list() {
36
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37
-
38
- return this.request('GET', this.resource, query);
39
- }
40
- }, {
41
- key: 'create',
42
- value: function create() {
43
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
-
45
- return this.request('POST', this.resource, query);
46
- }
47
- }, {
48
- key: 'retrieve',
49
- value: function retrieve(id) {
50
- return this.request('GET', this.resource + '/' + id);
51
- }
52
- }, {
53
- key: 'update',
54
- value: function update(id) {
55
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
56
-
57
- return this.request('POST', this.resource + '/' + id, query);
58
- }
59
- }, {
60
- key: 'refund',
61
- value: function refund(id) {
62
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
63
-
64
- return this.request('POST', this.resource + '/' + id + '/refund', query);
65
- }
66
- }, {
67
- key: 'capture',
68
- value: function capture(id) {
69
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
70
-
71
- return this.request('POST', this.resource + '/' + id + '/capture', query);
72
- }
73
- }]);
74
-
75
- return Charge;
76
- }(_resource2.default);
77
-
78
- exports.default = Charge;
79
- module.exports = exports['default'];
package/lib/customer.js DELETED
@@ -1,105 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _resource = require('./resource');
10
-
11
- var _resource2 = _interopRequireDefault(_resource);
12
-
13
- var _card = require('./card');
14
-
15
- var _card2 = _interopRequireDefault(_card);
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
-
21
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
22
-
23
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
24
-
25
- var CustomerSubscription = function (_Resource) {
26
- _inherits(CustomerSubscription, _Resource);
27
-
28
- function CustomerSubscription(payjp) {
29
- _classCallCheck(this, CustomerSubscription);
30
-
31
- var _this = _possibleConstructorReturn(this, (CustomerSubscription.__proto__ || Object.getPrototypeOf(CustomerSubscription)).call(this, payjp));
32
-
33
- _this.resource = 'subscriptions';
34
- return _this;
35
- }
36
-
37
- _createClass(CustomerSubscription, [{
38
- key: 'list',
39
- value: function list(customer_id) {
40
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
41
-
42
- return this.request('GET', 'customers/' + customer_id + '/' + this.resource, query);
43
- }
44
- }, {
45
- key: 'retrieve',
46
- value: function retrieve(customer_id, id) {
47
- return this.request('GET', 'customers/' + customer_id + '/' + this.resource + '/' + id);
48
- }
49
- }]);
50
-
51
- return CustomerSubscription;
52
- }(_resource2.default);
53
-
54
- var Customer = function (_Resource2) {
55
- _inherits(Customer, _Resource2);
56
-
57
- function Customer(payjp) {
58
- _classCallCheck(this, Customer);
59
-
60
- var _this2 = _possibleConstructorReturn(this, (Customer.__proto__ || Object.getPrototypeOf(Customer)).call(this, payjp));
61
-
62
- _this2.resource = 'customers';
63
- _this2.cards = new _card2.default(payjp);
64
- _this2.subscriptions = new CustomerSubscription(payjp);
65
- return _this2;
66
- }
67
-
68
- _createClass(Customer, [{
69
- key: 'list',
70
- value: function list() {
71
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
-
73
- return this.request('GET', this.resource, query);
74
- }
75
- }, {
76
- key: 'create',
77
- value: function create() {
78
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
79
-
80
- return this.request('POST', this.resource, query);
81
- }
82
- }, {
83
- key: 'retrieve',
84
- value: function retrieve(id) {
85
- return this.request('GET', this.resource + '/' + id);
86
- }
87
- }, {
88
- key: 'update',
89
- value: function update(id) {
90
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
91
-
92
- return this.request('POST', this.resource + '/' + id, query);
93
- }
94
- }, {
95
- key: 'delete',
96
- value: function _delete(id) {
97
- return this.request('DELETE', this.resource + '/' + id);
98
- }
99
- }]);
100
-
101
- return Customer;
102
- }(_resource2.default);
103
-
104
- exports.default = Customer;
105
- module.exports = exports['default'];
package/lib/event.js DELETED
@@ -1,51 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8
-
9
- var _resource = require('./resource');
10
-
11
- var _resource2 = _interopRequireDefault(_resource);
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
-
17
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18
-
19
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20
-
21
- var Event = function (_Resource) {
22
- _inherits(Event, _Resource);
23
-
24
- function Event(payjp) {
25
- _classCallCheck(this, Event);
26
-
27
- var _this = _possibleConstructorReturn(this, (Event.__proto__ || Object.getPrototypeOf(Event)).call(this, payjp));
28
-
29
- _this.resource = 'events';
30
- return _this;
31
- }
32
-
33
- _createClass(Event, [{
34
- key: 'list',
35
- value: function list() {
36
- var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37
-
38
- return this.request('GET', this.resource, query);
39
- }
40
- }, {
41
- key: 'retrieve',
42
- value: function retrieve(id) {
43
- return this.request('GET', this.resource + '/' + id);
44
- }
45
- }]);
46
-
47
- return Event;
48
- }(_resource2.default);
49
-
50
- exports.default = Event;
51
- module.exports = exports['default'];