@waffo/waffo-node 2.3.0 → 2.3.2
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/README.md +108 -1
- package/dist/index.d.mts +44 -2
- package/dist/index.d.ts +44 -2
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Waffo Node.js SDK
|
|
2
2
|
|
|
3
|
-
<!-- Synced with waffo-sdk/README.md @ commit
|
|
3
|
+
<!-- Synced with waffo-sdk/README.md @ commit ee83ead -->
|
|
4
4
|
|
|
5
5
|
**English** | [中文](README_CN.md)
|
|
6
6
|
|
|
@@ -804,6 +804,113 @@ app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res)
|
|
|
804
804
|
> - `SUBSCRIPTION_STATUS_NOTIFICATION`: When new subscription status changes to `ACTIVE`
|
|
805
805
|
> - `PAYMENT_NOTIFICATION`: If upgrade requires additional payment (price difference)
|
|
806
806
|
|
|
807
|
+
### Webhook Notification Payload Examples
|
|
808
|
+
|
|
809
|
+
The following examples show the actual payload structure for each notification type.
|
|
810
|
+
|
|
811
|
+
#### PAYMENT_NOTIFICATION
|
|
812
|
+
|
|
813
|
+
```json
|
|
814
|
+
{
|
|
815
|
+
"eventType": "PAYMENT_NOTIFICATION",
|
|
816
|
+
"result": {
|
|
817
|
+
"acquiringOrderId": "A2026xxxxxxxxxxxxxxxxxxxx",
|
|
818
|
+
"orderStatus": "PAY_SUCCESS",
|
|
819
|
+
"orderAmount": "109.00",
|
|
820
|
+
"orderCurrency": "USD",
|
|
821
|
+
"finalDealAmount": "109.00",
|
|
822
|
+
"userCurrency": "USD",
|
|
823
|
+
"orderDescription": "Sample Product",
|
|
824
|
+
"orderRequestedAt": "2026-02-28T10:05:58.000Z",
|
|
825
|
+
"orderCompletedAt": "2026-02-28T10:06:10.000Z",
|
|
826
|
+
"orderUpdatedAt": "2026-02-28T10:06:10.000Z",
|
|
827
|
+
"refundExpiryAt": "2026-08-26T23:59:59.999Z",
|
|
828
|
+
"userInfo": {
|
|
829
|
+
"userId": "user@example.com",
|
|
830
|
+
"userEmail": "user@example.com"
|
|
831
|
+
},
|
|
832
|
+
"merchantInfo": {
|
|
833
|
+
"merchantId": "YOUR_MERCHANT_ID"
|
|
834
|
+
},
|
|
835
|
+
"goodsInfo": {
|
|
836
|
+
"goodsId": "goods_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
837
|
+
"goodsName": "Sample Product"
|
|
838
|
+
},
|
|
839
|
+
"addressInfo": {},
|
|
840
|
+
"paymentInfo": {
|
|
841
|
+
"productName": "SUBSCRIPTION",
|
|
842
|
+
"payMethodType": "CREDITCARD",
|
|
843
|
+
"payMethodName": "CC_VISA",
|
|
844
|
+
"payMethodProperties": "{\"cardToken\":\"CARD_TOKEN_XXXXXXXXXXXXXXXXXXXX\",\"cardTransactionType\":\"CIT\"}",
|
|
845
|
+
"payMethodResponse": "{\"maskCardData\":\"XXXX42****XX4242\"}"
|
|
846
|
+
},
|
|
847
|
+
"subscriptionInfo": {
|
|
848
|
+
"subscriptionId": "SC2026xxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
849
|
+
"subscriptionRequest": "sub_req_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
850
|
+
"merchantRequest": "sub_req_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
851
|
+
"period": "1"
|
|
852
|
+
},
|
|
853
|
+
"cancelRedirectUrl": "https://YOUR_DOMAIN/checkout/YOUR_CHECKOUT_ID"
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
#### SUBSCRIPTION_STATUS_NOTIFICATION / SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION
|
|
859
|
+
|
|
860
|
+
These two notification types share the same payload structure:
|
|
861
|
+
|
|
862
|
+
```json
|
|
863
|
+
{
|
|
864
|
+
"eventType": "SUBSCRIPTION_STATUS_NOTIFICATION",
|
|
865
|
+
"result": {
|
|
866
|
+
"subscriptionId": "SC2026xxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
867
|
+
"subscriptionRequest": "sub_req_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
868
|
+
"merchantSubscriptionId": "sub_req_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
869
|
+
"subscriptionStatus": "ACTIVE",
|
|
870
|
+
"currency": "USD",
|
|
871
|
+
"userCurrency": "USD",
|
|
872
|
+
"amount": "109.00",
|
|
873
|
+
"requestedAt": "2026-02-28T10:05:58.000Z",
|
|
874
|
+
"updatedAt": "2026-02-28T10:06:10.000Z",
|
|
875
|
+
"userInfo": {
|
|
876
|
+
"userId": "user@example.com",
|
|
877
|
+
"userEmail": "user@example.com"
|
|
878
|
+
},
|
|
879
|
+
"merchantInfo": {
|
|
880
|
+
"merchantId": "YOUR_MERCHANT_ID"
|
|
881
|
+
},
|
|
882
|
+
"goodsInfo": {
|
|
883
|
+
"goodsId": "goods_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
884
|
+
"goodsName": "Sample Product"
|
|
885
|
+
},
|
|
886
|
+
"productInfo": {
|
|
887
|
+
"periodType": "MONTHLY",
|
|
888
|
+
"periodInterval": "1",
|
|
889
|
+
"currentPeriod": "1",
|
|
890
|
+
"startDateTime": "2026-02-28T10:06:10.000Z",
|
|
891
|
+
"nextPaymentDateTime": "2026-03-28T10:06:10.000Z",
|
|
892
|
+
"description": "Sample Product"
|
|
893
|
+
},
|
|
894
|
+
"paymentInfo": {
|
|
895
|
+
"productName": "SUBSCRIPTION",
|
|
896
|
+
"payMethodType": "CREDITCARD",
|
|
897
|
+
"payMethodName": "CC_VISA",
|
|
898
|
+
"payMethodProperties": "{}"
|
|
899
|
+
},
|
|
900
|
+
"paymentDetails": [
|
|
901
|
+
{
|
|
902
|
+
"period": "1",
|
|
903
|
+
"acquiringOrderId": "A2026xxxxxxxxxxxxxxxxxxxx",
|
|
904
|
+
"orderAmount": "109.00",
|
|
905
|
+
"orderCurrency": "USD",
|
|
906
|
+
"orderStatus": "PAY_SUCCESS",
|
|
907
|
+
"orderUpdatedAt": "2026-02-28T10:06:10.000Z"
|
|
908
|
+
}
|
|
909
|
+
]
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
```
|
|
913
|
+
|
|
807
914
|
## Payment Method Types
|
|
808
915
|
|
|
809
916
|
### payMethodType Reference
|
package/dist/index.d.mts
CHANGED
|
@@ -735,7 +735,8 @@ declare enum WebhookEventType {
|
|
|
735
735
|
PAYMENT_NOTIFICATION = "PAYMENT_NOTIFICATION",
|
|
736
736
|
REFUND_NOTIFICATION = "REFUND_NOTIFICATION",
|
|
737
737
|
SUBSCRIPTION_STATUS_NOTIFICATION = "SUBSCRIPTION_STATUS_NOTIFICATION",
|
|
738
|
-
SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION = "SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION"
|
|
738
|
+
SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION = "SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION",
|
|
739
|
+
SUBSCRIPTION_CHANGE_NOTIFICATION = "SUBSCRIPTION_CHANGE_NOTIFICATION"
|
|
739
740
|
}
|
|
740
741
|
/**
|
|
741
742
|
* Result of webhook handling.
|
|
@@ -853,6 +854,33 @@ interface SubscriptionNotificationResult {
|
|
|
853
854
|
paymentDetails?: Record<string, unknown>[];
|
|
854
855
|
[key: string]: unknown;
|
|
855
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Subscription change notification result payload.
|
|
859
|
+
* Triggered when a subscription change (upgrade/downgrade) reaches final status (SUCCESS or CLOSED).
|
|
860
|
+
*/
|
|
861
|
+
interface SubscriptionChangeNotificationResult {
|
|
862
|
+
subscriptionRequest?: string;
|
|
863
|
+
originSubscriptionRequest?: string;
|
|
864
|
+
merchantSubscriptionId?: string;
|
|
865
|
+
subscriptionId?: string;
|
|
866
|
+
/** Final status: SUCCESS or CLOSED */
|
|
867
|
+
subscriptionChangeStatus?: string;
|
|
868
|
+
subscriptionAction?: string;
|
|
869
|
+
remainingAmount?: string;
|
|
870
|
+
currency?: string;
|
|
871
|
+
userCurrency?: string;
|
|
872
|
+
requestedAt?: string;
|
|
873
|
+
subscriptionManagementUrl?: string;
|
|
874
|
+
extendInfo?: string;
|
|
875
|
+
orderExpiredAt?: string;
|
|
876
|
+
productInfoList?: Record<string, unknown>[];
|
|
877
|
+
merchantInfo?: Record<string, unknown>;
|
|
878
|
+
userInfo?: Record<string, unknown>;
|
|
879
|
+
goodsInfo?: Record<string, unknown>;
|
|
880
|
+
addressInfo?: Record<string, unknown>;
|
|
881
|
+
paymentInfo?: Record<string, unknown>;
|
|
882
|
+
[key: string]: unknown;
|
|
883
|
+
}
|
|
856
884
|
/**
|
|
857
885
|
* Payment notification from Waffo.
|
|
858
886
|
*/
|
|
@@ -885,11 +913,20 @@ interface SubscriptionPeriodChangedNotification extends BaseNotification {
|
|
|
885
913
|
result?: SubscriptionNotificationResult;
|
|
886
914
|
[key: string]: unknown;
|
|
887
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* Subscription change notification from Waffo.
|
|
918
|
+
*/
|
|
919
|
+
interface SubscriptionChangeNotification extends BaseNotification {
|
|
920
|
+
eventType: 'SUBSCRIPTION_CHANGE_NOTIFICATION';
|
|
921
|
+
result?: SubscriptionChangeNotificationResult;
|
|
922
|
+
[key: string]: unknown;
|
|
923
|
+
}
|
|
888
924
|
type PaymentHandler = (notification: PaymentNotification) => void | Promise<void>;
|
|
889
925
|
type RefundHandler = (notification: RefundNotification) => void | Promise<void>;
|
|
890
926
|
type SubscriptionStatusHandler = (notification: SubscriptionStatusNotification) => void | Promise<void>;
|
|
891
927
|
type SubscriptionPaymentHandler = (notification: SubscriptionStatusNotification) => void | Promise<void>;
|
|
892
928
|
type SubscriptionPeriodChangedHandler = (notification: SubscriptionPeriodChangedNotification) => void | Promise<void>;
|
|
929
|
+
type SubscriptionChangeHandler = (notification: SubscriptionChangeNotification) => void | Promise<void>;
|
|
893
930
|
/**
|
|
894
931
|
* Webhook handler for processing Waffo webhook notifications.
|
|
895
932
|
*
|
|
@@ -924,6 +961,7 @@ declare class WebhookHandler {
|
|
|
924
961
|
private subscriptionStatusHandler?;
|
|
925
962
|
private subscriptionPaymentHandler?;
|
|
926
963
|
private subscriptionPeriodChangedHandler?;
|
|
964
|
+
private subscriptionChangeHandler?;
|
|
927
965
|
constructor(config: WaffoConfig);
|
|
928
966
|
/**
|
|
929
967
|
* Registers a handler for payment notifications.
|
|
@@ -946,6 +984,10 @@ declare class WebhookHandler {
|
|
|
946
984
|
* Registers a handler for subscription period changed notifications.
|
|
947
985
|
*/
|
|
948
986
|
onSubscriptionPeriodChanged(handler: SubscriptionPeriodChangedHandler): this;
|
|
987
|
+
/**
|
|
988
|
+
* Registers a handler for subscription change notifications.
|
|
989
|
+
*/
|
|
990
|
+
onSubscriptionChange(handler: SubscriptionChangeHandler): this;
|
|
949
991
|
/**
|
|
950
992
|
* Processes a webhook notification.
|
|
951
993
|
*
|
|
@@ -972,7 +1014,7 @@ declare class WebhookHandler {
|
|
|
972
1014
|
/**
|
|
973
1015
|
* Builds a failed response with signature.
|
|
974
1016
|
*/
|
|
975
|
-
buildFailedResponse(
|
|
1017
|
+
buildFailedResponse(_message: string): {
|
|
976
1018
|
body: string;
|
|
977
1019
|
signature: string;
|
|
978
1020
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -735,7 +735,8 @@ declare enum WebhookEventType {
|
|
|
735
735
|
PAYMENT_NOTIFICATION = "PAYMENT_NOTIFICATION",
|
|
736
736
|
REFUND_NOTIFICATION = "REFUND_NOTIFICATION",
|
|
737
737
|
SUBSCRIPTION_STATUS_NOTIFICATION = "SUBSCRIPTION_STATUS_NOTIFICATION",
|
|
738
|
-
SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION = "SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION"
|
|
738
|
+
SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION = "SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION",
|
|
739
|
+
SUBSCRIPTION_CHANGE_NOTIFICATION = "SUBSCRIPTION_CHANGE_NOTIFICATION"
|
|
739
740
|
}
|
|
740
741
|
/**
|
|
741
742
|
* Result of webhook handling.
|
|
@@ -853,6 +854,33 @@ interface SubscriptionNotificationResult {
|
|
|
853
854
|
paymentDetails?: Record<string, unknown>[];
|
|
854
855
|
[key: string]: unknown;
|
|
855
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Subscription change notification result payload.
|
|
859
|
+
* Triggered when a subscription change (upgrade/downgrade) reaches final status (SUCCESS or CLOSED).
|
|
860
|
+
*/
|
|
861
|
+
interface SubscriptionChangeNotificationResult {
|
|
862
|
+
subscriptionRequest?: string;
|
|
863
|
+
originSubscriptionRequest?: string;
|
|
864
|
+
merchantSubscriptionId?: string;
|
|
865
|
+
subscriptionId?: string;
|
|
866
|
+
/** Final status: SUCCESS or CLOSED */
|
|
867
|
+
subscriptionChangeStatus?: string;
|
|
868
|
+
subscriptionAction?: string;
|
|
869
|
+
remainingAmount?: string;
|
|
870
|
+
currency?: string;
|
|
871
|
+
userCurrency?: string;
|
|
872
|
+
requestedAt?: string;
|
|
873
|
+
subscriptionManagementUrl?: string;
|
|
874
|
+
extendInfo?: string;
|
|
875
|
+
orderExpiredAt?: string;
|
|
876
|
+
productInfoList?: Record<string, unknown>[];
|
|
877
|
+
merchantInfo?: Record<string, unknown>;
|
|
878
|
+
userInfo?: Record<string, unknown>;
|
|
879
|
+
goodsInfo?: Record<string, unknown>;
|
|
880
|
+
addressInfo?: Record<string, unknown>;
|
|
881
|
+
paymentInfo?: Record<string, unknown>;
|
|
882
|
+
[key: string]: unknown;
|
|
883
|
+
}
|
|
856
884
|
/**
|
|
857
885
|
* Payment notification from Waffo.
|
|
858
886
|
*/
|
|
@@ -885,11 +913,20 @@ interface SubscriptionPeriodChangedNotification extends BaseNotification {
|
|
|
885
913
|
result?: SubscriptionNotificationResult;
|
|
886
914
|
[key: string]: unknown;
|
|
887
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* Subscription change notification from Waffo.
|
|
918
|
+
*/
|
|
919
|
+
interface SubscriptionChangeNotification extends BaseNotification {
|
|
920
|
+
eventType: 'SUBSCRIPTION_CHANGE_NOTIFICATION';
|
|
921
|
+
result?: SubscriptionChangeNotificationResult;
|
|
922
|
+
[key: string]: unknown;
|
|
923
|
+
}
|
|
888
924
|
type PaymentHandler = (notification: PaymentNotification) => void | Promise<void>;
|
|
889
925
|
type RefundHandler = (notification: RefundNotification) => void | Promise<void>;
|
|
890
926
|
type SubscriptionStatusHandler = (notification: SubscriptionStatusNotification) => void | Promise<void>;
|
|
891
927
|
type SubscriptionPaymentHandler = (notification: SubscriptionStatusNotification) => void | Promise<void>;
|
|
892
928
|
type SubscriptionPeriodChangedHandler = (notification: SubscriptionPeriodChangedNotification) => void | Promise<void>;
|
|
929
|
+
type SubscriptionChangeHandler = (notification: SubscriptionChangeNotification) => void | Promise<void>;
|
|
893
930
|
/**
|
|
894
931
|
* Webhook handler for processing Waffo webhook notifications.
|
|
895
932
|
*
|
|
@@ -924,6 +961,7 @@ declare class WebhookHandler {
|
|
|
924
961
|
private subscriptionStatusHandler?;
|
|
925
962
|
private subscriptionPaymentHandler?;
|
|
926
963
|
private subscriptionPeriodChangedHandler?;
|
|
964
|
+
private subscriptionChangeHandler?;
|
|
927
965
|
constructor(config: WaffoConfig);
|
|
928
966
|
/**
|
|
929
967
|
* Registers a handler for payment notifications.
|
|
@@ -946,6 +984,10 @@ declare class WebhookHandler {
|
|
|
946
984
|
* Registers a handler for subscription period changed notifications.
|
|
947
985
|
*/
|
|
948
986
|
onSubscriptionPeriodChanged(handler: SubscriptionPeriodChangedHandler): this;
|
|
987
|
+
/**
|
|
988
|
+
* Registers a handler for subscription change notifications.
|
|
989
|
+
*/
|
|
990
|
+
onSubscriptionChange(handler: SubscriptionChangeHandler): this;
|
|
949
991
|
/**
|
|
950
992
|
* Processes a webhook notification.
|
|
951
993
|
*
|
|
@@ -972,7 +1014,7 @@ declare class WebhookHandler {
|
|
|
972
1014
|
/**
|
|
973
1015
|
* Builds a failed response with signature.
|
|
974
1016
|
*/
|
|
975
|
-
buildFailedResponse(
|
|
1017
|
+
buildFailedResponse(_message: string): {
|
|
976
1018
|
body: string;
|
|
977
1019
|
signature: string;
|
|
978
1020
|
};
|
package/dist/index.js
CHANGED
|
@@ -463,7 +463,7 @@ var HEADER_SDK_VERSION = "x-sdk-version";
|
|
|
463
463
|
var HEADER_CONTENT_TYPE = "content-type";
|
|
464
464
|
var CONTENT_TYPE_JSON = "application/json";
|
|
465
465
|
var API_VERSION = "1.0.0";
|
|
466
|
-
var SDK_VERSION = "waffo-node/2.3.
|
|
466
|
+
var SDK_VERSION = "waffo-node/2.3.2";
|
|
467
467
|
var WaffoHttpClient = class {
|
|
468
468
|
baseUrl;
|
|
469
469
|
apiKey;
|
|
@@ -624,6 +624,7 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
|
624
624
|
WebhookEventType2["REFUND_NOTIFICATION"] = "REFUND_NOTIFICATION";
|
|
625
625
|
WebhookEventType2["SUBSCRIPTION_STATUS_NOTIFICATION"] = "SUBSCRIPTION_STATUS_NOTIFICATION";
|
|
626
626
|
WebhookEventType2["SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION"] = "SUBSCRIPTION_PERIOD_CHANGED_NOTIFICATION";
|
|
627
|
+
WebhookEventType2["SUBSCRIPTION_CHANGE_NOTIFICATION"] = "SUBSCRIPTION_CHANGE_NOTIFICATION";
|
|
627
628
|
return WebhookEventType2;
|
|
628
629
|
})(WebhookEventType || {});
|
|
629
630
|
var WebhookHandler = class {
|
|
@@ -635,6 +636,7 @@ var WebhookHandler = class {
|
|
|
635
636
|
subscriptionStatusHandler;
|
|
636
637
|
subscriptionPaymentHandler;
|
|
637
638
|
subscriptionPeriodChangedHandler;
|
|
639
|
+
subscriptionChangeHandler;
|
|
638
640
|
constructor(config) {
|
|
639
641
|
this.waffoPublicKey = config.waffoPublicKey;
|
|
640
642
|
this.privateKey = config.privateKey;
|
|
@@ -676,6 +678,13 @@ var WebhookHandler = class {
|
|
|
676
678
|
this.subscriptionPeriodChangedHandler = handler;
|
|
677
679
|
return this;
|
|
678
680
|
}
|
|
681
|
+
/**
|
|
682
|
+
* Registers a handler for subscription change notifications.
|
|
683
|
+
*/
|
|
684
|
+
onSubscriptionChange(handler) {
|
|
685
|
+
this.subscriptionChangeHandler = handler;
|
|
686
|
+
return this;
|
|
687
|
+
}
|
|
679
688
|
/**
|
|
680
689
|
* Processes a webhook notification.
|
|
681
690
|
*
|
|
@@ -719,6 +728,11 @@ var WebhookHandler = class {
|
|
|
719
728
|
await this.subscriptionPeriodChangedHandler(parsed);
|
|
720
729
|
}
|
|
721
730
|
break;
|
|
731
|
+
case "SUBSCRIPTION_CHANGE_NOTIFICATION" /* SUBSCRIPTION_CHANGE_NOTIFICATION */:
|
|
732
|
+
if (this.subscriptionChangeHandler) {
|
|
733
|
+
await this.subscriptionChangeHandler(parsed);
|
|
734
|
+
}
|
|
735
|
+
break;
|
|
722
736
|
default:
|
|
723
737
|
this.logger?.warn(`Unknown webhook event type: ${eventType}`);
|
|
724
738
|
return this.createFailedResult(`Unknown event type: ${eventType}`);
|
|
@@ -745,15 +759,15 @@ var WebhookHandler = class {
|
|
|
745
759
|
* Builds a success response with signature.
|
|
746
760
|
*/
|
|
747
761
|
buildSuccessResponse() {
|
|
748
|
-
const body = JSON.stringify({
|
|
762
|
+
const body = JSON.stringify({ message: "success" });
|
|
749
763
|
const signature = RsaUtils.sign(body, this.privateKey);
|
|
750
764
|
return { body, signature };
|
|
751
765
|
}
|
|
752
766
|
/**
|
|
753
767
|
* Builds a failed response with signature.
|
|
754
768
|
*/
|
|
755
|
-
buildFailedResponse(
|
|
756
|
-
const body = JSON.stringify({
|
|
769
|
+
buildFailedResponse(_message) {
|
|
770
|
+
const body = JSON.stringify({ message: "failed" });
|
|
757
771
|
const signature = RsaUtils.sign(body, this.privateKey);
|
|
758
772
|
return { body, signature };
|
|
759
773
|
}
|