@phonepe-pg/pg-sdk-node 2.0.4
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/LICENSE +202 -0
- package/README.md +221 -0
- package/dist/src/Env.d.ts +4 -0
- package/dist/src/Env.js +23 -0
- package/dist/src/EnvConfig.d.ts +11 -0
- package/dist/src/EnvConfig.js +42 -0
- package/dist/src/common/BaseClient.d.ts +33 -0
- package/dist/src/common/BaseClient.js +103 -0
- package/dist/src/common/CommonUtils.d.ts +9 -0
- package/dist/src/common/CommonUtils.js +45 -0
- package/dist/src/common/configs/CredentialConfig.d.ts +25 -0
- package/dist/src/common/configs/CredentialConfig.js +64 -0
- package/dist/src/common/configs/index.d.ts +1 -0
- package/dist/src/common/configs/index.js +32 -0
- package/dist/src/common/constants/BaseUrl.d.ts +12 -0
- package/dist/src/common/constants/BaseUrl.js +30 -0
- package/dist/src/common/constants/Headers.d.ts +16 -0
- package/dist/src/common/constants/Headers.js +36 -0
- package/dist/src/common/events/Constants.d.ts +10 -0
- package/dist/src/common/events/Constants.js +29 -0
- package/dist/src/common/events/EventQueueHandler.d.ts +11 -0
- package/dist/src/common/events/EventQueueHandler.js +57 -0
- package/dist/src/common/events/builders/BaseEventBuilder.d.ts +17 -0
- package/dist/src/common/events/builders/BaseEventBuilder.js +46 -0
- package/dist/src/common/events/builders/EventBuillder.d.ts +16 -0
- package/dist/src/common/events/builders/EventBuillder.js +195 -0
- package/dist/src/common/events/builders/EventDataBuilder.d.ts +55 -0
- package/dist/src/common/events/builders/EventDataBuilder.js +115 -0
- package/dist/src/common/events/models/BaseEvent.d.ts +11 -0
- package/dist/src/common/events/models/BaseEvent.js +31 -0
- package/dist/src/common/events/models/BulkEvent.d.ts +18 -0
- package/dist/src/common/events/models/BulkEvent.js +56 -0
- package/dist/src/common/events/models/EventData.d.ts +32 -0
- package/dist/src/common/events/models/EventData.js +53 -0
- package/dist/src/common/events/models/enums/EventState.d.ts +5 -0
- package/dist/src/common/events/models/enums/EventState.js +24 -0
- package/dist/src/common/events/models/enums/EventType.d.ts +19 -0
- package/dist/src/common/events/models/enums/EventType.js +38 -0
- package/dist/src/common/events/models/enums/FlowType.d.ts +3 -0
- package/dist/src/common/events/models/enums/FlowType.js +22 -0
- package/dist/src/common/events/publisher/DefaultEventPublisher.d.ts +7 -0
- package/dist/src/common/events/publisher/DefaultEventPublisher.js +31 -0
- package/dist/src/common/events/publisher/EventPublisher.d.ts +6 -0
- package/dist/src/common/events/publisher/EventPublisher.js +21 -0
- package/dist/src/common/events/publisher/EventPublisherFactory.d.ts +9 -0
- package/dist/src/common/events/publisher/EventPublisherFactory.js +38 -0
- package/dist/src/common/events/publisher/QueuedEventPublisher.d.ts +21 -0
- package/dist/src/common/events/publisher/QueuedEventPublisher.js +124 -0
- package/dist/src/common/exception/Constants.d.ts +3 -0
- package/dist/src/common/exception/Constants.js +24 -0
- package/dist/src/common/exception/Exceptions.d.ts +45 -0
- package/dist/src/common/exception/Exceptions.js +102 -0
- package/dist/src/common/exception/index.d.ts +1 -0
- package/dist/src/common/exception/index.js +32 -0
- package/dist/src/common/http/HttpCommand.d.ts +15 -0
- package/dist/src/common/http/HttpCommand.js +93 -0
- package/dist/src/common/http/HttpMethodType.d.ts +4 -0
- package/dist/src/common/http/HttpMethodType.js +23 -0
- package/dist/src/common/http/PhonePeResponse.d.ts +12 -0
- package/dist/src/common/http/PhonePeResponse.js +21 -0
- package/dist/src/common/http/index.d.ts +2 -0
- package/dist/src/common/http/index.js +33 -0
- package/dist/src/common/index.d.ts +5 -0
- package/dist/src/common/index.js +36 -0
- package/dist/src/common/models/MetaInfo.d.ts +26 -0
- package/dist/src/common/models/MetaInfo.js +61 -0
- package/dist/src/common/models/PaymentFlow.d.ts +5 -0
- package/dist/src/common/models/PaymentFlow.js +24 -0
- package/dist/src/common/models/PaymentFlowType.d.ts +4 -0
- package/dist/src/common/models/PaymentFlowType.js +23 -0
- package/dist/src/common/models/PgV2InstrumentType.d.ts +9 -0
- package/dist/src/common/models/PgV2InstrumentType.js +28 -0
- package/dist/src/common/models/index.d.ts +6 -0
- package/dist/src/common/models/index.js +37 -0
- package/dist/src/common/models/request/AccountConstraint.d.ts +18 -0
- package/dist/src/common/models/request/AccountConstraint.js +49 -0
- package/dist/src/common/models/request/DeviceContext.d.ts +17 -0
- package/dist/src/common/models/request/DeviceContext.js +46 -0
- package/dist/src/common/models/request/InstrumentConstraint.d.ts +5 -0
- package/dist/src/common/models/request/InstrumentConstraint.js +24 -0
- package/dist/src/common/models/request/PaymentInstrumentType.d.ts +3 -0
- package/dist/src/common/models/request/PaymentInstrumentType.js +22 -0
- package/dist/src/common/models/request/RefundRequest.d.ts +20 -0
- package/dist/src/common/models/request/RefundRequest.js +51 -0
- package/dist/src/common/models/request/index.d.ts +5 -0
- package/dist/src/common/models/request/index.js +36 -0
- package/dist/src/common/models/request/instruments/BillingAddress.d.ts +29 -0
- package/dist/src/common/models/request/instruments/BillingAddress.js +60 -0
- package/dist/src/common/models/request/instruments/CardPayRequestBuilder.d.ts +39 -0
- package/dist/src/common/models/request/instruments/CardPayRequestBuilder.js +113 -0
- package/dist/src/common/models/request/instruments/CardPaymentV2Instrument.d.ts +22 -0
- package/dist/src/common/models/request/instruments/CardPaymentV2Instrument.js +56 -0
- package/dist/src/common/models/request/instruments/CollectPaymentDetails.d.ts +5 -0
- package/dist/src/common/models/request/instruments/CollectPaymentDetails.js +24 -0
- package/dist/src/common/models/request/instruments/CollectPaymentDetailsType.d.ts +4 -0
- package/dist/src/common/models/request/instruments/CollectPaymentDetailsType.js +23 -0
- package/dist/src/common/models/request/instruments/CollectPaymentV2Instrument.d.ts +19 -0
- package/dist/src/common/models/request/instruments/CollectPaymentV2Instrument.js +49 -0
- package/dist/src/common/models/request/instruments/Expiry.d.ts +14 -0
- package/dist/src/common/models/request/instruments/Expiry.js +43 -0
- package/dist/src/common/models/request/instruments/IntentPaymentV2Instrument.d.ts +12 -0
- package/dist/src/common/models/request/instruments/IntentPaymentV2Instrument.js +41 -0
- package/dist/src/common/models/request/instruments/NetBankingPayRequestBuilder.d.ts +25 -0
- package/dist/src/common/models/request/instruments/NetBankingPayRequestBuilder.js +71 -0
- package/dist/src/common/models/request/instruments/NetBankingPaymentV2Instrument.d.ts +15 -0
- package/dist/src/common/models/request/instruments/NetBankingPaymentV2Instrument.js +46 -0
- package/dist/src/common/models/request/instruments/NewCardDetails.d.ts +29 -0
- package/dist/src/common/models/request/instruments/NewCardDetails.js +61 -0
- package/dist/src/common/models/request/instruments/PaymentV2Instrument.d.ts +7 -0
- package/dist/src/common/models/request/instruments/PaymentV2Instrument.js +24 -0
- package/dist/src/common/models/request/instruments/PhoneNumberCollectPaymentDetails.d.ts +12 -0
- package/dist/src/common/models/request/instruments/PhoneNumberCollectPaymentDetails.js +41 -0
- package/dist/src/common/models/request/instruments/TokenDetails.d.ts +39 -0
- package/dist/src/common/models/request/instruments/TokenDetails.js +81 -0
- package/dist/src/common/models/request/instruments/TokenPayRequestBuilder.d.ts +41 -0
- package/dist/src/common/models/request/instruments/TokenPayRequestBuilder.js +118 -0
- package/dist/src/common/models/request/instruments/TokenPaymentV2Instrument.d.ts +19 -0
- package/dist/src/common/models/request/instruments/TokenPaymentV2Instrument.js +51 -0
- package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.d.ts +25 -0
- package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.js +73 -0
- package/dist/src/common/models/request/instruments/UpiCollectPayViaVpaRequestBuilder.d.ts +25 -0
- package/dist/src/common/models/request/instruments/UpiCollectPayViaVpaRequestBuilder.js +71 -0
- package/dist/src/common/models/request/instruments/UpiIntentPayRequestBuilder.d.ts +25 -0
- package/dist/src/common/models/request/instruments/UpiIntentPayRequestBuilder.js +71 -0
- package/dist/src/common/models/request/instruments/UpiQrPaymentV2Instrument.d.ts +9 -0
- package/dist/src/common/models/request/instruments/UpiQrPaymentV2Instrument.js +36 -0
- package/dist/src/common/models/request/instruments/UpiQrRequestBuilder.d.ts +19 -0
- package/dist/src/common/models/request/instruments/UpiQrRequestBuilder.js +55 -0
- package/dist/src/common/models/request/instruments/VpaCollectPaymentDetails.d.ts +12 -0
- package/dist/src/common/models/request/instruments/VpaCollectPaymentDetails.js +41 -0
- package/dist/src/common/models/request/instruments/index.d.ts +21 -0
- package/dist/src/common/models/request/instruments/index.js +52 -0
- package/dist/src/common/models/response/CallbackData.d.ts +17 -0
- package/dist/src/common/models/response/CallbackData.js +21 -0
- package/dist/src/common/models/response/CallbackResponse.d.ts +6 -0
- package/dist/src/common/models/response/CallbackResponse.js +21 -0
- package/dist/src/common/models/response/CallbackType.d.ts +11 -0
- package/dist/src/common/models/response/CallbackType.js +30 -0
- package/dist/src/common/models/response/InstrumentCombo.d.ts +15 -0
- package/dist/src/common/models/response/InstrumentCombo.js +21 -0
- package/dist/src/common/models/response/OrderStatusResponse.d.ts +16 -0
- package/dist/src/common/models/response/OrderStatusResponse.js +21 -0
- package/dist/src/common/models/response/PaymentDetail.d.ts +24 -0
- package/dist/src/common/models/response/PaymentDetail.js +21 -0
- package/dist/src/common/models/response/PaymentRefundDetail.d.ts +24 -0
- package/dist/src/common/models/response/PaymentRefundDetail.js +21 -0
- package/dist/src/common/models/response/RefundResponse.d.ts +5 -0
- package/dist/src/common/models/response/RefundResponse.js +21 -0
- package/dist/src/common/models/response/RefundStatusResponse.d.ts +9 -0
- package/dist/src/common/models/response/RefundStatusResponse.js +21 -0
- package/dist/src/common/models/response/index.d.ts +11 -0
- package/dist/src/common/models/response/index.js +42 -0
- package/dist/src/common/models/response/paymentinstruments/AccountInstrumentV2.d.ts +10 -0
- package/dist/src/common/models/response/paymentinstruments/AccountInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/CreditCardPaymentInstrumentV2.d.ts +7 -0
- package/dist/src/common/models/response/paymentinstruments/CreditCardPaymentInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/DebitCardPaymentInstrumentV2.d.ts +7 -0
- package/dist/src/common/models/response/paymentinstruments/DebitCardPaymentInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/EgvPaymentInstrumentV2.d.ts +5 -0
- package/dist/src/common/models/response/paymentinstruments/EgvPaymentInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/NetbankingPaymentInstrumentV2.d.ts +7 -0
- package/dist/src/common/models/response/paymentinstruments/NetbankingPaymentInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentType.d.ts +8 -0
- package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentType.js +27 -0
- package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentV2.d.ts +4 -0
- package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentV2.js +21 -0
- package/dist/src/common/models/response/paymentinstruments/WalletPaymentInstrumentV2.d.ts +4 -0
- package/dist/src/common/models/response/paymentinstruments/WalletPaymentInstrumentV2.js +22 -0
- package/dist/src/common/models/response/paymentinstruments/index.d.ts +8 -0
- package/dist/src/common/models/response/paymentinstruments/index.js +39 -0
- package/dist/src/common/models/response/rails/PaymentRail.d.ts +9 -0
- package/dist/src/common/models/response/rails/PaymentRail.js +28 -0
- package/dist/src/common/models/response/rails/PgPaymentRail.d.ts +6 -0
- package/dist/src/common/models/response/rails/PgPaymentRail.js +22 -0
- package/dist/src/common/models/response/rails/PpiEgvPaymentRail.d.ts +3 -0
- package/dist/src/common/models/response/rails/PpiEgvPaymentRail.js +22 -0
- package/dist/src/common/models/response/rails/PpiWalletPaymentRail.d.ts +3 -0
- package/dist/src/common/models/response/rails/PpiWalletPaymentRail.js +22 -0
- package/dist/src/common/models/response/rails/UpiPaymentRail.d.ts +6 -0
- package/dist/src/common/models/response/rails/UpiPaymentRail.js +22 -0
- package/dist/src/common/models/response/rails/index.d.ts +5 -0
- package/dist/src/common/models/response/rails/index.js +36 -0
- package/dist/src/common/tokenhandler/OAuthRequest.d.ts +6 -0
- package/dist/src/common/tokenhandler/OAuthRequest.js +17 -0
- package/dist/src/common/tokenhandler/OAuthResponse.d.ts +10 -0
- package/dist/src/common/tokenhandler/OAuthResponse.js +52 -0
- package/dist/src/common/tokenhandler/TokenConstants.d.ts +4 -0
- package/dist/src/common/tokenhandler/TokenConstants.js +23 -0
- package/dist/src/common/tokenhandler/TokenService.d.ts +22 -0
- package/dist/src/common/tokenhandler/TokenService.js +115 -0
- package/dist/src/common/tokenhandler/index.d.ts +2 -0
- package/dist/src/common/tokenhandler/index.js +33 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +35 -0
- package/dist/src/payments/v2/CustomCheckoutClient.d.ts +86 -0
- package/dist/src/payments/v2/CustomCheckoutClient.js +229 -0
- package/dist/src/payments/v2/StandardCheckoutClient.d.ts +86 -0
- package/dist/src/payments/v2/StandardCheckoutClient.js +227 -0
- package/dist/src/payments/v2/customcheckout/Constants.d.ts +9 -0
- package/dist/src/payments/v2/customcheckout/Constants.js +28 -0
- package/dist/src/payments/v2/index.d.ts +3 -0
- package/dist/src/payments/v2/index.js +34 -0
- package/dist/src/payments/v2/models/index.d.ts +2 -0
- package/dist/src/payments/v2/models/index.js +33 -0
- package/dist/src/payments/v2/models/request/CreateSdkOrderRequest.d.ts +63 -0
- package/dist/src/payments/v2/models/request/CreateSdkOrderRequest.js +130 -0
- package/dist/src/payments/v2/models/request/CustomCheckoutPayRequest.d.ts +37 -0
- package/dist/src/payments/v2/models/request/CustomCheckoutPayRequest.js +79 -0
- package/dist/src/payments/v2/models/request/MerchantUrls.d.ts +4 -0
- package/dist/src/payments/v2/models/request/MerchantUrls.js +24 -0
- package/dist/src/payments/v2/models/request/PgCheckoutPaymentFlow.d.ts +18 -0
- package/dist/src/payments/v2/models/request/PgCheckoutPaymentFlow.js +48 -0
- package/dist/src/payments/v2/models/request/PgPaymentFlow.d.ts +20 -0
- package/dist/src/payments/v2/models/request/PgPaymentFlow.js +50 -0
- package/dist/src/payments/v2/models/request/PrefillUserLoginDetails.d.ts +16 -0
- package/dist/src/payments/v2/models/request/PrefillUserLoginDetails.js +38 -0
- package/dist/src/payments/v2/models/request/StandardCheckoutPayRequest.d.ts +40 -0
- package/dist/src/payments/v2/models/request/StandardCheckoutPayRequest.js +82 -0
- package/dist/src/payments/v2/models/request/index.d.ts +7 -0
- package/dist/src/payments/v2/models/request/index.js +38 -0
- package/dist/src/payments/v2/models/response/CreateSdkOrderResponse.d.ts +6 -0
- package/dist/src/payments/v2/models/response/CreateSdkOrderResponse.js +21 -0
- package/dist/src/payments/v2/models/response/CustomCheckoutPayResponse.d.ts +8 -0
- package/dist/src/payments/v2/models/response/CustomCheckoutPayResponse.js +21 -0
- package/dist/src/payments/v2/models/response/StandardCheckoutPayResponse.d.ts +6 -0
- package/dist/src/payments/v2/models/response/StandardCheckoutPayResponse.js +21 -0
- package/dist/src/payments/v2/models/response/index.d.ts +3 -0
- package/dist/src/payments/v2/models/response/index.js +34 -0
- package/dist/src/payments/v2/standardcheckout/Constants.d.ts +9 -0
- package/dist/src/payments/v2/standardcheckout/Constants.js +28 -0
- package/package.json +58 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.StandardCheckoutPayRequest = void 0;
|
|
19
|
+
const PgCheckoutPaymentFlow_1 = require("./PgCheckoutPaymentFlow");
|
|
20
|
+
/**
|
|
21
|
+
* Creates a request using the builder -> StandardCheckoutPayRequest.builder()
|
|
22
|
+
*/
|
|
23
|
+
class StandardCheckoutPayRequest {
|
|
24
|
+
constructor(merchantOrderId, amount, metaInfo, message, redirectUrl, expireAfter, disablePaymentRetry, prefillUserLoginDetails) {
|
|
25
|
+
this.merchantOrderId = merchantOrderId;
|
|
26
|
+
this.amount = amount;
|
|
27
|
+
this.metaInfo = metaInfo;
|
|
28
|
+
this.expireAfter = expireAfter;
|
|
29
|
+
this.paymentFlow = PgCheckoutPaymentFlow_1.PgCheckoutPaymentFlow.builder()
|
|
30
|
+
.message(message)
|
|
31
|
+
.redirectUrl(redirectUrl)
|
|
32
|
+
.build();
|
|
33
|
+
this.disablePaymentRetry = disablePaymentRetry;
|
|
34
|
+
this.prefillUserLoginDetails = prefillUserLoginDetails;
|
|
35
|
+
}
|
|
36
|
+
static builder() {
|
|
37
|
+
return new StandardCheckoutPayRequestBuilder();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.StandardCheckoutPayRequest = StandardCheckoutPayRequest;
|
|
41
|
+
class StandardCheckoutPayRequestBuilder {
|
|
42
|
+
constructor() {
|
|
43
|
+
/**
|
|
44
|
+
* Setters used for builder
|
|
45
|
+
*/
|
|
46
|
+
this.merchantOrderId = (merchantOrderId) => {
|
|
47
|
+
this._merchantOrderId = merchantOrderId;
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
this.amount = (amount) => {
|
|
51
|
+
this._amount = amount;
|
|
52
|
+
return this;
|
|
53
|
+
};
|
|
54
|
+
this.metaInfo = (metaInfo) => {
|
|
55
|
+
this._metaInfo = metaInfo;
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
this.redirectUrl = (redirectUrl) => {
|
|
59
|
+
this._redirectUrl = redirectUrl;
|
|
60
|
+
return this;
|
|
61
|
+
};
|
|
62
|
+
this.message = (message) => {
|
|
63
|
+
this._message = message;
|
|
64
|
+
return this;
|
|
65
|
+
};
|
|
66
|
+
this.expireAfter = (expireAfter) => {
|
|
67
|
+
this._expireAfter = expireAfter;
|
|
68
|
+
return this;
|
|
69
|
+
};
|
|
70
|
+
this.disablePaymentRetry = (disablePaymentRetry) => {
|
|
71
|
+
this._disablePaymentRetry = disablePaymentRetry;
|
|
72
|
+
return this;
|
|
73
|
+
};
|
|
74
|
+
this.prefillUserLoginDetails = (prefillUserLoginDetails) => {
|
|
75
|
+
this._prefillUserLoginDetails = prefillUserLoginDetails;
|
|
76
|
+
return this;
|
|
77
|
+
};
|
|
78
|
+
this.build = () => {
|
|
79
|
+
return new StandardCheckoutPayRequest(this._merchantOrderId, this._amount, this._metaInfo, this._message, this._redirectUrl, this._expireAfter, this._disablePaymentRetry, this._prefillUserLoginDetails);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './CreateSdkOrderRequest';
|
|
2
|
+
export * from './CustomCheckoutPayRequest';
|
|
3
|
+
export * from './StandardCheckoutPayRequest';
|
|
4
|
+
export * from './MerchantUrls';
|
|
5
|
+
export * from './PgCheckoutPaymentFlow';
|
|
6
|
+
export * from './PgPaymentFlow';
|
|
7
|
+
export * from './PrefillUserLoginDetails';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./CreateSdkOrderRequest"), exports);
|
|
33
|
+
__exportStar(require("./CustomCheckoutPayRequest"), exports);
|
|
34
|
+
__exportStar(require("./StandardCheckoutPayRequest"), exports);
|
|
35
|
+
__exportStar(require("./MerchantUrls"), exports);
|
|
36
|
+
__exportStar(require("./PgCheckoutPaymentFlow"), exports);
|
|
37
|
+
__exportStar(require("./PgPaymentFlow"), exports);
|
|
38
|
+
__exportStar(require("./PrefillUserLoginDetails"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CreateSdkOrderResponse = void 0;
|
|
19
|
+
class CreateSdkOrderResponse {
|
|
20
|
+
}
|
|
21
|
+
exports.CreateSdkOrderResponse = CreateSdkOrderResponse;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CustomCheckoutPayResponse = void 0;
|
|
19
|
+
class CustomCheckoutPayResponse {
|
|
20
|
+
}
|
|
21
|
+
exports.CustomCheckoutPayResponse = CustomCheckoutPayResponse;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.StandardCheckoutPayResponse = void 0;
|
|
19
|
+
class StandardCheckoutPayResponse {
|
|
20
|
+
}
|
|
21
|
+
exports.StandardCheckoutPayResponse = StandardCheckoutPayResponse;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./CreateSdkOrderResponse"), exports);
|
|
33
|
+
__exportStar(require("./CustomCheckoutPayResponse"), exports);
|
|
34
|
+
__exportStar(require("./StandardCheckoutPayResponse"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class StandardCheckoutContants {
|
|
2
|
+
static readonly PAY_API: string;
|
|
3
|
+
static readonly ORDER_STATUS_API = "/checkout/v2/order/{ORDER_ID}/status";
|
|
4
|
+
static readonly REFUND_API = "/payments/v2/refund";
|
|
5
|
+
static readonly REFUND_STATUS_API = "/payments/v2/refund/{REFUND_ID}/status";
|
|
6
|
+
static readonly ORDER_DETAILS = "details";
|
|
7
|
+
static readonly TRANSACTION_STATUS_API = "/checkout/v2/transaction/{TRANSACTION_ID}/status";
|
|
8
|
+
static readonly CREATE_ORDER_API = "/checkout/v2/sdk/order";
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Original Author(s), PhonePe India Pvt. Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.StandardCheckoutContants = void 0;
|
|
19
|
+
class StandardCheckoutContants {
|
|
20
|
+
}
|
|
21
|
+
exports.StandardCheckoutContants = StandardCheckoutContants;
|
|
22
|
+
StandardCheckoutContants.PAY_API = '/checkout/v2/pay';
|
|
23
|
+
StandardCheckoutContants.ORDER_STATUS_API = '/checkout/v2/order/{ORDER_ID}/status';
|
|
24
|
+
StandardCheckoutContants.REFUND_API = '/payments/v2/refund';
|
|
25
|
+
StandardCheckoutContants.REFUND_STATUS_API = '/payments/v2/refund/{REFUND_ID}/status';
|
|
26
|
+
StandardCheckoutContants.ORDER_DETAILS = 'details';
|
|
27
|
+
StandardCheckoutContants.TRANSACTION_STATUS_API = '/checkout/v2/transaction/{TRANSACTION_ID}/status';
|
|
28
|
+
StandardCheckoutContants.CREATE_ORDER_API = '/checkout/v2/sdk/order';
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phonepe-pg/pg-sdk-node",
|
|
3
|
+
"version": "2.0.4",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"types": "dist/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/src",
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "npm run lint && jest --config jest.config.ts",
|
|
13
|
+
"clean": "rimraf dist",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"lint": "eslint 'src/**/*.{js,ts}'",
|
|
16
|
+
"format": "prettier --write 'src/**/*.{js,ts,json,md}'"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"phonepe",
|
|
20
|
+
"payment gateway",
|
|
21
|
+
"sdk",
|
|
22
|
+
"payments"
|
|
23
|
+
],
|
|
24
|
+
"author": "PhonePe",
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"description": "Official Node SDK for PhonePe API",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/PhonePe/phonepe-pg-sdk-node.git"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/jest": "^28.1.1",
|
|
33
|
+
"@types/node": "^12.12.6",
|
|
34
|
+
"@types/uuid": "^3.4.4",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
36
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
37
|
+
"axios-mock-adapter": "^1.15.0",
|
|
38
|
+
"eslint": "^8.57.0",
|
|
39
|
+
"eslint-config-prettier": "^9.1.0",
|
|
40
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
41
|
+
"globals": "^15.3.0",
|
|
42
|
+
"jest": "^29.7.0",
|
|
43
|
+
"prettier": "^3.3.1",
|
|
44
|
+
"rimraf": "^4.4.1",
|
|
45
|
+
"ts-jest": "^29.1.3",
|
|
46
|
+
"ts-node": "^10.9.2",
|
|
47
|
+
"typescript": "^4.9.5",
|
|
48
|
+
"uuid": "^9.0.1"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"async-mutex": "^0.5.0",
|
|
52
|
+
"axios": "^1.2.1",
|
|
53
|
+
"axios-retry": "^3.2.0",
|
|
54
|
+
"class-transformer": "^0.4.0",
|
|
55
|
+
"class-transformer-validator": "^0.9.1",
|
|
56
|
+
"class-validator": "^0.14.1"
|
|
57
|
+
}
|
|
58
|
+
}
|