cybersource-rest-client 0.0.76 → 0.0.77
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/docs/AddNegativeListRequest.md +1 -1
- package/docs/Boardingv1registrationsIntegrationInformation.md +1 -0
- package/docs/Boardingv1registrationsIntegrationInformationMsd.md +8 -0
- package/docs/CheckPayerAuthEnrollmentRequest.md +1 -1
- package/docs/CreateSubscriptionRequest.md +1 -1
- package/docs/CreateSubscriptionRequest1.md +1 -1
- package/docs/FraudMarkingActionRequest.md +1 -1
- package/docs/GenerateUnifiedCheckoutV1CaptureContextRequest.md +20 -0
- package/docs/GetAllSubscriptionsResponseOrderInformation.md +1 -1
- package/docs/GetAllSubscriptionsResponseOrderInformationAmountDetails.md +11 -0
- package/docs/GetAllSubscriptionsResponseOrderInformationAmountDetailsSurcharge.md +8 -0
- package/docs/InlineResponse20016.md +2 -2
- package/docs/InlineResponse2005IntegrationInformation.md +1 -0
- package/docs/InlineResponse2011TokenizedCard.md +1 -1
- package/docs/InlineResponse2019.md +14 -0
- package/docs/InlineResponse2019ClientReferenceInformation.md +8 -0
- package/docs/{InlineResponse20016ErrorInformation.md → InlineResponse2019ErrorInformation.md} +1 -1
- package/docs/InlineResponse2019OrderInformation.md +8 -0
- package/docs/{InlineResponse20016OrderInformationCurrencyConversion.md → InlineResponse2019OrderInformationCurrencyConversion.md} +2 -2
- package/docs/{InlineResponse20016OrderInformationCurrencyConversionOffer.md → InlineResponse2019OrderInformationCurrencyConversionOffer.md} +1 -1
- package/docs/InlineResponse2019ProcessorInformation.md +8 -0
- package/docs/InlineResponse40010.md +13 -0
- package/docs/InlineResponse404.md +1 -2
- package/docs/InlineResponse4041.md +2 -5
- package/docs/InlineResponse4042.md +5 -5
- package/docs/{InlineResponse4041Details.md → InlineResponse4042Details.md} +1 -1
- package/docs/InlineResponse4043.md +5 -3
- package/docs/InlineResponse4044.md +3 -4
- package/docs/{InlineResponse4043Details.md → InlineResponse4044Details.md} +1 -1
- package/docs/InlineResponse4045.md +3 -3
- package/docs/InlineResponse4046.md +11 -0
- package/docs/InlineResponse404Errors.md +9 -0
- package/docs/{InlineResponse5004.md → InlineResponse5022.md} +1 -1
- package/docs/OfferRequest.md +11 -0
- package/docs/OffersApi.md +62 -0
- package/docs/PayerAuthSetupRequest.md +1 -1
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeatures.md +20 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesAfterPay.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesApplePay.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesBancontact.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesClickToPay.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesDecisionManager.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesDragonPay.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesECheck.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesGooglePay.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesIdeal.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesKonbini.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesMultibanco.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesMyBank.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesP24.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPayPal.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPayerAuthentication.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPortfolioAccessofSensitiveData.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesTinkPayByBank.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesTokenManagement.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesUnifiedClickToPaySDK.md +8 -0
- package/docs/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesVenmo.md +8 -0
- package/docs/PtsV2CreditsPost201Response.md +1 -0
- package/docs/PtsV2IncrementalAuthorizationPatch201ResponseErrorInformation.md +1 -1
- package/docs/PtsV2PaymentsCapturesPost201ResponseProcessorInformation.md +1 -1
- package/docs/PtsV2PaymentsPost201ResponseErrorInformation.md +1 -1
- package/docs/PtsV2PaymentsRefundPost201Response.md +1 -0
- package/docs/PtsV2PaymentsRefundPost201ResponseErrorInformation.md +10 -0
- package/docs/Ptsv1pullfundstransferAggregatorInformation.md +15 -0
- package/docs/Ptsv1pullfundstransferAggregatorInformationSubMerchant.md +8 -0
- package/docs/Ptsv1pullfundstransferClientReferenceInformation.md +11 -0
- package/docs/Ptsv1pullfundstransferMerchantInformation.md +8 -0
- package/docs/Ptsv1pullfundstransferMerchantInformationMerchantDescriptor.md +17 -0
- package/docs/Ptsv1pullfundstransferOrderInformation.md +9 -0
- package/docs/Ptsv1pullfundstransferOrderInformationAmountDetails.md +12 -0
- package/docs/Ptsv1pullfundstransferProcessingInformation.md +14 -0
- package/docs/Ptsv1pullfundstransferProcessingInformationFundingOptions.md +8 -0
- package/docs/Ptsv1pullfundstransferProcessingInformationFundingOptionsInitiator.md +11 -0
- package/docs/Ptsv1pullfundstransferProcessingInformationFundingOptionsInitiatorOriginatorInitiatedTransaction.md +9 -0
- package/docs/Ptsv1pullfundstransferProcessingInformationPayoutsOptions.md +8 -0
- package/docs/Ptsv1pullfundstransferProcessingInformationRecurringOptions.md +8 -0
- package/docs/Ptsv1pullfundstransferRecipientInformation.md +31 -0
- package/docs/Ptsv1pullfundstransferRecipientInformationPersonalIdentification.md +11 -0
- package/docs/Ptsv1pullfundstransferSenderInformation.md +31 -0
- package/docs/Ptsv1pullfundstransferSenderInformationAccount.md +9 -0
- package/docs/Ptsv1pullfundstransferSenderInformationConsumerAuthentication.md +9 -0
- package/docs/Ptsv1pullfundstransferSenderInformationConsumerAuthenticationStrongAuthentication.md +12 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformation.md +13 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformationCard.md +12 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformationCustomer.md +8 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformationInstrumentIdentifier.md +8 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformationPaymentInstrument.md +8 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPaymentInformationTokenizedCard.md +13 -0
- package/docs/Ptsv1pullfundstransferSenderInformationPersonalIdentification.md +11 -0
- package/docs/Ptsv1pullfundstransferidrefundOrderInformation.md +8 -0
- package/docs/Ptsv1pullfundstransferidrefundOrderInformationAmountDetails.md +8 -0
- package/docs/Ptsv1pullfundstransferidreversalReversalInformation.md +8 -0
- package/docs/Ptsv1pullfundstransferidreversalReversalInformationAmountDetails.md +8 -0
- package/docs/Ptsv1pushfundstransferMerchantInformation.md +2 -1
- package/docs/Ptsv1pushfundstransferMerchantInformationMerchantDescriptor.md +14 -0
- package/docs/Ptsv1pushfundstransferPaymentInformation.md +11 -0
- package/docs/Ptsv1pushfundstransferPaymentInformationCard.md +12 -0
- package/docs/Ptsv1pushfundstransferPaymentInformationCustomer.md +8 -0
- package/docs/Ptsv1pushfundstransferPaymentInformationInstrumentIdentifier.md +8 -0
- package/docs/Ptsv1pushfundstransferPaymentInformationPaymentInstrument.md +8 -0
- package/docs/Ptsv1pushfundstransferProcessingInformation.md +1 -0
- package/docs/Ptsv1pushfundstransferProcessingInformationPayoutsOptions.md +1 -1
- package/docs/Ptsv1pushfundstransferRecipientInformationPaymentInformationCard.md +1 -1
- package/docs/Ptsv2creditsProcessingInformation.md +1 -0
- package/docs/Ptsv2creditsSenderInformation.md +1 -0
- package/docs/Ptsv2paymentsProcessingInformation.md +1 -0
- package/docs/Ptsv2paymentsidrefundsProcessingInformation.md +1 -0
- package/docs/Ptsv2payoutsProcessingInformationPayoutsOptions.md +1 -1
- package/docs/PullFunds201Response.md +14 -0
- package/docs/PullFunds201ResponseErrorInformation.md +10 -0
- package/docs/PullFunds201ResponseErrorInformationDetails.md +9 -0
- package/docs/PullFunds201ResponseLinks.md +13 -0
- package/docs/PullFunds201ResponseLinksCustomer.md +9 -0
- package/docs/PullFunds201ResponseLinksInstrumentIdentifier.md +9 -0
- package/docs/PullFunds201ResponseLinksPaymentInstrument.md +9 -0
- package/docs/PullFunds201ResponseLinksRefund.md +9 -0
- package/docs/PullFunds201ResponseLinksReversal.md +9 -0
- package/docs/PullFunds201ResponseLinksSelf.md +9 -0
- package/docs/PullFunds201ResponseOrderInformation.md +8 -0
- package/docs/PullFunds201ResponseOrderInformationAmountDetails.md +9 -0
- package/docs/PullFunds201ResponseProcessorInformation.md +15 -0
- package/docs/PullFunds201ResponseProcessorInformationAvs.md +8 -0
- package/docs/PullFunds201ResponseProcessorInformationConsumerAuthenticationResponse.md +8 -0
- package/docs/PullFundsApi.md +209 -0
- package/docs/PullFundsRefund201Response.md +13 -0
- package/docs/PullFundsRefund201ResponseLinks.md +8 -0
- package/docs/PullFundsRefund201ResponseLinksSelf.md +9 -0
- package/docs/PullFundsRefund201ResponseProcessorInformation.md +9 -0
- package/docs/PullFundsRefundRequest.md +9 -0
- package/docs/PullFundsRequest.md +14 -0
- package/docs/PullFundsReversal201Response.md +13 -0
- package/docs/PullFundsReversal201ResponseErrorInformation.md +10 -0
- package/docs/PullFundsReversal201ResponseErrorInformationDetails.md +9 -0
- package/docs/PullFundsReversal201ResponseLinks.md +8 -0
- package/docs/PullFundsReversal201ResponseLinksSelf.md +9 -0
- package/docs/PullFundsReversal201ResponseProcessorInformation.md +11 -0
- package/docs/PullFundsReversal400Response.md +13 -0
- package/docs/PullFundsReversalRequest.md +9 -0
- package/docs/PushFunds201ResponseErrorInformation.md +1 -1
- package/docs/PushFunds201ResponseProcessorInformation.md +1 -0
- package/docs/PushFunds201ResponseProcessorInformationMerchantAdvice.md +9 -0
- package/docs/PushFundsRequest.md +1 -0
- package/docs/Rbsv1subscriptionsOrderInformation.md +8 -0
- package/docs/Rbsv1subscriptionsidOrderInformationAmountDetails.md +1 -0
- package/docs/Riskv1addressverificationsOrderInformationLineItems.md +1 -1
- package/docs/Riskv1decisionsClientReferenceInformation.md +1 -1
- package/docs/Riskv1decisionsOrderInformationLineItems.md +1 -1
- package/docs/Riskv1liststypeentriesOrderInformationLineItems.md +1 -1
- package/docs/SaveAsymEgressKey.md +1 -1
- package/docs/TmsBinLookupPaymentAccountInformationFeatures.md +4 -1
- package/docs/Tmsv2TokenizedCard.md +1 -1
- package/docs/Tmsv2tokenizeProcessingInformation.md +1 -1
- package/docs/{TransientTokenDataApi.md → TransientTokenDataV2Api.md} +54 -7
- package/docs/Ucv1sessionsAppearance.md +9 -0
- package/docs/Ucv1sessionsAppearanceVariables.md +72 -0
- package/docs/Ucv1sessionsCaptureMandate.md +17 -0
- package/docs/Ucv1sessionsCaptureMandateCPF.md +8 -0
- package/docs/Ucv1sessionsCompleteMandate.md +11 -0
- package/docs/Ucv1sessionsCompleteMandateTms.md +9 -0
- package/docs/Ucv1sessionsData.md +17 -0
- package/docs/Ucv1sessionsDataBuyerInformation.md +12 -0
- package/docs/Ucv1sessionsDataBuyerInformationPersonalIdentification.md +10 -0
- package/docs/Ucv1sessionsDataConsumerAuthenticationInformation.md +10 -0
- package/docs/Ucv1sessionsDataDeviceInformation.md +8 -0
- package/docs/Ucv1sessionsDataMerchantDefinedInformation.md +9 -0
- package/docs/Ucv1sessionsDataMerchantInformation.md +8 -0
- package/docs/Ucv1sessionsDataMerchantInformationMerchantDescriptor.md +15 -0
- package/docs/Ucv1sessionsDataOrderInformation.md +12 -0
- package/docs/Ucv1sessionsDataOrderInformationAmountDetails.md +15 -0
- package/docs/Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails.md +9 -0
- package/docs/Ucv1sessionsDataOrderInformationBillTo.md +26 -0
- package/docs/Ucv1sessionsDataOrderInformationBillToCompany.md +14 -0
- package/docs/Ucv1sessionsDataPaymentInformation.md +8 -0
- package/docs/Ucv1sessionsDataPaymentInformationCard.md +8 -0
- package/docs/Ucv1sessionsDataProcessingInformation.md +12 -0
- package/docs/Ucv1sessionsDataProcessingInformationAuthorizationOptions.md +12 -0
- package/docs/Ucv1sessionsDataProcessingInformationAuthorizationOptionsInitiator.md +9 -0
- package/docs/Ucv1sessionsDataRecipientInformation.md +16 -0
- package/docs/Ucv1sessionsPaymentConfigurations.md +10 -0
- package/docs/Ucv1sessionsPaymentConfigurationsCLICKTOPAY.md +8 -0
- package/docs/Ucv1sessionsPaymentConfigurationsGOOGLEPAY.md +8 -0
- package/docs/Ucv1sessionsPaymentConfigurationsTMSTOKEN.md +10 -0
- package/docs/Ucv1sessionsPaymentConfigurationsTMSTOKENCustomer.md +8 -0
- package/docs/Ucv1sessionsPaymentConfigurationsTMSTOKENInstrumentIdentifiers.md +8 -0
- package/docs/Ucv1sessionsPaymentConfigurationsTMSTOKENPaymentInstruments.md +8 -0
- package/docs/Ucv1sessionsTransientTokenResponseOptions.md +8 -0
- package/docs/UnifiedCheckoutV1CaptureContextApi.md +55 -0
- package/docs/Upv1capturecontextsDataOrderInformationBillToCompany.md +3 -3
- package/docs/Upv1capturecontextsOrderInformation.md +1 -1
- package/docs/Upv1capturecontextsOrderInformationBillTo.md +26 -0
- package/docs/Upv1capturecontextsOrderInformationBillToCompany.md +18 -0
- package/docs/ValidateExportComplianceRequest.md +1 -1
- package/docs/ValidateRequest.md +1 -1
- package/docs/Vasv1currencyconversionClientReferenceInformation.md +12 -0
- package/docs/Vasv1currencyconversionClientReferenceInformationPartner.md +9 -0
- package/docs/Vasv1currencyconversionOrderInformation.md +9 -0
- package/docs/Vasv1currencyconversionOrderInformationAmountDetails.md +9 -0
- package/docs/Vasv1currencyconversionOrderInformationCurrencyConversion.md +8 -0
- package/docs/Vasv1currencyconversionPaymentInformation.md +8 -0
- package/docs/Vasv1currencyconversionPaymentInformationCard.md +8 -0
- package/docs/Vasv1currencyconversionPointOfSaleInformation.md +9 -0
- package/docs/VerifyCustomerAddressRequest.md +1 -1
- package/package.json +5 -2
- package/src/api/BankAccountValidationApi.js +4 -4
- package/src/api/CustomerApi.js +4 -4
- package/src/api/CustomerPaymentInstrumentApi.js +4 -4
- package/src/api/CustomerShippingAddressApi.js +4 -4
- package/src/api/DeviceDeAssociationApi.js +4 -4
- package/src/api/DeviceSearchApi.js +4 -4
- package/src/api/InstrumentIdentifierApi.js +4 -4
- package/src/api/ManageWebhooksApi.js +4 -4
- package/src/api/MerchantBoardingApi.js +4 -4
- package/src/api/MerchantDefinedFieldsApi.js +4 -4
- package/src/api/OffersApi.js +107 -4
- package/src/api/PaymentInstrumentApi.js +4 -4
- package/src/api/PlansApi.js +4 -4
- package/src/api/PullFundsApi.js +392 -0
- package/src/api/SubscriptionsApi.js +4 -4
- package/src/api/SubscriptionsFollowOnsApi.js +4 -4
- package/src/api/TokenApi.js +4 -4
- package/src/api/TokenizedCardApi.js +4 -4
- package/src/api/{TransientTokenDataApi.js → TransientTokenDataV2Api.js} +75 -10
- package/src/api/UnifiedCheckoutV1CaptureContextApi.js +120 -0
- package/src/authentication/core/MerchantConfig.js +7 -1
- package/src/authentication/jwt/JWTSigToken.js +104 -32
- package/src/authentication/util/Constants.js +1 -0
- package/src/index.js +761 -56
- package/src/model/AddNegativeListRequest.js +6 -6
- package/src/model/Boardingv1registrationsIntegrationInformation.js +12 -4
- package/src/model/Boardingv1registrationsIntegrationInformationMsd.js +82 -0
- package/src/model/CheckPayerAuthEnrollmentRequest.js +6 -6
- package/src/model/CreateSubscriptionRequest.js +6 -6
- package/src/model/CreateSubscriptionRequest1.js +6 -6
- package/src/model/FraudMarkingActionRequest.js +6 -6
- package/src/model/GenerateUnifiedCheckoutV1CaptureContextRequest.js +184 -0
- package/src/model/GetAllSubscriptionsResponseOrderInformation.js +6 -6
- package/src/model/GetAllSubscriptionsResponseOrderInformationAmountDetails.js +108 -0
- package/src/model/GetAllSubscriptionsResponseOrderInformationAmountDetailsSurcharge.js +82 -0
- package/src/model/InlineResponse20016.js +8 -8
- package/src/model/InlineResponse2005IntegrationInformation.js +12 -4
- package/src/model/InlineResponse2011TokenizedCard.js +1 -1
- package/src/model/InlineResponse2019.js +135 -0
- package/src/model/{Kmsegressv2keysasymClientReferenceInformation.js → InlineResponse2019ClientReferenceInformation.js} +9 -10
- package/src/model/{InlineResponse20016ErrorInformation.js → InlineResponse2019ErrorInformation.js} +8 -8
- package/src/model/InlineResponse2019OrderInformation.js +81 -0
- package/src/model/{InlineResponse20016OrderInformationCurrencyConversion.js → InlineResponse2019OrderInformationCurrencyConversion.js} +13 -13
- package/src/model/{InlineResponse20016OrderInformationCurrencyConversionOffer.js → InlineResponse2019OrderInformationCurrencyConversionOffer.js} +8 -8
- package/src/model/InlineResponse2019ProcessorInformation.js +82 -0
- package/src/model/InlineResponse40010.js +129 -0
- package/src/model/InlineResponse404.js +8 -18
- package/src/model/InlineResponse4041.js +8 -35
- package/src/model/InlineResponse4042.js +15 -14
- package/src/model/{InlineResponse4041Details.js → InlineResponse4042Details.js} +8 -8
- package/src/model/InlineResponse4043.js +26 -6
- package/src/model/InlineResponse4044.js +12 -24
- package/src/model/{InlineResponse4043Details.js → InlineResponse4044Details.js} +8 -8
- package/src/model/InlineResponse4045.js +17 -17
- package/src/model/InlineResponse4046.js +109 -0
- package/src/model/InlineResponse404Errors.js +91 -0
- package/src/model/{InlineResponse5004.js → InlineResponse5022.js} +8 -8
- package/src/model/OfferRequest.js +105 -0
- package/src/model/PayerAuthSetupRequest.js +6 -6
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeatures.js +164 -4
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesAfterPay.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesApplePay.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesBancontact.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesClickToPay.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesDecisionManager.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesDragonPay.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesECheck.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesGooglePay.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesIdeal.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesKonbini.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesMultibanco.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesMyBank.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesP24.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPayPal.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPayerAuthentication.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesPortfolioAccessofSensitiveData.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesTinkPayByBank.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesTokenManagement.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesUnifiedClickToPaySDK.js +82 -0
- package/src/model/PaymentsProductsUnifiedCheckoutSubscriptionInformationFeaturesVenmo.js +82 -0
- package/src/model/PtsV2CreditsPost201Response.js +12 -4
- package/src/model/PtsV2IncrementalAuthorizationPatch201ResponseErrorInformation.js +1 -1
- package/src/model/PtsV2PaymentsCapturesPost201ResponseProcessorInformation.js +1 -1
- package/src/model/PtsV2PaymentsPost201ResponseErrorInformation.js +1 -1
- package/src/model/PtsV2PaymentsRefundPost201Response.js +12 -4
- package/src/model/PtsV2PaymentsRefundPost201ResponseErrorInformation.js +99 -0
- package/src/model/Ptsv1pullfundstransferAggregatorInformation.js +144 -0
- package/src/model/Ptsv1pullfundstransferAggregatorInformationSubMerchant.js +82 -0
- package/src/model/Ptsv1pullfundstransferClientReferenceInformation.js +109 -0
- package/src/model/Ptsv1pullfundstransferMerchantInformation.js +81 -0
- package/src/model/Ptsv1pullfundstransferMerchantInformationMerchantDescriptor.js +163 -0
- package/src/model/Ptsv1pullfundstransferOrderInformation.js +90 -0
- package/src/model/Ptsv1pullfundstransferOrderInformationAmountDetails.js +119 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformation.js +134 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformationFundingOptions.js +81 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformationFundingOptionsInitiator.js +108 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformationFundingOptionsInitiatorOriginatorInitiatedTransaction.js +91 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformationPayoutsOptions.js +82 -0
- package/src/model/Ptsv1pullfundstransferProcessingInformationRecurringOptions.js +82 -0
- package/src/model/Ptsv1pullfundstransferRecipientInformation.js +288 -0
- package/src/model/Ptsv1pullfundstransferRecipientInformationPersonalIdentification.js +109 -0
- package/src/model/Ptsv1pullfundstransferSenderInformation.js +285 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationAccount.js +91 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationConsumerAuthentication.js +90 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationConsumerAuthenticationStrongAuthentication.js +118 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformation.js +122 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformationCard.js +118 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformationCustomer.js +82 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformationInstrumentIdentifier.js +82 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformationPaymentInstrument.js +82 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPaymentInformationTokenizedCard.js +127 -0
- package/src/model/Ptsv1pullfundstransferSenderInformationPersonalIdentification.js +109 -0
- package/src/model/Ptsv1pullfundstransferidrefundOrderInformation.js +82 -0
- package/src/model/Ptsv1pullfundstransferidrefundOrderInformationAmountDetails.js +83 -0
- package/src/model/Ptsv1pullfundstransferidreversalReversalInformation.js +82 -0
- package/src/model/Ptsv1pullfundstransferidreversalReversalInformationAmountDetails.js +83 -0
- package/src/model/Ptsv1pushfundstransferMerchantInformation.js +14 -6
- package/src/model/Ptsv1pushfundstransferMerchantInformationMerchantDescriptor.js +136 -0
- package/src/model/Ptsv1pushfundstransferPaymentInformation.js +105 -0
- package/src/model/Ptsv1pushfundstransferPaymentInformationCard.js +118 -0
- package/src/model/Ptsv1pushfundstransferPaymentInformationCustomer.js +82 -0
- package/src/model/Ptsv1pushfundstransferPaymentInformationInstrumentIdentifier.js +82 -0
- package/src/model/Ptsv1pushfundstransferPaymentInformationPaymentInstrument.js +82 -0
- package/src/model/Ptsv1pushfundstransferProcessingInformation.js +9 -0
- package/src/model/Ptsv1pushfundstransferProcessingInformationPayoutsOptions.js +1 -1
- package/src/model/Ptsv1pushfundstransferRecipientInformationPaymentInformationCard.js +1 -1
- package/src/model/Ptsv2creditsProcessingInformation.js +9 -0
- package/src/model/Ptsv2creditsSenderInformation.js +9 -0
- package/src/model/Ptsv2paymentsProcessingInformation.js +9 -0
- package/src/model/Ptsv2paymentsidrefundsProcessingInformation.js +9 -0
- package/src/model/Ptsv2payoutsProcessingInformationPayoutsOptions.js +1 -1
- package/src/model/PullFunds201Response.js +132 -0
- package/src/model/PullFunds201ResponseErrorInformation.js +99 -0
- package/src/model/PullFunds201ResponseErrorInformationDetails.js +91 -0
- package/src/model/PullFunds201ResponseLinks.js +121 -0
- package/src/model/PullFunds201ResponseLinksCustomer.js +92 -0
- package/src/model/PullFunds201ResponseLinksInstrumentIdentifier.js +92 -0
- package/src/model/PullFunds201ResponseLinksPaymentInstrument.js +92 -0
- package/src/model/PullFunds201ResponseLinksRefund.js +92 -0
- package/src/model/PullFunds201ResponseLinksReversal.js +92 -0
- package/src/model/PullFunds201ResponseLinksSelf.js +92 -0
- package/src/model/PullFunds201ResponseOrderInformation.js +81 -0
- package/src/model/PullFunds201ResponseOrderInformationAmountDetails.js +91 -0
- package/src/model/PullFunds201ResponseProcessorInformation.js +143 -0
- package/src/model/PullFunds201ResponseProcessorInformationAvs.js +82 -0
- package/src/model/PullFunds201ResponseProcessorInformationConsumerAuthenticationResponse.js +82 -0
- package/src/model/PullFundsRefund201Response.js +124 -0
- package/src/model/PullFundsRefund201ResponseLinks.js +81 -0
- package/src/model/PullFundsRefund201ResponseLinksSelf.js +92 -0
- package/src/model/PullFundsRefund201ResponseProcessorInformation.js +91 -0
- package/src/model/PullFundsRefundRequest.js +90 -0
- package/src/model/PullFundsRequest.js +129 -0
- package/src/model/PullFundsReversal201Response.js +124 -0
- package/src/model/PullFundsReversal201ResponseErrorInformation.js +99 -0
- package/src/model/PullFundsReversal201ResponseErrorInformationDetails.js +91 -0
- package/src/model/PullFundsReversal201ResponseLinks.js +81 -0
- package/src/model/PullFundsReversal201ResponseLinksSelf.js +92 -0
- package/src/model/PullFundsReversal201ResponseProcessorInformation.js +109 -0
- package/src/model/PullFundsReversal400Response.js +126 -0
- package/src/model/PullFundsReversalRequest.js +90 -0
- package/src/model/PushFunds201ResponseErrorInformation.js +1 -1
- package/src/model/PushFunds201ResponseProcessorInformation.js +12 -4
- package/src/model/PushFunds201ResponseProcessorInformationMerchantAdvice.js +91 -0
- package/src/model/PushFundsRequest.js +12 -4
- package/src/model/Rbsv1subscriptionsOrderInformation.js +81 -0
- package/src/model/Rbsv1subscriptionsidOrderInformationAmountDetails.js +12 -4
- package/src/model/Riskv1addressverificationsOrderInformationLineItems.js +3 -4
- package/src/model/Riskv1decisionsClientReferenceInformation.js +2 -3
- package/src/model/Riskv1decisionsOrderInformationLineItems.js +1 -1
- package/src/model/Riskv1liststypeentriesOrderInformationLineItems.js +1 -1
- package/src/model/SaveAsymEgressKey.js +6 -6
- package/src/model/TmsBinLookupPaymentAccountInformationFeatures.js +28 -1
- package/src/model/Tmsv2TokenizedCard.js +1 -1
- package/src/model/Tmsv2tokenizeProcessingInformation.js +1 -1
- package/src/model/Ucv1sessionsAppearance.js +91 -0
- package/src/model/Ucv1sessionsAppearanceVariables.js +659 -0
- package/src/model/Ucv1sessionsCaptureMandate.js +162 -0
- package/src/model/Ucv1sessionsCaptureMandateCPF.js +82 -0
- package/src/model/Ucv1sessionsCompleteMandate.js +109 -0
- package/src/model/Ucv1sessionsCompleteMandateTms.js +92 -0
- package/src/model/Ucv1sessionsData.js +153 -0
- package/src/model/Ucv1sessionsDataBuyerInformation.js +117 -0
- package/src/model/Ucv1sessionsDataBuyerInformationPersonalIdentification.js +100 -0
- package/src/model/Ucv1sessionsDataConsumerAuthenticationInformation.js +100 -0
- package/src/model/Ucv1sessionsDataDeviceInformation.js +82 -0
- package/src/model/Ucv1sessionsDataMerchantDefinedInformation.js +92 -0
- package/src/model/{InlineResponse20016OrderInformation.js → Ucv1sessionsDataMerchantInformation.js} +15 -15
- package/src/model/Ucv1sessionsDataMerchantInformationMerchantDescriptor.js +145 -0
- package/src/model/Ucv1sessionsDataOrderInformation.js +113 -0
- package/src/model/Ucv1sessionsDataOrderInformationAmountDetails.js +143 -0
- package/src/model/Ucv1sessionsDataOrderInformationAmountDetailsTaxDetails.js +91 -0
- package/src/model/Ucv1sessionsDataOrderInformationBillTo.js +243 -0
- package/src/model/Ucv1sessionsDataOrderInformationBillToCompany.js +136 -0
- package/src/model/Ucv1sessionsDataPaymentInformation.js +81 -0
- package/src/model/Ucv1sessionsDataPaymentInformationCard.js +82 -0
- package/src/model/Ucv1sessionsDataProcessingInformation.js +117 -0
- package/src/model/Ucv1sessionsDataProcessingInformationAuthorizationOptions.js +117 -0
- package/src/model/Ucv1sessionsDataProcessingInformationAuthorizationOptionsInitiator.js +90 -0
- package/src/model/Ucv1sessionsDataRecipientInformation.js +151 -0
- package/src/model/Ucv1sessionsPaymentConfigurations.js +98 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsCLICKTOPAY.js +82 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsGOOGLEPAY.js +82 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsTMSTOKEN.js +100 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsTMSTOKENCustomer.js +82 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsTMSTOKENInstrumentIdentifiers.js +81 -0
- package/src/model/Ucv1sessionsPaymentConfigurationsTMSTOKENPaymentInstruments.js +81 -0
- package/src/model/Ucv1sessionsTransientTokenResponseOptions.js +82 -0
- package/src/model/Upv1capturecontextsDataOrderInformationBillToCompany.js +10 -10
- package/src/model/Upv1capturecontextsOrderInformation.js +6 -6
- package/src/model/Upv1capturecontextsOrderInformationBillTo.js +243 -0
- package/src/model/Upv1capturecontextsOrderInformationBillToCompany.js +172 -0
- package/src/model/ValidateExportComplianceRequest.js +6 -6
- package/src/model/ValidateRequest.js +6 -6
- package/src/model/Vasv1currencyconversionClientReferenceInformation.js +117 -0
- package/src/model/Vasv1currencyconversionClientReferenceInformationPartner.js +91 -0
- package/src/model/Vasv1currencyconversionOrderInformation.js +89 -0
- package/src/model/Vasv1currencyconversionOrderInformationAmountDetails.js +91 -0
- package/src/model/Vasv1currencyconversionOrderInformationCurrencyConversion.js +83 -0
- package/src/model/Vasv1currencyconversionPaymentInformation.js +81 -0
- package/src/model/Vasv1currencyconversionPaymentInformationCard.js +82 -0
- package/src/model/Vasv1currencyconversionPointOfSaleInformation.js +91 -0
- package/src/model/VerifyCustomerAddressRequest.js +6 -6
- package/docs/InlineResponse20016OrderInformation.md +0 -8
- package/docs/Kmsegressv2keysasymClientReferenceInformation.md +0 -8
- package/docs/Riskv1authenticationsetupsClientReferenceInformation.md +0 -11
- package/docs/Riskv1liststypeentriesClientReferenceInformation.md +0 -10
- package/src/model/Riskv1authenticationsetupsClientReferenceInformation.js +0 -108
- package/src/model/Riskv1liststypeentriesClientReferenceInformation.js +0 -100
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CyberSource Merged Spec
|
|
3
|
+
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
4
|
+
*
|
|
5
|
+
* OpenAPI spec version: 0.0.1
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This class is auto generated by the swagger code generator program.
|
|
8
|
+
* https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
*
|
|
10
|
+
* Swagger Codegen version: 2.4.38
|
|
11
|
+
*
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
(function(root, factory) {
|
|
17
|
+
if (typeof define === 'function' && define.amd) {
|
|
18
|
+
// AMD. Register as an anonymous module.
|
|
19
|
+
define(['Authentication/MLEUtility', 'ApiClient', 'model/GenerateUnifiedCheckoutV1CaptureContextRequest', 'model/InlineResponse4001'], factory);
|
|
20
|
+
} else if (typeof module === 'object' && module.exports) {
|
|
21
|
+
// CommonJS-like environments that support module.exports, like Node.
|
|
22
|
+
module.exports = factory(require('../authentication/util/MLEUtility'), require('../ApiClient'), require('../model/GenerateUnifiedCheckoutV1CaptureContextRequest'), require('../model/InlineResponse4001'));
|
|
23
|
+
} else {
|
|
24
|
+
// Browser globals (root is window)
|
|
25
|
+
if (!root.CyberSource) {
|
|
26
|
+
root.CyberSource = {};
|
|
27
|
+
}
|
|
28
|
+
root.CyberSource.UnifiedCheckoutV1CaptureContextApi = factory(root.Authentication.MLEUtility, root.CyberSource.ApiClient, root.CyberSource.GenerateUnifiedCheckoutV1CaptureContextRequest, root.CyberSource.InlineResponse4001);
|
|
29
|
+
}
|
|
30
|
+
}(this, function(MLEUtility, ApiClient, GenerateUnifiedCheckoutV1CaptureContextRequest, InlineResponse4001) {
|
|
31
|
+
'use strict';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* UnifiedCheckoutV1CaptureContext service.
|
|
35
|
+
* @module api/UnifiedCheckoutV1CaptureContextApi
|
|
36
|
+
* @version 0.0.1
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new UnifiedCheckoutV1CaptureContextApi.
|
|
41
|
+
* @alias module:api/UnifiedCheckoutV1CaptureContextApi
|
|
42
|
+
* @class
|
|
43
|
+
* @param {module:ApiClient} apiClient Optional API client implementation to use,
|
|
44
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
45
|
+
*/
|
|
46
|
+
var exports = function(configObject, apiClient) {
|
|
47
|
+
this.apiClient = apiClient || ApiClient.instance;
|
|
48
|
+
|
|
49
|
+
this.apiClient.setConfiguration(configObject);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Callback function to receive the result of the generateUnifiedCheckoutV1CaptureContext operation.
|
|
54
|
+
* @callback module:api/UnifiedCheckoutV1CaptureContextApi~generateUnifiedCheckoutV1CaptureContextCallback
|
|
55
|
+
* @param {String} error Error message, if any.
|
|
56
|
+
* @param {'String'} data The data returned by the service call.
|
|
57
|
+
* @param {String} response The complete HTTP response.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generate Unified Checkout V1 Capture Context
|
|
62
|
+
* Unified Checkout is a powerful product within the Digital Acceptance Suite. Unified Checkout is designed to assist merchants with the adoption and inclusion of digital payments within their payment acceptance page. With Unified Checkout Integration you can add digital payment methods to create familiar, convenient and seamless payment experiences that are designed to reduce checkout friction and increase conversions. Click to Pay Drop-in UI is built on the Unified Checkout platform. For more information about Unified Checkout, see the [Unified Checkout Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-intro.html). For examples on how to integrate Unified Checkout within your webpage please see our [GitHub Unified Checkout Samples](https://github.com/CyberSource/cybersource-unified-checkout-sample-java). Generate Unified Checkout V1 Capture Context Generate a one-time use capture context used for the invocation of Unified Checkout. The Request wil contain all of the parameters for how Unified Checkout will operate within a client webpage. The resulting payload will be a JWT signed object that can be used to initiate Unified Checkout or Click to Pay Drop-in UI within a web page
|
|
63
|
+
* @param {module:model/GenerateUnifiedCheckoutV1CaptureContextRequest} generateUnifiedCheckoutV1CaptureContextRequest
|
|
64
|
+
* @param {module:api/UnifiedCheckoutV1CaptureContextApi~generateUnifiedCheckoutV1CaptureContextCallback} callback The callback function, accepting three arguments: error, data, response
|
|
65
|
+
* data is of type: {@link 'String'}
|
|
66
|
+
*/
|
|
67
|
+
this.generateUnifiedCheckoutV1CaptureContext = function(generateUnifiedCheckoutV1CaptureContextRequest, callback) {
|
|
68
|
+
var postBody = generateUnifiedCheckoutV1CaptureContextRequest;
|
|
69
|
+
|
|
70
|
+
// verify the required parameter 'generateUnifiedCheckoutV1CaptureContextRequest' is set
|
|
71
|
+
if (generateUnifiedCheckoutV1CaptureContextRequest === undefined || generateUnifiedCheckoutV1CaptureContextRequest === null) {
|
|
72
|
+
throw new Error("Missing the required parameter 'generateUnifiedCheckoutV1CaptureContextRequest' when calling generateUnifiedCheckoutV1CaptureContext");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var SdkTracker = require('../utilities/tracking/SdkTracker');
|
|
76
|
+
|
|
77
|
+
var sdkTracker = new SdkTracker();
|
|
78
|
+
postBody = sdkTracker.insertDeveloperIdTracker(postBody, 'module:model/GenerateUnifiedCheckoutV1CaptureContextRequest', this.apiClient.merchantConfig.runEnvironment, this.apiClient.merchantConfig.defaultDeveloperId);
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
var pathParams = {
|
|
82
|
+
};
|
|
83
|
+
var queryParams = {
|
|
84
|
+
};
|
|
85
|
+
var headerParams = {
|
|
86
|
+
};
|
|
87
|
+
var formParams = {
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var authNames = [];
|
|
92
|
+
var contentTypes = ['application/json;charset=utf-8'];
|
|
93
|
+
var accepts = ['application/jwt'];
|
|
94
|
+
var returnType = 'String';
|
|
95
|
+
|
|
96
|
+
//check isMLE for an api method 'this.generateUnifiedCheckoutV1CaptureContext'
|
|
97
|
+
var inboundMLEStatus = 'false';
|
|
98
|
+
var isMLEForApi = MLEUtility.checkIsMLEForAPI(this.apiClient.merchantConfig, inboundMLEStatus, 'generateUnifiedCheckoutV1CaptureContext');
|
|
99
|
+
const isResponseMLEForApi = MLEUtility.checkIsResponseMLEForAPI(this.apiClient.merchantConfig, ['generateUnifiedCheckoutV1CaptureContext']);
|
|
100
|
+
|
|
101
|
+
if (isMLEForApi === true) {
|
|
102
|
+
MLEUtility.encryptRequestPayload(this.apiClient.merchantConfig, postBody).then(postBody => {
|
|
103
|
+
return this.apiClient.callApi(
|
|
104
|
+
'/uc/v1/sessions', 'POST',
|
|
105
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
106
|
+
authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
return this.apiClient.callApi(
|
|
111
|
+
'/uc/v1/sessions', 'POST',
|
|
112
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
113
|
+
authNames, contentTypes, accepts, returnType, isResponseMLEForApi, callback
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return exports;
|
|
120
|
+
}));
|
|
@@ -645,6 +645,9 @@ MerchantConfig.prototype.defaultPropValues = function defaultPropValues() {
|
|
|
645
645
|
{
|
|
646
646
|
ApiException.ApiException(Constants.PORTFOLIO_ID_REQ, logger);
|
|
647
647
|
}
|
|
648
|
+
else if (this.useMetaKey && typeof (this.portfolioID) !== "string") {
|
|
649
|
+
this.portfolioID = this.portfolioID.toString();
|
|
650
|
+
}
|
|
648
651
|
|
|
649
652
|
if (typeof (this.disableSSLVerification) !== "boolean") {
|
|
650
653
|
this.disableSSLVerification = false;
|
|
@@ -730,9 +733,12 @@ MerchantConfig.prototype.defaultPropValues = function defaultPropValues() {
|
|
|
730
733
|
this.keyAlias = this.merchantID;
|
|
731
734
|
logger.warn(Constants.KEY_ALIAS_NULL_EMPTY);
|
|
732
735
|
}
|
|
733
|
-
|
|
736
|
+
if (!this.useMetaKey && this.keyAlias !== this.merchantID) {
|
|
734
737
|
this.keyAlias = this.merchantID;
|
|
735
738
|
logger.warn(Constants.INCORRECT_KEY_ALIAS);
|
|
739
|
+
} else if (this.useMetaKey && this.keyAlias !== this.portfolioID) {
|
|
740
|
+
this.keyAlias = this.portfolioID;
|
|
741
|
+
logger.warn(Constants.INCORRECT_KEY_ALIAS_FOR_METAKEY);
|
|
736
742
|
}
|
|
737
743
|
|
|
738
744
|
if (this.keyPass === null || this.keyPass === "" || this.keyPass === undefined) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const Jwt = require('jwt-simple');
|
|
4
4
|
const Constants = require('../util/Constants');
|
|
5
5
|
const KeyCertificate = require('./KeyCertificateGenerator');
|
|
6
|
-
const DigestGenerator = require('../payloadDigest/DigestGenerator');
|
|
7
6
|
const MLEUtility = require('../util/MLEUtility');
|
|
8
7
|
|
|
9
8
|
// Constants for algorithms
|
|
@@ -20,6 +19,107 @@ const DIGEST_ALGORITHM = 'SHA-256';
|
|
|
20
19
|
* @module authentication/jwt/JWTSigToken
|
|
21
20
|
*/
|
|
22
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Generates the payload claim set for the JWT token based on the merchant configuration and request details.
|
|
24
|
+
* @private
|
|
25
|
+
* @param {Object} merchantConfig - The merchant configuration object containing necessary details.
|
|
26
|
+
* @param {boolean} isResponseMLEForApi - Flag indicating if MLE is enabled for this API
|
|
27
|
+
* @param {Object} logger - Logger instance for logging errors and information.
|
|
28
|
+
*/
|
|
29
|
+
function getPayloadClaimSet(merchantConfig, isResponseMLEForApi, logger) {
|
|
30
|
+
const { randomUUID } = require('crypto');
|
|
31
|
+
const DigestGenerator = require('../payloadDigest/DigestGenerator');
|
|
32
|
+
|
|
33
|
+
const payloadClaimSet = {};
|
|
34
|
+
|
|
35
|
+
// Determine issuer
|
|
36
|
+
const issuer = merchantConfig.getUseMetaKey()
|
|
37
|
+
? merchantConfig.getPortfolioID()
|
|
38
|
+
: merchantConfig.getMerchantID();
|
|
39
|
+
|
|
40
|
+
const requestVerb = merchantConfig.getRequestType().toLowerCase();
|
|
41
|
+
|
|
42
|
+
// Add digest claims for POST / PUT / PATCH
|
|
43
|
+
if ([Constants.POST, Constants.PUT, Constants.PATCH].includes(requestVerb)) {
|
|
44
|
+
payloadClaimSet["digest"] = DigestGenerator.generateDigest(merchantConfig, logger);
|
|
45
|
+
payloadClaimSet["digest-algorithm"] = DIGEST_ALGORITHM;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Current UTC time in seconds
|
|
49
|
+
const nowEpochSeconds = Math.floor(Date.now() / 1000);
|
|
50
|
+
|
|
51
|
+
payloadClaimSet["iat"] = nowEpochSeconds;
|
|
52
|
+
payloadClaimSet["exp"] = nowEpochSeconds + 120; // +2 minutes
|
|
53
|
+
|
|
54
|
+
let requestTarget;
|
|
55
|
+
|
|
56
|
+
if (merchantConfig.requestTarget.includes("?")) {
|
|
57
|
+
requestTarget = merchantConfig.requestTarget.substring(0, merchantConfig.requestTarget.indexOf("?"));
|
|
58
|
+
} else {
|
|
59
|
+
requestTarget = merchantConfig.requestTarget;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Request metadata
|
|
63
|
+
payloadClaimSet["request-host"] = merchantConfig.getRunEnvironment();
|
|
64
|
+
payloadClaimSet["request-resource-path"] = requestTarget;
|
|
65
|
+
payloadClaimSet["request-method"] = requestVerb;
|
|
66
|
+
|
|
67
|
+
// Standard JWT claims
|
|
68
|
+
payloadClaimSet["iss"] = issuer;
|
|
69
|
+
payloadClaimSet["jti"] = randomUUID();
|
|
70
|
+
payloadClaimSet["v-c-jwt-version"] = "2";
|
|
71
|
+
|
|
72
|
+
// Merchant ID (if present)
|
|
73
|
+
if (merchantConfig.getMerchantID() != null) {
|
|
74
|
+
payloadClaimSet["v-c-merchant-id"] = merchantConfig.getMerchantID();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Optional Response MLE handling
|
|
78
|
+
try {
|
|
79
|
+
if (isResponseMLEForApi) {
|
|
80
|
+
payloadClaimSet["v-c-response-mle-kid"] = MLEUtility.validateAndAutoExtractResponseMleKid(merchantConfig, logger);
|
|
81
|
+
}
|
|
82
|
+
} catch (err) {
|
|
83
|
+
logger.fatal(GlobalLabelParameters.JWT_SIG_FAILED);
|
|
84
|
+
logger.error(err);
|
|
85
|
+
throw new Error(`${GlobalLabelParameters.JWT_SIG_FAILED} ${err.message}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return payloadClaimSet;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Returns the header claim set as a JavaScript object.
|
|
93
|
+
* @private
|
|
94
|
+
* @returns {Object} The header claimset object.
|
|
95
|
+
*/
|
|
96
|
+
function getHeaderClaimSet(certificate) {
|
|
97
|
+
const headerClaimSet = {
|
|
98
|
+
'header': {
|
|
99
|
+
'kid': getSerialNumberFromCert(certificate)
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return headerClaimSet;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Gets the serial number from the certificate's subject attributes.
|
|
107
|
+
* @private
|
|
108
|
+
* @param {*} cert - The certificate object containing subject attributes.
|
|
109
|
+
* @returns {string} The serial number extracted from the certificate.
|
|
110
|
+
*/
|
|
111
|
+
function getSerialNumberFromCert(cert) {
|
|
112
|
+
if (!cert.subject || !cert.subject.attributes) {
|
|
113
|
+
throw new Error("Subject or attributes are missing in JWT P12 certificate");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const serialNumberAttr = cert.subject.attributes.find(attr => attr.name === 'serialNumber');
|
|
117
|
+
if (serialNumberAttr) {
|
|
118
|
+
return serialNumberAttr.value;
|
|
119
|
+
}
|
|
120
|
+
throw new Error("Serial number attribute not found in cert subject of JWT P12 certificate");
|
|
121
|
+
}
|
|
122
|
+
|
|
23
123
|
/**
|
|
24
124
|
* Generates a JWT token for authentication
|
|
25
125
|
*
|
|
@@ -31,44 +131,16 @@ const DIGEST_ALGORITHM = 'SHA-256';
|
|
|
31
131
|
*/
|
|
32
132
|
exports.getToken = function (merchantConfig, isResponseMLEForApi, logger) {
|
|
33
133
|
try {
|
|
34
|
-
// date format is 'Mon, 09 Apr 2018 10:18:57 GMT'
|
|
35
|
-
const date = new Date(Date.now()).toUTCString();
|
|
36
134
|
const rsaPrivateKey = KeyCertificate.getRSAPrivateKey(merchantConfig, logger);
|
|
37
|
-
const certificate = KeyCertificate.
|
|
38
|
-
const requestType = merchantConfig.getRequestType().toLowerCase();
|
|
39
|
-
// Create claim set as a regular JavaScript object
|
|
40
|
-
const claimSetJson = {};
|
|
41
|
-
|
|
42
|
-
if (requestType === Constants.GET || requestType === Constants.DELETE) {
|
|
43
|
-
claimSetJson.iat = date;
|
|
44
|
-
}
|
|
45
|
-
else if (requestType === Constants.POST || requestType === Constants.PUT
|
|
46
|
-
|| requestType === Constants.PATCH) {
|
|
47
|
-
const digest = DigestGenerator.generateDigest(merchantConfig, logger);
|
|
48
|
-
claimSetJson.digest = digest;
|
|
49
|
-
claimSetJson.digestAlgorithm = DIGEST_ALGORITHM;
|
|
50
|
-
claimSetJson.iat = date;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Add MLE key ID if MLE is enabled
|
|
54
|
-
if (isResponseMLEForApi === true) {
|
|
55
|
-
const responseMleKID = MLEUtility.validateAndAutoExtractResponseMleKid(merchantConfig, logger);
|
|
56
|
-
// Using bracket notation for property name with hyphens
|
|
57
|
-
claimSetJson["v-c-response-mle-kid"] = responseMleKID;
|
|
58
|
-
}
|
|
135
|
+
const certificate = KeyCertificate.getX509CertificateInCert(merchantConfig, logger, merchantConfig.getKeyAlias());
|
|
59
136
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
'v-c-merchant-id': merchantConfig.getMerchantID(),
|
|
63
|
-
'x5c': [certificate]
|
|
64
|
-
}
|
|
65
|
-
};
|
|
137
|
+
const claimSetJson = getPayloadClaimSet(merchantConfig, isResponseMLEForApi, logger);
|
|
138
|
+
const customHeader = getHeaderClaimSet(certificate);
|
|
66
139
|
|
|
67
140
|
// Generating JWToken using the claimSetJson object directly
|
|
68
141
|
const jwtToken = Jwt.encode(claimSetJson, rsaPrivateKey, JWT_ALGORITHM, customHeader);
|
|
69
142
|
|
|
70
143
|
return jwtToken;
|
|
71
|
-
|
|
72
144
|
} catch (err) {
|
|
73
145
|
logger.error(`JWT token generation failed: ${err.message}`);
|
|
74
146
|
throw new Error(`Failed to generate JWT token: ${err.message}`);
|
|
@@ -68,6 +68,7 @@ module.exports = {
|
|
|
68
68
|
REFER_LOG : "Please refer Log for details",
|
|
69
69
|
MERCHANTID_REQ : "MerchantID is mandatory",
|
|
70
70
|
INCORRECT_KEY_ALIAS : "The Entered key_alias is Incorrect, Assigining merchantID value",
|
|
71
|
+
INCORRECT_KEY_ALIAS_FOR_METAKEY : "The Entered key_alias is Incorrect for MetaKey, Assigining portfolioID value",
|
|
71
72
|
INCORRECT_KEY_PASS : "The Entered keyPass is Incorrect",
|
|
72
73
|
AUTHENTICATION_REQ : "AuthenticationType is Mandatory",
|
|
73
74
|
MERCHANT_KEY_ID_REQ : "MerchantKeyId is Mandatory",
|