File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ let user = thepeer.indexUser("Thor Odin", "thor", "
[email protected] ");
5656 - link_id (string)
5757 - amount (integer)
5858 - ` returns ` : object
59+ * getBusinesses
60+ - ` accepts ` :
61+ - channel (string)
62+ - ` returns ` : object
5963
6064## Extra
6165
Original file line number Diff line number Diff line change @@ -157,6 +157,25 @@ class Thepeer {
157157 Helper . processError ( e )
158158 }
159159 }
160+
161+ /**
162+ * Get a list of all integrated businesses and their respective images
163+ * @param {string } channel - Channel type (send, checkout, direct_charge)
164+ * @returns {JSON } A JSON response containing the details of the businesses
165+ * @memberof Thepeer
166+ */
167+ async getBusinesses ( channel ) {
168+ try {
169+ let url = '/businesses'
170+ if ( channel . length !== 0 ) {
171+ url += `?channel=${ channel } `
172+ }
173+ const response = await this . request . get ( url )
174+ return response . data
175+ } catch ( e ) {
176+ Helper . processError ( e )
177+ }
178+ }
160179}
161180
162181module . exports = Thepeer
You can’t perform that action at this time.
0 commit comments