@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,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.NewCardDetails = void 0;
|
|
19
|
+
class NewCardDetails {
|
|
20
|
+
constructor(encryptedCardNumber, encryptedCvv, encryptionKeyId, expiry, cardHolderName) {
|
|
21
|
+
this.encryptedCardNumber = encryptedCardNumber;
|
|
22
|
+
this.encryptedCvv = encryptedCvv;
|
|
23
|
+
this.encryptionKeyId = encryptionKeyId;
|
|
24
|
+
this.expiry = expiry;
|
|
25
|
+
this.cardHolderName = cardHolderName;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.NewCardDetails = NewCardDetails;
|
|
29
|
+
NewCardDetails.builder = () => {
|
|
30
|
+
return new NewCardDetailsBuilder();
|
|
31
|
+
};
|
|
32
|
+
class NewCardDetailsBuilder {
|
|
33
|
+
constructor() {
|
|
34
|
+
/**
|
|
35
|
+
* SETTERS
|
|
36
|
+
*/
|
|
37
|
+
this.encryptedCardNumber = (encryptedCardNumber) => {
|
|
38
|
+
this._encryptedCardNumber = encryptedCardNumber;
|
|
39
|
+
return this;
|
|
40
|
+
};
|
|
41
|
+
this.encryptedCvv = (encryptedCvv) => {
|
|
42
|
+
this._encryptedCvv = encryptedCvv;
|
|
43
|
+
return this;
|
|
44
|
+
};
|
|
45
|
+
this.encryptionKeyId = (encryptionKeyId) => {
|
|
46
|
+
this._encryptionKeyId = encryptionKeyId;
|
|
47
|
+
return this;
|
|
48
|
+
};
|
|
49
|
+
this.expiry = (expiry) => {
|
|
50
|
+
this._expiry = expiry;
|
|
51
|
+
return this;
|
|
52
|
+
};
|
|
53
|
+
this.cardHolderName = (cardHolderName) => {
|
|
54
|
+
this._cardHolderName = cardHolderName;
|
|
55
|
+
return this;
|
|
56
|
+
};
|
|
57
|
+
this.build = () => {
|
|
58
|
+
return new NewCardDetails(this._encryptedCardNumber, this._encryptedCvv, this._encryptionKeyId, this._expiry, this._cardHolderName);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InstrumentConstraint } from '../InstrumentConstraint';
|
|
2
|
+
import { PgV2InstrumentType } from '../../PgV2InstrumentType';
|
|
3
|
+
export declare abstract class PaymentV2Instrument {
|
|
4
|
+
type: PgV2InstrumentType;
|
|
5
|
+
constraints?: InstrumentConstraint[];
|
|
6
|
+
constructor(type: PgV2InstrumentType);
|
|
7
|
+
}
|
|
@@ -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.PaymentV2Instrument = void 0;
|
|
19
|
+
class PaymentV2Instrument {
|
|
20
|
+
constructor(type) {
|
|
21
|
+
this.type = type;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PaymentV2Instrument = PaymentV2Instrument;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CollectPaymentDetails } from './CollectPaymentDetails';
|
|
2
|
+
export declare class PhoneNumberCollectPaymentDetails extends CollectPaymentDetails {
|
|
3
|
+
phoneNumber: string;
|
|
4
|
+
constructor(phoneNumber: string);
|
|
5
|
+
static builder: () => PhoneNumberCollectPaymentDetailsBuilder;
|
|
6
|
+
}
|
|
7
|
+
declare class PhoneNumberCollectPaymentDetailsBuilder {
|
|
8
|
+
private _phoneNumber;
|
|
9
|
+
phoneNumber: (phoneNumber: string) => this;
|
|
10
|
+
build: () => PhoneNumberCollectPaymentDetails;
|
|
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.PhoneNumberCollectPaymentDetails = void 0;
|
|
19
|
+
const CollectPaymentDetails_1 = require("./CollectPaymentDetails");
|
|
20
|
+
const CollectPaymentDetailsType_1 = require("./CollectPaymentDetailsType");
|
|
21
|
+
class PhoneNumberCollectPaymentDetails extends CollectPaymentDetails_1.CollectPaymentDetails {
|
|
22
|
+
constructor(phoneNumber) {
|
|
23
|
+
super(CollectPaymentDetailsType_1.CollectPaymentDetailsType.PHONE_NUMBER);
|
|
24
|
+
this.phoneNumber = phoneNumber;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.PhoneNumberCollectPaymentDetails = PhoneNumberCollectPaymentDetails;
|
|
28
|
+
PhoneNumberCollectPaymentDetails.builder = () => {
|
|
29
|
+
return new PhoneNumberCollectPaymentDetailsBuilder();
|
|
30
|
+
};
|
|
31
|
+
class PhoneNumberCollectPaymentDetailsBuilder {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.phoneNumber = (phoneNumber) => {
|
|
34
|
+
this._phoneNumber = phoneNumber;
|
|
35
|
+
return this;
|
|
36
|
+
};
|
|
37
|
+
this.build = () => {
|
|
38
|
+
return new PhoneNumberCollectPaymentDetails(this._phoneNumber);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Expiry } from './Expiry';
|
|
2
|
+
export declare class TokenDetails {
|
|
3
|
+
encryptedToken: string;
|
|
4
|
+
encryptedCvv: string;
|
|
5
|
+
encryptionKeyId: number;
|
|
6
|
+
expiry: Expiry;
|
|
7
|
+
cryptogram: string;
|
|
8
|
+
panSuffix: string;
|
|
9
|
+
cardHolderName?: string;
|
|
10
|
+
eci?: string;
|
|
11
|
+
atc?: string;
|
|
12
|
+
constructor(encryptedToken: string, encryptedCvv: string, encryptionKeyId: number, expiry: Expiry, cryptogram: string, panSuffix: string, cardHolderName?: string, eci?: string, atc?: string);
|
|
13
|
+
static builder: () => TokenDetailsBuilder;
|
|
14
|
+
}
|
|
15
|
+
declare class TokenDetailsBuilder {
|
|
16
|
+
private _encryptedToken;
|
|
17
|
+
private _encryptedCvv;
|
|
18
|
+
private _encryptionKeyId;
|
|
19
|
+
private _expiry;
|
|
20
|
+
private _cryptogram;
|
|
21
|
+
private _panSuffix;
|
|
22
|
+
private _cardHolderName?;
|
|
23
|
+
private _eci?;
|
|
24
|
+
private _atc?;
|
|
25
|
+
/**
|
|
26
|
+
* SETTERS
|
|
27
|
+
*/
|
|
28
|
+
encryptedToken: (encryptedToken: string) => this;
|
|
29
|
+
encryptedCvv: (encryptedCvv: string) => this;
|
|
30
|
+
encryptionKeyId: (encryptionKeyId: number) => this;
|
|
31
|
+
expiry: (expiry: Expiry) => this;
|
|
32
|
+
cryptogram: (cryptogram: string) => this;
|
|
33
|
+
panSuffix: (panSuffix: string) => this;
|
|
34
|
+
cardHolderName: (cardHolderName?: string) => this;
|
|
35
|
+
eci: (eci: string) => this;
|
|
36
|
+
atc: (atc: string) => this;
|
|
37
|
+
build: () => TokenDetails;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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.TokenDetails = void 0;
|
|
19
|
+
class TokenDetails {
|
|
20
|
+
constructor(encryptedToken, encryptedCvv, encryptionKeyId, expiry, cryptogram, panSuffix, cardHolderName, eci, atc) {
|
|
21
|
+
this.encryptedToken = encryptedToken;
|
|
22
|
+
this.encryptedCvv = encryptedCvv;
|
|
23
|
+
this.encryptionKeyId = encryptionKeyId;
|
|
24
|
+
this.expiry = expiry;
|
|
25
|
+
this.cryptogram = cryptogram;
|
|
26
|
+
this.panSuffix = panSuffix;
|
|
27
|
+
this.cardHolderName = cardHolderName;
|
|
28
|
+
this.eci = eci;
|
|
29
|
+
this.atc = atc;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.TokenDetails = TokenDetails;
|
|
33
|
+
TokenDetails.builder = () => {
|
|
34
|
+
return new TokenDetailsBuilder();
|
|
35
|
+
};
|
|
36
|
+
class TokenDetailsBuilder {
|
|
37
|
+
constructor() {
|
|
38
|
+
/**
|
|
39
|
+
* SETTERS
|
|
40
|
+
*/
|
|
41
|
+
this.encryptedToken = (encryptedToken) => {
|
|
42
|
+
this._encryptedToken = encryptedToken;
|
|
43
|
+
return this;
|
|
44
|
+
};
|
|
45
|
+
this.encryptedCvv = (encryptedCvv) => {
|
|
46
|
+
this._encryptedCvv = encryptedCvv;
|
|
47
|
+
return this;
|
|
48
|
+
};
|
|
49
|
+
this.encryptionKeyId = (encryptionKeyId) => {
|
|
50
|
+
this._encryptionKeyId = encryptionKeyId;
|
|
51
|
+
return this;
|
|
52
|
+
};
|
|
53
|
+
this.expiry = (expiry) => {
|
|
54
|
+
this._expiry = expiry;
|
|
55
|
+
return this;
|
|
56
|
+
};
|
|
57
|
+
this.cryptogram = (cryptogram) => {
|
|
58
|
+
this._cryptogram = cryptogram;
|
|
59
|
+
return this;
|
|
60
|
+
};
|
|
61
|
+
this.panSuffix = (panSuffix) => {
|
|
62
|
+
this._panSuffix = panSuffix;
|
|
63
|
+
return this;
|
|
64
|
+
};
|
|
65
|
+
this.cardHolderName = (cardHolderName) => {
|
|
66
|
+
this._cardHolderName = cardHolderName;
|
|
67
|
+
return this;
|
|
68
|
+
};
|
|
69
|
+
this.eci = (eci) => {
|
|
70
|
+
this._eci = eci;
|
|
71
|
+
return this;
|
|
72
|
+
};
|
|
73
|
+
this.atc = (atc) => {
|
|
74
|
+
this._atc = atc;
|
|
75
|
+
return this;
|
|
76
|
+
};
|
|
77
|
+
this.build = () => {
|
|
78
|
+
return new TokenDetails(this._encryptedToken, this._encryptedCvv, this._encryptionKeyId, this._expiry, this._cryptogram, this._panSuffix, this._cardHolderName, this._eci, this._atc);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CustomCheckoutPayRequest } from '../../../../payments/v2/models/request/CustomCheckoutPayRequest';
|
|
2
|
+
import { InstrumentConstraint } from '../InstrumentConstraint';
|
|
3
|
+
import { MetaInfo } from '../../MetaInfo';
|
|
4
|
+
export declare class TokenPayRequestBuilder {
|
|
5
|
+
private _merchantOrderId;
|
|
6
|
+
private _amount;
|
|
7
|
+
private _encryptionKeyId;
|
|
8
|
+
private _encryptedToken;
|
|
9
|
+
private _encryptedCvv;
|
|
10
|
+
private _cryptogram;
|
|
11
|
+
private _panSuffix;
|
|
12
|
+
private _expiryMonth;
|
|
13
|
+
private _expiryYear;
|
|
14
|
+
private _authMode?;
|
|
15
|
+
private _redirectUrl?;
|
|
16
|
+
private _cardHolderName?;
|
|
17
|
+
private _merchantUserId?;
|
|
18
|
+
private _metaInfo?;
|
|
19
|
+
private _constraints?;
|
|
20
|
+
private _expireAfter?;
|
|
21
|
+
/**
|
|
22
|
+
* SETTERS
|
|
23
|
+
*/
|
|
24
|
+
merchantOrderId: (merchantOrderId: string) => this;
|
|
25
|
+
amount: (amount: number) => this;
|
|
26
|
+
metaInfo: (metaInfo: MetaInfo) => this;
|
|
27
|
+
constraints: (constraints: InstrumentConstraint[]) => this;
|
|
28
|
+
encryptedToken: (encryptedToken: string) => this;
|
|
29
|
+
authMode: (authMode: string) => this;
|
|
30
|
+
encryptionKeyId: (encryptionKeyId: number) => this;
|
|
31
|
+
panSuffix: (panSuffix: string) => this;
|
|
32
|
+
cryptogram: (cryptogram: string) => this;
|
|
33
|
+
encryptedCvv: (encryptedCvv: string) => this;
|
|
34
|
+
expiryMonth: (expiryMonth: string) => this;
|
|
35
|
+
expiryYear: (expiryYear: string) => this;
|
|
36
|
+
redirectUrl: (redirectUrl: string) => this;
|
|
37
|
+
cardHolderName: (cardHolderName: string) => this;
|
|
38
|
+
merchantUserId: (merchantUserId: string) => this;
|
|
39
|
+
expireAfter: (expireAfter: number) => this;
|
|
40
|
+
build: () => CustomCheckoutPayRequest;
|
|
41
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
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.TokenPayRequestBuilder = void 0;
|
|
19
|
+
const CustomCheckoutPayRequest_1 = require("../../../../payments/v2/models/request/CustomCheckoutPayRequest");
|
|
20
|
+
const Expiry_1 = require("./Expiry");
|
|
21
|
+
const TokenDetails_1 = require("./TokenDetails");
|
|
22
|
+
const TokenPaymentV2Instrument_1 = require("./TokenPaymentV2Instrument");
|
|
23
|
+
const PgPaymentFlow_1 = require("../../../../payments/v2/models/request/PgPaymentFlow");
|
|
24
|
+
class TokenPayRequestBuilder {
|
|
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.encryptedToken = (encryptedToken) => {
|
|
46
|
+
this._encryptedToken = encryptedToken;
|
|
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.panSuffix = (panSuffix) => {
|
|
58
|
+
this._panSuffix = panSuffix;
|
|
59
|
+
return this;
|
|
60
|
+
};
|
|
61
|
+
this.cryptogram = (cryptogram) => {
|
|
62
|
+
this._cryptogram = cryptogram;
|
|
63
|
+
return this;
|
|
64
|
+
};
|
|
65
|
+
this.encryptedCvv = (encryptedCvv) => {
|
|
66
|
+
this._encryptedCvv = encryptedCvv;
|
|
67
|
+
return this;
|
|
68
|
+
};
|
|
69
|
+
this.expiryMonth = (expiryMonth) => {
|
|
70
|
+
this._expiryMonth = expiryMonth;
|
|
71
|
+
return this;
|
|
72
|
+
};
|
|
73
|
+
this.expiryYear = (expiryYear) => {
|
|
74
|
+
this._expiryYear = expiryYear;
|
|
75
|
+
return this;
|
|
76
|
+
};
|
|
77
|
+
this.redirectUrl = (redirectUrl) => {
|
|
78
|
+
this._redirectUrl = redirectUrl;
|
|
79
|
+
return this;
|
|
80
|
+
};
|
|
81
|
+
this.cardHolderName = (cardHolderName) => {
|
|
82
|
+
this._cardHolderName = cardHolderName;
|
|
83
|
+
return this;
|
|
84
|
+
};
|
|
85
|
+
this.merchantUserId = (merchantUserId) => {
|
|
86
|
+
this._merchantUserId = merchantUserId;
|
|
87
|
+
return this;
|
|
88
|
+
};
|
|
89
|
+
this.expireAfter = (expireAfter) => {
|
|
90
|
+
this._expireAfter = expireAfter;
|
|
91
|
+
return this;
|
|
92
|
+
};
|
|
93
|
+
this.build = () => {
|
|
94
|
+
const tokenDetails = TokenDetails_1.TokenDetails.builder()
|
|
95
|
+
.cardHolderName(this._cardHolderName)
|
|
96
|
+
.cryptogram(this._cryptogram)
|
|
97
|
+
.panSuffix(this._panSuffix)
|
|
98
|
+
.expiry(Expiry_1.Expiry.builder()
|
|
99
|
+
.expiryMonth(this._expiryMonth)
|
|
100
|
+
.expiryYear(this._expiryYear)
|
|
101
|
+
.build())
|
|
102
|
+
.encryptionKeyId(this._encryptionKeyId)
|
|
103
|
+
.encryptedToken(this._encryptedToken)
|
|
104
|
+
.encryptedCvv(this._encryptedCvv)
|
|
105
|
+
.build();
|
|
106
|
+
const paymentFlow = PgPaymentFlow_1.PgPaymentFlow.builder()
|
|
107
|
+
.paymentMode(TokenPaymentV2Instrument_1.TokenPaymentV2Instrument.builder()
|
|
108
|
+
.tokenDetails(tokenDetails)
|
|
109
|
+
.authMode(this._authMode)
|
|
110
|
+
.merchantUserId(this._merchantUserId)
|
|
111
|
+
.build())
|
|
112
|
+
.redirectUrl(this._redirectUrl)
|
|
113
|
+
.build();
|
|
114
|
+
return new CustomCheckoutPayRequest_1.CustomCheckoutPayRequest(this._merchantOrderId, this._amount, paymentFlow, this._expireAfter, this._metaInfo, this._constraints);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.TokenPayRequestBuilder = TokenPayRequestBuilder;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PaymentV2Instrument } from './PaymentV2Instrument';
|
|
2
|
+
import { TokenDetails } from './TokenDetails';
|
|
3
|
+
export declare class TokenPaymentV2Instrument extends PaymentV2Instrument {
|
|
4
|
+
tokenDetails: TokenDetails;
|
|
5
|
+
authMode?: string;
|
|
6
|
+
merchantUserId?: string;
|
|
7
|
+
constructor(tokenDetails: TokenDetails, authMode?: string, merchantUserId?: string);
|
|
8
|
+
static builder: () => TokenPaymentV2InstrumentBuilder;
|
|
9
|
+
}
|
|
10
|
+
declare class TokenPaymentV2InstrumentBuilder {
|
|
11
|
+
private _tokenDetails;
|
|
12
|
+
private _authMode?;
|
|
13
|
+
private _merchantUserId?;
|
|
14
|
+
tokenDetails: (tokenDetails: TokenDetails) => this;
|
|
15
|
+
authMode: (authMode?: string) => this;
|
|
16
|
+
merchantUserId: (merchantUserId?: string) => this;
|
|
17
|
+
build: () => TokenPaymentV2Instrument;
|
|
18
|
+
}
|
|
19
|
+
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.TokenPaymentV2Instrument = void 0;
|
|
19
|
+
const PgV2InstrumentType_1 = require("../../PgV2InstrumentType");
|
|
20
|
+
const PaymentV2Instrument_1 = require("./PaymentV2Instrument");
|
|
21
|
+
class TokenPaymentV2Instrument extends PaymentV2Instrument_1.PaymentV2Instrument {
|
|
22
|
+
constructor(tokenDetails, authMode, merchantUserId) {
|
|
23
|
+
super(PgV2InstrumentType_1.PgV2InstrumentType.TOKEN);
|
|
24
|
+
this.authMode = authMode;
|
|
25
|
+
this.tokenDetails = tokenDetails;
|
|
26
|
+
this.merchantUserId = merchantUserId;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.TokenPaymentV2Instrument = TokenPaymentV2Instrument;
|
|
30
|
+
TokenPaymentV2Instrument.builder = () => {
|
|
31
|
+
return new TokenPaymentV2InstrumentBuilder();
|
|
32
|
+
};
|
|
33
|
+
class TokenPaymentV2InstrumentBuilder {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.tokenDetails = (tokenDetails) => {
|
|
36
|
+
this._tokenDetails = tokenDetails;
|
|
37
|
+
return this;
|
|
38
|
+
};
|
|
39
|
+
this.authMode = (authMode) => {
|
|
40
|
+
this._authMode = authMode;
|
|
41
|
+
return this;
|
|
42
|
+
};
|
|
43
|
+
this.merchantUserId = (merchantUserId) => {
|
|
44
|
+
this._merchantUserId = merchantUserId;
|
|
45
|
+
return this;
|
|
46
|
+
};
|
|
47
|
+
this.build = () => {
|
|
48
|
+
return new TokenPaymentV2Instrument(this._tokenDetails, this._authMode, this._merchantUserId);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.d.ts
ADDED
|
@@ -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 UpiCollectPayViaPhoneNumberRequestBuilder {
|
|
5
|
+
private _merchantOrderId;
|
|
6
|
+
private _amount;
|
|
7
|
+
private _metaInfo?;
|
|
8
|
+
private _constraints?;
|
|
9
|
+
private _phoneNumber;
|
|
10
|
+
private _message?;
|
|
11
|
+
private _expireAfter?;
|
|
12
|
+
private _deviceOS?;
|
|
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
|
+
message: (message: string) => this;
|
|
21
|
+
phoneNumber: (phoneNumber: string) => this;
|
|
22
|
+
expireAfter: (expireAfter: number) => this;
|
|
23
|
+
deviceOS: (xDeviceOs: string) => this;
|
|
24
|
+
build: () => CustomCheckoutPayRequest;
|
|
25
|
+
}
|
package/dist/src/common/models/request/instruments/UpiCollectPayViaPhoneNumberRequestBuilder.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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.UpiCollectPayViaPhoneNumberRequestBuilder = void 0;
|
|
19
|
+
const CustomCheckoutPayRequest_1 = require("../../../../payments/v2/models/request/CustomCheckoutPayRequest");
|
|
20
|
+
const CollectPaymentV2Instrument_1 = require("./CollectPaymentV2Instrument");
|
|
21
|
+
const PhoneNumberCollectPaymentDetails_1 = require("./PhoneNumberCollectPaymentDetails");
|
|
22
|
+
const PgPaymentFlow_1 = require("../../../../payments/v2/models/request/PgPaymentFlow");
|
|
23
|
+
class UpiCollectPayViaPhoneNumberRequestBuilder {
|
|
24
|
+
constructor() {
|
|
25
|
+
/**
|
|
26
|
+
* SETTERS
|
|
27
|
+
*/
|
|
28
|
+
this.merchantOrderId = (merchantOrderId) => {
|
|
29
|
+
this._merchantOrderId = merchantOrderId;
|
|
30
|
+
return this;
|
|
31
|
+
};
|
|
32
|
+
this.amount = (amount) => {
|
|
33
|
+
this._amount = amount;
|
|
34
|
+
return this;
|
|
35
|
+
};
|
|
36
|
+
this.metaInfo = (metaInfo) => {
|
|
37
|
+
this._metaInfo = metaInfo;
|
|
38
|
+
return this;
|
|
39
|
+
};
|
|
40
|
+
this.constraints = (constraints) => {
|
|
41
|
+
this._constraints = constraints;
|
|
42
|
+
return this;
|
|
43
|
+
};
|
|
44
|
+
this.message = (message) => {
|
|
45
|
+
this._message = message;
|
|
46
|
+
return this;
|
|
47
|
+
};
|
|
48
|
+
this.phoneNumber = (phoneNumber) => {
|
|
49
|
+
this._phoneNumber = phoneNumber;
|
|
50
|
+
return this;
|
|
51
|
+
};
|
|
52
|
+
this.expireAfter = (expireAfter) => {
|
|
53
|
+
this._expireAfter = expireAfter;
|
|
54
|
+
return this;
|
|
55
|
+
};
|
|
56
|
+
this.deviceOS = (xDeviceOs) => {
|
|
57
|
+
this._deviceOS = xDeviceOs;
|
|
58
|
+
return this;
|
|
59
|
+
};
|
|
60
|
+
this.build = () => {
|
|
61
|
+
const paymentFlow = PgPaymentFlow_1.PgPaymentFlow.builder()
|
|
62
|
+
.paymentMode(CollectPaymentV2Instrument_1.CollectPaymentV2Instrument.builder()
|
|
63
|
+
.details(PhoneNumberCollectPaymentDetails_1.PhoneNumberCollectPaymentDetails.builder()
|
|
64
|
+
.phoneNumber(this._phoneNumber)
|
|
65
|
+
.build())
|
|
66
|
+
.message(this._message)
|
|
67
|
+
.build())
|
|
68
|
+
.build();
|
|
69
|
+
return new CustomCheckoutPayRequest_1.CustomCheckoutPayRequest(this._merchantOrderId, this._amount, paymentFlow, this._expireAfter, this._metaInfo, this._constraints, undefined, this._deviceOS);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.UpiCollectPayViaPhoneNumberRequestBuilder = UpiCollectPayViaPhoneNumberRequestBuilder;
|
|
@@ -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 UpiCollectPayViaVpaRequestBuilder {
|
|
5
|
+
private _merchantOrderId;
|
|
6
|
+
private _amount;
|
|
7
|
+
private _metaInfo?;
|
|
8
|
+
private _constraints?;
|
|
9
|
+
private _vpa;
|
|
10
|
+
private _message?;
|
|
11
|
+
private _expireAfter?;
|
|
12
|
+
private _deviceOS?;
|
|
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
|
+
message: (message: string) => this;
|
|
21
|
+
vpa: (vpa: string) => this;
|
|
22
|
+
expireAfter: (expireAfter: number) => this;
|
|
23
|
+
deviceOS: (xDeviceOs: string) => this;
|
|
24
|
+
build: () => CustomCheckoutPayRequest;
|
|
25
|
+
}
|