litegate-sdk 1.0.1 → 1.0.3

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/client.d.ts CHANGED
@@ -21,5 +21,5 @@ export declare class LiteGateClient {
21
21
  transId: string;
22
22
  }): Promise<any>;
23
23
  initiateCbebirrPayment(title: string, amount: string, buyer_phone_number: string, publicKey: string, privateKey: string): Promise<any>;
24
- cbebirrCallback(EncVal: string, publicKey: string, privateKey: string): Promise<any>;
24
+ cbebirrCallback(EncVal: string): Promise<any>;
25
25
  }
package/dist/client.js CHANGED
@@ -74,14 +74,14 @@ class LiteGateClient {
74
74
  }
75
75
  return response.json();
76
76
  }
77
- async cbebirrCallback(EncVal, publicKey, privateKey) {
77
+ async cbebirrCallback(EncVal) {
78
78
  const body = { EncVal };
79
- const signature = await (0, signature_1.signRequest)(body, privateKey);
79
+ const signature = await (0, signature_1.signRequest)(body, this.PrivateKey);
80
80
  const response = await fetch(`${this.baseUrl}/v1/cbebirr/notify/`, {
81
81
  method: "POST",
82
82
  headers: {
83
83
  "Content-Type": "application/json",
84
- Authorization: `PublicKey ${publicKey}`,
84
+ Authorization: `PublicKey ${this.PublicKey}`,
85
85
  "X-SIGNATURE": signature,
86
86
  },
87
87
  body: JSON.stringify(body),
@@ -21,5 +21,5 @@ export declare class LiteGateClient {
21
21
  transId: string;
22
22
  }): Promise<any>;
23
23
  initiateCbebirrPayment(title: string, amount: string, buyer_phone_number: string): Promise<any>;
24
- cbebirrCallback(EncVal: string, publicKey: string, privateKey: string): Promise<any>;
24
+ cbebirrCallback(EncVal: string): Promise<any>;
25
25
  }
@@ -74,14 +74,14 @@ class LiteGateClient {
74
74
  }
75
75
  return response.json();
76
76
  }
77
- async cbebirrCallback(EncVal, publicKey, privateKey) {
77
+ async cbebirrCallback(EncVal) {
78
78
  const body = { EncVal };
79
- const signature = await (0, signature_1.signRequest)(body, privateKey);
79
+ const signature = await (0, signature_1.signRequest)(body, this.PrivateKey);
80
80
  const response = await fetch(`${this.baseUrl}/v1/cbebirr/notify/`, {
81
81
  method: "POST",
82
82
  headers: {
83
83
  "Content-Type": "application/json",
84
- Authorization: `PublicKey ${publicKey}`,
84
+ Authorization: `PublicKey ${this.PublicKey}`,
85
85
  "X-SIGNATURE": signature,
86
86
  },
87
87
  body: JSON.stringify(body),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litegate-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Official TypeScript SDK for LiteGate API",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",