globalpayments-api 1.4.9 → 2.0.0
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/CHANGELOG.md +7 -3
- package/package.json +3 -4
- package/lib/src/Builders/AuthorizationBuilder.d.ts +0 -325
- package/lib/src/Builders/AuthorizationBuilder.js +0 -599
- package/lib/src/Builders/BaseBuilder/ValidationClause.d.ts +0 -14
- package/lib/src/Builders/BaseBuilder/ValidationClause.js +0 -61
- package/lib/src/Builders/BaseBuilder/ValidationTarget.d.ts +0 -16
- package/lib/src/Builders/BaseBuilder/ValidationTarget.js +0 -28
- package/lib/src/Builders/BaseBuilder/Validations.d.ts +0 -11
- package/lib/src/Builders/BaseBuilder/Validations.js +0 -56
- package/lib/src/Builders/BaseBuilder.d.ts +0 -11
- package/lib/src/Builders/BaseBuilder.js +0 -16
- package/lib/src/Builders/ManagementBuilder.d.ts +0 -103
- package/lib/src/Builders/ManagementBuilder.js +0 -227
- package/lib/src/Builders/PayFacBuilder.d.ts +0 -96
- package/lib/src/Builders/PayFacBuilder.js +0 -184
- package/lib/src/Builders/RecurringBuilder.d.ts +0 -13
- package/lib/src/Builders/RecurringBuilder.js +0 -47
- package/lib/src/Builders/ReportBuilder.d.ts +0 -8
- package/lib/src/Builders/ReportBuilder.js +0 -36
- package/lib/src/Builders/TransactionBuilder.d.ts +0 -10
- package/lib/src/Builders/TransactionBuilder.js +0 -46
- package/lib/src/Builders/TransactionReportBuilder.d.ts +0 -15
- package/lib/src/Builders/TransactionReportBuilder.js +0 -79
- package/lib/src/Builders/index.d.ts +0 -7
- package/lib/src/Builders/index.js +0 -19
- package/lib/src/Entities/Address.d.ts +0 -13
- package/lib/src/Entities/Address.js +0 -19
- package/lib/src/Entities/BatchSummary.d.ts +0 -6
- package/lib/src/Entities/BatchSummary.js +0 -9
- package/lib/src/Entities/Customer.d.ts +0 -64
- package/lib/src/Entities/Customer.js +0 -47
- package/lib/src/Entities/DocumentUploadData.d.ts +0 -13
- package/lib/src/Entities/DocumentUploadData.js +0 -48
- package/lib/src/Entities/EcommerceInfo.d.ts +0 -12
- package/lib/src/Entities/EcommerceInfo.js +0 -14
- package/lib/src/Entities/EncryptionData.d.ts +0 -6
- package/lib/src/Entities/EncryptionData.js +0 -9
- package/lib/src/Entities/Enums.d.ts +0 -273
- package/lib/src/Entities/Enums.js +0 -385
- package/lib/src/Entities/Errors.d.ts +0 -23
- package/lib/src/Entities/Errors.js +0 -106
- package/lib/src/Entities/HostedPaymentData.d.ts +0 -10
- package/lib/src/Entities/HostedPaymentData.js +0 -10
- package/lib/src/Entities/ProFac/AccountBalanceResponseData.d.ts +0 -7
- package/lib/src/Entities/ProFac/AccountBalanceResponseData.js +0 -9
- package/lib/src/Entities/ProFac/AccountPermissions.d.ts +0 -15
- package/lib/src/Entities/ProFac/AccountPermissions.js +0 -9
- package/lib/src/Entities/ProFac/BankAccountData.d.ts +0 -10
- package/lib/src/Entities/ProFac/BankAccountData.js +0 -9
- package/lib/src/Entities/ProFac/BankAccountOwnershipData.d.ts +0 -8
- package/lib/src/Entities/ProFac/BankAccountOwnershipData.js +0 -11
- package/lib/src/Entities/ProFac/BeneficialOwnerData.d.ts +0 -6
- package/lib/src/Entities/ProFac/BeneficialOwnerData.js +0 -10
- package/lib/src/Entities/ProFac/BeneficialOwnerDataResult.d.ts +0 -5
- package/lib/src/Entities/ProFac/BeneficialOwnerDataResult.js +0 -9
- package/lib/src/Entities/ProFac/BusinessData.d.ts +0 -14
- package/lib/src/Entities/ProFac/BusinessData.js +0 -11
- package/lib/src/Entities/ProFac/DeviceAttributeInfo.d.ts +0 -4
- package/lib/src/Entities/ProFac/DeviceAttributeInfo.js +0 -9
- package/lib/src/Entities/ProFac/DeviceData.d.ts +0 -5
- package/lib/src/Entities/ProFac/DeviceData.js +0 -10
- package/lib/src/Entities/ProFac/DeviceInfo.d.ts +0 -6
- package/lib/src/Entities/ProFac/DeviceInfo.js +0 -9
- package/lib/src/Entities/ProFac/FlashFundsPaymentCardData.d.ts +0 -7
- package/lib/src/Entities/ProFac/FlashFundsPaymentCardData.js +0 -13
- package/lib/src/Entities/ProFac/GrossBillingInformation.d.ts +0 -8
- package/lib/src/Entities/ProFac/GrossBillingInformation.js +0 -9
- package/lib/src/Entities/ProFac/OrderDevice.d.ts +0 -18
- package/lib/src/Entities/ProFac/OrderDevice.js +0 -9
- package/lib/src/Entities/ProFac/OwnersData.d.ts +0 -12
- package/lib/src/Entities/ProFac/OwnersData.js +0 -11
- package/lib/src/Entities/ProFac/PayFacResponseData.d.ts +0 -55
- package/lib/src/Entities/ProFac/PayFacResponseData.js +0 -9
- package/lib/src/Entities/ProFac/RenewAccountData.d.ts +0 -10
- package/lib/src/Entities/ProFac/RenewAccountData.js +0 -11
- package/lib/src/Entities/ProFac/SignificantOwnerData.d.ts +0 -8
- package/lib/src/Entities/ProFac/SignificantOwnerData.js +0 -11
- package/lib/src/Entities/ProFac/ThreatRiskData.d.ts +0 -5
- package/lib/src/Entities/ProFac/ThreatRiskData.js +0 -9
- package/lib/src/Entities/ProFac/UserPersonalData.d.ts +0 -26
- package/lib/src/Entities/ProFac/UserPersonalData.js +0 -14
- package/lib/src/Entities/RecurringEntity.d.ts +0 -14
- package/lib/src/Entities/RecurringEntity.js +0 -86
- package/lib/src/Entities/SSORequestData.d.ts +0 -5
- package/lib/src/Entities/SSORequestData.js +0 -9
- package/lib/src/Entities/Schedule.d.ts +0 -47
- package/lib/src/Entities/Schedule.js +0 -253
- package/lib/src/Entities/Transaction.d.ts +0 -78
- package/lib/src/Entities/Transaction.js +0 -108
- package/lib/src/Entities/TransactionSummary.d.ts +0 -61
- package/lib/src/Entities/TransactionSummary.js +0 -9
- package/lib/src/Entities/index.d.ts +0 -12
- package/lib/src/Entities/index.js +0 -24
- package/lib/src/Gateways/Gateway.d.ts +0 -10
- package/lib/src/Gateways/Gateway.js +0 -42
- package/lib/src/Gateways/IPayFacProvider.d.ts +0 -5
- package/lib/src/Gateways/IPayFacProvider.js +0 -2
- package/lib/src/Gateways/IPaymentGateway.d.ts +0 -8
- package/lib/src/Gateways/IPaymentGateway.js +0 -2
- package/lib/src/Gateways/IRecurringService.d.ts +0 -6
- package/lib/src/Gateways/IRecurringService.js +0 -2
- package/lib/src/Gateways/PayPlanConnector.d.ts +0 -43
- package/lib/src/Gateways/PayPlanConnector.js +0 -564
- package/lib/src/Gateways/PorticoConnector.d.ts +0 -44
- package/lib/src/Gateways/PorticoConnector.js +0 -1017
- package/lib/src/Gateways/ProPayConnector.d.ts +0 -41
- package/lib/src/Gateways/ProPayConnector.js +0 -698
- package/lib/src/Gateways/RealexConnector.d.ts +0 -30
- package/lib/src/Gateways/RealexConnector.js +0 -523
- package/lib/src/Gateways/RestGateway.d.ts +0 -6
- package/lib/src/Gateways/RestGateway.js +0 -31
- package/lib/src/Gateways/XmlGateway.d.ts +0 -6
- package/lib/src/Gateways/XmlGateway.js +0 -39
- package/lib/src/Gateways/https-wrapper.d.ts +0 -3
- package/lib/src/Gateways/https-wrapper.js +0 -35
- package/lib/src/Gateways/index.d.ts +0 -7
- package/lib/src/Gateways/index.js +0 -19
- package/lib/src/HostedPaymentConfig.d.ts +0 -12
- package/lib/src/HostedPaymentConfig.js +0 -9
- package/lib/src/PaymentMethods/Cash.d.ts +0 -8
- package/lib/src/PaymentMethods/Cash.js +0 -36
- package/lib/src/PaymentMethods/Credit.d.ts +0 -85
- package/lib/src/PaymentMethods/Credit.js +0 -106
- package/lib/src/PaymentMethods/CreditCardData.d.ts +0 -20
- package/lib/src/PaymentMethods/CreditCardData.js +0 -57
- package/lib/src/PaymentMethods/CreditTrackData.d.ts +0 -7
- package/lib/src/PaymentMethods/CreditTrackData.js +0 -27
- package/lib/src/PaymentMethods/Debit.d.ts +0 -40
- package/lib/src/PaymentMethods/Debit.js +0 -70
- package/lib/src/PaymentMethods/DebitTrackData.d.ts +0 -7
- package/lib/src/PaymentMethods/DebitTrackData.js +0 -27
- package/lib/src/PaymentMethods/EBT.d.ts +0 -48
- package/lib/src/PaymentMethods/EBT.js +0 -88
- package/lib/src/PaymentMethods/EBTCardData.d.ts +0 -16
- package/lib/src/PaymentMethods/EBTCardData.js +0 -32
- package/lib/src/PaymentMethods/EBTTrackData.d.ts +0 -8
- package/lib/src/PaymentMethods/EBTTrackData.js +0 -27
- package/lib/src/PaymentMethods/ECheck.d.ts +0 -32
- package/lib/src/PaymentMethods/ECheck.js +0 -40
- package/lib/src/PaymentMethods/GiftCard.d.ts +0 -131
- package/lib/src/PaymentMethods/GiftCard.js +0 -205
- package/lib/src/PaymentMethods/Interfaces.d.ts +0 -55
- package/lib/src/PaymentMethods/Interfaces.js +0 -2
- package/lib/src/PaymentMethods/PaymentMethod.d.ts +0 -19
- package/lib/src/PaymentMethods/PaymentMethod.js +0 -114
- package/lib/src/PaymentMethods/RecurringPaymentMethod.d.ts +0 -23
- package/lib/src/PaymentMethods/RecurringPaymentMethod.js +0 -77
- package/lib/src/PaymentMethods/TransactionReference.d.ts +0 -10
- package/lib/src/PaymentMethods/TransactionReference.js +0 -12
- package/lib/src/PaymentMethods/index.d.ts +0 -15
- package/lib/src/PaymentMethods/index.js +0 -27
- package/lib/src/Services/BatchService.d.ts +0 -4
- package/lib/src/Services/BatchService.js +0 -17
- package/lib/src/Services/CheckService.d.ts +0 -6
- package/lib/src/Services/CheckService.js +0 -20
- package/lib/src/Services/CreditService.d.ts +0 -12
- package/lib/src/Services/CreditService.js +0 -54
- package/lib/src/Services/DebitService.d.ts +0 -7
- package/lib/src/Services/DebitService.js +0 -28
- package/lib/src/Services/EBTService.d.ts +0 -8
- package/lib/src/Services/EBTService.js +0 -32
- package/lib/src/Services/GiftService.d.ts +0 -16
- package/lib/src/Services/GiftService.js +0 -54
- package/lib/src/Services/HostedService.d.ts +0 -9
- package/lib/src/Services/HostedService.js +0 -59
- package/lib/src/Services/PayFacService.d.ts +0 -26
- package/lib/src/Services/PayFacService.js +0 -77
- package/lib/src/Services/RecurringService.d.ts +0 -8
- package/lib/src/Services/RecurringService.js +0 -27
- package/lib/src/Services/ReportingService.d.ts +0 -6
- package/lib/src/Services/ReportingService.js +0 -19
- package/lib/src/Services/index.d.ts +0 -9
- package/lib/src/Services/index.js +0 -21
- package/lib/src/ServicesConfig.d.ts +0 -27
- package/lib/src/ServicesConfig.js +0 -50
- package/lib/src/ServicesContainer.d.ts +0 -14
- package/lib/src/ServicesContainer.js +0 -87
- package/lib/src/Utils/GenerationUtils.d.ts +0 -5
- package/lib/src/Utils/GenerationUtils.js +0 -36
- package/lib/src/Utils/InputValidation.d.ts +0 -12
- package/lib/src/Utils/InputValidation.js +0 -72
- package/lib/src/Utils/Sha1.d.ts +0 -6
- package/lib/src/Utils/Sha1.js +0 -225
- package/lib/src/Utils/StringUtils.d.ts +0 -6
- package/lib/src/Utils/StringUtils.js +0 -53
- package/lib/src/Utils/index.d.ts +0 -2
- package/lib/src/Utils/index.js +0 -14
- package/lib/src/index.d.ts +0 -11
- package/lib/src/index.js +0 -27
- package/lib/test/Data/TestCards.d.ts +0 -24
- package/lib/test/Data/TestCards.js +0 -232
- package/lib/test/Data/TestChecks.d.ts +0 -4
- package/lib/test/Data/TestChecks.js +0 -32
- package/lib/test/Data/index.d.ts +0 -2
- package/lib/test/Data/index.js +0 -14
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -112
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -483
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -83
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1720
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -83
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1757
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -682
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2218
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -707
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -151
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -171
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -192
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -377
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -196
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -47
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.js +0 -100
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.js +0 -352
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.js +0 -123
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.js +0 -146
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.d.ts +0 -39
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/TestData/TestAccountData.js +0 -371
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.js +0 -100
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.js +0 -535
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.js +0 -124
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.d.ts +0 -1
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.js +0 -144
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.d.ts +0 -33
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestAccountData.js +0 -268
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.d.ts +0 -4
- package/lib/test/Integration/Gateways/ProPayConnector/TestData/TestFundsData.js +0 -30
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +0 -4373
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +0 -758
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +0 -2399
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +0 -1656
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +0 -5650
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +0 -1985
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +0 -2369
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +0 -1703
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +0 -2053
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +0 -2469
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +0 -3116
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +0 -2031
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +0 -322
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +0 -98
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.d.ts +0 -1
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +0 -263
- package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/CheckServiceTest.js +0 -98
- package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/CreditServiceTest.js +0 -313
- package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/DebitServiceTest.js +0 -154
- package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
- package/lib/test/Integration/Services/EBTServiceTest.js +0 -135
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -161
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -139
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -202
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.d.ts +0 -1
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +0 -29
- package/logger.txt +0 -483
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var ava_1 = require("ava");
|
|
40
|
-
var src_1 = require("../../../../src/");
|
|
41
|
-
var config = new src_1.ServicesConfig();
|
|
42
|
-
config.merchantId = "heartlandgpsandbox";
|
|
43
|
-
config.accountId = "api";
|
|
44
|
-
config.sharedSecret = "secret";
|
|
45
|
-
config.rebatePassword = "rebate";
|
|
46
|
-
config.refundPassword = "refund";
|
|
47
|
-
config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
|
|
48
|
-
var test = ava_1.default.serial;
|
|
49
|
-
var card = new src_1.CreditCardData();
|
|
50
|
-
card.number = "4263970000005262";
|
|
51
|
-
card.expMonth = "5";
|
|
52
|
-
card.expYear = "2019";
|
|
53
|
-
card.cardHolderName = "James Mason";
|
|
54
|
-
var customerId = src_1.GenerationUtils.generateTimestamp() + "-Realex";
|
|
55
|
-
var paymentId = function (t) {
|
|
56
|
-
return src_1.GenerationUtils.generateTimestamp() + "-Realex-" + t;
|
|
57
|
-
};
|
|
58
|
-
var customer = new src_1.Customer();
|
|
59
|
-
customer.key = customerId;
|
|
60
|
-
customer.title = "Mr.";
|
|
61
|
-
customer.firstName = "James";
|
|
62
|
-
customer.lastName = "Mason";
|
|
63
|
-
customer.company = "Realex Payments";
|
|
64
|
-
customer.address = new src_1.Address();
|
|
65
|
-
customer.address.streetAddress1 = "Flat 123";
|
|
66
|
-
customer.address.streetAddress2 = "House 456";
|
|
67
|
-
customer.address.streetAddress3 = "The Cul-De-Sac";
|
|
68
|
-
customer.address.city = "Halifax";
|
|
69
|
-
customer.address.province = "West Yorkshire";
|
|
70
|
-
customer.address.postalCode = "W6 9HR";
|
|
71
|
-
customer.address.country = "United Kingdom";
|
|
72
|
-
customer.homePhone = "+35312345678";
|
|
73
|
-
customer.workPhone = "+3531987654321";
|
|
74
|
-
customer.fax = "+124546871258";
|
|
75
|
-
customer.mobilePhone = "+25544778544";
|
|
76
|
-
customer.email = "text@example.com";
|
|
77
|
-
customer.comments = "Campaign Ref E7373G";
|
|
78
|
-
test.before(function (_t) {
|
|
79
|
-
src_1.ServicesContainer.configure(config);
|
|
80
|
-
});
|
|
81
|
-
test("001a - create customer", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
|
-
var newCustomer, e_1;
|
|
83
|
-
return __generator(this, function (_a) {
|
|
84
|
-
switch (_a.label) {
|
|
85
|
-
case 0:
|
|
86
|
-
t.plan(1);
|
|
87
|
-
_a.label = 1;
|
|
88
|
-
case 1:
|
|
89
|
-
_a.trys.push([1, 3, , 4]);
|
|
90
|
-
return [4 /*yield*/, customer.create()];
|
|
91
|
-
case 2:
|
|
92
|
-
newCustomer = _a.sent();
|
|
93
|
-
t.truthy(newCustomer);
|
|
94
|
-
return [3 /*break*/, 4];
|
|
95
|
-
case 3:
|
|
96
|
-
e_1 = _a.sent();
|
|
97
|
-
console.log(e_1);
|
|
98
|
-
if (e_1.responseCode !== "520") {
|
|
99
|
-
t.fail(e_1.message);
|
|
100
|
-
}
|
|
101
|
-
return [3 /*break*/, 4];
|
|
102
|
-
case 4: return [2 /*return*/];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}); });
|
|
106
|
-
test("001b - create payment method", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
var paymentMethod, e_2;
|
|
108
|
-
return __generator(this, function (_a) {
|
|
109
|
-
switch (_a.label) {
|
|
110
|
-
case 0:
|
|
111
|
-
t.plan(1);
|
|
112
|
-
_a.label = 1;
|
|
113
|
-
case 1:
|
|
114
|
-
_a.trys.push([1, 3, , 4]);
|
|
115
|
-
return [4 /*yield*/, customer.addPaymentMethod(paymentId("Credit"), card)];
|
|
116
|
-
case 2:
|
|
117
|
-
paymentMethod = _a.sent();
|
|
118
|
-
t.truthy(paymentMethod);
|
|
119
|
-
return [3 /*break*/, 4];
|
|
120
|
-
case 3:
|
|
121
|
-
e_2 = _a.sent();
|
|
122
|
-
if (e_2.responseCode !== "520") {
|
|
123
|
-
t.fail(e_2.message);
|
|
124
|
-
}
|
|
125
|
-
return [3 /*break*/, 4];
|
|
126
|
-
case 4: return [2 /*return*/];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}); });
|
|
130
|
-
test("002a - edit customer from id", function (_t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
-
var editCustomer;
|
|
132
|
-
return __generator(this, function (_a) {
|
|
133
|
-
switch (_a.label) {
|
|
134
|
-
case 0:
|
|
135
|
-
editCustomer = new src_1.Customer();
|
|
136
|
-
editCustomer.key = customerId;
|
|
137
|
-
return [4 /*yield*/, customer.saveChanges()];
|
|
138
|
-
case 1:
|
|
139
|
-
_a.sent();
|
|
140
|
-
return [2 /*return*/];
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}); });
|
|
144
|
-
test("002b - edit payment method from id", function (_t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
145
|
-
var newCard, paymentMethod;
|
|
146
|
-
return __generator(this, function (_a) {
|
|
147
|
-
switch (_a.label) {
|
|
148
|
-
case 0:
|
|
149
|
-
newCard = new src_1.CreditCardData();
|
|
150
|
-
newCard.number = "5425230000004415";
|
|
151
|
-
newCard.expMonth = "10";
|
|
152
|
-
newCard.expYear = "2020";
|
|
153
|
-
newCard.cardHolderName = "Philip Marlowe";
|
|
154
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
155
|
-
paymentMethod.paymentMethod = newCard;
|
|
156
|
-
return [4 /*yield*/, paymentMethod.saveChanges()];
|
|
157
|
-
case 1:
|
|
158
|
-
_a.sent();
|
|
159
|
-
return [2 /*return*/];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}); });
|
|
163
|
-
test("003 - find", function (_t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
164
|
-
return __generator(this, function (_a) {
|
|
165
|
-
switch (_a.label) {
|
|
166
|
-
case 0: return [4 /*yield*/, src_1.Customer.find(customerId)];
|
|
167
|
-
case 1:
|
|
168
|
-
_a.sent();
|
|
169
|
-
return [2 /*return*/];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}); });
|
|
173
|
-
test("004a - charge stored card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
174
|
-
var paymentMethod, response;
|
|
175
|
-
return __generator(this, function (_a) {
|
|
176
|
-
switch (_a.label) {
|
|
177
|
-
case 0:
|
|
178
|
-
t.plan(2);
|
|
179
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
180
|
-
return [4 /*yield*/, paymentMethod
|
|
181
|
-
.charge(10)
|
|
182
|
-
.withCurrency("USD")
|
|
183
|
-
.withCvn("123")
|
|
184
|
-
.execute()];
|
|
185
|
-
case 1:
|
|
186
|
-
response = _a.sent();
|
|
187
|
-
t.truthy(response);
|
|
188
|
-
t.is(response.responseCode, "00");
|
|
189
|
-
return [2 /*return*/];
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}); });
|
|
193
|
-
test("004b - verify stored card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
194
|
-
var paymentMethod, response;
|
|
195
|
-
return __generator(this, function (_a) {
|
|
196
|
-
switch (_a.label) {
|
|
197
|
-
case 0:
|
|
198
|
-
t.plan(2);
|
|
199
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
200
|
-
return [4 /*yield*/, paymentMethod
|
|
201
|
-
.verify()
|
|
202
|
-
.withCvn("123")
|
|
203
|
-
.execute()];
|
|
204
|
-
case 1:
|
|
205
|
-
response = _a.sent();
|
|
206
|
-
t.truthy(response);
|
|
207
|
-
t.is(response.responseCode, "00");
|
|
208
|
-
return [2 /*return*/];
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}); });
|
|
212
|
-
test("004c - refund stored card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
213
|
-
var paymentMethod, response;
|
|
214
|
-
return __generator(this, function (_a) {
|
|
215
|
-
switch (_a.label) {
|
|
216
|
-
case 0:
|
|
217
|
-
t.plan(2);
|
|
218
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
219
|
-
return [4 /*yield*/, paymentMethod
|
|
220
|
-
.refund(10.01)
|
|
221
|
-
.withCurrency("USD")
|
|
222
|
-
.execute()];
|
|
223
|
-
case 1:
|
|
224
|
-
response = _a.sent();
|
|
225
|
-
t.truthy(response);
|
|
226
|
-
t.is(response.responseCode, "00");
|
|
227
|
-
return [2 /*return*/];
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}); });
|
|
231
|
-
test("005 - delete payment method", function (_t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
232
|
-
var paymentMethod;
|
|
233
|
-
return __generator(this, function (_a) {
|
|
234
|
-
switch (_a.label) {
|
|
235
|
-
case 0:
|
|
236
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
237
|
-
return [4 /*yield*/, paymentMethod.delete()];
|
|
238
|
-
case 1:
|
|
239
|
-
_a.sent();
|
|
240
|
-
return [2 /*return*/];
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}); });
|
|
244
|
-
test("006 - recurring payment", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
245
|
-
var paymentMethod, response;
|
|
246
|
-
return __generator(this, function (_a) {
|
|
247
|
-
switch (_a.label) {
|
|
248
|
-
case 0:
|
|
249
|
-
t.plan(2);
|
|
250
|
-
paymentMethod = new src_1.RecurringPaymentMethod(customerId, paymentId("Credit"));
|
|
251
|
-
return [4 /*yield*/, paymentMethod
|
|
252
|
-
.charge(12)
|
|
253
|
-
.withRecurringInfo(src_1.RecurringType.Fixed, src_1.RecurringSequence.First)
|
|
254
|
-
.withCurrency("USD")
|
|
255
|
-
.execute()];
|
|
256
|
-
case 1:
|
|
257
|
-
response = _a.sent();
|
|
258
|
-
t.truthy(response);
|
|
259
|
-
t.is(response.responseCode, "00");
|
|
260
|
-
return [2 /*return*/];
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}); });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var ava_1 = require("ava");
|
|
40
|
-
var src_1 = require("../../../src/");
|
|
41
|
-
var Data_1 = require("../../Data");
|
|
42
|
-
var config = new src_1.ServicesConfig();
|
|
43
|
-
config.secretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
|
|
44
|
-
config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
|
|
45
|
-
var service = new src_1.CheckService(config);
|
|
46
|
-
var runSerially = false;
|
|
47
|
-
var test = runSerially ? ava_1.default.serial : ava_1.default;
|
|
48
|
-
var check = Data_1.TestChecks.certification();
|
|
49
|
-
var address = new src_1.Address();
|
|
50
|
-
address.streetAddress1 = "123 Main St.";
|
|
51
|
-
address.city = "Downtown";
|
|
52
|
-
address.state = "NJ";
|
|
53
|
-
address.postalCode = "12345";
|
|
54
|
-
test("sale", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
var response;
|
|
56
|
-
return __generator(this, function (_a) {
|
|
57
|
-
switch (_a.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
t.plan(2);
|
|
60
|
-
return [4 /*yield*/, service
|
|
61
|
-
.charge(10)
|
|
62
|
-
.withCurrency("USD")
|
|
63
|
-
.withPaymentMethod(check)
|
|
64
|
-
.withAddress(address)
|
|
65
|
-
.execute()];
|
|
66
|
-
case 1:
|
|
67
|
-
response = _a.sent();
|
|
68
|
-
t.truthy(response);
|
|
69
|
-
t.is(response.responseCode, "00", response.responseMessage);
|
|
70
|
-
return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}); });
|
|
74
|
-
test("void", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
-
var response, voidResponse;
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
switch (_a.label) {
|
|
78
|
-
case 0:
|
|
79
|
-
t.plan(4);
|
|
80
|
-
return [4 /*yield*/, service
|
|
81
|
-
.charge(10)
|
|
82
|
-
.withCurrency("USD")
|
|
83
|
-
.withPaymentMethod(check)
|
|
84
|
-
.withAddress(address)
|
|
85
|
-
.execute()];
|
|
86
|
-
case 1:
|
|
87
|
-
response = _a.sent();
|
|
88
|
-
t.truthy(response);
|
|
89
|
-
t.is(response.responseCode, "00", response.responseMessage);
|
|
90
|
-
return [4 /*yield*/, service.void(response.transactionId).execute()];
|
|
91
|
-
case 2:
|
|
92
|
-
voidResponse = _a.sent();
|
|
93
|
-
t.truthy(voidResponse);
|
|
94
|
-
t.is(voidResponse.responseCode, "00", voidResponse.responseMessage);
|
|
95
|
-
return [2 /*return*/];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var ava_1 = require("ava");
|
|
40
|
-
var src_1 = require("../../../src/");
|
|
41
|
-
var Data_1 = require("../../Data");
|
|
42
|
-
var config = new src_1.ServicesConfig();
|
|
43
|
-
config.secretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
|
|
44
|
-
config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
|
|
45
|
-
var service = new src_1.CreditService(config);
|
|
46
|
-
var runSerially = false;
|
|
47
|
-
var test = runSerially ? ava_1.default.serial : ava_1.default;
|
|
48
|
-
var card = Data_1.TestCards.visaManual();
|
|
49
|
-
test("auth capture", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
-
var response, capture;
|
|
51
|
-
return __generator(this, function (_a) {
|
|
52
|
-
switch (_a.label) {
|
|
53
|
-
case 0:
|
|
54
|
-
t.plan(4);
|
|
55
|
-
return [4 /*yield*/, service
|
|
56
|
-
.authorize(10)
|
|
57
|
-
.withCurrency("USD")
|
|
58
|
-
.withPaymentMethod(card)
|
|
59
|
-
.withAllowDuplicates(true)
|
|
60
|
-
.execute()];
|
|
61
|
-
case 1:
|
|
62
|
-
response = _a.sent();
|
|
63
|
-
t.truthy(response);
|
|
64
|
-
t.is(response.responseCode, "00");
|
|
65
|
-
return [4 /*yield*/, service.capture(response.transactionId).execute()];
|
|
66
|
-
case 2:
|
|
67
|
-
capture = _a.sent();
|
|
68
|
-
t.truthy(capture);
|
|
69
|
-
t.is(capture.responseCode, "00");
|
|
70
|
-
return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}); });
|
|
74
|
-
test("sale", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
-
var response;
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
switch (_a.label) {
|
|
78
|
-
case 0:
|
|
79
|
-
t.plan(2);
|
|
80
|
-
return [4 /*yield*/, service
|
|
81
|
-
.charge(11.01)
|
|
82
|
-
.withCurrency("USD")
|
|
83
|
-
.withPaymentMethod(card)
|
|
84
|
-
.withAllowDuplicates(true)
|
|
85
|
-
.execute()];
|
|
86
|
-
case 1:
|
|
87
|
-
response = _a.sent();
|
|
88
|
-
t.truthy(response);
|
|
89
|
-
t.is(response.responseCode, "00");
|
|
90
|
-
return [2 /*return*/];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}); });
|
|
94
|
-
test("edit", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
-
var response, edit;
|
|
96
|
-
return __generator(this, function (_a) {
|
|
97
|
-
switch (_a.label) {
|
|
98
|
-
case 0:
|
|
99
|
-
t.plan(4);
|
|
100
|
-
return [4 /*yield*/, service
|
|
101
|
-
.charge(12)
|
|
102
|
-
.withCurrency("USD")
|
|
103
|
-
.withPaymentMethod(card)
|
|
104
|
-
.withAllowDuplicates(true)
|
|
105
|
-
.execute()];
|
|
106
|
-
case 1:
|
|
107
|
-
response = _a.sent();
|
|
108
|
-
t.truthy(response);
|
|
109
|
-
t.is(response.responseCode, "00");
|
|
110
|
-
return [4 /*yield*/, service
|
|
111
|
-
.edit(response.transactionId)
|
|
112
|
-
.withAmount(14)
|
|
113
|
-
.withGratuity(2)
|
|
114
|
-
.execute()];
|
|
115
|
-
case 2:
|
|
116
|
-
edit = _a.sent();
|
|
117
|
-
t.truthy(edit);
|
|
118
|
-
t.is(edit.responseCode, "00");
|
|
119
|
-
return [2 /*return*/];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}); });
|
|
123
|
-
test("commercial edit", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
-
var response, edit;
|
|
125
|
-
return __generator(this, function (_a) {
|
|
126
|
-
switch (_a.label) {
|
|
127
|
-
case 0:
|
|
128
|
-
t.plan(4);
|
|
129
|
-
return [4 /*yield*/, service
|
|
130
|
-
.charge(13)
|
|
131
|
-
.withCurrency("USD")
|
|
132
|
-
.withPaymentMethod(card)
|
|
133
|
-
.withCommercialRequest(true)
|
|
134
|
-
.withAllowDuplicates(true)
|
|
135
|
-
.execute()];
|
|
136
|
-
case 1:
|
|
137
|
-
response = _a.sent();
|
|
138
|
-
t.truthy(response);
|
|
139
|
-
t.is(response.responseCode, "00");
|
|
140
|
-
return [4 /*yield*/, service
|
|
141
|
-
.edit(response.transactionId)
|
|
142
|
-
.withTaxType(src_1.TaxType.SalesTax)
|
|
143
|
-
.withTaxAmount(1)
|
|
144
|
-
.execute()];
|
|
145
|
-
case 2:
|
|
146
|
-
edit = _a.sent();
|
|
147
|
-
t.truthy(edit);
|
|
148
|
-
t.is(edit.responseCode, "00");
|
|
149
|
-
return [2 /*return*/];
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}); });
|
|
153
|
-
test("refund by card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
154
|
-
var response, refund;
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
switch (_a.label) {
|
|
157
|
-
case 0:
|
|
158
|
-
t.plan(4);
|
|
159
|
-
return [4 /*yield*/, service
|
|
160
|
-
.charge(14)
|
|
161
|
-
.withCurrency("USD")
|
|
162
|
-
.withPaymentMethod(card)
|
|
163
|
-
.withAllowDuplicates(true)
|
|
164
|
-
.execute()];
|
|
165
|
-
case 1:
|
|
166
|
-
response = _a.sent();
|
|
167
|
-
t.truthy(response);
|
|
168
|
-
t.is(response.responseCode, "00");
|
|
169
|
-
return [4 /*yield*/, service
|
|
170
|
-
.refund(14)
|
|
171
|
-
.withCurrency("USD")
|
|
172
|
-
.withPaymentMethod(card)
|
|
173
|
-
.execute()];
|
|
174
|
-
case 2:
|
|
175
|
-
refund = _a.sent();
|
|
176
|
-
t.truthy(refund);
|
|
177
|
-
t.is(refund.responseCode, "00");
|
|
178
|
-
return [2 /*return*/];
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}); });
|
|
182
|
-
test("refund by transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
|
-
var response, refund;
|
|
184
|
-
return __generator(this, function (_a) {
|
|
185
|
-
switch (_a.label) {
|
|
186
|
-
case 0:
|
|
187
|
-
t.plan(4);
|
|
188
|
-
return [4 /*yield*/, service
|
|
189
|
-
.charge(15)
|
|
190
|
-
.withCurrency("USD")
|
|
191
|
-
.withPaymentMethod(card)
|
|
192
|
-
.withAllowDuplicates(true)
|
|
193
|
-
.execute()];
|
|
194
|
-
case 1:
|
|
195
|
-
response = _a.sent();
|
|
196
|
-
t.truthy(response);
|
|
197
|
-
t.is(response.responseCode, "00");
|
|
198
|
-
return [4 /*yield*/, service
|
|
199
|
-
.refund(15)
|
|
200
|
-
.withCurrency("USD")
|
|
201
|
-
.withTransactionId(response.transactionId)
|
|
202
|
-
.execute()];
|
|
203
|
-
case 2:
|
|
204
|
-
refund = _a.sent();
|
|
205
|
-
t.truthy(refund);
|
|
206
|
-
t.is(refund.responseCode, "00");
|
|
207
|
-
return [2 /*return*/];
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}); });
|
|
211
|
-
test("reverse by card", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
212
|
-
var response, reverse;
|
|
213
|
-
return __generator(this, function (_a) {
|
|
214
|
-
switch (_a.label) {
|
|
215
|
-
case 0:
|
|
216
|
-
t.plan(4);
|
|
217
|
-
return [4 /*yield*/, service
|
|
218
|
-
.charge(16)
|
|
219
|
-
.withCurrency("USD")
|
|
220
|
-
.withPaymentMethod(card)
|
|
221
|
-
.withAllowDuplicates(true)
|
|
222
|
-
.execute()];
|
|
223
|
-
case 1:
|
|
224
|
-
response = _a.sent();
|
|
225
|
-
t.truthy(response);
|
|
226
|
-
t.is(response.responseCode, "00");
|
|
227
|
-
return [4 /*yield*/, service
|
|
228
|
-
.reverse(16)
|
|
229
|
-
.withCurrency("USD")
|
|
230
|
-
.withPaymentMethod(card)
|
|
231
|
-
.execute()];
|
|
232
|
-
case 2:
|
|
233
|
-
reverse = _a.sent();
|
|
234
|
-
t.truthy(reverse);
|
|
235
|
-
t.is(reverse.responseCode, "00");
|
|
236
|
-
return [2 /*return*/];
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}); });
|
|
240
|
-
test("reverse by transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
-
var response, reverse;
|
|
242
|
-
return __generator(this, function (_a) {
|
|
243
|
-
switch (_a.label) {
|
|
244
|
-
case 0:
|
|
245
|
-
t.plan(4);
|
|
246
|
-
return [4 /*yield*/, service
|
|
247
|
-
.charge(17)
|
|
248
|
-
.withCurrency("USD")
|
|
249
|
-
.withPaymentMethod(card)
|
|
250
|
-
.withAllowDuplicates(true)
|
|
251
|
-
.execute()];
|
|
252
|
-
case 1:
|
|
253
|
-
response = _a.sent();
|
|
254
|
-
t.truthy(response);
|
|
255
|
-
t.is(response.responseCode, "00");
|
|
256
|
-
return [4 /*yield*/, service
|
|
257
|
-
.reverse(17)
|
|
258
|
-
.withCurrency("USD")
|
|
259
|
-
.withTransactionId(response.transactionId)
|
|
260
|
-
.execute()];
|
|
261
|
-
case 2:
|
|
262
|
-
reverse = _a.sent();
|
|
263
|
-
t.truthy(reverse);
|
|
264
|
-
t.is(reverse.responseCode, "00");
|
|
265
|
-
return [2 /*return*/];
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
}); });
|
|
269
|
-
test("verify", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
270
|
-
var response;
|
|
271
|
-
return __generator(this, function (_a) {
|
|
272
|
-
switch (_a.label) {
|
|
273
|
-
case 0:
|
|
274
|
-
t.plan(2);
|
|
275
|
-
return [4 /*yield*/, service
|
|
276
|
-
.verify()
|
|
277
|
-
.withCurrency("USD")
|
|
278
|
-
.withPaymentMethod(card)
|
|
279
|
-
.execute()];
|
|
280
|
-
case 1:
|
|
281
|
-
response = _a.sent();
|
|
282
|
-
t.truthy(response);
|
|
283
|
-
t.is(response.responseCode, "00");
|
|
284
|
-
return [2 /*return*/];
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}); });
|
|
288
|
-
test("reverse by client transaction ID", function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
289
|
-
var response, voidResponse;
|
|
290
|
-
return __generator(this, function (_a) {
|
|
291
|
-
switch (_a.label) {
|
|
292
|
-
case 0:
|
|
293
|
-
t.plan(4);
|
|
294
|
-
return [4 /*yield*/, service
|
|
295
|
-
.charge(19)
|
|
296
|
-
.withCurrency("USD")
|
|
297
|
-
.withPaymentMethod(card)
|
|
298
|
-
.withClientTransactionId("123456789")
|
|
299
|
-
.withAllowDuplicates(true)
|
|
300
|
-
.execute()];
|
|
301
|
-
case 1:
|
|
302
|
-
response = _a.sent();
|
|
303
|
-
t.truthy(response);
|
|
304
|
-
t.is(response.responseCode, "00");
|
|
305
|
-
return [4 /*yield*/, service.void(response.transactionId).execute()];
|
|
306
|
-
case 2:
|
|
307
|
-
voidResponse = _a.sent();
|
|
308
|
-
t.truthy(voidResponse);
|
|
309
|
-
t.is(voidResponse.responseCode, "00");
|
|
310
|
-
return [2 /*return*/];
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}); });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|