@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.
Files changed (231) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +221 -0
  3. package/dist/src/Env.d.ts +4 -0
  4. package/dist/src/Env.js +23 -0
  5. package/dist/src/EnvConfig.d.ts +11 -0
  6. package/dist/src/EnvConfig.js +42 -0
  7. package/dist/src/common/BaseClient.d.ts +33 -0
  8. package/dist/src/common/BaseClient.js +103 -0
  9. package/dist/src/common/CommonUtils.d.ts +9 -0
  10. package/dist/src/common/CommonUtils.js +45 -0
  11. package/dist/src/common/configs/CredentialConfig.d.ts +25 -0
  12. package/dist/src/common/configs/CredentialConfig.js +64 -0
  13. package/dist/src/common/configs/index.d.ts +1 -0
  14. package/dist/src/common/configs/index.js +32 -0
  15. package/dist/src/common/constants/BaseUrl.d.ts +12 -0
  16. package/dist/src/common/constants/BaseUrl.js +30 -0
  17. package/dist/src/common/constants/Headers.d.ts +16 -0
  18. package/dist/src/common/constants/Headers.js +36 -0
  19. package/dist/src/common/events/Constants.d.ts +10 -0
  20. package/dist/src/common/events/Constants.js +29 -0
  21. package/dist/src/common/events/EventQueueHandler.d.ts +11 -0
  22. package/dist/src/common/events/EventQueueHandler.js +57 -0
  23. package/dist/src/common/events/builders/BaseEventBuilder.d.ts +17 -0
  24. package/dist/src/common/events/builders/BaseEventBuilder.js +46 -0
  25. package/dist/src/common/events/builders/EventBuillder.d.ts +16 -0
  26. package/dist/src/common/events/builders/EventBuillder.js +195 -0
  27. package/dist/src/common/events/builders/EventDataBuilder.d.ts +55 -0
  28. package/dist/src/common/events/builders/EventDataBuilder.js +115 -0
  29. package/dist/src/common/events/models/BaseEvent.d.ts +11 -0
  30. package/dist/src/common/events/models/BaseEvent.js +31 -0
  31. package/dist/src/common/events/models/BulkEvent.d.ts +18 -0
  32. package/dist/src/common/events/models/BulkEvent.js +56 -0
  33. package/dist/src/common/events/models/EventData.d.ts +32 -0
  34. package/dist/src/common/events/models/EventData.js +53 -0
  35. package/dist/src/common/events/models/enums/EventState.d.ts +5 -0
  36. package/dist/src/common/events/models/enums/EventState.js +24 -0
  37. package/dist/src/common/events/models/enums/EventType.d.ts +19 -0
  38. package/dist/src/common/events/models/enums/EventType.js +38 -0
  39. package/dist/src/common/events/models/enums/FlowType.d.ts +3 -0
  40. package/dist/src/common/events/models/enums/FlowType.js +22 -0
  41. package/dist/src/common/events/publisher/DefaultEventPublisher.d.ts +7 -0
  42. package/dist/src/common/events/publisher/DefaultEventPublisher.js +31 -0
  43. package/dist/src/common/events/publisher/EventPublisher.d.ts +6 -0
  44. package/dist/src/common/events/publisher/EventPublisher.js +21 -0
  45. package/dist/src/common/events/publisher/EventPublisherFactory.d.ts +9 -0
  46. package/dist/src/common/events/publisher/EventPublisherFactory.js +38 -0
  47. package/dist/src/common/events/publisher/QueuedEventPublisher.d.ts +21 -0
  48. package/dist/src/common/events/publisher/QueuedEventPublisher.js +124 -0
  49. package/dist/src/common/exception/Constants.d.ts +3 -0
  50. package/dist/src/common/exception/Constants.js +24 -0
  51. package/dist/src/common/exception/Exceptions.d.ts +45 -0
  52. package/dist/src/common/exception/Exceptions.js +102 -0
  53. package/dist/src/common/exception/index.d.ts +1 -0
  54. package/dist/src/common/exception/index.js +32 -0
  55. package/dist/src/common/http/HttpCommand.d.ts +15 -0
  56. package/dist/src/common/http/HttpCommand.js +93 -0
  57. package/dist/src/common/http/HttpMethodType.d.ts +4 -0
  58. package/dist/src/common/http/HttpMethodType.js +23 -0
  59. package/dist/src/common/http/PhonePeResponse.d.ts +12 -0
  60. package/dist/src/common/http/PhonePeResponse.js +21 -0
  61. package/dist/src/common/http/index.d.ts +2 -0
  62. package/dist/src/common/http/index.js +33 -0
  63. package/dist/src/common/index.d.ts +5 -0
  64. package/dist/src/common/index.js +36 -0
  65. package/dist/src/common/models/MetaInfo.d.ts +26 -0
  66. package/dist/src/common/models/MetaInfo.js +61 -0
  67. package/dist/src/common/models/PaymentFlow.d.ts +5 -0
  68. package/dist/src/common/models/PaymentFlow.js +24 -0
  69. package/dist/src/common/models/PaymentFlowType.d.ts +4 -0
  70. package/dist/src/common/models/PaymentFlowType.js +23 -0
  71. package/dist/src/common/models/PgV2InstrumentType.d.ts +9 -0
  72. package/dist/src/common/models/PgV2InstrumentType.js +28 -0
  73. package/dist/src/common/models/index.d.ts +6 -0
  74. package/dist/src/common/models/index.js +37 -0
  75. package/dist/src/common/models/request/AccountConstraint.d.ts +18 -0
  76. package/dist/src/common/models/request/AccountConstraint.js +49 -0
  77. package/dist/src/common/models/request/DeviceContext.d.ts +17 -0
  78. package/dist/src/common/models/request/DeviceContext.js +46 -0
  79. package/dist/src/common/models/request/InstrumentConstraint.d.ts +5 -0
  80. package/dist/src/common/models/request/InstrumentConstraint.js +24 -0
  81. package/dist/src/common/models/request/PaymentInstrumentType.d.ts +3 -0
  82. package/dist/src/common/models/request/PaymentInstrumentType.js +22 -0
  83. package/dist/src/common/models/request/RefundRequest.d.ts +20 -0
  84. package/dist/src/common/models/request/RefundRequest.js +51 -0
  85. package/dist/src/common/models/request/index.d.ts +5 -0
  86. package/dist/src/common/models/request/index.js +36 -0
  87. package/dist/src/common/models/request/instruments/BillingAddress.d.ts +29 -0
  88. package/dist/src/common/models/request/instruments/BillingAddress.js +60 -0
  89. package/dist/src/common/models/request/instruments/CardPayRequestBuilder.d.ts +39 -0
  90. package/dist/src/common/models/request/instruments/CardPayRequestBuilder.js +113 -0
  91. package/dist/src/common/models/request/instruments/CardPaymentV2Instrument.d.ts +22 -0
  92. package/dist/src/common/models/request/instruments/CardPaymentV2Instrument.js +56 -0
  93. package/dist/src/common/models/request/instruments/CollectPaymentDetails.d.ts +5 -0
  94. package/dist/src/common/models/request/instruments/CollectPaymentDetails.js +24 -0
  95. package/dist/src/common/models/request/instruments/CollectPaymentDetailsType.d.ts +4 -0
  96. package/dist/src/common/models/request/instruments/CollectPaymentDetailsType.js +23 -0
  97. package/dist/src/common/models/request/instruments/CollectPaymentV2Instrument.d.ts +19 -0
  98. package/dist/src/common/models/request/instruments/CollectPaymentV2Instrument.js +49 -0
  99. package/dist/src/common/models/request/instruments/Expiry.d.ts +14 -0
  100. package/dist/src/common/models/request/instruments/Expiry.js +43 -0
  101. package/dist/src/common/models/request/instruments/IntentPaymentV2Instrument.d.ts +12 -0
  102. package/dist/src/common/models/request/instruments/IntentPaymentV2Instrument.js +41 -0
  103. package/dist/src/common/models/request/instruments/NetBankingPayRequestBuilder.d.ts +25 -0
  104. package/dist/src/common/models/request/instruments/NetBankingPayRequestBuilder.js +71 -0
  105. package/dist/src/common/models/request/instruments/NetBankingPaymentV2Instrument.d.ts +15 -0
  106. package/dist/src/common/models/request/instruments/NetBankingPaymentV2Instrument.js +46 -0
  107. package/dist/src/common/models/request/instruments/NewCardDetails.d.ts +29 -0
  108. package/dist/src/common/models/request/instruments/NewCardDetails.js +61 -0
  109. package/dist/src/common/models/request/instruments/PaymentV2Instrument.d.ts +7 -0
  110. package/dist/src/common/models/request/instruments/PaymentV2Instrument.js +24 -0
  111. package/dist/src/common/models/request/instruments/PhoneNumberCollectPaymentDetails.d.ts +12 -0
  112. package/dist/src/common/models/request/instruments/PhoneNumberCollectPaymentDetails.js +41 -0
  113. package/dist/src/common/models/request/instruments/TokenDetails.d.ts +39 -0
  114. package/dist/src/common/models/request/instruments/TokenDetails.js +81 -0
  115. package/dist/src/common/models/request/instruments/TokenPayRequestBuilder.d.ts +41 -0
  116. package/dist/src/common/models/request/instruments/TokenPayRequestBuilder.js +118 -0
  117. package/dist/src/common/models/request/instruments/TokenPaymentV2Instrument.d.ts +19 -0
  118. package/dist/src/common/models/request/instruments/TokenPaymentV2Instrument.js +51 -0
  119. package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.d.ts +25 -0
  120. package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.js +73 -0
  121. package/dist/src/common/models/request/instruments/UpiCollectPayViaVpaRequestBuilder.d.ts +25 -0
  122. package/dist/src/common/models/request/instruments/UpiCollectPayViaVpaRequestBuilder.js +71 -0
  123. package/dist/src/common/models/request/instruments/UpiIntentPayRequestBuilder.d.ts +25 -0
  124. package/dist/src/common/models/request/instruments/UpiIntentPayRequestBuilder.js +71 -0
  125. package/dist/src/common/models/request/instruments/UpiQrPaymentV2Instrument.d.ts +9 -0
  126. package/dist/src/common/models/request/instruments/UpiQrPaymentV2Instrument.js +36 -0
  127. package/dist/src/common/models/request/instruments/UpiQrRequestBuilder.d.ts +19 -0
  128. package/dist/src/common/models/request/instruments/UpiQrRequestBuilder.js +55 -0
  129. package/dist/src/common/models/request/instruments/VpaCollectPaymentDetails.d.ts +12 -0
  130. package/dist/src/common/models/request/instruments/VpaCollectPaymentDetails.js +41 -0
  131. package/dist/src/common/models/request/instruments/index.d.ts +21 -0
  132. package/dist/src/common/models/request/instruments/index.js +52 -0
  133. package/dist/src/common/models/response/CallbackData.d.ts +17 -0
  134. package/dist/src/common/models/response/CallbackData.js +21 -0
  135. package/dist/src/common/models/response/CallbackResponse.d.ts +6 -0
  136. package/dist/src/common/models/response/CallbackResponse.js +21 -0
  137. package/dist/src/common/models/response/CallbackType.d.ts +11 -0
  138. package/dist/src/common/models/response/CallbackType.js +30 -0
  139. package/dist/src/common/models/response/InstrumentCombo.d.ts +15 -0
  140. package/dist/src/common/models/response/InstrumentCombo.js +21 -0
  141. package/dist/src/common/models/response/OrderStatusResponse.d.ts +16 -0
  142. package/dist/src/common/models/response/OrderStatusResponse.js +21 -0
  143. package/dist/src/common/models/response/PaymentDetail.d.ts +24 -0
  144. package/dist/src/common/models/response/PaymentDetail.js +21 -0
  145. package/dist/src/common/models/response/PaymentRefundDetail.d.ts +24 -0
  146. package/dist/src/common/models/response/PaymentRefundDetail.js +21 -0
  147. package/dist/src/common/models/response/RefundResponse.d.ts +5 -0
  148. package/dist/src/common/models/response/RefundResponse.js +21 -0
  149. package/dist/src/common/models/response/RefundStatusResponse.d.ts +9 -0
  150. package/dist/src/common/models/response/RefundStatusResponse.js +21 -0
  151. package/dist/src/common/models/response/index.d.ts +11 -0
  152. package/dist/src/common/models/response/index.js +42 -0
  153. package/dist/src/common/models/response/paymentinstruments/AccountInstrumentV2.d.ts +10 -0
  154. package/dist/src/common/models/response/paymentinstruments/AccountInstrumentV2.js +22 -0
  155. package/dist/src/common/models/response/paymentinstruments/CreditCardPaymentInstrumentV2.d.ts +7 -0
  156. package/dist/src/common/models/response/paymentinstruments/CreditCardPaymentInstrumentV2.js +22 -0
  157. package/dist/src/common/models/response/paymentinstruments/DebitCardPaymentInstrumentV2.d.ts +7 -0
  158. package/dist/src/common/models/response/paymentinstruments/DebitCardPaymentInstrumentV2.js +22 -0
  159. package/dist/src/common/models/response/paymentinstruments/EgvPaymentInstrumentV2.d.ts +5 -0
  160. package/dist/src/common/models/response/paymentinstruments/EgvPaymentInstrumentV2.js +22 -0
  161. package/dist/src/common/models/response/paymentinstruments/NetbankingPaymentInstrumentV2.d.ts +7 -0
  162. package/dist/src/common/models/response/paymentinstruments/NetbankingPaymentInstrumentV2.js +22 -0
  163. package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentType.d.ts +8 -0
  164. package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentType.js +27 -0
  165. package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentV2.d.ts +4 -0
  166. package/dist/src/common/models/response/paymentinstruments/PaymentInstrumentV2.js +21 -0
  167. package/dist/src/common/models/response/paymentinstruments/WalletPaymentInstrumentV2.d.ts +4 -0
  168. package/dist/src/common/models/response/paymentinstruments/WalletPaymentInstrumentV2.js +22 -0
  169. package/dist/src/common/models/response/paymentinstruments/index.d.ts +8 -0
  170. package/dist/src/common/models/response/paymentinstruments/index.js +39 -0
  171. package/dist/src/common/models/response/rails/PaymentRail.d.ts +9 -0
  172. package/dist/src/common/models/response/rails/PaymentRail.js +28 -0
  173. package/dist/src/common/models/response/rails/PgPaymentRail.d.ts +6 -0
  174. package/dist/src/common/models/response/rails/PgPaymentRail.js +22 -0
  175. package/dist/src/common/models/response/rails/PpiEgvPaymentRail.d.ts +3 -0
  176. package/dist/src/common/models/response/rails/PpiEgvPaymentRail.js +22 -0
  177. package/dist/src/common/models/response/rails/PpiWalletPaymentRail.d.ts +3 -0
  178. package/dist/src/common/models/response/rails/PpiWalletPaymentRail.js +22 -0
  179. package/dist/src/common/models/response/rails/UpiPaymentRail.d.ts +6 -0
  180. package/dist/src/common/models/response/rails/UpiPaymentRail.js +22 -0
  181. package/dist/src/common/models/response/rails/index.d.ts +5 -0
  182. package/dist/src/common/models/response/rails/index.js +36 -0
  183. package/dist/src/common/tokenhandler/OAuthRequest.d.ts +6 -0
  184. package/dist/src/common/tokenhandler/OAuthRequest.js +17 -0
  185. package/dist/src/common/tokenhandler/OAuthResponse.d.ts +10 -0
  186. package/dist/src/common/tokenhandler/OAuthResponse.js +52 -0
  187. package/dist/src/common/tokenhandler/TokenConstants.d.ts +4 -0
  188. package/dist/src/common/tokenhandler/TokenConstants.js +23 -0
  189. package/dist/src/common/tokenhandler/TokenService.d.ts +22 -0
  190. package/dist/src/common/tokenhandler/TokenService.js +115 -0
  191. package/dist/src/common/tokenhandler/index.d.ts +2 -0
  192. package/dist/src/common/tokenhandler/index.js +33 -0
  193. package/dist/src/index.d.ts +4 -0
  194. package/dist/src/index.js +35 -0
  195. package/dist/src/payments/v2/CustomCheckoutClient.d.ts +86 -0
  196. package/dist/src/payments/v2/CustomCheckoutClient.js +229 -0
  197. package/dist/src/payments/v2/StandardCheckoutClient.d.ts +86 -0
  198. package/dist/src/payments/v2/StandardCheckoutClient.js +227 -0
  199. package/dist/src/payments/v2/customcheckout/Constants.d.ts +9 -0
  200. package/dist/src/payments/v2/customcheckout/Constants.js +28 -0
  201. package/dist/src/payments/v2/index.d.ts +3 -0
  202. package/dist/src/payments/v2/index.js +34 -0
  203. package/dist/src/payments/v2/models/index.d.ts +2 -0
  204. package/dist/src/payments/v2/models/index.js +33 -0
  205. package/dist/src/payments/v2/models/request/CreateSdkOrderRequest.d.ts +63 -0
  206. package/dist/src/payments/v2/models/request/CreateSdkOrderRequest.js +130 -0
  207. package/dist/src/payments/v2/models/request/CustomCheckoutPayRequest.d.ts +37 -0
  208. package/dist/src/payments/v2/models/request/CustomCheckoutPayRequest.js +79 -0
  209. package/dist/src/payments/v2/models/request/MerchantUrls.d.ts +4 -0
  210. package/dist/src/payments/v2/models/request/MerchantUrls.js +24 -0
  211. package/dist/src/payments/v2/models/request/PgCheckoutPaymentFlow.d.ts +18 -0
  212. package/dist/src/payments/v2/models/request/PgCheckoutPaymentFlow.js +48 -0
  213. package/dist/src/payments/v2/models/request/PgPaymentFlow.d.ts +20 -0
  214. package/dist/src/payments/v2/models/request/PgPaymentFlow.js +50 -0
  215. package/dist/src/payments/v2/models/request/PrefillUserLoginDetails.d.ts +16 -0
  216. package/dist/src/payments/v2/models/request/PrefillUserLoginDetails.js +38 -0
  217. package/dist/src/payments/v2/models/request/StandardCheckoutPayRequest.d.ts +40 -0
  218. package/dist/src/payments/v2/models/request/StandardCheckoutPayRequest.js +82 -0
  219. package/dist/src/payments/v2/models/request/index.d.ts +7 -0
  220. package/dist/src/payments/v2/models/request/index.js +38 -0
  221. package/dist/src/payments/v2/models/response/CreateSdkOrderResponse.d.ts +6 -0
  222. package/dist/src/payments/v2/models/response/CreateSdkOrderResponse.js +21 -0
  223. package/dist/src/payments/v2/models/response/CustomCheckoutPayResponse.d.ts +8 -0
  224. package/dist/src/payments/v2/models/response/CustomCheckoutPayResponse.js +21 -0
  225. package/dist/src/payments/v2/models/response/StandardCheckoutPayResponse.d.ts +6 -0
  226. package/dist/src/payments/v2/models/response/StandardCheckoutPayResponse.js +21 -0
  227. package/dist/src/payments/v2/models/response/index.d.ts +3 -0
  228. package/dist/src/payments/v2/models/response/index.js +34 -0
  229. package/dist/src/payments/v2/standardcheckout/Constants.d.ts +9 -0
  230. package/dist/src/payments/v2/standardcheckout/Constants.js +28 -0
  231. package/package.json +58 -0
