@crmcom/self-service-sdk 3.0.0-build.34 → 3.0.0-build.35
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/index.d.ts +1 -0
- package/package.json +1 -1
- package/wallet.js +21 -1
package/index.d.ts
CHANGED
|
@@ -331,6 +331,7 @@ export declare const wallet: {
|
|
|
331
331
|
getWalletSummarisedTotals(params?: { posted_on?: string; posted_on_gt?: string; posted_on_gte?: string; posted_on_lt?: string; posted_on_lte?: string }, walletId?: string): Promise<SDKResult>;
|
|
332
332
|
activateDeactivateCommercePool(params: { commerce_pool_id: string; action: string }): Promise<SDKResult>;
|
|
333
333
|
verifyWalletExists(params?: { type?: string; value?: string }): Promise<SDKResult>;
|
|
334
|
+
getDigitalPoundBalance(): Promise<string | null>;
|
|
334
335
|
};
|
|
335
336
|
|
|
336
337
|
// ============================================================================
|
package/package.json
CHANGED
package/wallet.js
CHANGED
|
@@ -19,7 +19,8 @@ export const wallet = {
|
|
|
19
19
|
getWalletCode,
|
|
20
20
|
getWalletSummarisedTotals,
|
|
21
21
|
activateDeactivateCommercePool,
|
|
22
|
-
verifyWalletExists
|
|
22
|
+
verifyWalletExists,
|
|
23
|
+
getDigitalPoundBalance,
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
async function getWallet(walletId) {
|
|
@@ -480,4 +481,23 @@ async function verifyWalletExists({ type, value } = {}) {
|
|
|
480
481
|
logger.error("Exception getContact:", e);
|
|
481
482
|
return createResult(ErrorCodes.UNKNOWN, e);
|
|
482
483
|
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
async function getDigitalPoundBalance() {
|
|
487
|
+
try {
|
|
488
|
+
let id = httpUtil.getSession().sub;
|
|
489
|
+
|
|
490
|
+
let response = await httpUtil.get({
|
|
491
|
+
resourcePath: '/v2/contacts/' + id + '/digital_pound/balance',
|
|
492
|
+
withAccessToken: true,
|
|
493
|
+
logOutIfSessionInvalid: false,
|
|
494
|
+
});
|
|
495
|
+
console.log("result", response)
|
|
496
|
+
//check return code here instead of put as there would be different intepretation for different API
|
|
497
|
+
return createCommonResult(response);
|
|
498
|
+
} catch (e) {
|
|
499
|
+
console.log("error", e)
|
|
500
|
+
logger.error('Exception getDigitalPoundBalance:', e);
|
|
501
|
+
return createResult(ErrorCodes.UNKNOWN, e);
|
|
502
|
+
}
|
|
483
503
|
}
|