paperless-client 1.0.3 → 1.0.5
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/dist/index.d.ts +4 -4
- package/dist/index.js +8 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ export default class PaperlessClient {
|
|
|
8
8
|
/**
|
|
9
9
|
* @param muid It will be provided upon registration
|
|
10
10
|
* @param app_access_key It will be provided upon registration
|
|
11
|
-
* @param
|
|
11
|
+
* @param origin The origin of the server
|
|
12
12
|
*/
|
|
13
|
-
constructor(muid: string, app_access_key: string,
|
|
13
|
+
constructor(muid: string, app_access_key: string, origin: string);
|
|
14
14
|
/**
|
|
15
15
|
* merchant_order_id and merchant_ref_id should be unique for each payment.
|
|
16
|
-
* marchant_order_id is
|
|
17
|
-
* merchant_ref_id is used by
|
|
16
|
+
* marchant_order_id is used by the merchant to identify the order in the dashboard.
|
|
17
|
+
* merchant_ref_id is used by Peperless to communicate with banks. Max 20 characters.
|
|
18
18
|
*/
|
|
19
19
|
newPayment(options: GetPaymentUrlOptionsType): Promise<{
|
|
20
20
|
url: string;
|
package/dist/index.js
CHANGED
|
@@ -8,24 +8,24 @@ export {} from "./callback_data.js";
|
|
|
8
8
|
export default class PaperlessClient {
|
|
9
9
|
#muid;
|
|
10
10
|
#app_access_key;
|
|
11
|
-
#
|
|
11
|
+
#origin;
|
|
12
12
|
/**
|
|
13
13
|
* @param muid It will be provided upon registration
|
|
14
14
|
* @param app_access_key It will be provided upon registration
|
|
15
|
-
* @param
|
|
15
|
+
* @param origin The origin of the server
|
|
16
16
|
*/
|
|
17
|
-
constructor(muid, app_access_key,
|
|
17
|
+
constructor(muid, app_access_key, origin) {
|
|
18
18
|
this.#muid = muid;
|
|
19
19
|
this.#app_access_key = app_access_key;
|
|
20
|
-
this.#
|
|
20
|
+
this.#origin = origin;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* merchant_order_id and merchant_ref_id should be unique for each payment.
|
|
24
|
-
* marchant_order_id is
|
|
25
|
-
* merchant_ref_id is used by
|
|
24
|
+
* marchant_order_id is used by the merchant to identify the order in the dashboard.
|
|
25
|
+
* merchant_ref_id is used by Peperless to communicate with banks. Max 20 characters.
|
|
26
26
|
*/
|
|
27
27
|
async newPayment(options) {
|
|
28
|
-
const checkServerResponse = await checkServer(this.#
|
|
28
|
+
const checkServerResponse = await checkServer(this.#origin);
|
|
29
29
|
if (!checkServerResponse.success) {
|
|
30
30
|
throw new Error('Server check failed', {
|
|
31
31
|
cause: checkServerResponse.data
|
|
@@ -50,7 +50,7 @@ export default class PaperlessClient {
|
|
|
50
50
|
* @param token The token received from the newPayment method
|
|
51
51
|
*/
|
|
52
52
|
async checkPayment(token) {
|
|
53
|
-
const checkPaymentResponse = await checkPayment(this.#
|
|
53
|
+
const checkPaymentResponse = await checkPayment(this.#origin, this.#muid, token);
|
|
54
54
|
if (!checkPaymentResponse.success) {
|
|
55
55
|
throw new Error('Payment check failed', {
|
|
56
56
|
cause: checkPaymentResponse.data
|