@@ -0,0 +1,61 @@
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.MetaInfo = void 0;
19
+ class MetaInfo {
20
+ constructor(udf1, udf2, udf3, udf4, udf5) {
21
+ this.udf1 = udf1;
22
+ this.udf2 = udf2;
23
+ this.udf3 = udf3;
24
+ this.udf4 = udf4;
25
+ this.udf5 = udf5;
26
+ }
27
+ static builder() {
28
+ return new MetaInfoBuilder();
29
+ }
30
+ }
31
+ exports.MetaInfo = MetaInfo;
32
+ class MetaInfoBuilder {
33
+ constructor() {
34
+ /**
35
+ * SETTERS
36
+ */
37
+ this.udf1 = (udf1) => {
38
+ this._udf1 = udf1;
39
+ return this;
40
+ };
41
+ this.udf2 = (udf2) => {
42
+ this._udf2 = udf2;
43
+ return this;
44
+ };
45
+ this.udf3 = (udf3) => {
46
+ this._udf3 = udf3;
47
+ return this;
48
+ };
49
+ this.udf4 = (udf4) => {
50
+ this._udf4 = udf4;
51
+ return this;
52
+ };
53
+ this.udf5 = (udf5) => {
54
+ this._udf5 = udf5;
55
+ return this;
56
+ };
57
+ this.build = () => {
58
+ return new MetaInfo(this._udf1, this._udf2, this._udf3, this._udf4, this._udf5);
59
+ };
60
+ }
61
+ }
@@ -0,0 +1,5 @@
1
+ import { PaymentFlowType } from './PaymentFlowType';
2
+ export declare abstract class PaymentFlow {
3
+ type: PaymentFlowType;
4
+ constructor(paymentFlowType: PaymentFlowType);
5
+ }
@@ -0,0 +1,24 @@
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.PaymentFlow = void 0;
19
+ class PaymentFlow {
20
+ constructor(paymentFlowType) {
21
+ this.type = paymentFlowType;
22
+ }
23
+ }
24
+ exports.PaymentFlow = PaymentFlow;
@@ -0,0 +1,4 @@
1
+ export declare enum PaymentFlowType {
2
+ PG = "PG",
3
+ PG_CHECKOUT = "PG_CHECKOUT"
4
+ }
@@ -0,0 +1,23 @@
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.PaymentFlowType = void 0;
19
+ var PaymentFlowType;
20
+ (function (PaymentFlowType) {
21
+ PaymentFlowType["PG"] = "PG";
22
+ PaymentFlowType["PG_CHECKOUT"] = "PG_CHECKOUT";
23
+ })(PaymentFlowType = exports.PaymentFlowType || (exports.PaymentFlowType = {}));
@@ -0,0 +1,9 @@
1
+ export declare enum PgV2InstrumentType {
2
+ UPI_COLLECT = "UPI_COLLECT",
3
+ UPI_INTENT = "UPI_INTENT",
4
+ PPE_INTENT = "PPE_INTENT",
5
+ UPI_QR = "UPI_QR",
6
+ CARD = "CARD",
7
+ TOKEN = "TOKEN",
8
+ NET_BANKING = "NET_BANKING"
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.PgV2InstrumentType = void 0;
19
+ var PgV2InstrumentType;
20
+ (function (PgV2InstrumentType) {
21
+ PgV2InstrumentType["UPI_COLLECT"] = "UPI_COLLECT";
22
+ PgV2InstrumentType["UPI_INTENT"] = "UPI_INTENT";
23
+ PgV2InstrumentType["PPE_INTENT"] = "PPE_INTENT";
24
+ PgV2InstrumentType["UPI_QR"] = "UPI_QR";
25
+ PgV2InstrumentType["CARD"] = "CARD";
26
+ PgV2InstrumentType["TOKEN"] = "TOKEN";
27
+ PgV2InstrumentType["NET_BANKING"] = "NET_BANKING";
28
+ })(PgV2InstrumentType = exports.PgV2InstrumentType || (exports.PgV2InstrumentType = {}));
@@ -0,0 +1,6 @@
1
+ export * from './request';
2
+ export * from './response';
3
+ export * from './MetaInfo';
4
+ export * from './PaymentFlow';
5
+ export * from './PaymentFlowType';
6
+ export * from './PgV2InstrumentType';
@@ -0,0 +1,37 @@
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("./request"), exports);
33
+ __exportStar(require("./response"), exports);
34
+ __exportStar(require("./MetaInfo"), exports);
35
+ __exportStar(require("./PaymentFlow"), exports);
36
+ __exportStar(require("./PaymentFlowType"), exports);
37
+ __exportStar(require("./PgV2InstrumentType"), exports);
@@ -0,0 +1,18 @@
1
+ import { InstrumentConstraint } from './InstrumentConstraint';
2
+ /**
3
+ * Used to create an Account Constraint which can be send with the pay request
4
+ */
5
+ export declare class AccountConstraint extends InstrumentConstraint {
6
+ accountNumber: string;
7
+ ifsc: string;
8
+ constructor(accountNumber: string, ifsc: string);
9
+ static builder: () => AccountConstraintBuilder;
10
+ }
11
+ declare class AccountConstraintBuilder {
12
+ private _accountNumber;
13
+ private _ifsc;
14
+ accountNumber: (accountNumber: string) => this;
15
+ ifsc: (ifsc: string) => this;
16
+ build: () => AccountConstraint;
17
+ }
18
+ export {};
@@ -0,0 +1,49 @@
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.AccountConstraint = void 0;
19
+ const InstrumentConstraint_1 = require("./InstrumentConstraint");
20
+ const PaymentInstrumentType_1 = require("./PaymentInstrumentType");
21
+ /**
22
+ * Used to create an Account Constraint which can be send with the pay request
23
+ */
24
+ class AccountConstraint extends InstrumentConstraint_1.InstrumentConstraint {
25
+ constructor(accountNumber, ifsc) {
26
+ super(PaymentInstrumentType_1.PaymentInstrumentType.ACCOUNT);
27
+ this.accountNumber = accountNumber;
28
+ this.ifsc = ifsc;
29
+ }
30
+ }
31
+ exports.AccountConstraint = AccountConstraint;
32
+ AccountConstraint.builder = () => {
33
+ return new AccountConstraintBuilder();
34
+ };
35
+ class AccountConstraintBuilder {
36
+ constructor() {
37
+ this.accountNumber = (accountNumber) => {
38
+ this._accountNumber = accountNumber;
39
+ return this;
40
+ };
41
+ this.ifsc = (ifsc) => {
42
+ this._ifsc = ifsc;
43
+ return this;
44
+ };
45
+ this.build = () => {
46
+ return new AccountConstraint(this._accountNumber, this._ifsc);
47
+ };
48
+ }
49
+ }
@@ -0,0 +1,17 @@
1
+ export declare class DeviceContext {
2
+ deviceOS?: string;
3
+ merchantCallBackScheme?: string;
4
+ constructor(deviceOS?: string, merchantCallBackScheme?: string);
5
+ static builder(): DeviceContextBuilder;
6
+ }
7
+ declare class DeviceContextBuilder {
8
+ private _deviceOS?;
9
+ private _merchantCallBackScheme?;
10
+ /**
11
+ * SETTERS
12
+ */
13
+ deviceOS: (deviceOS?: string) => DeviceContextBuilder;
14
+ merchantCallBackScheme: (merchantCallBackScheme?: string) => DeviceContextBuilder;
15
+ build: () => DeviceContext;
16
+ }
17
+ export {};
@@ -0,0 +1,46 @@
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.DeviceContext = void 0;
19
+ class DeviceContext {
20
+ constructor(deviceOS, merchantCallBackScheme) {
21
+ this.deviceOS = deviceOS;
22
+ this.merchantCallBackScheme = merchantCallBackScheme;
23
+ }
24
+ static builder() {
25
+ return new DeviceContextBuilder();
26
+ }
27
+ }
28
+ exports.DeviceContext = DeviceContext;
29
+ class DeviceContextBuilder {
30
+ constructor() {
31
+ /**
32
+ * SETTERS
33
+ */
34
+ this.deviceOS = (deviceOS) => {
35
+ this._deviceOS = deviceOS;
36
+ return this;
37
+ };
38
+ this.merchantCallBackScheme = (merchantCallBackScheme) => {
39
+ this._merchantCallBackScheme = merchantCallBackScheme;
40
+ return this;
41
+ };
42
+ this.build = () => {
43
+ return new DeviceContext(this._deviceOS, this._merchantCallBackScheme);
44
+ };
45
+ }
46
+ }
@@ -0,0 +1,5 @@
1
+ import { PaymentInstrumentType } from './PaymentInstrumentType';
2
+ export declare abstract class InstrumentConstraint {
3
+ type: PaymentInstrumentType;
4
+ constructor(type: PaymentInstrumentType);
5
+ }
@@ -0,0 +1,24 @@
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.InstrumentConstraint = void 0;
19
+ class InstrumentConstraint {
20
+ constructor(type) {
21
+ this.type = type;
22
+ }
23
+ }
24
+ exports.InstrumentConstraint = InstrumentConstraint;
@@ -0,0 +1,3 @@
1
+ export declare enum PaymentInstrumentType {
2
+ ACCOUNT = "ACCOUNT"
3
+ }
@@ -0,0 +1,22 @@
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.PaymentInstrumentType = void 0;
19
+ var PaymentInstrumentType;
20
+ (function (PaymentInstrumentType) {
21
+ PaymentInstrumentType["ACCOUNT"] = "ACCOUNT";
22
+ })(PaymentInstrumentType = exports.PaymentInstrumentType || (exports.PaymentInstrumentType = {}));
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Creates a request to initiate a refund -> RefundRequest.builder()
3
+ */
4
+ export declare class RefundRequest {
5
+ merchantRefundId: string;
6
+ originalMerchantOrderId: string;
7
+ amount: number;
8
+ constructor(merchantRefundId: string, originalMerchantOrderId: string, amount: number);
9
+ static builder: () => RefundRequestBuilder;
10
+ }
11
+ declare class RefundRequestBuilder {
12
+ private _merchantRefundId;
13
+ private _originalMerchantOrderId;
14
+ private _amount;
15
+ merchantRefundId: (merchantRefundId: string) => RefundRequestBuilder;
16
+ originalMerchantOrderId: (originalMerchantOrderId: string) => RefundRequestBuilder;
17
+ amount: (amount: number) => RefundRequestBuilder;
18
+ build: () => RefundRequest;
19
+ }
20
+ export {};
@@ -0,0 +1,51 @@
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.RefundRequest = void 0;
19
+ /**
20
+ * Creates a request to initiate a refund -> RefundRequest.builder()
21
+ */
22
+ class RefundRequest {
23
+ constructor(merchantRefundId, originalMerchantOrderId, amount) {
24
+ this.merchantRefundId = merchantRefundId;
25
+ this.originalMerchantOrderId = originalMerchantOrderId;
26
+ this.amount = amount;
27
+ }
28
+ }
29
+ exports.RefundRequest = RefundRequest;
30
+ RefundRequest.builder = () => {
31
+ return new RefundRequestBuilder();
32
+ };
33
+ class RefundRequestBuilder {
34
+ constructor() {
35
+ this.merchantRefundId = (merchantRefundId) => {
36
+ this._merchantRefundId = merchantRefundId;
37
+ return this;
38
+ };
39
+ this.originalMerchantOrderId = (originalMerchantOrderId) => {
40
+ this._originalMerchantOrderId = originalMerchantOrderId;
41
+ return this;
42
+ };
43
+ this.amount = (amount) => {
44
+ this._amount = amount;
45
+ return this;
46
+ };
47
+ this.build = () => {
48
+ return new RefundRequest(this._merchantRefundId, this._originalMerchantOrderId, this._amount);
49
+ };
50
+ }
51
+ }
@@ -0,0 +1,5 @@
1
+ export * from './AccountConstraint';
2
+ export * from './DeviceContext';
3
+ export * from './InstrumentConstraint';
4
+ export * from './instruments';
5
+ export * from './RefundRequest';
@@ -0,0 +1,36 @@
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("./AccountConstraint"), exports);
33
+ __exportStar(require("./DeviceContext"), exports);
34
+ __exportStar(require("./InstrumentConstraint"), exports);
35
+ __exportStar(require("./instruments"), exports);
36
+ __exportStar(require("./RefundRequest"), exports);
@@ -0,0 +1,29 @@
1
+ export declare class BillingAddress {
2
+ line1?: string;
3
+ line2?: string;
4
+ city?: string;
5
+ state?: string;
6
+ zip?: string;
7
+ country?: string;
8
+ constructor(line1?: string, line2?: string, city?: string, state?: string, zip?: string, country?: string);
9
+ static builder(): BillingAddressBuilder;
10
+ }
11
+ declare class BillingAddressBuilder {
12
+ private _line1?;
13
+ private _line2?;
14
+ private _city?;
15
+ private _state?;
16
+ private _zip?;
17
+ private _country?;
18
+ /**
19
+ * SETTERS
20
+ */
21
+ line1: (line1: string) => void;
22
+ line2: (line2: string) => void;
23
+ city: (city: string) => void;
24
+ state: (state: string) => void;
25
+ zip: (zip: string) => void;
26
+ country: (country: string) => void;
27
+ build: () => BillingAddress;
28
+ }
29
+ export {};
@@ -0,0 +1,60 @@
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.BillingAddress = void 0;
19
+ class BillingAddress {
20
+ constructor(line1, line2, city, state, zip, country) {
21
+ this.line1 = line1;
22
+ this.line2 = line2;
23
+ this.city = city;
24
+ this.state = state;
25
+ this.zip = zip;
26
+ this.country = country;
27
+ }
28
+ static builder() {
29
+ return new BillingAddressBuilder();
30
+ }
31
+ }
32
+ exports.BillingAddress = BillingAddress;
33
+ class BillingAddressBuilder {
34
+ constructor() {
35
+ /**
36
+ * SETTERS
37
+ */
38
+ this.line1 = (line1) => {
39
+ this._line1 = line1;
40
+ };
41
+ this.line2 = (line2) => {
42
+ this._line2 = line2;
43
+ };
44
+ this.city = (city) => {
45
+ this._city = city;
46
+ };
47
+ this.state = (state) => {
48
+ this._state = state;
49
+ };
50
+ this.zip = (zip) => {
51
+ this._zip = zip;
52
+ };
53
+ this.country = (country) => {
54
+ this._country = country;
55
+ };
56
+ this.build = () => {
57
+ return new BillingAddress(this._line1, this._line2, this._city, this._state, this._zip, this._country);
58
+ };
59
+ }
60
+ }
@@ -0,0 +1,39 @@
1
+ import { CustomCheckoutPayRequest } from '../../../../payments/v2/models/request/CustomCheckoutPayRequest';
2
+ import { InstrumentConstraint } from '../InstrumentConstraint';
3
+ import { MetaInfo } from '../../MetaInfo';
4
+ export declare class CardPayRequestBuilder {
5
+ private _merchantOrderId;
6
+ private _amount;
7
+ private _encryptionKeyId;
8
+ private _encryptedCardNumber;
9
+ private _encryptedCvv;
10
+ private _expiryMonth;
11
+ private _expiryYear;
12
+ private _authMode?;
13
+ private _cardHolderName?;
14
+ private _merchantUserId?;
15
+ private _metaInfo?;
16
+ private _redirectUrl?;
17
+ private _savedCard?;
18
+ private _constraints?;
19
+ private _expireAfter?;
20
+ /**
21
+ * SETTERS
22
+ */
23
+ merchantOrderId: (merchantOrderId: string) => this;
24
+ amount: (amount: number) => this;
25
+ metaInfo: (metaInfo: MetaInfo) => this;
26
+ constraints: (constraints: InstrumentConstraint[]) => this;
27
+ encryptedCardNumber: (encryptedCardNumber: string) => this;
28
+ authMode: (authMode: string) => this;
29
+ encryptionKeyId: (encryptionKeyId: number) => this;
30
+ encryptedCvv: (encryptedCvv: string) => this;
31
+ expiryMonth: (expiryMonth: string) => this;
32
+ expiryYear: (expiryYear: string) => this;
33
+ redirectUrl: (redirectUrl: string) => this;
34
+ cardHolderName: (cardHolderName: string) => this;
35
+ savedCard: (savedCard: boolean) => this;
36
+ merchantUserId: (merchantUserId: string) => this;
37
+ expireAfter: (expireAfter: number) => this;
38
+ build: () => CustomCheckoutPayRequest;
39
+ }