@insignia-education/api-sdk-js 0.9.19 → 0.9.21
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/package.json
CHANGED
package/src/api/v1/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import Insignias from './Insignias.js';
|
|
|
17
17
|
import Languages from './Languages.js';
|
|
18
18
|
import MailBlacklist from './MailBlacklist.js';
|
|
19
19
|
import Organizations from './Organizations.js';
|
|
20
|
+
import PaymentMethods from './PaymentMethods.js';
|
|
20
21
|
import Quizzes from './Quizzes.js';
|
|
21
22
|
import ShortLinks from './ShortLinks.js';
|
|
22
23
|
import Surveys from './Surveys.js';
|
|
@@ -57,6 +58,7 @@ export default class InsigniaApiV1 extends InsigniaApi {
|
|
|
57
58
|
this.languages = new Languages(this);
|
|
58
59
|
this.mailBlacklist = new MailBlacklist(this);
|
|
59
60
|
this.organizations = new Organizations(this);
|
|
61
|
+
this.paymentMethods = new PaymentMethods(this);
|
|
60
62
|
this.quizzes = new Quizzes(this);
|
|
61
63
|
this.shortLinks = new ShortLinks(this);
|
|
62
64
|
this.surveys = new Surveys(this);
|
|
@@ -90,3 +90,36 @@ describe('Auth', () => {
|
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
+
describe('PaymentMethods', () => {
|
|
94
|
+
test('get By currency id() returns a list', async () => {
|
|
95
|
+
await api.currencies.get()
|
|
96
|
+
.then(response => {
|
|
97
|
+
Object.values(response).forEach(async currency => {
|
|
98
|
+
await api.paymentMethods.byCurrency(currency.id)
|
|
99
|
+
.then(response => {
|
|
100
|
+
response = Object.values(response);
|
|
101
|
+
if(response.length == 0){
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
expect(response[0]["id"]).toBeDefined();
|
|
105
|
+
expect(response[0]["currency_id"]).toBeDefined();
|
|
106
|
+
expect(response[0]["order"]).toBeDefined();
|
|
107
|
+
expect(response[0]["cod"]).toBeDefined();
|
|
108
|
+
expect(response[0]["title"]).toBeDefined();
|
|
109
|
+
expect(response[0]["requires_reference"]).toBeDefined();
|
|
110
|
+
expect(response[0]["can_upload_support"]).toBeDefined();
|
|
111
|
+
expect(response[0]["enabled"]).toBeDefined();
|
|
112
|
+
expect(response[0]["commission_amount"]).toBeDefined();
|
|
113
|
+
expect(response[0]["commission_percentage"]).toBeDefined();
|
|
114
|
+
expect(response[0]["description"]).toBeDefined();
|
|
115
|
+
expect(response[0]["image"]).toBeDefined();
|
|
116
|
+
expect(response[0]["icon"]).toBeDefined();
|
|
117
|
+
expect(response[0]["created_at"]).toBeDefined();
|
|
118
|
+
expect(response[0]["updated_at"]).toBeDefined();
|
|
119
|
+
expect(response[0]["deleted_at"]).toBeDefined();
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|