@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,113 @@
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.CardPayRequestBuilder = void 0;
19
+ const CustomCheckoutPayRequest_1 = require("../../../../payments/v2/models/request/CustomCheckoutPayRequest");
20
+ const CardPaymentV2Instrument_1 = require("./CardPaymentV2Instrument");
21
+ const Expiry_1 = require("./Expiry");
22
+ const NewCardDetails_1 = require("./NewCardDetails");
23
+ const PgPaymentFlow_1 = require("../../../../payments/v2/models/request/PgPaymentFlow");
24
+ class CardPayRequestBuilder {
25
+ constructor() {
26
+ /**
27
+ * SETTERS
28
+ */
29
+ this.merchantOrderId = (merchantOrderId) => {
30
+ this._merchantOrderId = merchantOrderId;
31
+ return this;
32
+ };
33
+ this.amount = (amount) => {
34
+ this._amount = amount;
35
+ return this;
36
+ };
37
+ this.metaInfo = (metaInfo) => {
38
+ this._metaInfo = metaInfo;
39
+ return this;
40
+ };
41
+ this.constraints = (constraints) => {
42
+ this._constraints = constraints;
43
+ return this;
44
+ };
45
+ this.encryptedCardNumber = (encryptedCardNumber) => {
46
+ this._encryptedCardNumber = encryptedCardNumber;
47
+ return this;
48
+ };
49
+ this.authMode = (authMode) => {
50
+ this._authMode = authMode;
51
+ return this;
52
+ };
53
+ this.encryptionKeyId = (encryptionKeyId) => {
54
+ this._encryptionKeyId = encryptionKeyId;
55
+ return this;
56
+ };
57
+ this.encryptedCvv = (encryptedCvv) => {
58
+ this._encryptedCvv = encryptedCvv;
59
+ return this;
60
+ };
61
+ this.expiryMonth = (expiryMonth) => {
62
+ this._expiryMonth = expiryMonth;
63
+ return this;
64
+ };
65
+ this.expiryYear = (expiryYear) => {
66
+ this._expiryYear = expiryYear;
67
+ return this;
68
+ };
69
+ this.redirectUrl = (redirectUrl) => {
70
+ this._redirectUrl = redirectUrl;
71
+ return this;
72
+ };
73
+ this.cardHolderName = (cardHolderName) => {
74
+ this._cardHolderName = cardHolderName;
75
+ return this;
76
+ };
77
+ this.savedCard = (savedCard) => {
78
+ this._savedCard = savedCard;
79
+ return this;
80
+ };
81
+ this.merchantUserId = (merchantUserId) => {
82
+ this._merchantUserId = merchantUserId;
83
+ return this;
84
+ };
85
+ this.expireAfter = (expireAfter) => {
86
+ this._expireAfter = expireAfter;
87
+ return this;
88
+ };
89
+ this.build = () => {
90
+ const newCardDetails = NewCardDetails_1.NewCardDetails.builder()
91
+ .cardHolderName(this._cardHolderName)
92
+ .expiry(Expiry_1.Expiry.builder()
93
+ .expiryMonth(this._expiryMonth)
94
+ .expiryYear(this._expiryYear)
95
+ .build())
96
+ .encryptionKeyId(this._encryptionKeyId)
97
+ .encryptedCardNumber(this._encryptedCardNumber)
98
+ .encryptedCvv(this._encryptedCvv)
99
+ .build();
100
+ const paymentFlow = PgPaymentFlow_1.PgPaymentFlow.builder()
101
+ .paymentMode(CardPaymentV2Instrument_1.CardPaymentV2Instrument.builder()
102
+ .cardDetails(newCardDetails)
103
+ .authMode(this._authMode)
104
+ .merchantUserId(this._merchantUserId)
105
+ .savedCard(this._savedCard)
106
+ .build())
107
+ .redirectUrl(this._redirectUrl)
108
+ .build();
109
+ return new CustomCheckoutPayRequest_1.CustomCheckoutPayRequest(this._merchantOrderId, this._amount, paymentFlow, this._expireAfter, this._metaInfo, this._constraints);
110
+ };
111
+ }
112
+ }
113
+ exports.CardPayRequestBuilder = CardPayRequestBuilder;
@@ -0,0 +1,22 @@
1
+ import { NewCardDetails } from './NewCardDetails';
2
+ import { PaymentV2Instrument } from './PaymentV2Instrument';
3
+ export declare class CardPaymentV2Instrument extends PaymentV2Instrument {
4
+ cardDetails: NewCardDetails;
5
+ authMode?: string;
6
+ savedCard?: boolean;
7
+ merchantUserId?: string;
8
+ constructor(cardDetails: NewCardDetails, authMode?: string, merchantUserId?: string, savedCard?: boolean);
9
+ static builder: () => CardPaymentV2InstrumentBuilder;
10
+ }
11
+ declare class CardPaymentV2InstrumentBuilder {
12
+ private _cardDetails;
13
+ private _authMode?;
14
+ private _savedCard?;
15
+ private _merchantUserId?;
16
+ cardDetails: (cardDetails: NewCardDetails) => this;
17
+ authMode: (authMode?: string) => this;
18
+ savedCard: (savedCard?: boolean) => this;
19
+ merchantUserId: (merchantUserId?: string) => this;
20
+ build: () => CardPaymentV2Instrument;
21
+ }
22
+ export {};
@@ -0,0 +1,56 @@
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.CardPaymentV2Instrument = void 0;
19
+ const PgV2InstrumentType_1 = require("../../PgV2InstrumentType");
20
+ const PaymentV2Instrument_1 = require("./PaymentV2Instrument");
21
+ class CardPaymentV2Instrument extends PaymentV2Instrument_1.PaymentV2Instrument {
22
+ constructor(cardDetails, authMode, merchantUserId, savedCard) {
23
+ super(PgV2InstrumentType_1.PgV2InstrumentType.CARD);
24
+ this.authMode = authMode;
25
+ this.cardDetails = cardDetails;
26
+ this.merchantUserId = merchantUserId;
27
+ this.savedCard = savedCard;
28
+ }
29
+ }
30
+ exports.CardPaymentV2Instrument = CardPaymentV2Instrument;
31
+ CardPaymentV2Instrument.builder = () => {
32
+ return new CardPaymentV2InstrumentBuilder();
33
+ };
34
+ class CardPaymentV2InstrumentBuilder {
35
+ constructor() {
36
+ this.cardDetails = (cardDetails) => {
37
+ this._cardDetails = cardDetails;
38
+ return this;
39
+ };
40
+ this.authMode = (authMode) => {
41
+ this._authMode = authMode;
42
+ return this;
43
+ };
44
+ this.savedCard = (savedCard) => {
45
+ this._savedCard = savedCard;
46
+ return this;
47
+ };
48
+ this.merchantUserId = (merchantUserId) => {
49
+ this._merchantUserId = merchantUserId;
50
+ return this;
51
+ };
52
+ this.build = () => {
53
+ return new CardPaymentV2Instrument(this._cardDetails, this._authMode, this._merchantUserId, this._savedCard);
54
+ };
55
+ }
56
+ }
@@ -0,0 +1,5 @@
1
+ import { CollectPaymentDetailsType } from './CollectPaymentDetailsType';
2
+ export declare abstract class CollectPaymentDetails {
3
+ type: CollectPaymentDetailsType;
4
+ constructor(type: CollectPaymentDetailsType);
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.CollectPaymentDetails = void 0;
19
+ class CollectPaymentDetails {
20
+ constructor(type) {
21
+ this.type = type;
22
+ }
23
+ }
24
+ exports.CollectPaymentDetails = CollectPaymentDetails;
@@ -0,0 +1,4 @@
1
+ export declare enum CollectPaymentDetailsType {
2
+ VPA = "VPA",
3
+ PHONE_NUMBER = "PHONE_NUMBER"
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.CollectPaymentDetailsType = void 0;
19
+ var CollectPaymentDetailsType;
20
+ (function (CollectPaymentDetailsType) {
21
+ CollectPaymentDetailsType["VPA"] = "VPA";
22
+ CollectPaymentDetailsType["PHONE_NUMBER"] = "PHONE_NUMBER";
23
+ })(CollectPaymentDetailsType = exports.CollectPaymentDetailsType || (exports.CollectPaymentDetailsType = {}));
@@ -0,0 +1,19 @@
1
+ import { CollectPaymentDetails } from './CollectPaymentDetails';
2
+ import { PaymentV2Instrument } from './PaymentV2Instrument';
3
+ export declare class CollectPaymentV2Instrument extends PaymentV2Instrument {
4
+ details: CollectPaymentDetails;
5
+ message?: string;
6
+ constructor(details: CollectPaymentDetails, message?: string);
7
+ static builder: () => CollectPaymentV2InstrumentBuilder;
8
+ }
9
+ declare class CollectPaymentV2InstrumentBuilder {
10
+ private _details;
11
+ private _message?;
12
+ /**
13
+ * SETTERS
14
+ */
15
+ details: (details: CollectPaymentDetails) => this;
16
+ message: (message?: string) => this;
17
+ build: () => CollectPaymentV2Instrument;
18
+ }
19
+ 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.CollectPaymentV2Instrument = void 0;
19
+ const PgV2InstrumentType_1 = require("../../PgV2InstrumentType");
20
+ const PaymentV2Instrument_1 = require("./PaymentV2Instrument");
21
+ class CollectPaymentV2Instrument extends PaymentV2Instrument_1.PaymentV2Instrument {
22
+ constructor(details, message) {
23
+ super(PgV2InstrumentType_1.PgV2InstrumentType.UPI_COLLECT);
24
+ this.details = details;
25
+ this.message = message;
26
+ }
27
+ }
28
+ exports.CollectPaymentV2Instrument = CollectPaymentV2Instrument;
29
+ CollectPaymentV2Instrument.builder = () => {
30
+ return new CollectPaymentV2InstrumentBuilder();
31
+ };
32
+ class CollectPaymentV2InstrumentBuilder {
33
+ constructor() {
34
+ /**
35
+ * SETTERS
36
+ */
37
+ this.details = (details) => {
38
+ this._details = details;
39
+ return this;
40
+ };
41
+ this.message = (message) => {
42
+ this._message = message;
43
+ return this;
44
+ };
45
+ this.build = () => {
46
+ return new CollectPaymentV2Instrument(this._details, this._message);
47
+ };
48
+ }
49
+ }
@@ -0,0 +1,14 @@
1
+ export declare class Expiry {
2
+ month: string;
3
+ year: string;
4
+ constructor(month: string, year: string);
5
+ static builder: () => ExpiryBuilder;
6
+ }
7
+ declare class ExpiryBuilder {
8
+ private _expiryMonth;
9
+ private _expiryYear;
10
+ expiryMonth: (expiryMonth: string) => this;
11
+ expiryYear: (expiryYear: string) => this;
12
+ build: () => Expiry;
13
+ }
14
+ export {};
@@ -0,0 +1,43 @@
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.Expiry = void 0;
19
+ class Expiry {
20
+ constructor(month, year) {
21
+ this.month = month;
22
+ this.year = year;
23
+ }
24
+ }
25
+ exports.Expiry = Expiry;
26
+ Expiry.builder = () => {
27
+ return new ExpiryBuilder();
28
+ };
29
+ class ExpiryBuilder {
30
+ constructor() {
31
+ this.expiryMonth = (expiryMonth) => {
32
+ this._expiryMonth = expiryMonth;
33
+ return this;
34
+ };
35
+ this.expiryYear = (expiryYear) => {
36
+ this._expiryYear = expiryYear;
37
+ return this;
38
+ };
39
+ this.build = () => {
40
+ return new Expiry(this._expiryMonth, this._expiryYear);
41
+ };
42
+ }
43
+ }
@@ -0,0 +1,12 @@
1
+ import { PaymentV2Instrument } from './PaymentV2Instrument';
2
+ export declare class IntentPaymentV2Instrument extends PaymentV2Instrument {
3
+ targetApp?: string;
4
+ constructor(targetApp?: string);
5
+ static builder: () => IntentPaymentV2InstrumentBuilder;
6
+ }
7
+ declare class IntentPaymentV2InstrumentBuilder {
8
+ private _targetApp?;
9
+ targetApp: (targetApp?: string) => IntentPaymentV2InstrumentBuilder;
10
+ build: () => IntentPaymentV2Instrument;
11
+ }
12
+ export {};
@@ -0,0 +1,41 @@
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.IntentPaymentV2Instrument = void 0;
19
+ const PgV2InstrumentType_1 = require("../../PgV2InstrumentType");
20
+ const PaymentV2Instrument_1 = require("./PaymentV2Instrument");
21
+ class IntentPaymentV2Instrument extends PaymentV2Instrument_1.PaymentV2Instrument {
22
+ constructor(targetApp) {
23
+ super(PgV2InstrumentType_1.PgV2InstrumentType.UPI_INTENT);
24
+ this.targetApp = targetApp;
25
+ }
26
+ }
27
+ exports.IntentPaymentV2Instrument = IntentPaymentV2Instrument;
28
+ IntentPaymentV2Instrument.builder = () => {
29
+ return new IntentPaymentV2InstrumentBuilder();
30
+ };
31
+ class IntentPaymentV2InstrumentBuilder {
32
+ constructor() {
33
+ this.targetApp = (targetApp) => {
34
+ this._targetApp = targetApp;
35
+ return this;
36
+ };
37
+ this.build = () => {
38
+ return new IntentPaymentV2Instrument(this._targetApp);
39
+ };
40
+ }
41
+ }
@@ -0,0 +1,25 @@
1
+ import { CustomCheckoutPayRequest } from '../../../../payments/v2/models/request/CustomCheckoutPayRequest';
2
+ import { InstrumentConstraint } from '../InstrumentConstraint';
3
+ import { MetaInfo } from '../../MetaInfo';
4
+ export declare class NetBankingPayRequestBuilder {
5
+ private _merchantOrderId;
6
+ private _amount;
7
+ private _constraints?;
8
+ private _metaInfo?;
9
+ private _bankId;
10
+ private _merchantUserId?;
11
+ private _redirectUrl?;
12
+ private _expireAfter?;
13
+ /**
14
+ * SETTERS
15
+ */
16
+ merchantOrderId: (merchantOrderId: string) => this;
17
+ amount: (amount: number) => this;
18
+ metaInfo: (metaInfo: MetaInfo) => this;
19
+ constraints: (constraints: InstrumentConstraint[]) => this;
20
+ bankId: (bankId: string) => this;
21
+ merchantUserId: (merchantUserId: string) => this;
22
+ redirectUrl: (redirectUrl: string) => this;
23
+ expireAfter: (expireAfter: number) => this;
24
+ build: () => CustomCheckoutPayRequest;
25
+ }
@@ -0,0 +1,71 @@
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.NetBankingPayRequestBuilder = void 0;
19
+ const CustomCheckoutPayRequest_1 = require("../../../../payments/v2/models/request/CustomCheckoutPayRequest");
20
+ const NetBankingPaymentV2Instrument_1 = require("./NetBankingPaymentV2Instrument");
21
+ const PgPaymentFlow_1 = require("../../../../payments/v2/models/request/PgPaymentFlow");
22
+ class NetBankingPayRequestBuilder {
23
+ constructor() {
24
+ /**
25
+ * SETTERS
26
+ */
27
+ this.merchantOrderId = (merchantOrderId) => {
28
+ this._merchantOrderId = merchantOrderId;
29
+ return this;
30
+ };
31
+ this.amount = (amount) => {
32
+ this._amount = amount;
33
+ return this;
34
+ };
35
+ this.metaInfo = (metaInfo) => {
36
+ this._metaInfo = metaInfo;
37
+ return this;
38
+ };
39
+ this.constraints = (constraints) => {
40
+ this._constraints = constraints;
41
+ return this;
42
+ };
43
+ this.bankId = (bankId) => {
44
+ this._bankId = bankId;
45
+ return this;
46
+ };
47
+ this.merchantUserId = (merchantUserId) => {
48
+ this._merchantUserId = merchantUserId;
49
+ return this;
50
+ };
51
+ this.redirectUrl = (redirectUrl) => {
52
+ this._redirectUrl = redirectUrl;
53
+ return this;
54
+ };
55
+ this.expireAfter = (expireAfter) => {
56
+ this._expireAfter = expireAfter;
57
+ return this;
58
+ };
59
+ this.build = () => {
60
+ const paymentFlow = PgPaymentFlow_1.PgPaymentFlow.builder()
61
+ .paymentMode(NetBankingPaymentV2Instrument_1.NetBankingPaymentV2Instrument.builder()
62
+ .bankId(this._bankId)
63
+ .merchantUserId(this._merchantUserId)
64
+ .build())
65
+ .redirectUrl(this._redirectUrl)
66
+ .build();
67
+ return new CustomCheckoutPayRequest_1.CustomCheckoutPayRequest(this._merchantOrderId, this._amount, paymentFlow, this._expireAfter, this._metaInfo, this._constraints);
68
+ };
69
+ }
70
+ }
71
+ exports.NetBankingPayRequestBuilder = NetBankingPayRequestBuilder;
@@ -0,0 +1,15 @@
1
+ import { PaymentV2Instrument } from './PaymentV2Instrument';
2
+ export declare class NetBankingPaymentV2Instrument extends PaymentV2Instrument {
3
+ bankId: string;
4
+ merchantUserId?: string;
5
+ constructor(bankId: string, merchantUserId?: string);
6
+ static builder: () => NetBankingPaymentV2InstrumentBuilder;
7
+ }
8
+ declare class NetBankingPaymentV2InstrumentBuilder {
9
+ private _bankId;
10
+ private _merchantUserId?;
11
+ bankId: (bankId: string) => this;
12
+ merchantUserId: (merchantUserId?: string) => this;
13
+ build: () => NetBankingPaymentV2Instrument;
14
+ }
15
+ 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.NetBankingPaymentV2Instrument = void 0;
19
+ const PgV2InstrumentType_1 = require("../../PgV2InstrumentType");
20
+ const PaymentV2Instrument_1 = require("./PaymentV2Instrument");
21
+ class NetBankingPaymentV2Instrument extends PaymentV2Instrument_1.PaymentV2Instrument {
22
+ constructor(bankId, merchantUserId) {
23
+ super(PgV2InstrumentType_1.PgV2InstrumentType.NET_BANKING);
24
+ this.bankId = bankId;
25
+ this.merchantUserId = merchantUserId;
26
+ }
27
+ }
28
+ exports.NetBankingPaymentV2Instrument = NetBankingPaymentV2Instrument;
29
+ NetBankingPaymentV2Instrument.builder = () => {
30
+ return new NetBankingPaymentV2InstrumentBuilder();
31
+ };
32
+ class NetBankingPaymentV2InstrumentBuilder {
33
+ constructor() {
34
+ this.bankId = (bankId) => {
35
+ this._bankId = bankId;
36
+ return this;
37
+ };
38
+ this.merchantUserId = (merchantUserId) => {
39
+ this._merchantUserId = merchantUserId;
40
+ return this;
41
+ };
42
+ this.build = () => {
43
+ return new NetBankingPaymentV2Instrument(this._bankId, this._merchantUserId);
44
+ };
45
+ }
46
+ }
@@ -0,0 +1,29 @@
1
+ import { BillingAddress } from './BillingAddress';
2
+ import { Expiry } from './Expiry';
3
+ export declare class NewCardDetails {
4
+ encryptedCardNumber: string;
5
+ encryptionKeyId: number;
6
+ encryptedCvv: string;
7
+ expiry: Expiry;
8
+ cardHolderName?: string;
9
+ billingAddress?: BillingAddress;
10
+ constructor(encryptedCardNumber: string, encryptedCvv: string, encryptionKeyId: number, expiry: Expiry, cardHolderName?: string);
11
+ static builder: () => NewCardDetailsBuilder;
12
+ }
13
+ declare class NewCardDetailsBuilder {
14
+ private _encryptedCardNumber;
15
+ private _encryptionKeyId;
16
+ private _encryptedCvv;
17
+ private _cardHolderName?;
18
+ private _expiry;
19
+ /**
20
+ * SETTERS
21
+ */
22
+ encryptedCardNumber: (encryptedCardNumber: string) => this;
23
+ encryptedCvv: (encryptedCvv: string) => this;
24
+ encryptionKeyId: (encryptionKeyId: number) => this;
25
+ expiry: (expiry: Expiry) => this;
26
+ cardHolderName: (cardHolderName?: string) => this;
27
+ build: () => NewCardDetails;
28
+ }
29
+ export {};