From 508660450d9d9e54af945f8bd80409926eb74277 Mon Sep 17 00:00:00 2001 From: Dimitar Natskin emerchantpay Date: Fri, 16 Aug 2024 14:56:22 +0300 Subject: [PATCH] 5.4.3.7 --- .gitignore | 3 + .phpcs.xml | 1 + .phpmd.xml | 1 + .pronto.yml | 6 - Gemfile | 6 - Gemfile.lock | 53 - LICENSE | 83 ++ README.md | 36 +- VERSION | 1 + .../Ecomprocessing/Genesis/Helpers/Helper.php | 42 +- .../Genesis/Helpers/ThreedsHelper.php | 10 +- .../Helpers/ThreedsIndicatorHelper.php | 15 +- .../Financial/Alternatives/ABNiDEAL.php | 110 -- .../Financial/Alternatives/Earthport.php | 325 ----- .../Request/Financial/Alternatives/INPay.php | 230 ---- .../Financial/Alternatives/PaypalExpress.php | 68 - .../Alternatives/Trustly/Withdrawal.php | 104 -- .../API/Request/Financial/Cards/Credit.php | 66 - .../Financial/CashPayments/Banamex.php | 57 - .../Request/Financial/CashPayments/Pix.php | 123 -- .../Financial/CashPayments/SantanderCash.php | 50 - .../Financial/CashPayments/Surtimax.php | 50 - .../OnlineBankingPayments/Alipay.php | 99 -- .../OnlineBankingPayments/AstropayDirect.php | 99 -- .../OnlineBankingPayments/Citadel/Payin.php | 117 -- .../OnlineBankingPayments/Citadel/Payout.php | 256 ---- .../OnlineBankingPayments/Entercash.php | 203 --- .../OnlineBankingPayments/GiroPay.php | 124 -- .../OnlineBankingPayments/InstantTransfer.php | 152 --- .../OnlineBankingPayments/TrustPay.php | 98 -- .../Request/Financial/PayByVouchers/Sale.php | 127 -- .../Request/Financial/PayByVouchers/oBeP.php | 216 --- .../Financial/Vouchers/AstropayCard.php | 102 -- .../API/Request/Financial/Wallets/Qiwi.php | 122 -- .../API/Request/Financial/Wallets/Zimpler.php | 99 -- .../Genesis/API/Request/NonFinancial/AVS.php | 125 -- .../NonFinancial/AccountVerification.php | 144 -- .../Request/Financial/VoucherAttributes.php | 50 - .../Constants/BankAccountTypes.php | 15 +- .../Genesis/{API => Api}/Constants/Banks.php | 19 +- .../{API => Api}/Constants/DateTimeFormat.php | 8 +- .../{API => Api}/Constants/Endpoints.php | 8 +- .../{API => Api}/Constants/Environments.php | 8 +- .../Genesis/{API => Api}/Constants/Errors.php | 145 +- .../Alternatives/Trustly/ClearingHouses.php | 104 ++ .../Fraud/Chargeback/ExternallyProcessed.php | 7 +- .../Fraud/Chargeback/ProcessingTypes.php | 7 +- .../NonFinancial/Kyc}/CallServiceTypes.php | 7 +- .../Kyc}/CallVerificationStatuses.php | 7 +- .../NonFinancial/Kyc/CvvPresents.php} | 11 +- .../Kyc}/DeviceFingerprintTypes.php | 7 +- .../NonFinancial/Kyc}/DocumentTypes.php | 7 +- .../Constants/NonFinancial/Kyc}/Genders.php | 7 +- .../Kyc}/IdentityDocumentMethods.php | 7 +- .../NonFinancial/Kyc}/IndustryTypes.php | 7 +- .../NonFinancial/Kyc}/PaymentMethods.php | 7 +- .../NonFinancial/Kyc}/ProfileActionTypes.php | 7 +- .../Kyc}/ProfileCurrentStatuses.php | 7 +- .../NonFinancial/Kyc}/TransactionStatuses.php | 7 +- .../Kyc}/VerificationAddressesTypes.php | 7 +- .../Kyc}/VerificationDocumentTypes.php | 5 +- .../Kyc}/VerificationLanguages.php | 8 +- .../Kyc}/VerificationSupportedModes.php | 7 +- .../Constants/NonFinancial/Services.php} | 29 +- .../Constants/Payment/Methods.php | 15 +- .../Transaction/CustomRequiredParameters.php | 55 +- .../Constants/Transaction/Names.php | 37 +- .../Parameters/AfricanMobileOperators.php | 7 +- .../Parameters/Alternatives/AccountTypes.php | 7 +- .../Parameters/Alternatives/P24/BankCodes.php | 7 +- .../Alternatives/PurposeOfRemittances.php | 7 +- .../Parameters/Business/PaymentTypes.php | 7 +- .../Parameters/CashPayments/CompanyTypes.php | 89 ++ .../Parameters/CashPayments/Gender.php | 65 + .../CashPayments/MaritalStatuses.php | 79 ++ .../Parameters/CredentialOnFile.php | 7 +- .../CustomerIdentificationOwner.php | 7 +- .../CustomerIdentificationSubType.php | 8 +- .../CustomerIdentificationType.php | 7 +- .../Parameters/Funding/IdentifierTypes.php | 8 +- .../Funding/ReceiverAccountTypes.php | 8 +- .../Transaction/Parameters/IFrameTargets.php | 7 +- .../Parameters/IdentificationTypes.php | 7 +- .../ManagedRecurring/AmountTypes.php | 7 +- .../ManagedRecurring/Frequencies.php | 7 +- .../Parameters/ManagedRecurring/Intervals.php | 7 +- .../Parameters/ManagedRecurring/Modes.php | 7 +- .../ManagedRecurring/PaymentTypes.php | 7 +- .../Mobile/ApplePay/PaymentTypes.php | 5 +- .../Mobile/GooglePay/PaymentTypes.php | 5 +- .../Parameters/MpiProtocolSubVersions.php | 94 ++ .../Parameters/MpiProtocolVersions.php | 7 +- .../OnlineBanking/BankCodeParameters.php | 17 +- .../OnlineBanking/Ideal/AllowedBanks.php | 7 +- .../Parameters/OnlineBanking/PaymentTypes.php | 7 +- .../OnlineBanking/PayoutBankParameters.php | 7 +- .../PayoutPaymentTypesParameters.php | 7 +- .../Parameters/Payout/MoneyTransferTypes.php | 7 +- .../Parameters/Recurring/Categories.php | 5 +- .../Parameters/Recurring/Types.php | 5 +- .../Refund/BankAccountTypeParameters.php | 5 +- .../Parameters/RussianMobileOperators.php | 7 +- .../Transaction/Parameters/ScaExemptions.php | 7 +- .../Transaction/Parameters/SourceOfFunds.php | 7 +- .../Threeds/V2/Browser/ColorDepths.php | 7 +- .../PasswordChangeIndicators.php | 7 +- .../RegistrationIndicators.php | 7 +- .../ShippingAddressUsageIndicators.php | 7 +- .../SuspiciousActivityIndicators.php | 7 +- .../V2/CardHolderAccount/UpdateIndicators.php | 7 +- .../V2/Control/ChallengeIndicators.php | 7 +- .../V2/Control/ChallengeWindowSizes.php | 7 +- .../Threeds/V2/Control/DeviceTypes.php | 7 +- .../V2/MerchantRisk/DeliveryTimeframes.php | 7 +- .../PreOrderPurchaseIndicators.php | 7 +- .../V2/MerchantRisk/ReorderItemIndicators.php | 9 +- .../V2/MerchantRisk/ShippingIndicators.php | 7 +- .../Threeds/V2/Purchase/Categories.php | 7 +- .../Parameters/Threeds/V2/Sdk/Interfaces.php | 7 +- .../Parameters/Threeds/V2/Sdk/UiTypes.php | 7 +- .../Wallets/PayPal/PaymentTypes.php | 7 +- .../Constants/Transaction/States.php | 54 +- .../Constants/Transaction/Types.php | 301 +---- .../Genesis/{API => Api}/Constants/i18n.php | 10 +- .../src/Genesis/{API => Api}/Notification.php | 47 +- .../src/Genesis/{API => Api}/Request.php | 74 +- .../Request/Base/BaseVersionedRequest.php | 14 +- .../{API => Api}/Request/Base/Financial.php | 67 +- .../Request/Base/Financial/Alternative.php | 19 +- .../Base/Financial/Alternative/Klarna.php | 16 +- .../Base/Financial/Cards/CreditCard.php | 28 +- .../Base/Financial/Cards/CreditCard3D.php | 14 +- .../Request/Base/Financial/GiftCard.php | 24 +- .../Request/Base/Financial/Reference.php | 16 +- .../Base/Financial/SouthAmericanPayment.php | 25 +- .../Api/Request/Base/GraphqlRequest.php | 253 ++++ .../Alternatives/Klarna/BaseRequest.php | 104 ++ .../Alternatives/Trustly/BaseRequest.php | 174 +++ .../NonFinancial/Consumers/BaseRequest.php | 10 +- .../Base/NonFinancial/DateRangeRequest.php | 56 +- .../Base/NonFinancial/Fx/BaseRequest.php | 10 +- .../Base/NonFinancial/Kyc}/BaseRequest.php | 30 +- .../TokenizationApi/BaseRequest.php | 9 +- .../Alternatives/Klarna/Authorize.php | 20 +- .../Financial/Alternatives/Klarna/Capture.php | 13 +- .../Financial/Alternatives/Klarna/Item.php | 341 ++--- .../Financial/Alternatives/Klarna/Items.php | 23 +- .../Klarna/ProductIdentifiers.php | 7 +- .../Financial/Alternatives/Klarna/Refund.php | 13 +- .../Request/Financial/Alternatives/P24.php | 14 +- .../Request/Financial/Alternatives/Poli.php} | 13 +- .../Request/Financial/Alternatives/Ppro.php} | 73 +- .../Request/Financial/Alternatives/Sofort.php | 24 +- .../Alternatives/TransferTo/Payout.php | 35 +- .../Financial/Alternatives/Trustly/Sale.php | 30 +- .../{API => Api}/Request/Financial/Cancel.php | 14 +- .../Request/Financial/Capture.php | 19 +- .../Request/Financial/Cards/Argencard.php | 11 +- .../Request/Financial/Cards/Aura.php | 11 +- .../Request/Financial/Cards/Authorize.php | 83 +- .../Request/Financial/Cards/Authorize3D.php | 74 +- .../Request/Financial/Cards/Bancontact.php | 21 +- .../Request/Financial/Cards/Cabal.php | 11 +- .../Request/Financial/Cards/Cencosud.php | 11 +- .../Api/Request/Financial/Cards/Credit.php | 109 ++ .../Request/Financial/Cards/Elo.php | 11 +- .../Financial/Cards/EzeeCardPayout.php | 12 +- .../Request/Financial/Cards/Naranja.php | 11 +- .../Request/Financial/Cards/Nativa.php | 11 +- .../Request/Financial/Cards/Payout.php | 38 +- .../Cards/Recurring/InitRecurringSale.php | 49 +- .../Cards/Recurring/InitRecurringSale3D.php | 61 +- .../Cards/Recurring/RecurringSale.php | 28 +- .../Request/Financial/Cards/Sale.php | 78 +- .../Request/Financial/Cards/Sale3D.php | 74 +- .../Financial/Cards/TarjetaShopping.php | 11 +- .../Cards/Threeds/V2/MethodContinue.php | 21 +- .../Request/Financial/CashPayments/Baloto.php | 11 +- .../CashPayments/BancoDeOccidente.php | 11 +- .../Request/Financial/CashPayments/Boleto.php | 11 +- .../Request/Financial/CashPayments/Efecty.php | 11 +- .../Request/Financial/CashPayments/Oxxo.php | 11 +- .../Financial/CashPayments/PagoFacil.php | 11 +- .../Request/Financial/CashPayments/Pix.php | 251 ++++ .../Financial/CashPayments/Redpagos.php | 11 +- .../Financial/Crypto/BitPay/Payout.php | 25 +- .../Financial/Crypto/BitPay/Refund.php | 18 +- .../Request/Financial/Crypto/BitPay/Sale.php | 19 +- .../Financial/GiftCards/Fashioncheque.php | 11 +- .../Financial/GiftCards/Intersolve.php | 11 +- .../Request/Financial/GiftCards/Tcs.php | 11 +- .../Financial/Mobile/AfricanMobileSale.php | 23 +- .../Request/Financial/Mobile/ApplePay.php | 39 +- .../Request/Financial/Mobile/GooglePay.php | 48 +- .../Financial/Mobile/RussianMobileSale.php | 26 +- .../OnlineBankingPayments/BancoDoBrasil.php | 31 +- .../OnlineBankingPayments/Bancomer.php | 13 +- .../OnlineBankingPayments/Bradesco.php | 13 +- .../OnlineBankingPayments/Davivienda.php | 13 +- .../Financial/OnlineBankingPayments/Eps.php | 24 +- .../Financial/OnlineBankingPayments/Ideal.php | 30 +- .../OnlineBankingPayments/Idebit}/Payin.php | 18 +- .../OnlineBankingPayments/Idebit}/Payout.php | 11 +- .../InstaDebit/Payin.php | 11 +- .../InstaDebit/Payout.php | 11 +- .../Financial/OnlineBankingPayments/Itau.php | 13 +- .../OnlineBankingPayments/Multibanco.php | 24 +- .../OnlineBankingPayments/MyBank.php | 24 +- .../OnlineBanking/Payin.php | 39 +- .../OnlineBanking/Payout.php | 66 +- .../Financial/OnlineBankingPayments/PayU.php | 24 +- .../OnlineBankingPayments/PostFinance.php | 24 +- .../Financial/OnlineBankingPayments/Pse.php | 13 +- .../OnlineBankingPayments/RapiPago.php | 13 +- .../OnlineBankingPayments/SafetyPay.php | 24 +- .../OnlineBankingPayments/Santander.php | 13 +- .../Financial/OnlineBankingPayments/Upi.php | 29 +- .../OnlineBankingPayments/WeChat.php | 21 +- .../OnlineBankingPayments/Webpay.php | 11 +- .../Financial/Payout/AfricanMobilePayout.php | 23 +- .../Financial/Payout/RussianMobilePayout.php | 21 +- .../Preauthorization/IncrementalAuthorize.php | 8 +- .../Preauthorization/PartialReversal.php | 8 +- .../{API => Api}/Request/Financial/Refund.php | 23 +- .../Request/Financial/Sct}/Payout.php | 12 +- .../Sdd}/Recurring/InitRecurringSale.php | 12 +- .../Sdd}/Recurring/RecurringSale.php | 11 +- .../Request/Financial/Sdd}/Refund.php | 13 +- .../Request/Financial/Sdd}/Sale.php | 29 +- .../TravelData/AirlineItineraryLegData.php | 17 +- .../TravelData/AirlineItineraryTaxesData.php | 4 +- .../TravelData/Base/AidAttributes.php | 5 +- .../Request/Financial/Vouchers/CashU.php | 21 +- .../Request/Financial/Vouchers/Neosurf.php | 23 +- .../Financial/Vouchers/Paysafecard.php | 21 +- .../Request/Financial/Wallets/EzeeWallet.php} | 65 +- .../Request/Financial/Wallets/Neteller.php | 21 +- .../Request/Financial/Wallets/PayPal.php | 39 +- .../Request/Financial/Wallets/WebMoney.php | 23 +- .../Klarna/ReleaseAuthorization.php} | 41 +- .../Alternatives/Klarna/ResendInvoice.php} | 38 +- .../Alternatives/Klarna/UpdateAddress.php} | 59 +- .../Alternatives/Klarna/UpdateItems.php | 102 ++ .../Alternatives/TransferTo/Payers.php | 10 +- .../Alternatives/Trustly/RegisterAccount.php | 128 ++ .../Alternatives/Trustly/SelectAccount.php | 154 +++ .../NonFinancial/BillingApi/Transaction.php | 536 ++++++++ .../Request/NonFinancial/Blacklist.php | 8 +- .../Request/NonFinancial/Consumers/Create.php | 17 +- .../NonFinancial/Consumers/Disable.php | 10 +- .../Request/NonFinancial/Consumers/Enable.php | 10 +- .../NonFinancial/Consumers/GetCards.php | 92 ++ .../NonFinancial/Consumers/Retrieve.php | 10 +- .../Request/NonFinancial/Consumers/Update.php | 17 +- .../Fraud/Chargeback/DateRange.php | 62 +- .../Fraud/Chargeback/Transaction.php | 8 +- .../NonFinancial/Fraud/Reports/DateRange.php | 9 +- .../Fraud/Reports/Transaction.php | 8 +- .../Fraud/Retrieval/DateRange.php | 10 +- .../Fraud/Retrieval/Transaction.php | 8 +- .../Request/NonFinancial/Fx/GetRate.php | 12 +- .../Request/NonFinancial/Fx/GetRates.php | 12 +- .../Request/NonFinancial/Fx/GetTier.php | 12 +- .../Request/NonFinancial/Fx/GetTiers.php | 12 +- .../Request/NonFinancial/Fx/SearchRate.php | 10 +- .../Request/NonFinancial/Kyc}/Call/Create.php | 13 +- .../Request/NonFinancial/Kyc}/Call/Update.php | 13 +- .../Kyc}/ClientVerification/Register.php | 11 +- .../Kyc}/ClientVerification/Status.php | 11 +- .../Kyc}/ClientVerification/Verify.php | 91 +- .../Request/NonFinancial/Kyc/Cnpj/Check.php | 94 ++ .../Kyc}/ConsumerRegistration/Create.php | 22 +- .../Kyc}/ConsumerRegistration/Update.php | 11 +- .../Request/NonFinancial/Kyc/Cpf/Check.php | 94 ++ .../Kyc}/IdentityDocument/Download.php | 9 +- .../Kyc}/IdentityDocument/Upload.php | 13 +- .../NonFinancial/Kyc}/Transaction/Create.php | 37 +- .../NonFinancial/Kyc}/Transaction/Update.php | 12 +- .../ProcessedBatches/PostDateRange.php | 94 ++ .../ProcessedTransactions/DateRange.php | 14 +- .../ProcessedTransactions/PostDateRange.php | 16 +- .../ProcessedTransactions/Transaction.php | 10 +- .../NonFinancial/Reconcile/DateRange.php | 93 ++ .../NonFinancial/Reconcile/Transaction.php | 8 +- .../Request/NonFinancial/Sca/Checker.php | 13 +- .../TokenizationApi/DeleteToken.php | 16 +- .../TokenizationApi/Detokenize.php | 17 +- .../NonFinancial/TokenizationApi/GetCard.php | 16 +- .../NonFinancial/TokenizationApi/Tokenize.php | 16 +- .../TokenizationApi/UpdateToken.php | 19 +- .../TokenizationApi/ValidateToken.php | 16 +- .../TransactionApi/CardExpiryDateUpdate.php | 12 +- .../WPF => Api/Request/Wpf}/Create.php | 239 +--- .../WPF => Api/Request/Wpf}/Reconcile.php | 8 +- .../src/Genesis/{API => Api}/Response.php | 136 +- .../{API => Api}/Traits/MagicAccessors.php | 7 +- .../Traits/Request/AddressInfoAttributes.php | 15 +- .../Traits/Request/BaseAttributes.php | 7 +- .../Traits/Request/CreditCardAttributes.php | 12 +- .../CustomerAddress/BillingInfoAttributes.php | 32 +- .../CustomerInfoAttributes.php | 7 +- .../ShippingInfoAttributes.php | 32 +- .../Traits/Request/DocumentAttributes.php | 9 +- .../Financial/AccountOwnerAttributes.php} | 50 +- .../Request/Financial/AsyncAttributes.php | 7 +- .../Request/Financial/BankAttributes.php | 25 +- .../Financial/BeneficiaryAttributes.php | 7 +- .../Request/Financial/BirthDateAttributes.php | 9 +- .../AirlinesAirCarriersAttributes.php | 9 +- .../Financial/Business/BusinessAttributes.php | 19 +- .../CarPlaneAndBoatRentalsAttributes.php | 9 +- .../Business/CruiseLinesAttributes.php | 9 +- .../Business/EventManagementAttributes.php | 9 +- .../Business/FurnitureAttributes.php | 9 +- .../HotelsAndRealEstateRentalsAttributes.php | 9 +- .../Business/TravelAgenciesAttributes.php | 9 +- .../Recurring/ManagedRecurringAttributes.php | 13 +- .../ManagedRecurringIndianCardAttributes.php | 13 +- .../Recurring/RecurringCategoryAttributes.php | 9 +- .../Recurring/RecurringTypeAttributes.php | 25 +- .../SubsequentRecurringTypeAttributes.php | 87 ++ .../Financial/CredentialOnFileAttributes.php | 9 +- .../Request/Financial/CryptoAttributes.php | 7 +- .../Request/Financial}/CustomerAttributes.php | 21 +- .../Financial/CustomerIdentificationData.php | 13 +- .../Financial/DescriptorAttributes.php | 7 +- .../Request/Financial/FundingAttributes.php | 11 +- .../Request/Financial/FxRateAttributes.php | 7 +- .../Request/Financial/GamingAttributes.php | 7 +- .../Request/Financial/MpiAttributes.php | 38 +- .../Financial/NotificationAttributes.php | 8 +- .../UserCategoryAttributes.php | 7 +- .../VirtualPaymentAddressAttributes.php | 9 +- .../Request/Financial/PaymentAttributes.php | 7 +- .../Financial/PendingPaymentAttributes.php | 7 +- .../Request/Financial/PproAttributes.php | 11 +- .../Financial/PreauthorizationAttributes.php | 7 +- .../Financial/PurposeOfPaymentAttributes.php | 45 + .../Request/Financial/ReferenceAttributes.php | 7 +- .../Financial/Refund/BankAttributes.php | 9 +- .../Request/Financial/ScaAttributes.php | 9 +- .../Financial/SourceOfFundsAttributes.php | 10 +- .../Financial/Threeds/V2/AllAttributes.php | 10 +- .../Request/Financial/Threeds/V2/Browser.php | 10 +- .../Threeds/V2/CardHolderAccount.php | 19 +- .../Financial/Threeds/V2/CommonAttributes.php | 21 +- .../Request/Financial/Threeds/V2/Control.php | 13 +- .../Financial/Threeds/V2/MerchantRisk.php | 20 +- .../Request/Financial/Threeds/V2/Method.php | 7 +- .../Request/Financial/Threeds/V2/Purchase.php | 9 +- .../Financial/Threeds/V2/Recurring.php | 9 +- .../Request/Financial/Threeds/V2/Sdk.php | 12 +- .../Financial/Threeds/V2/WpfAttributes.php | 16 +- .../TravelData/AirlineItineraryAttributes.php | 13 +- .../TravelData/CarRentalAttributes.php | 9 +- .../TravelData/HotelRentalAttributes.php | 9 +- .../TravelData/ReferenceTicketAttributes.php | 7 +- .../TravelData/TravelDataAttributes.php | 13 +- .../Request/Financial/UcofAttributes.php | 7 +- .../Request/Mobile/ApplePayAttributes.php | 43 +- .../Request/Mobile/GooglePayAttributes.php | 5 +- .../Traits/Request/MotoAttributes.php | 7 +- .../BillingApi/OrderByDirection.php} | 62 +- .../NonFinancial/CustomerInformation.php | 13 +- .../Request/NonFinancial/DateAttributes.php} | 73 +- .../Request/NonFinancial/DepositLimits.php | 9 +- .../NonFinancial/ExternallyProcessed.php | 10 +- .../NonFinancial/IdentityDocuments.php | 7 +- .../Kyc}/KycBackgroundChecksVerifications.php | 9 +- .../Kyc}/KycDocumentVerifications.php | 11 +- .../Kyc}/KycFaceVerifications.php | 8 +- .../NonFinancial/Kyc}/KycVerifications.php | 77 +- .../NonFinancial/KycBillingInformation.php | 11 +- .../NonFinancial/KycShippingInformation.php | 7 +- .../NonFinancial/PagingAttributes.php} | 73 +- .../Request/NonFinancial/PaymentDetails.php | 11 +- .../Request/NonFinancial/ProcessingType.php | 10 +- .../TokenizationApiAttributes.php | 7 +- .../TokenizationApiCardAttributes.php | 9 +- .../TokenizationApiTokenAttributes.php | 7 +- .../Payout/MoneyTransferPayoutAttributes.php | 11 +- .../Traits/Request/RiskAttributes.php | 7 +- .../Traits/Request/TokenizationAttributes.php | 10 +- .../Api/Traits/Request/Wpf/Validations.php | 183 +++ .../{API => Api}/Traits/RestrictedSetter.php | 11 +- .../Validations/Request/Validations.php | 31 +- .../Validators/Request/Base/Validator.php | 17 +- .../Validators/Request/RegexValidator.php | 20 +- .../Library/Genesis/src/Genesis/Builder.php | 9 +- .../Genesis/Builders/{FORM.php => Form.php} | 7 +- .../Genesis/Builders/{JSON.php => Json.php} | 12 +- .../src/Genesis/Builders/{XML.php => Xml.php} | 13 +- .../Library/Genesis/src/Genesis/Config.php | 113 +- .../Genesis/Exceptions/DeprecatedMethod.php | 4 +- .../Genesis/Exceptions/EnvironmentNotSet.php | 4 +- .../src/Genesis/Exceptions/ErrorAPI.php | 48 - .../src/Genesis/Exceptions/ErrorNetwork.php | 6 +- .../src/Genesis/Exceptions/ErrorParameter.php | 4 +- .../src/Genesis/Exceptions/Exception.php | 3 +- .../Genesis/Exceptions/InvalidArgument.php | 4 +- .../src/Genesis/Exceptions/InvalidMethod.php | 7 +- .../Genesis/Exceptions/InvalidResponse.php | 4 +- .../src/Genesis/Exceptions/NotImplemented.php | 4 +- .../Library/Genesis/src/Genesis/Genesis.php | 12 +- .../src/Genesis/Interfaces/Builder.php | 4 +- .../Genesis/src/Genesis/Interfaces/Parser.php | 4 +- .../Library/Genesis/src/Genesis/Network.php | 68 +- .../Genesis/src/Genesis/Network/Base.php | 8 +- .../Genesis/Network/{cURL.php => Curl.php} | 29 +- .../Genesis/src/Genesis/Network/Stream.php | 26 +- .../Library/Genesis/src/Genesis/Parser.php | 12 +- .../Genesis/Parsers/{JSON.php => Json.php} | 8 +- .../src/Genesis/Parsers/{XML.php => Xml.php} | 27 +- .../Genesis/src/Genesis/Utils/Common.php | 22 +- .../Genesis/src/Genesis/Utils/Country.php | 4 +- .../Genesis/src/Genesis/Utils/Currency.php | 2 + .../src/Genesis/Utils/Requirements.php | 14 +- .../Genesis/src/Genesis/Utils/Threeds/V2.php | 5 +- .../Module/Ecomprocessing/Genesis/Main.php | 4 +- .../Payment/Processor/AEcomprocessing.php | 66 +- .../Processor/EcomprocessingCheckout.php | 87 +- .../Checkout/Select/ChallengeIndicator.php | 2 +- .../Checkout/Select/ScaExemption.php | 2 +- .../Checkout/Select/TransactionTypes.php | 21 +- .../Genesis/View/Model/AEcomprocessing.php | 4 +- .../Genesis/changelog/5.4/3/5.log | 6 + .../Genesis/changelog/5.4/3/6.log | 7 + .../Genesis/changelog/5.4/3/7.log | 9 + .../Module/Ecomprocessing/Genesis/main.yaml | 2 +- composer.json | 35 + composer.lock | 1188 +++++++++++++++++ .../Genesis/css/style.css | 0 .../Genesis/images/EComProcessing-logo.png | Bin .../images/ecomprocessing_checkout.png | Bin .../Genesis/method_icon.png | Bin .../method_icon_EComProcessingCheckout.png | Bin .../Genesis/settings/body.tpl | 0 437 files changed, 8280 insertions(+), 6904 deletions(-) delete mode 100644 .pronto.yml delete mode 100644 Gemfile delete mode 100644 Gemfile.lock create mode 100644 LICENSE create mode 100644 VERSION delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/ABNiDEAL.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Earthport.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/INPay.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/PaypalExpress.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Trustly/Withdrawal.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Credit.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Banamex.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Pix.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/SantanderCash.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Surtimax.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Alipay.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/AstropayDirect.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payin.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payout.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Entercash.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/GiroPay.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/InstantTransfer.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/TrustPay.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/Sale.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/oBeP.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Vouchers/AstropayCard.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Qiwi.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Zimpler.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AVS.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AccountVerification.php delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/VoucherAttributes.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/BankAccountTypes.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Banks.php (98%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/DateTimeFormat.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Endpoints.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Environments.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Errors.php (83%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/NonFinancial/Alternatives/Trustly/ClearingHouses.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/NonFinancial/Fraud/Chargeback/ExternallyProcessed.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/NonFinancial/Fraud/Chargeback/ProcessingTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/CallServiceTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/CallVerificationStatuses.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC/CVVPresents.php => Api/Constants/NonFinancial/Kyc/CvvPresents.php} (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/DeviceFingerprintTypes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/DocumentTypes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/Genders.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/IdentityDocumentMethods.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/IndustryTypes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/PaymentMethods.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/ProfileActionTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/ProfileCurrentStatuses.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/TransactionStatuses.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/VerificationAddressesTypes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/VerificationDocumentTypes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/VerificationLanguages.php (98%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/KYC => Api/Constants/NonFinancial/Kyc}/VerificationSupportedModes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/Cards/Hipercard.php => Api/Constants/NonFinancial/Services.php} (68%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Payment/Methods.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/CustomRequiredParameters.php (63%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Names.php (80%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/AfricanMobileOperators.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Alternatives/AccountTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Alternatives/P24/BankCodes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Alternatives/PurposeOfRemittances.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Business/PaymentTypes.php (89%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/CashPayments/CompanyTypes.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/CashPayments/Gender.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/CashPayments/MaritalStatuses.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/CredentialOnFile.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/CustomerIdentification/CustomerIdentificationOwner.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/CustomerIdentification/CustomerIdentificationSubType.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/CustomerIdentification/CustomerIdentificationType.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Funding/IdentifierTypes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Funding/ReceiverAccountTypes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/IFrameTargets.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/IdentificationTypes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ManagedRecurring/AmountTypes.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ManagedRecurring/Frequencies.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ManagedRecurring/Intervals.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ManagedRecurring/Modes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ManagedRecurring/PaymentTypes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Mobile/ApplePay/PaymentTypes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Mobile/GooglePay/PaymentTypes.php (93%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/MpiProtocolSubVersions.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/MpiProtocolVersions.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/OnlineBanking/BankCodeParameters.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/OnlineBanking/PaymentTypes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/OnlineBanking/PayoutBankParameters.php (99%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/OnlineBanking/PayoutPaymentTypesParameters.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Payout/MoneyTransferTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Recurring/Categories.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Recurring/Types.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Refund/BankAccountTypeParameters.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/RussianMobileOperators.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/ScaExemptions.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/SourceOfFunds.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Browser/ColorDepths.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/CardHolderAccount/PasswordChangeIndicators.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/CardHolderAccount/RegistrationIndicators.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/CardHolderAccount/ShippingAddressUsageIndicators.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/CardHolderAccount/SuspiciousActivityIndicators.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/CardHolderAccount/UpdateIndicators.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Control/ChallengeIndicators.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Control/ChallengeWindowSizes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Control/DeviceTypes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/MerchantRisk/DeliveryTimeframes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/MerchantRisk/PreOrderPurchaseIndicators.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/MerchantRisk/ReorderItemIndicators.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/MerchantRisk/ShippingIndicators.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Purchase/Categories.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Sdk/Interfaces.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Threeds/V2/Sdk/UiTypes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Parameters/Wallets/PayPal/PaymentTypes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/States.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/Transaction/Types.php (76%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Constants/i18n.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Notification.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/BaseVersionedRequest.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial.php (63%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/Alternative.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/Alternative/Klarna.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/Cards/CreditCard.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/Cards/CreditCard3D.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/GiftCard.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/Reference.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/Financial/SouthAmericanPayment.php (83%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/GraphqlRequest.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Klarna/BaseRequest.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Trustly/BaseRequest.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/NonFinancial/Consumers/BaseRequest.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/NonFinancial/DateRangeRequest.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/NonFinancial/Fx/BaseRequest.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Base/NonFinancial/KYC => Api/Request/Base/NonFinancial/Kyc}/BaseRequest.php (73%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/Authorize.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/Capture.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/Item.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/Items.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Klarna/Refund.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/P24.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/Alternatives/POLi.php => Api/Request/Financial/Alternatives/Poli.php} (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/Alternatives/PPRO.php => Api/Request/Financial/Alternatives/Ppro.php} (75%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Sofort.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/TransferTo/Payout.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Alternatives/Trustly/Sale.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cancel.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Capture.php (79%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Argencard.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Aura.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Authorize.php (67%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Authorize3D.php (74%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Bancontact.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Cabal.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Cencosud.php (84%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Credit.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Elo.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/EzeeCardPayout.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Naranja.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Nativa.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Payout.php (71%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Recurring/InitRecurringSale.php (72%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Recurring/InitRecurringSale3D.php (76%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Recurring/RecurringSale.php (80%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Sale.php (67%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Sale3D.php (74%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/TarjetaShopping.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Cards/Threeds/V2/MethodContinue.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/Baloto.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/BancoDeOccidente.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/Boleto.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/Efecty.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/Oxxo.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/PagoFacil.php (83%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Pix.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/CashPayments/Redpagos.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Crypto/BitPay/Payout.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Crypto/BitPay/Refund.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Crypto/BitPay/Sale.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/GiftCards/Fashioncheque.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/GiftCards/Intersolve.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/GiftCards/Tcs.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Mobile/AfricanMobileSale.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Mobile/ApplePay.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Mobile/GooglePay.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Mobile/RussianMobileSale.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/BancoDoBrasil.php (79%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Bancomer.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Bradesco.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Davivienda.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Eps.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Ideal.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/OnlineBankingPayments/iDebit => Api/Request/Financial/OnlineBankingPayments/Idebit}/Payin.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/OnlineBankingPayments/iDebit => Api/Request/Financial/OnlineBankingPayments/Idebit}/Payout.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/InstaDebit/Payin.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/InstaDebit/Payout.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Itau.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Multibanco.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/MyBank.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/OnlineBanking/Payin.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/PayU.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/PostFinance.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Pse.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/RapiPago.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/SafetyPay.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Santander.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Upi.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/WeChat.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/OnlineBankingPayments/Webpay.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Payout/AfricanMobilePayout.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Payout/RussianMobilePayout.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Preauthorization/IncrementalAuthorize.php (58%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Preauthorization/PartialReversal.php (58%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Refund.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/SCT => Api/Request/Financial/Sct}/Payout.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/SDD => Api/Request/Financial/Sdd}/Recurring/InitRecurringSale.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/SDD => Api/Request/Financial/Sdd}/Recurring/RecurringSale.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/SDD => Api/Request/Financial/Sdd}/Refund.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/SDD => Api/Request/Financial/Sdd}/Sale.php (80%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/TravelData/AirlineItineraryLegData.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/TravelData/AirlineItineraryTaxesData.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/TravelData/Base/AidAttributes.php (70%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Vouchers/CashU.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Vouchers/Neosurf.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Vouchers/Paysafecard.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/Wallets/eZeeWallet.php => Api/Request/Financial/Wallets/EzeeWallet.php} (67%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Wallets/Neteller.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Wallets/PayPal.php (80%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/Financial/Wallets/WebMoney.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/CashPayments/EmpreseDeEnergia.php => Api/Request/NonFinancial/Alternatives/Klarna/ReleaseAuthorization.php} (62%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/Financial/CashPayments/Carulla.php => Api/Request/NonFinancial/Alternatives/Klarna/ResendInvoice.php} (64%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/Retrieve/AbniDealBanks.php => Api/Request/NonFinancial/Alternatives/Klarna/UpdateAddress.php} (53%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/UpdateItems.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Alternatives/TransferTo/Payers.php (90%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Trustly/RegisterAccount.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Trustly/SelectAccount.php create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/BillingApi/Transaction.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Blacklist.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Consumers/Create.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Consumers/Disable.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Consumers/Enable.php (90%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Consumers/GetCards.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Consumers/Retrieve.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Consumers/Update.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Chargeback/DateRange.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Chargeback/Transaction.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Reports/DateRange.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Reports/Transaction.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Retrieval/DateRange.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fraud/Retrieval/Transaction.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fx/GetRate.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fx/GetRates.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fx/GetTier.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fx/GetTiers.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Fx/SearchRate.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/Call/Create.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/Call/Update.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/ClientVerification/Register.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/ClientVerification/Status.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/ClientVerification/Verify.php (76%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/Cnpj/Check.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/ConsumerRegistration/Create.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/ConsumerRegistration/Update.php (91%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/Cpf/Check.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/IdentityDocument/Download.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/IdentityDocument/Upload.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/Transaction/Create.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/KYC => Api/Request/NonFinancial/Kyc}/Transaction/Update.php (93%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/ProcessedBatches/PostDateRange.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/ProcessedTransactions/DateRange.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/ProcessedTransactions/PostDateRange.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/ProcessedTransactions/Transaction.php (91%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Reconcile/DateRange.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Reconcile/Transaction.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/Sca/Checker.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/DeleteToken.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/Detokenize.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/GetCard.php (82%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/Tokenize.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/UpdateToken.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TokenizationApi/ValidateToken.php (83%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Request/NonFinancial/TransactionApi/CardExpiryDateUpdate.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/WPF => Api/Request/Wpf}/Create.php (71%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/WPF => Api/Request/Wpf}/Reconcile.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Response.php (80%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/MagicAccessors.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/AddressInfoAttributes.php (79%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/BaseAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/CreditCardAttributes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/CustomerAddress/BillingInfoAttributes.php (77%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/CustomerAddress/CustomerInfoAttributes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/CustomerAddress/ShippingInfoAttributes.php (77%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/DocumentAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/NonFinancial/Services.php => Api/Traits/Request/Financial/AccountOwnerAttributes.php} (50%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/AsyncAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/BankAttributes.php (81%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/BeneficiaryAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/BirthDateAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/AirlinesAirCarriersAttributes.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/BusinessAttributes.php (84%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/CarPlaneAndBoatRentalsAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/CruiseLinesAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/EventManagementAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/FurnitureAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/HotelsAndRealEstateRentalsAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Business/TravelAgenciesAttributes.php (97%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Cards/Recurring/ManagedRecurringAttributes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Cards/Recurring/ManagedRecurringIndianCardAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Cards/Recurring/RecurringCategoryAttributes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Cards/Recurring/RecurringTypeAttributes.php (83%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Cards/Recurring/SubsequentRecurringTypeAttributes.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/CredentialOnFileAttributes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/CryptoAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Traits/Request/Financial/OnlineBankingPayments => Api/Traits/Request/Financial}/CustomerAttributes.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/CustomerIdentificationData.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/DescriptorAttributes.php (97%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/FundingAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/FxRateAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/GamingAttributes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/MpiAttributes.php (85%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/NotificationAttributes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/OnlineBankingPayments/UserCategoryAttributes.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/OnlineBankingPayments/VirtualPaymentAddressAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/PaymentAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/PendingPaymentAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/PproAttributes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/PreauthorizationAttributes.php (91%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/PurposeOfPaymentAttributes.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/ReferenceAttributes.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Refund/BankAttributes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/ScaAttributes.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/SourceOfFundsAttributes.php (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/AllAttributes.php (88%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Browser.php (97%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/CardHolderAccount.php (97%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/CommonAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Control.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/MerchantRisk.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Method.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Purchase.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Recurring.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/Sdk.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/Threeds/V2/WpfAttributes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/TravelData/CarRentalAttributes.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/TravelData/HotelRentalAttributes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/TravelData/ReferenceTicketAttributes.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/TravelData/TravelDataAttributes.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Financial/UcofAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Mobile/ApplePayAttributes.php (70%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Mobile/GooglePayAttributes.php (97%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/MotoAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/Transaction/Parameters/PayByVouchers/CardTypes.php => Api/Traits/Request/NonFinancial/BillingApi/OrderByDirection.php} (55%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/CustomerInformation.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Request/NonFinancial/Reconcile/DateRange.php => Api/Traits/Request/NonFinancial/DateAttributes.php} (68%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/DepositLimits.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/ExternallyProcessed.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/IdentityDocuments.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Traits/Request/NonFinancial/KYC => Api/Traits/Request/NonFinancial/Kyc}/KycBackgroundChecksVerifications.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Traits/Request/NonFinancial/KYC => Api/Traits/Request/NonFinancial/Kyc}/KycDocumentVerifications.php (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Traits/Request/NonFinancial/KYC => Api/Traits/Request/NonFinancial/Kyc}/KycFaceVerifications.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Traits/Request/NonFinancial/KYC => Api/Traits/Request/NonFinancial/Kyc}/KycVerifications.php (79%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/KycBillingInformation.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/KycShippingInformation.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API/Constants/Transaction/Parameters/PayByVouchers/RedeemTypes.php => Api/Traits/Request/NonFinancial/PagingAttributes.php} (51%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/PaymentDetails.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/ProcessingType.php (90%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/TokenizationApiAttributes.php (93%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/TokenizationApiCardAttributes.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/NonFinancial/TokenizationApiTokenAttributes.php (91%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/Payout/MoneyTransferPayoutAttributes.php (96%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/RiskAttributes.php (98%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Request/TokenizationAttributes.php (92%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Wpf/Validations.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/RestrictedSetter.php (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Traits/Validations/Request/Validations.php (92%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Validators/Request/Base/Validator.php (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/{API => Api}/Validators/Request/RegexValidator.php (87%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/{FORM.php => Form.php} (95%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/{JSON.php => Json.php} (89%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/{XML.php => Xml.php} (95%) delete mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorAPI.php rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/{cURL.php => Curl.php} (86%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/{JSON.php => Json.php} (94%) rename classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/{XML.php => Xml.php} (91%) create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/5.log create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/6.log create mode 100644 classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/7.log create mode 100644 composer.json create mode 100644 composer.lock rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/css/style.css (100%) rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/images/EComProcessing-logo.png (100%) rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/images/ecomprocessing_checkout.png (100%) rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/method_icon.png (100%) rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/method_icon_EComProcessingCheckout.png (100%) rename skins/admin/en/modules/{EComprocessing => Ecomprocessing}/Genesis/settings/body.tpl (100%) diff --git a/.gitignore b/.gitignore index 090a1f0..0b73d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .idea .DS_Store +vendor/ +phpcs_report.xml +phpmd_report.xml diff --git a/.phpcs.xml b/.phpcs.xml index 5305af0..18d1bad 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -5,4 +5,5 @@ */Genesis/src/* + */vendor/* diff --git a/.phpmd.xml b/.phpmd.xml index 45cafb7..09056fd 100644 --- a/.phpmd.xml +++ b/.phpmd.xml @@ -48,4 +48,5 @@ */Genesis/src/* + */vendor/* diff --git a/.pronto.yml b/.pronto.yml deleted file mode 100644 index e73969d..0000000 --- a/.pronto.yml +++ /dev/null @@ -1,6 +0,0 @@ -github: - slug: eMerchantPay/xcart-ecp-plugin - access_token: ENV['PRONTO_GITHUB_ACCESS_TOKEN'] - api_endpoint: ENV['PRONTO_GITHUB_API_ENDPOINT'] - web_endpoint: ENV['PRONTO_GITHUB_WEB_ENDPOINT'] -verbose: false diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 5f29bc2..0000000 --- a/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'http://rubygems.org' - -# code analysis -gem 'pronto', '~> 0.9.5' -gem 'pronto-phpcs', '~> 0.4.0', require: false -gem 'pronto-phpmd', '~> 0.4.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 925f5be..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,53 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - faraday (1.0.1) - multipart-post (>= 1.2, < 3) - gitlab (4.14.0) - httparty (~> 0.14, >= 0.14.0) - terminal-table (~> 1.5, >= 1.5.1) - httparty (0.21.0) - mini_mime (>= 1.0.0) - multi_xml (>= 0.5.2) - mini_mime (1.1.2) - multi_xml (0.6.0) - multipart-post (2.3.0) - octokit (4.25.1) - faraday (>= 1, < 3) - sawyer (~> 0.9) - pronto (0.9.5) - gitlab (~> 4.0, >= 4.0.0) - httparty (>= 0.13.7) - octokit (~> 4.7, >= 4.7.0) - rainbow (~> 2.1) - rugged (~> 0.24, >= 0.23.0) - thor (~> 0.19.0) - pronto-phpcs (0.4.0) - pronto (~> 0.9.0) - pronto-phpmd (0.4.0) - pronto (~> 0.9.0) - public_suffix (4.0.7) - rainbow (2.2.2) - rake - rake (13.0.6) - rugged (0.99.0) - sawyer (0.9.2) - addressable (>= 2.3.5) - faraday (>= 0.17.3, < 3) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thor (0.19.4) - unicode-display_width (1.8.0) - -PLATFORMS - ruby - -DEPENDENCIES - pronto (~> 0.9.5) - pronto-phpcs (~> 0.4.0) - pronto-phpmd (~> 0.4.0) - -BUNDLED WITH - 1.17.3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b1fd939 --- /dev/null +++ b/LICENSE @@ -0,0 +1,83 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 18f5476..0dab09e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ E-Comprocessing Gateway Module for X-Cart ====================================== +[![Software License](https://img.shields.io/badge/license-GPL-green.svg?style=flat)](LICENSE) + This is a Payment Module for X-Cart, that gives you the ability to process payments through E-Comprocessing's Payment Gateway - Genesis. Requirements ------------ * X-Cart 5.4.x (you can get this plugin to work on older 5.2, 5.3 versions simply by changing the __Major Version__ to ```5.2```, ```5.3``` in ```Main.php``` and ```main.yaml```) -* [GenesisPHP v1.24.0](https://github.com/GenesisGateway/genesis_php/releases/tag/1.24.0) - (Integrated in Module) +* [GenesisPHP v2.0.2](https://github.com/GenesisGateway/genesis_php/releases/tag/2.0.2) - (Integrated in Module) GenesisPHP Requirements ------------ @@ -72,12 +74,10 @@ Supported Transactions & Payment Methods * __eps__ * __eZeeWallet__ * __Fashioncheque__ - * __GiroPay__ * __Google Pay__ * __iDeal__ * __iDebit__ * __InstaDebit__ - * __InstantTransfer__ * __InitRecurringSale__ * __InitRecurringSale (3D-Secure)__ * __Intersolve__ @@ -92,7 +92,9 @@ Supported Transactions & Payment Methods * __Online Banking__ * __Interac Combined Pay-in (CPI)__ * __Bancontact (BCT)__ - * __Blik One Click (BLK)__ + * __BLIK (BLK)__ + * __SPEI (SE)__ + * __LatiPay (PID)__ * __OXXO__ * __P24__ * __Pago Facil__ @@ -102,15 +104,6 @@ Supported Transactions & Payment Methods * __Pix__ * __POLi__ * __Post Finance__ - * __PPRO__ - * __eps__ - * __GiroPay__ - * __Ideal__ - * __Przelewy24__ - * __SafetyPay__ - * __TrustPay__ - * __BCMC__ - * __MyBank__ * __PSE__ * __RapiPago__ * __Redpagos__ @@ -133,4 +126,19 @@ _Note_: If you have trouble with your credentials or terminal configuration, get You're now ready to process payments through our gateway. -[support]: mailto:tech-support@e-comprocessing.com +Development +------------ +* Install dev packages +```shell +composer install +``` +* Run PHP Code Sniffer +```shell +composer php-cs +``` +* Run PHP Mess Detector +```shell +composer php-md +``` + +[support]: mailto:tech-support@e-comprocessing.net diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..91b981c --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +5.4.3.7 diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/Helper.php b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/Helper.php index 7559240..dcb43b5 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/Helper.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/Helper.php @@ -19,16 +19,17 @@ namespace XLite\Module\Ecomprocessing\Genesis\Helpers; -use Genesis\API\Constants\Banks; -use Genesis\API\Constants\i18n; -use Genesis\API\Constants\Transaction\Types; -use Genesis\API\Request\Financial\Alternatives\Klarna\Items; +use Genesis\Api\Constants\Banks; +use Genesis\Api\Constants\i18n; +use Genesis\Api\Constants\Transaction\Types; +use Genesis\Api\Request\Financial\Alternatives\Klarna\Item as KlarnaItem; +use Genesis\Api\Request\Financial\Alternatives\Klarna\Items; use XLite\Model\Order; use XLite\Model\OrderItem; use XLite\Module\CDev\Paypal\Core\Api\Orders\Item; -use Genesis\API\Constants\Transaction\Parameters\Mobile\ApplePay\PaymentTypes as ApplePaymentTypes; -use Genesis\API\Constants\Transaction\Parameters\Mobile\GooglePay\PaymentTypes as GooglePaymentTypes; -use Genesis\API\Constants\Transaction\Parameters\Wallets\PayPal\PaymentTypes as PayPalPaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Mobile\ApplePay\PaymentTypes as ApplePaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Mobile\GooglePay\PaymentTypes as GooglePaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Wallets\PayPal\PaymentTypes as PayPalPaymentTypes; /** * Class Helper @@ -36,11 +37,6 @@ */ class Helper { - /** - * PPRO Transactions Suffix - */ - const PPRO_TRANSACTION_SUFFIX = '_ppro'; - /** * Google Pay transaction prefix and methods */ @@ -179,11 +175,11 @@ public static function getKlarnaCustomParamItems(Order $order) /** @var OrderItem $item */ foreach ($itemsList as $item) { - $klarnaItem = new \Genesis\API\Request\Financial\Alternatives\Klarna\Item( + $klarnaItem = new KlarnaItem( $item->getName(), $item->isShippable() ? - \Genesis\API\Request\Financial\Alternatives\Klarna\Item::ITEM_TYPE_PHYSICAL : - \Genesis\API\Request\Financial\Alternatives\Klarna\Item::ITEM_TYPE_DIGITAL, + KlarnaItem::ITEM_TYPE_PHYSICAL : + KlarnaItem::ITEM_TYPE_DIGITAL, $item->getAmount(), $item->getPrice() ); @@ -193,9 +189,9 @@ public static function getKlarnaCustomParamItems(Order $order) $taxes = floatval($order->getSurchargesSubtotal(self::XCART_SURCHARGE_TAX)); if ($taxes) { $items->addItem( - new \Genesis\API\Request\Financial\Alternatives\Klarna\Item( + new KlarnaItem( 'Taxes', - \Genesis\API\Request\Financial\Alternatives\Klarna\Item::ITEM_TYPE_SURCHARGE, + KlarnaItem::ITEM_TYPE_SURCHARGE, 1, $taxes ) @@ -205,9 +201,9 @@ public static function getKlarnaCustomParamItems(Order $order) $discount = floatval($order->getSurchargesSubtotal(self::XCART_SURCHARGE_DISCOUNT)); if ($discount) { $items->addItem( - new \Genesis\API\Request\Financial\Alternatives\Klarna\Item( + new KlarnaItem( 'Discount', - \Genesis\API\Request\Financial\Alternatives\Klarna\Item::ITEM_TYPE_DISCOUNT, + KlarnaItem::ITEM_TYPE_DISCOUNT, 1, -$discount ) @@ -217,9 +213,9 @@ public static function getKlarnaCustomParamItems(Order $order) $shipping_cost = floatval($order->getSurchargesSubtotal(self::XCART_SURCHARGE_SHOPPING)); if ($shipping_cost) { $items->addItem( - new \Genesis\API\Request\Financial\Alternatives\Klarna\Item( + new KlarnaItem( 'Shipping Costs', - \Genesis\API\Request\Financial\Alternatives\Klarna\Item::ITEM_TYPE_SHIPPING_FEE, + KlarnaItem::ITEM_TYPE_SHIPPING_FEE, 1, $shipping_cost ) @@ -239,7 +235,9 @@ public static function getAvailableBankCodes() return [ Banks::CPI => 'Interac Combined Pay-in', Banks::BCT => 'Bancontact', - Banks::BLK => 'Blik One Click', + Banks::BLK => 'BLIK', + Banks::SE => 'SPEI', + Banks::PID => 'LatiPay' ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsHelper.php b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsHelper.php index a373ac0..7ceafa7 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsHelper.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsHelper.php @@ -19,6 +19,8 @@ namespace XLite\Module\Ecomprocessing\Genesis\Helpers; +use DateInterval; +use DateTime; use XLite\Core\CommonCell; use XLite\Module\Ecomprocessing\Genesis\Model\Payment\Processor\EcomprocessingCheckout; @@ -197,7 +199,7 @@ public function getPasswordChangeDate() */ public function countOrdersPeriod($period) { - $dateFrom = (new \DateTime())->sub(new \DateInterval($period)); + $dateFrom = (new DateTime())->sub(new DateInterval($period)); $searchCondition = new CommonCell(); $searchCondition->{\XLite\Model\Repo\Order::P_DATE} = array( @@ -215,7 +217,8 @@ public function countOrdersPeriod($period) } $searchCondition->{\XLite\Model\Repo\Order::P_PROFILE_ID} = Helper::getCurrentUserId(); - $searchCondition->{\XLite\Model\Repo\Order::P_PAYMENT_METHOD_NAME} = EcomprocessingCheckout::PAYMENT_METHOD_NAME; + $searchCondition->{\XLite\Model\Repo\Order::P_PAYMENT_METHOD_NAME} = + EcomprocessingCheckout::PAYMENT_METHOD_NAME; if ($period == self::ACTIVITY_6_MONTHS) { $paidStatus = \XLite\Model\Order\Status\Payment::getPaidStatuses(); @@ -236,7 +239,8 @@ public function getProfileOrders() { $searchCondition = new CommonCell(); $searchCondition->{\XLite\Model\Repo\Order::P_PROFILE_ID} = Helper::getCurrentUserId(); - $searchCondition->{\XLite\Model\Repo\Order::P_PAYMENT_METHOD_NAME} = EcomprocessingCheckout::PAYMENT_METHOD_NAME; + $searchCondition->{\XLite\Model\Repo\Order::P_PAYMENT_METHOD_NAME} = + EcomprocessingCheckout::PAYMENT_METHOD_NAME; $searchCondition->{\XLite\Model\Repo\AttributeOption::P_ORDER_BY} = ['o.date', 'ASC']; return \XLite\Core\Database::getRepo('XLite\Model\Order')->search($searchCondition); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsIndicatorHelper.php b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsIndicatorHelper.php index 65746fa..13cb9ff 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsIndicatorHelper.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Helpers/ThreedsIndicatorHelper.php @@ -19,12 +19,13 @@ namespace XLite\Module\Ecomprocessing\Genesis\Helpers; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\PasswordChangeIndicators; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\RegistrationIndicators; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\ShippingAddressUsageIndicators; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\UpdateIndicators; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\ReorderItemIndicators; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\ShippingIndicators; +use DateTime; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\PasswordChangeIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\RegistrationIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\ShippingAddressUsageIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\UpdateIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\ReorderItemIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\ShippingIndicators; class ThreedsIndicatorHelper { @@ -222,7 +223,7 @@ public function fetchShippingAddressUsageIndicator($date) */ private function getDateIndicator($date) { - $now = new \DateTime(); + $now = new DateTime(); $checkDate = \DateTime::createFromFormat(Helper::THREEDS_DATE_FORMAT, $date); $days = $checkDate->diff($now)->days; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/ABNiDEAL.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/ABNiDEAL.php deleted file mode 100644 index 7a8c3e2..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/ABNiDEAL.php +++ /dev/null @@ -1,110 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => \Genesis\Utils\Country::getList(), - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'customer_bank_id' => $this->customer_bank_id, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Earthport.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Earthport.php deleted file mode 100644 index bcc8a84..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Earthport.php +++ /dev/null @@ -1,325 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ - 'AD', 'AU', 'AT', 'BH', 'BS', 'BE', 'BG', 'CA', 'CY', 'CZ', 'DK', 'EG', 'EE', - 'FI', 'FR', 'DE', 'GR', 'HK', 'HU', 'ID', 'IE', 'IL', 'IT', 'JP', 'KE', 'LV', - 'LI', 'LT', 'LU', 'MY', 'MT', 'MA', 'NL', 'NZ', 'NO', 'PK', 'PH', 'PL', 'PT', - 'RO', 'SG', 'SK', 'SI', 'ES', 'SE', 'CH', 'GB', 'US', 'VN' - ], - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - - $this->setRequiredFieldValuesConditional(); - } - - /** - * Set the required fields - conditionally depending on other fields - * - * @return void - * - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function setRequiredFieldValuesConditional() - { - $commonIbanFields = [ - 'iban', - 'bic' - ]; - $commonAccountFields = [ - 'account_number', - 'bank_code', - 'branch_code' - ]; - - $requiredFieldsConditional = [ - 'billing_country' => [ - 'AD' => $commonIbanFields, - 'AU' => $commonAccountFields, - 'AT' => $commonIbanFields, - 'BH' => $commonIbanFields, - 'BS' => $commonIbanFields, - 'BE' => $commonIbanFields, - 'BG' => $commonIbanFields, - 'CA' => $commonAccountFields, - 'CY' => $commonIbanFields, - 'CZ' => $commonIbanFields, - 'DK' => $commonIbanFields, - 'EG' => [ - 'account_number', - 'bic' - ], - 'EE' => $commonIbanFields, - 'FI' => $commonIbanFields, - 'FR' => $commonIbanFields, - 'DE' => $commonIbanFields, - 'GR' => $commonIbanFields, - 'HK' => [ - 'bank_code', - 'branch_code', - 'account_number', - 'account_number_suffix' - ], - 'HU' => $commonIbanFields, - 'ID' => $commonAccountFields, - 'IE' => $commonIbanFields, - 'IL' => $commonIbanFields, - 'IT' => $commonIbanFields, - 'JP' => $commonIbanFields, - 'KE' => $commonIbanFields, - 'LV' => $commonIbanFields, - 'LI' => $commonIbanFields, - 'LT' => $commonIbanFields, - 'LU' => $commonIbanFields, - 'MY' => [ - 'account_number', - 'bic' - ], - 'MT' => $commonIbanFields, - 'MA' => [ - 'account_number' - ], - 'NL' => $commonIbanFields, - 'NZ' => [ - 'bank_code', - 'branch_code', - 'account_number', - 'account_number_suffix' - ], - 'NO' => $commonIbanFields, - 'PK' => $commonIbanFields, - 'PH' => [ - 'bank_code', - 'account_number' - ], - 'PL' => $commonIbanFields, - 'PT' => $commonIbanFields, - 'RO' => $commonIbanFields, - 'SG' => $commonAccountFields, - 'SK' => $commonIbanFields, - 'SI' => $commonIbanFields, - 'ES' => $commonIbanFields, - 'SE' => [ - 'bank_code', - 'account_number', - 'bic' - ], - 'CH' => $commonIbanFields, - 'GB' => [ - 'account_number', - 'sort_code' - ], - 'US' => [ - 'billing_state', - 'account_number', - 'aba_routing_number' - ], - 'VN' => [ - 'account_number', - 'bic' - ] - ] - ]; - - $this->requiredFieldsConditional = \Genesis\Utils\Common::createArrayObject($requiredFieldsConditional); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'account_name' => $this->account_name, - 'bank_name' => $this->bank_name, - 'iban' => $this->iban, - 'bic' => $this->bic, - 'account_number' => $this->account_number, - 'bank_code' => $this->bank_code, - 'branch_code' => $this->branch_code, - 'account_number_suffix' => $this->account_number_suffix, - 'sort_code' => $this->sort_code, - 'aba_routing_number' => $this->aba_routing_number, - 'billing_address' => $this->getBillingAddressParamsStructure(), - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/INPay.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/INPay.php deleted file mode 100644 index 40c8e23..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/INPay.php +++ /dev/null @@ -1,230 +0,0 @@ -setIsPayout(false); - } - - /** - * Returns the Request transaction type - * @return string - */ - protected function getTransactionType() - { - return \Genesis\API\Constants\Transaction\Types::INPAY; - } - - /** - * Set Flag for payout transaction - * @param bool|int|string $value - * @return $this - */ - public function setIsPayout($value) - { - $this->is_payout = filter_var($value, FILTER_VALIDATE_BOOLEAN); - - return $this; - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'remote_ip', - 'amount', - 'currency', - 'return_success_url', - 'return_failure_url', - 'customer_email', - 'billing_country' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => \Genesis\Utils\Country::getList(), - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - - $requiredFieldsConditional = [ - 'is_payout' => [ - false => [ - 'customer_bank_id', - 'order_description' - ], - true => [ - 'payout_order_id', - 'payout_bank_country', - 'payout_bank_name', - 'payout_swift', - 'payout_acc_number', - 'payout_bank_address', - 'payout_owner_name', - 'payout_owner_address' - ] - ] - ]; - - $this->requiredFieldsConditional = \Genesis\Utils\Common::createArrayObject($requiredFieldsConditional); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'is_payout' => var_export($this->is_payout, true), - 'customer_bank_id' => $this->customer_bank_id, - 'order_description' => $this->order_description, - 'payout_order_id' => $this->payout_order_id, - 'payout_bank_country' => $this->payout_bank_country, - 'payout_bank_name' => $this->payout_bank_name, - 'payout_swift' => $this->payout_swift, - 'payout_acc_number' => $this->payout_acc_number, - 'payout_bank_address' => $this->payout_bank_address, - 'payout_owner_name' => $this->payout_owner_name, - 'payout_owner_address' => $this->payout_owner_address, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/PaypalExpress.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/PaypalExpress.php deleted file mode 100644 index 0d210a9..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/PaypalExpress.php +++ /dev/null @@ -1,68 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Trustly/Withdrawal.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Trustly/Withdrawal.php deleted file mode 100644 index 98e99ac..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Trustly/Withdrawal.php +++ /dev/null @@ -1,104 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ - 'AT', 'BG', 'BE', 'HR', 'CZ', 'CY', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IT', 'IE', 'LT', 'LV', - 'LU', 'MT', 'NO', 'NL', 'PT', 'PL', 'RO', 'SK', 'SI', 'SE', 'ES', 'GB' - ], - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - protected function getPaymentTransactionStructure() - { - return array_merge( - $this->getPaymentAttributesStructure(), - [ - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'birth_date' => $this->getBirthDate(), - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ] - ); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Credit.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Credit.php deleted file mode 100644 index 0f973da..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Credit.php +++ /dev/null @@ -1,66 +0,0 @@ -getSourceOfFundsStructure(), - [ - 'customer_identification' => $this->getCustomerIdentificationDataStructure() - ] - ); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Banamex.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Banamex.php deleted file mode 100644 index 25cdfff..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Banamex.php +++ /dev/null @@ -1,57 +0,0 @@ -requiredFields = CommonUtils::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => $this->getAllowedBillingCountries() - ]; - - $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); - - $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( - $this->getDocumentIdConditions() - ); - } - - /** - * Return additional request attributes - * - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'document_id' => $this->document_id, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure(), - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/SantanderCash.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/SantanderCash.php deleted file mode 100644 index a6054b9..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/SantanderCash.php +++ /dev/null @@ -1,50 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'currency' => [ 'CNY' ] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'birth_date' => $this->getBirthDate(), - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/AstropayDirect.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/AstropayDirect.php deleted file mode 100644 index 55297c8..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/AstropayDirect.php +++ /dev/null @@ -1,99 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => ['AR', 'BR', 'CL', 'CN', 'CO', 'MX', 'PE', 'UY'] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'consumer_reference' => $this->consumer_reference, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payin.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payin.php deleted file mode 100644 index 986f70a..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payin.php +++ /dev/null @@ -1,117 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ - 'AT', 'AU', 'BE', 'CA', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', - 'GR', 'HU', 'IE', 'IT', 'JP', 'LT', 'LV', 'PL', 'PT', 'SE', 'SK' - ], - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'notification_url' => $this->notification_url, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'merchant_customer_id' => $this->merchant_customer_id, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payout.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payout.php deleted file mode 100644 index b297204..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Citadel/Payout.php +++ /dev/null @@ -1,256 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ - 'АЕ', 'AT', 'AU', 'BE', 'BG', 'CA', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', - 'FI', 'FR', 'GB', 'GF', 'GP', 'GR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', - 'MC', 'MQ', 'MT', 'MX', 'NL', 'PL', 'PT', 'RE', 'SE', 'SI', 'SK' - ], - 'currency' => \Genesis\Utils\Currency::getList() - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - - $this->setRequiredFieldsConditional(); - } - - /** - * Set the required fields conditional - * - * @return void - */ - protected function setRequiredFieldsConditional() - { - $requiredParamsIbanSwiftCode = ['iban', 'swift_code']; - - $requiredFieldsConditional = [ - 'billing_country' => [ - 'AE' => $requiredParamsIbanSwiftCode, - 'AT' => $requiredParamsIbanSwiftCode, - 'AU' => ['account_number', 'branch_code'], - 'BE' => $requiredParamsIbanSwiftCode, - 'BG' => ['iban'], - 'CA' => ['account_number', 'branch_code', 'bank_code', 'bank_name'], - 'CY' => $requiredParamsIbanSwiftCode, - 'CZ' => ['iban'], - 'DE' => $requiredParamsIbanSwiftCode, - 'DK' => ['account_number', 'bank_code'], - 'EE' => $requiredParamsIbanSwiftCode, - 'ES' => $requiredParamsIbanSwiftCode, - 'FI' => $requiredParamsIbanSwiftCode, - 'FR' => $requiredParamsIbanSwiftCode, - 'GB' => ['account_number', 'bank_code'], - 'GF' => $requiredParamsIbanSwiftCode, - 'GP' => $requiredParamsIbanSwiftCode, - 'GR' => $requiredParamsIbanSwiftCode, - 'HU' => ['account_number'], - 'IE' => $requiredParamsIbanSwiftCode, - 'IT' => $requiredParamsIbanSwiftCode, - 'LT' => $requiredParamsIbanSwiftCode, - 'LU' => $requiredParamsIbanSwiftCode, - 'LV' => $requiredParamsIbanSwiftCode, - 'MC' => $requiredParamsIbanSwiftCode, - 'MQ' => $requiredParamsIbanSwiftCode, - 'MT' => $requiredParamsIbanSwiftCode, - 'MX' => ['iban', 'bank_name'], - 'NL' => $requiredParamsIbanSwiftCode, - 'PL' => ['iban'], - 'PT' => $requiredParamsIbanSwiftCode, - 'RE' => $requiredParamsIbanSwiftCode, - 'SE' => ['iban'], - 'SI' => $requiredParamsIbanSwiftCode, - 'SK' => $requiredParamsIbanSwiftCode - ] - ]; - - $this->requiredFieldsConditional = \Genesis\Utils\Common::createArrayObject($requiredFieldsConditional); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'holder_name' => $this->holder_name, - 'iban' => $this->iban, - 'swift_code' => $this->swift_code, - 'account_number' => $this->account_number, - 'bank_name' => $this->bank_name, - 'bank_city' => $this->bank_city, - 'bank_code' => $this->bank_code, - 'branch_code' => $this->branch_code, - 'branch_check_digit' => $this->branch_check_digit, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Entercash.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Entercash.php deleted file mode 100644 index d36e59c..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/Entercash.php +++ /dev/null @@ -1,203 +0,0 @@ -iban) === false) { - $this->setIban($this->iban); - } - break; - case 'SE': - case 'FI': - $this->setIban(''); - $this->setBic(''); - break; - } - - return parent::setBillingCountry($value); - } - - /** - * @param $value - * - * @return Entercash - * @throws ErrorParameter - */ - public function setBic($value) - { - switch ($this->billing_country) { - case 'SE': - case 'FI': - $this->throwBankAttributesNotSupported(); - break; - } - - return parent::setBic($value); - } - - /** - * @param $value - * - * @return Entercash - * @throws ErrorParameter - */ - public function setIban($value) - { - switch ($this->billing_country) { - case 'DE': - $this->validateIban(self::PATTERN_DE_IBAN, $value); - break; - case 'AT': - $this->validateIban(self::PATTERN_AT_IBAN, $value); - break; - case 'SE': - case 'FI': - $this->throwBankAttributesNotSupported(); - break; - } - - return parent::setIban($value); - } - - /** - * @param string $pattern Regex pattern for IBAN validation - * @param string $value - * - * @throws ErrorParameter - */ - protected function validateIban($pattern, $value) - { - if (!preg_match($pattern, $value)) { - throw new ErrorParameter('Invalid IBAN. Please check the documenatition for more information.'); - } - } - - /** - * @throws ErrorParameter - */ - protected function throwBankAttributesNotSupported() - { - throw new ErrorParameter('The selected country doesn\'t support IBAN and Bic params.' . - 'Please check the documenatition for more information.'); - } - - /** - * Returns the Request transaction type - * @return string - */ - protected function getTransactionType() - { - return \Genesis\API\Constants\Transaction\Types::ENTERCASH; - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'usage', - 'remote_ip', - 'return_success_url', - 'return_failure_url', - 'amount', - 'currency', - 'consumer_reference', - 'customer_email', - 'billing_country' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ 'AT', 'DE', 'FI', 'SE' ], - 'currency' => [ 'EUR', 'SEK' ] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'consumer_reference' => $this->consumer_reference, - 'customer_email' => $this->customer_email, - 'iban' => $this->iban, - 'bic' => $this->bic, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/GiroPay.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/GiroPay.php deleted file mode 100644 index a1c4839..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/GiroPay.php +++ /dev/null @@ -1,124 +0,0 @@ -requiredFields = CommonUtils::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => ['DE'], - 'currency' => ['EUR'] - ]; - - $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); - } - - /** - * Add iban conditional validation if it is present - * - * @return void - * - * @throws InvalidArgument - * @throws \Genesis\Exceptions\ErrorParameter - * @throws \Genesis\Exceptions\InvalidClassMethod - */ - protected function checkRequirements() - { - $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( - array_merge( - (array)$this->requiredFieldValuesConditional, - $this->getIbanConditions() - ) - ); - - parent::checkRequirements(); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'return_pending_url' => $this->getReturnPendingUrl(), - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'bic' => $this->bic, - 'iban' => $this->iban, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/InstantTransfer.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/InstantTransfer.php deleted file mode 100644 index 189de94..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/InstantTransfer.php +++ /dev/null @@ -1,152 +0,0 @@ -iban) === false) { - $this->setIban($this->iban); - } - break; - } - - return parent::setBillingCountry($value); - } - - /** - * @param $value - * - * @return InstantTransfer - * @throws ErrorParameter - */ - public function setIban($value) - { - if ($this->billing_country === 'DE') { - $this->validateIban(self::PATTERN_DE_IBAN, $value); - } - - return parent::setIban($value); - } - - /** - * @param string $pattern Regex pattern for IBAN validation - * @param string $value - * - * @throws ErrorParameter - */ - protected function validateIban($pattern, $value) - { - if (!preg_match($pattern, $value)) { - throw new ErrorParameter('Invalid IBAN. Please check the documenatition for more information.'); - } - } - - /** - * Returns the Request transaction type - * @return string - */ - protected function getTransactionType() - { - return \Genesis\API\Constants\Transaction\Types::INSTANT_TRANSFER; - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'return_success_url', - 'return_failure_url', - 'amount', - 'currency', - 'billing_country' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ 'DE' ] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'iban' => $this->iban, - 'bic' => $this->bic, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/TrustPay.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/TrustPay.php deleted file mode 100644 index 012ed16..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/TrustPay.php +++ /dev/null @@ -1,98 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => ['CZ', 'SK'], - 'currency' => ['EUR', 'CZK'] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'return_pending_url' => $this->getReturnPendingUrl(), - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/Sale.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/Sale.php deleted file mode 100644 index b73f790..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/Sale.php +++ /dev/null @@ -1,127 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = array_merge( - [ - 'card_type' => CardTypes::getCardTypes(), - 'redeem_type' => RedeemTypes::getRedeemTypes(), - 'currency' => Currency::getList() - ], - $this->getCCFieldValueFormatValidators() - ); - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'card_type' => $this->card_type, - 'redeem_type' => $this->redeem_type, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'card_holder' => $this->card_holder, - 'card_number' => $this->card_number, - 'cvv' => $this->cvv, - 'expiration_month' => $this->expiration_month, - 'expiration_year' => $this->expiration_year, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'birth_date' => $this->getBirthDate(), - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure(), - 'dynamic_descriptor_params' => $this->getDynamicDescriptorParamsStructure() - ]; - } - - /** - * Skip Credit Card validation if Client-Side Encryption is set - * - * @return void - */ - protected function checkRequirements() - { - $this->removeCreditCardValidations(); - - parent::checkRequirements(); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/oBeP.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/oBeP.php deleted file mode 100644 index 874f1b0..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/PayByVouchers/oBeP.php +++ /dev/null @@ -1,216 +0,0 @@ -initXmlConfiguration(); - - $this->initApiGatewayConfiguration(); - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'card_type', - 'redeem_type', - 'amount', - 'currency', - 'product_name', - 'product_category', - 'customer_name', - 'customer_email', - 'customer_phone', - 'customer_id_number', - 'customer_bank_id', - 'bank_account_number' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - } - - /** - * Create the request's Tree structure - * - * @return void - */ - protected function populateStructure() - { - $treeStructure = [ - 'payment_transaction' => [ - 'transaction_type' => \Genesis\API\Constants\Transaction\Types::PAYBYVOUCHER_YEEPAY, - 'transaction_id' => $this->transaction_id, - 'card_type' => $this->card_type, - 'redeem_type' => $this->redeem_type, - 'remote_ip' => $this->remote_ip, - 'amount' => $this->transform( - 'amount', - [ - $this->amount, - $this->currency - ] - ), - 'currency' => $this->currency, - 'product_name' => $this->product_name, - 'product_category' => $this->product_category, - 'customer_name' => $this->customer_name, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'customer_id_number' => $this->customer_id_number, - 'customer_bank_id' => $this->customer_bank_id, - 'bank_account_number' => $this->bank_account_number - ] - ]; - - $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Vouchers/AstropayCard.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Vouchers/AstropayCard.php deleted file mode 100644 index 06336b1..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Vouchers/AstropayCard.php +++ /dev/null @@ -1,102 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => ['AR', 'BR', 'CL', 'CO', 'CR', 'MX', 'PE', 'UY', 'VE'] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'return_pending_url' => $this->getReturnPendingUrl(), - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'consumer_reference' => $this->consumer_reference, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Qiwi.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Qiwi.php deleted file mode 100644 index b30a545..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Qiwi.php +++ /dev/null @@ -1,122 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => ['RU', 'KZ', 'UA'], - 'customer_phone' => new RegexValidator(RegexValidator::PATTERN_QIWI_PHONE_NUMBER) - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - - $requiredFieldValuesConditional = [ - 'billing_country' => [ - 'RU' => [ - [ - 'currency' => ['EUR', 'RUB'] - ] - ], - 'KZ' => [ - [ - 'currency' => ['EUR', 'KZT'] - ] - ], - 'UA' => [ - [ - 'currency' => ['USD'] - ] - ] - ] - ]; - - $this->requiredFieldValuesConditional = - \Genesis\Utils\Common::createArrayObject($requiredFieldValuesConditional); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Zimpler.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Zimpler.php deleted file mode 100644 index a320594..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Zimpler.php +++ /dev/null @@ -1,99 +0,0 @@ -requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = [ - 'billing_country' => [ 'FI', 'SE' ], - 'currency' => [ 'EUR', 'SEK' ] - ]; - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Return additional request attributes - * @return array - */ - protected function getPaymentTransactionStructure() - { - return [ - 'usage' => $this->usage, - 'remote_ip' => $this->remote_ip, - 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url, - 'amount' => $this->transformAmount($this->amount, $this->currency), - 'currency' => $this->currency, - 'customer_phone' => $this->customer_phone, - 'customer_email' => $this->customer_email, - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() - ]; - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AVS.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AVS.php deleted file mode 100644 index bf0f2a6..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AVS.php +++ /dev/null @@ -1,125 +0,0 @@ -initXmlConfiguration(); - - $this->initApiGatewayConfiguration(); - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'card_holder', - 'card_number', - 'expiration_month', - 'expiration_year', - 'billing_address1', - 'billing_zip_code', - 'billing_city' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - - $requiredFieldValues = $this->getCCFieldValueFormatValidators(); - - $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - } - - /** - * Create the request's Tree structure - * - * @return void - */ - protected function populateStructure() - { - $treeStructure = [ - 'payment_transaction' => [ - 'transaction_type' => Services::AVS, - 'transaction_id' => $this->transaction_id, - 'usage' => $this->usage, - 'moto' => $this->moto, - 'remote_ip' => $this->remote_ip, - 'card_holder' => $this->card_holder, - 'card_number' => $this->card_number, - 'cvv' => $this->cvv, - 'expiration_month' => $this->expiration_month, - 'expiration_year' => $this->expiration_year, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'birth_date' => $this->getBirthDate(), - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure(), - 'risk_params' => $this->getRiskParamsStructure() - ] - ]; - - $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); - } - - /** - * Skip Credit Card validation if Client-Side Encryption is set - * - * @return void - */ - protected function checkRequirements() - { - $this->removeCreditCardValidations(); - - parent::checkRequirements(); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AccountVerification.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AccountVerification.php deleted file mode 100644 index dff6dbe..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/AccountVerification.php +++ /dev/null @@ -1,144 +0,0 @@ -initXmlConfiguration(); - - $this->initApiGatewayConfiguration(); - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'transaction_id', - 'card_holder', - 'card_number', - 'expiration_month', - 'expiration_year', - 'billing_address1', - 'billing_zip_code', - 'billing_city' - ]; - - $this->requiredFields = CommonUtils::createArrayObject($requiredFields); - - $requiredFieldValues = $this->getCCFieldValueFormatValidators(); - - $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); - } - - /** - * Create the request's Tree structure - * - * @return void - */ - protected function populateStructure() - { - $treeStructure = [ - 'payment_transaction' => array_merge( - [ - 'transaction_type' => \Genesis\API\Constants\Transaction\Types::ACCOUNT_VERIFICATION, - 'transaction_id' => $this->transaction_id, - 'usage' => $this->usage, - 'moto' => $this->moto, - 'remote_ip' => $this->remote_ip, - 'card_holder' => $this->card_holder, - 'card_number' => $this->card_number, - 'cvv' => $this->cvv, - 'expiration_month' => $this->expiration_month, - 'expiration_year' => $this->expiration_year, - 'customer_email' => $this->customer_email, - 'customer_phone' => $this->customer_phone, - 'document_id' => $this->document_id, - 'birth_date' => $this->getBirthDate(), - 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure(), - 'risk_params' => $this->getRiskParamsStructure() - ], - $this->getCredentialOnFileAttributesStructure() - ) - ]; - - $this->treeStructure = CommonUtils::createArrayObject($treeStructure); - } - - /** - * Skip Credit Card validation if Client-Side Encryption is set - * Add document_id conditional validation if it is present - * - * @return void - * @throws InvalidArgument - * @throws \Genesis\Exceptions\ErrorParameter - * @throws \Genesis\Exceptions\InvalidClassMethod - */ - protected function checkRequirements() - { - $this->removeCreditCardValidations(); - - if ($this->document_id) { - $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( - $this->getDocumentIdConditions() - ); - } - - parent::checkRequirements(); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/VoucherAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/VoucherAttributes.php deleted file mode 100644 index f736c24..0000000 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/VoucherAttributes.php +++ /dev/null @@ -1,50 +0,0 @@ - \Genesis\API\Constants\Payment\Methods::getMethods() + 'payment_method' => \Genesis\Api\Constants\Payment\Methods::getMethods() ]; } /** * @return array */ - public static function forPayByVoucherSale() - { - return [ - 'card_type' => - \Genesis\API\Constants\Transaction\Parameters\PayByVouchers\CardTypes::getCardTypes(), - 'redeem_type' => - \Genesis\API\Constants\Transaction\Parameters\PayByVouchers\RedeemTypes::getRedeemTypes() - ]; - } - - /** - * @return array - * @deprecated PayByVoucherYeepay payment method is deprecated and will be removed - */ - public static function forPayByVoucherYeepay() - { - return array_merge( - static::forPayByVoucherSale(), - [ - 'product_name' => null, - 'product_category' => null - ] - ); - } - - /** - * @return array - */ - public static function forCitadelPayIn() + public static function forInstaDebitPayIn() { return [ - 'merchant_customer_id' => null + 'customer_account_id' => null ]; } /** * @return array */ - public static function forInstaDebitPayIn() + public static function forIDebitPayIn() { return [ 'customer_account_id' => null @@ -94,20 +67,22 @@ public static function forInstaDebitPayIn() /** * @return array */ - public static function forIDebitPayIn() + public static function forKlarnaAuthorize() { return [ - 'customer_account_id' => null + 'billing_country' => Authorize::getAllowedCountries() ]; } /** + * Required custom attribute for Paysafecard + * * @return array */ - public static function forKlarnaAuthorize() + public static function forPaysafecard() { return [ - 'billing_country' => Authorize::getAllowedCountries() + 'customer_id' => null ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Names.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Names.php similarity index 80% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Names.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Names.php index ad94541..0aaa3cd 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Names.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Names.php @@ -1,4 +1,5 @@ 'AVS', - Types::ABNIDEAL => 'ABN iDeal', - Types::ACCOUNT_VERIFICATION => 'Account Verification', Types::AFRICAN_MOBILE_PAYOUT => 'African Mobile Payout', Types::AFRICAN_MOBILE_SALE => 'African Mobile Sale', - Types::ALIPAY => 'Alipay', Types::APPLE_PAY => 'Apple pay', Types::ARGENCARD => 'Argencard', - Types::ASTROPAY_CARD => 'Astropay Card', - Types::ASTROPAY_DIRECT => 'Astropay Direct', Types::AURA => 'Aura', Types::AUTHORIZE => 'Authorize', Types::AUTHORIZE_3D => 'Authorize (3D-Secure)', Types::BALOTO => 'Baloto', - Types::BANAMEX => 'Banamex', Types::BANCOMER => 'Bancomer', Types::BANCONTACT => 'Bancontact', Types::BANCO_DE_OCCIDENTE => 'Banco de Occidente', @@ -68,33 +62,23 @@ class Names Types::BRADESCO => 'Bradesco', Types::CABAL => 'Cabal', Types::CAPTURE => 'Capture', - Types::CARULLA => 'Carulla', Types::CASHU => 'CashU', Types::CENCOSUD => 'Cencosud', - Types::CITADEL_PAYIN => 'Citadel PayIn', - Types::CITADEL_PAYOUT => 'Citadel PayOut', Types::CREDIT => 'Credit', Types::DAVIVIENDA => 'Davivienda', - Types::EARTHPORT => 'Earthport', Types::EFECTY => 'Efecty', Types::ELO => 'Elo', - Types::EMPRESE_DE_ENERGIA => 'Emprese de Energia', - Types::ENTERCASH => 'Entercash', Types::EPS => 'EPS', Types::EZEECARD_PAYOUT => 'eZeeCard Payout', Types::EZEEWALLET => 'eZeeWallet', Types::FASHIONCHEQUE => 'Fashioncheque', - Types::GIROPAY => 'GiroPay', Types::GOOGLE_PAY => 'Google Pay', - Types::HIPERCARD => 'Hipercard', Types::IDEAL => 'iDeal', Types::IDEBIT_PAYIN => 'iDebit PayIn', Types::IDEBIT_PAYOUT => 'iDebit PayOut', Types::INCREMENTAL_AUTHORIZE => 'Incremental Authorize', Types::INIT_RECURRING_SALE => 'Init Recurring Sale', Types::INIT_RECURRING_SALE_3D => 'Init Recurring Sale (3D-Secure)', - Types::INPAY => 'INPay', - Types::INSTANT_TRANSFER => 'InstantTransfer', Types::INSTA_DEBIT_PAYIN => 'InstaDebit PayIn', Types::INSTA_DEBIT_PAYOUT => 'InstaDebit PayOut', Types::INTERSOLVE => 'Intersolve', @@ -114,11 +98,8 @@ class Names Types::P24 => 'P24', Types::PAGO_FACIL => 'Pago Facil', Types::PARTIAL_REVERSAL => 'Partial Reversal', - Types::PAYBYVOUCHER_SALE => 'PayByVoucher Sale', - Types::PAYBYVOUCHER_YEEPAY => 'PayByVoucher Yeepay', Types::PAYOUT => 'Payout', Types::PAY_PAL => 'PayPal', - Types::PAYPAL_EXPRESS => 'PayPal Express Checkout', Types::PAYSAFECARD => 'Paysafecard', Types::PAYU => 'PayU', Types::PIX => 'PIX', @@ -126,7 +107,6 @@ class Names Types::POST_FINANCE => 'PostFinance', Types::PPRO => 'PPRO', Types::PSE => 'Pagos Seguros en Linea', - Types::QIWI => 'QIWI', Types::RAPI_PAGO => 'RapiPago', Types::RECURRING_SALE => 'Recurring Sale', Types::RUSSIAN_MOBILE_SALE => 'Russian Mobile Sale', @@ -137,26 +117,21 @@ class Names Types::SALE => 'Sale', Types::SALE_3D => 'Sale (3D-Secure)', Types::SANTANDER => 'Santander', - Types::SANTANDER_CASH => 'Santander Cash', Types::SCT_PAYOUT => 'SCT Payout', Types::SDD_INIT_RECURRING_SALE => 'SDD Init Recurring Sale', Types::SDD_RECURRING_SALE => 'SDD Recurring Sale', Types::SDD_REFUND => 'SDD Refund', Types::SDD_SALE => 'SDD Sale', Types::SOFORT => 'Sofort', - Types::SURTIMAX => 'Surtimax', Types::TARJETA_SHOPPING => 'Tarjeta Shopping', Types::TCS => 'The Container Store', Types::TRANSFER_TO_PAYOUT => 'TransferTo Payout', Types::TRUSTLY_SALE => 'Trustly Sale', - Types::TRUSTLY_WITHDRAWAL => 'Trustly Withdrawal', - Types::TRUSTPAY => 'TrustPay', Types::UPI => 'Upi', Types::VOID => 'Void', Types::WEBMONEY => 'WebMoney', Types::WEBPAY => 'Webpay', - Types::WECHAT => 'Wechat', - Types::ZIMPLER => 'Zimpler' + Types::WECHAT => 'Wechat' ]; /** diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/AfricanMobileOperators.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/AfricanMobileOperators.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/AfricanMobileOperators.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/AfricanMobileOperators.php index 42f1d0d..854001d 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/AfricanMobileOperators.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/AfricanMobileOperators.php @@ -1,4 +1,5 @@ [ + Banks::PID + ], 'BRL' => [ Banks::CA ], @@ -60,7 +64,7 @@ class BankCodeParameters Banks::SP ], 'EUR' => [ - Banks::PF, Banks::BCT + Banks::PF, Banks::BCT, Banks::TRL ], 'THB' => [ Banks::BBL_IB_U, Banks::KBANK_PAYPLUS, Banks::BAY_IB_U, Banks::KTB_IB_U, @@ -119,6 +123,9 @@ class BankCodeParameters ], 'PLN' => [ Banks::BLK + ], + 'GBP' => [ + Banks::TRL ] ]; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php index 59aaec4..fd8d356 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Parameters/OnlineBanking/Ideal/AllowedBanks.php @@ -1,4 +1,5 @@ status)) { - return $this->compare($target); - } + if ( + $action === 'is' && + in_array( + $target, + array_merge(CommonUtils::getClassConstants(__CLASS__), $this->getAllStateAliases()) + ) + ) { + return $this->compare($target); } throw new InvalidMethod( sprintf( - 'You\'re trying to call a non-existent method %s of class %s!', + 'You\'re trying to call a non-existent method %s of class %s! The transaction states are: %s', $method, - __CLASS__ + __CLASS__, + implode(', ', CommonUtils::getClassConstants(__CLASS__)) ) ); } @@ -316,7 +329,7 @@ public function compare($subject) */ public function isValid() { - $statusList = \Genesis\Utils\Common::getClassConstants(__CLASS__); + $statusList = CommonUtils::getClassConstants(__CLASS__); return in_array(strtolower($this->status), $statusList); } @@ -330,9 +343,7 @@ public function isValid() private function getStateAliasConstantName($state) { $subject = $state; - $alias = [ - self::NEW_STATUS => 'new_status' - ]; + $alias = $this->getAllStateAliases(); if (array_key_exists($state, $alias)) { $subject = $alias[$state]; @@ -340,4 +351,15 @@ private function getStateAliasConstantName($state) return $subject; } + + /** + * The list of state aliases + * @return string[] + */ + private function getAllStateAliases() + { + return [ + self::NEW_STATUS => 'new_status' + ]; + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Types.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Types.php similarity index 76% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Types.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Types.php index 31ae668..4b05c3a 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/Transaction/Types.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/Transaction/Types.php @@ -1,4 +1,5 @@ 'Cancel', self::CAPTURE => 'Capture', self::REFUND => 'Refund', - self::ABNIDEAL => 'Alternatives\ABNiDEAL', - self::EARTHPORT => 'Alternatives\Earthport', - self::INPAY => 'Alternatives\INPay', self::KLARNA_AUTHORIZE => 'Alternatives\Klarna\Authorize', self::KLARNA_CAPTURE => 'Alternatives\Klarna\Capture', self::KLARNA_REFUND => 'Alternatives\Klarna\Refund', self::P24 => 'Alternatives\P24', - self::PAYPAL_EXPRESS => 'Alternatives\PaypalExpress', - self::POLI => 'Alternatives\POLi', - self::PPRO => 'Alternatives\PPRO', + self::POLI => 'Alternatives\Poli', + self::PPRO => 'Alternatives\Ppro', self::SOFORT => 'Alternatives\Sofort', self::TRANSFER_TO_PAYOUT => 'Alternatives\TransferTo\Payout', self::TRUSTLY_SALE => 'Alternatives\Trustly\Sale', - self::TRUSTLY_WITHDRAWAL => 'Alternatives\Trustly\Withdrawal', self::INIT_RECURRING_SALE => 'Cards\Recurring\InitRecurringSale', self::INIT_RECURRING_SALE_3D => 'Cards\Recurring\InitRecurringSale3D', self::RECURRING_SALE => 'Cards\Recurring\RecurringSale', @@ -810,7 +614,6 @@ public static function getFinancialRequestClassForTrxType($type) self::CREDIT => 'Cards\Credit', self::ELO => 'Cards\Elo', self::EZEECARD_PAYOUT => 'Cards\EzeeCardPayout', - self::HIPERCARD => 'Cards\Hipercard', self::NARANJA => 'Cards\Naranja', self::NATIVA => 'Cards\Nativa', self::PAYOUT => 'Cards\Payout', @@ -818,18 +621,13 @@ public static function getFinancialRequestClassForTrxType($type) self::SALE_3D => 'Cards\Sale3D', self::TARJETA_SHOPPING => 'Cards\TarjetaShopping', self::BALOTO => 'CashPayments\Baloto', - self::BANAMEX => 'CashPayments\Banamex', self::BANCO_DE_OCCIDENTE => 'CashPayments\BancoDeOccidente', self::BOLETO => 'CashPayments\Boleto', - self::CARULLA => 'CashPayments\Carulla', self::EFECTY => 'CashPayments\Efecty', - self::EMPRESE_DE_ENERGIA => 'CashPayments\EmpreseDeEnergia', self::OXXO => 'CashPayments\Oxxo', self::PAGO_FACIL => 'CashPayments\PagoFacil', self::PIX => 'CashPayments\Pix', self::REDPAGOS => 'CashPayments\Redpagos', - self::SANTANDER_CASH => 'CashPayments\SantanderCash', - self::SURTIMAX => 'CashPayments\Surtimax', self::BITPAY_PAYOUT => 'Crypto\BitPay\Payout', self::BITPAY_REFUND => 'Crypto\BitPay\Refund', self::BITPAY_SALE => 'Crypto\BitPay\Sale', @@ -840,23 +638,16 @@ public static function getFinancialRequestClassForTrxType($type) self::GOOGLE_PAY => 'Mobile\GooglePay', self::RUSSIAN_MOBILE_SALE => 'Mobile\RussianMobileSale', self::AFRICAN_MOBILE_SALE => 'Mobile\AfricanMobileSale.php', - self::ALIPAY => 'OnlineBankingPayments\Alipay', - self::ASTROPAY_DIRECT => 'OnlineBankingPayments\AstropayDirect', self::BANCO_DO_BRASIL => 'OnlineBankingPayments\BancoDoBrasil', self::BANCOMER => 'OnlineBankingPayments\Bancomer', self::BRADESCO => 'OnlineBankingPayments\Bradesco', - self::CITADEL_PAYIN => 'OnlineBankingPayments\Citadel\Payin', - self::CITADEL_PAYOUT => 'OnlineBankingPayments\Citadel\Payout', self::DAVIVIENDA => 'OnlineBankingPayments\Davivienda', - self::ENTERCASH => 'OnlineBankingPayments\Entercash', self::EPS => 'OnlineBankingPayments\Eps', - self::GIROPAY => 'OnlineBankingPayments\Giropay', self::IDEAL => 'OnlineBankingPayments\Ideal', - self::IDEBIT_PAYIN => 'OnlineBankingPayments\iDebit\Payin', - self::IDEBIT_PAYOUT => 'OnlineBankingPayments\iDebit\Payout', + self::IDEBIT_PAYIN => 'OnlineBankingPayments\Idebit\Payin', + self::IDEBIT_PAYOUT => 'OnlineBankingPayments\Idebit\Payout', self::INSTA_DEBIT_PAYIN => 'OnlineBankingPayments\InstaDebit\PayIn', self::INSTA_DEBIT_PAYOUT => 'OnlineBankingPayments\InstaDebit\Payout', - self::INSTANT_TRANSFER => 'OnlineBankingPayments\InstantTransfer', self::ITAU => 'OnlineBankingPayments\Itau', self::MULTIBANCO => 'OnlineBankingPayments\Multibanco', self::MY_BANK => 'OnlineBankingPayments\MyBank', @@ -868,31 +659,25 @@ public static function getFinancialRequestClassForTrxType($type) self::RAPI_PAGO => 'OnlineBankingPayments\RapiPago', self::SAFETYPAY => 'OnlineBankingPayments\SafetyPay', self::SANTANDER => 'OnlineBankingPayments\Santander', - self::TRUSTPAY => 'OnlineBankingPayments\TrustPay', self::UPI => 'OnlineBankingPayments\Upi', self::WEBPAY => 'OnlineBankingPayments\Webpay', self::WECHAT => 'OnlineBankingPayments\WeChat', - self::PAYBYVOUCHER_YEEPAY => 'PayByVouchers\oBeP', - self::PAYBYVOUCHER_SALE => 'PayByVouchers\Sale', self::AFRICAN_MOBILE_PAYOUT => 'Payout\AfricanMobilePayout', self::RUSSIAN_MOBILE_PAYOUT => 'Payout\RussianMobilePayout', self::INCREMENTAL_AUTHORIZE => 'Preauthorization\IncrementalAuthorize', self::PARTIAL_REVERSAL => 'Preauthorization\PartialReversal', - self::SCT_PAYOUT => 'SCT\Payout', - self::SDD_INIT_RECURRING_SALE => 'SDD\Recurring\InitRecurringSale', - self::SDD_RECURRING_SALE => 'SDD\Recurring\RecurringSale', - self::SDD_REFUND => 'SDD\Refund', - self::SDD_SALE => 'SDD\Sale', - self::ASTROPAY_CARD => 'Vouchers\AstropayCard', + self::SCT_PAYOUT => 'Sct\Payout', + self::SDD_INIT_RECURRING_SALE => 'Sdd\Recurring\InitRecurringSale', + self::SDD_RECURRING_SALE => 'Sdd\Recurring\RecurringSale', + self::SDD_REFUND => 'Sdd\Refund', + self::SDD_SALE => 'Sdd\Sale', self::CASHU => 'Vouchers\CashU', self::NEOSURF => 'Vouchers\Neosurf', self::PAYSAFECARD => 'Vouchers\Paysafecard', - self::EZEEWALLET => 'Wallets\eZeeWallet', + self::EZEEWALLET => 'Wallets\EzeeWallet', self::NETELLER => 'Wallets\Neteller', - self::QIWI => 'Wallets\Qiwi', self::PAY_PAL => 'Wallets\PayPal', - self::WEBMONEY => 'Wallets\WebMoney', - self::ZIMPLER => 'Wallets\Zimpler', + self::WEBMONEY => 'Wallets\WebMoney' ]; return isset($map[$type]) ? 'Financial\\' . $map[$type] : false; @@ -943,7 +728,6 @@ public static function getWPFTransactionTypes() self::EPS, self::EZEEWALLET, self::FASHIONCHEQUE, - self::GIROPAY, self::GOOGLE_PAY, self::IDEAL, self::IDEBIT_PAYIN, @@ -1031,23 +815,6 @@ public static function isValidSplitPaymentTrxType($type) return in_array(strtolower($type), self::getSplitPaymentsTrxTypes()); } - /** - * Check whether this is a valid (known) transaction type - * - * @param string $type - * - * @return bool - */ - public static function isPayByVoucher($type) - { - $transactionTypesList = [ - self::PAYBYVOUCHER_YEEPAY, - self::PAYBYVOUCHER_SALE - ]; - - return in_array(strtolower($type), $transactionTypesList); - } - /** * @param string $type * @@ -1092,7 +859,6 @@ public static function canRefund($type) self::EFECTY, self::EPS, self::FASHIONCHEQUE, - self::GIROPAY, self::IDEAL, self::IDEBIT_PAYIN, self::INIT_RECURRING_SALE, @@ -1128,7 +894,6 @@ public static function canRefund($type) self::UPI, self::WEBPAY, self::WECHAT, - self::ZIMPLER, self::GOOGLE_PAY, ]; @@ -1287,31 +1052,7 @@ public static function getFinancialDeprecatedRequests() { $data = array(); - $transactions = [ - self::ABNIDEAL, - self::ALIPAY, - self::ASTROPAY_CARD, - self::ASTROPAY_DIRECT, - self::BANAMEX, - self::CARULLA, - self::CITADEL_PAYIN, - self::CITADEL_PAYOUT, - self::EARTHPORT, - self::EMPRESE_DE_ENERGIA, - self::ENTERCASH, - self::HIPERCARD, - self::INSTANT_TRANSFER, - self::INPAY, - self::PAYBYVOUCHER_SALE, - self::PAYBYVOUCHER_YEEPAY, - self::PAYPAL_EXPRESS, - self::QIWI, - self::SANTANDER_CASH, - self::SURTIMAX, - self::TRUSTLY_WITHDRAWAL, - self::TRUSTPAY, - self::ZIMPLER - ]; + $transactions = []; foreach ($transactions as $transaction) { $data[$transaction] = self::getFinancialRequestClassForTrxType($transaction); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/i18n.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/i18n.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/i18n.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/i18n.php index 6a0c5b7..18a17a8 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Constants/i18n.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Constants/i18n.php @@ -1,4 +1,5 @@ isAuthentic()) { - throw new \Genesis\Exceptions\InvalidArgument('Invalid Genesis Notification!'); + throw new InvalidArgument('Invalid Genesis Notification!'); } } @@ -111,7 +123,12 @@ public function parseNotification($notification = [], $authenticate = true) * Reconcile with the Payment Gateway to get the latest * status on the transaction * - * @throws \Genesis\Exceptions\InvalidResponse + * @throws ErrorParameter + * @throws InvalidClassMethod + * @throws InvalidResponse + * @throws InvalidArgument + * @throws InvalidMethod + * @throws DeprecatedMethod */ public function initReconciliation() { @@ -120,18 +137,14 @@ public function initReconciliation() if ($this->isAPINotification()) { $type = 'NonFinancial\Reconcile\Transaction'; } elseif ($this->isWPFNotification()) { - $type = 'WPF\Reconcile'; + $type = 'Wpf\Reconcile'; } - $request = new \Genesis\Genesis($type); + $request = new Genesis($type); - try { - $request->request()->setUniqueId($this->unique_id); + $request->request()->setUniqueId($this->unique_id); - $request->execute(); - } catch (\Genesis\Exceptions\ErrorAPI $api) { - // This is reconciliation, don't throw on ErrorAPI - } + $request->execute(); return $this->reconciliationObj = $request->response()->getResponseObject(); } @@ -140,12 +153,12 @@ public function initReconciliation() * Verify the signature on the parsed Notification * * @return bool - * @throws \Genesis\Exceptions\InvalidArgument + * @throws InvalidArgument */ public function isAuthentic() { if (!isset($this->unique_id) || !isset($this->notificationObj->signature)) { - throw new \Genesis\Exceptions\InvalidArgument( + throw new InvalidArgument( 'Missing field(s), required for validation!' ); } @@ -237,7 +250,7 @@ public function generateResponse() ] ]; - $builder = new \Genesis\Builder('xml'); + $builder = new Builder('xml'); $builder->parseStructure($structure); return $builder->getDocument(); @@ -256,7 +269,7 @@ public function getResponseIdField() case $this->isKYCNotification(): return 'reference_id'; default: - throw new \LogicException('Unknown notification type'); + throw new LogicException('Unknown notification type'); } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request.php similarity index 82% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request.php index ab2032d..265a8e6 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request.php @@ -1,4 +1,5 @@ processRequestParameters(); if ($this->treeStructure instanceof \ArrayObject) { - $this->builderContext = new \Genesis\Builder($this->builderInterface); + $this->builderContext = new Builder($this->builderInterface); $this->builderContext->parseStructure($this->treeStructure->getArrayCopy()); return $this->builderContext->getDocument(); @@ -295,10 +300,11 @@ protected function initXmlConfiguration() { $this->config = CommonUtils::createArrayObject( [ - 'protocol' => Request::PROTOCOL_HTTPS, - 'port' => Request::PORT_HTTPS, - 'type' => Request::METHOD_POST, - 'format' => Builder::XML + 'protocol' => Request::PROTOCOL_HTTPS, + 'port' => Request::PORT_HTTPS, + 'type' => Request::METHOD_POST, + 'format' => Builder::XML, + 'authorization' => Request::AUTH_TYPE_BASIC ] ); } @@ -312,10 +318,11 @@ protected function initJsonConfiguration() { $this->config = CommonUtils::createArrayObject( [ - 'protocol' => Request::PROTOCOL_HTTPS, - 'port' => Request::PORT_HTTPS, - 'type' => Request::METHOD_POST, - 'format' => Builder::JSON + 'protocol' => Request::PROTOCOL_HTTPS, + 'port' => Request::PORT_HTTPS, + 'type' => Request::METHOD_POST, + 'format' => Builder::JSON, + 'authorization' => Request::AUTH_TYPE_BASIC ] ); } @@ -329,10 +336,30 @@ protected function initFormConfiguration() { $this->config = CommonUtils::createArrayObject( [ - 'protocol' => Request::PROTOCOL_HTTPS, - 'port' => Request::PORT_HTTPS, - 'type' => Request::METHOD_POST, - 'format' => Builder::FORM + 'protocol' => Request::PROTOCOL_HTTPS, + 'port' => Request::PORT_HTTPS, + 'type' => Request::METHOD_POST, + 'format' => Builder::FORM, + 'authorization' => Request::AUTH_TYPE_BASIC + ] + ); + } + + /** + * Configures a Secure Post Request with GraphQL body + * + * @return void + */ + protected function initGraphqlConfiguration() + { + $this->config = CommonUtils::createArrayObject( + [ + 'protocol' => Request::PROTOCOL_HTTPS, + 'port' => Request::PORT_HTTPS, + 'type' => Request::METHOD_POST, + 'format' => Builder::JSON, + 'authorization' => Request::AUTH_TYPE_TOKEN, + 'bearer_token' => null ] ); } @@ -349,8 +376,7 @@ protected function initApiGatewayConfiguration( $requestPath = 'process', $includeToken = true, $subdomain = 'gateway' - ) - { + ) { $this->setApiConfig( 'url', $this->buildRequestURL( diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/BaseVersionedRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/BaseVersionedRequest.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/BaseVersionedRequest.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/BaseVersionedRequest.php index a76a7a4..965005e 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/BaseVersionedRequest.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/BaseVersionedRequest.php @@ -1,4 +1,5 @@ requestType) { case Builder::XML: @@ -147,7 +149,7 @@ protected function initConfiguration($subdomain = 'gateway') break; } - $this->initApiGatewayConfiguration($this->version . '/' . $this->requestPath, false, $subdomain); + $this->initApiGatewayConfiguration("$this->version/$this->requestPath", false); } /** diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial.php similarity index 63% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial.php index 95e91f0..366cd88 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial.php @@ -1,4 +1,5 @@ use_smart_router = CommonUtils::toBoolean($value); + + return $this; + } + /** * Returns the Request transaction type * @return string @@ -54,27 +78,37 @@ abstract protected function getPaymentTransactionStructure(); /** * Initialize per-request configuration + * + * @throws EnvironmentNotSet */ protected function initConfiguration() { $this->initXmlConfiguration(); $this->initApiGatewayConfiguration(); + + if (Config::getForceSmartRouting()) { + $this->initializeSmartRouter(); + } } /** - * Perform field validation + * Process Request Params * * @return void - * @throws \Genesis\Exceptions\InvalidArgument + * + * @throws EnvironmentNotSet * @throws \Genesis\Exceptions\ErrorParameter + * @throws \Genesis\Exceptions\InvalidArgument * @throws \Genesis\Exceptions\InvalidClassMethod */ - protected function checkRequirements() + protected function processRequestParameters() { - parent::checkRequirements(); + if ($this->getUseSmartRouter()) { + $this->initializeSmartRouter(); + } - $this->validateConditionalValuesRequirements(); + parent::processRequestParameters(); } /** @@ -97,4 +131,15 @@ protected function populateStructure() $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); } + + /** + * Initialize Smart Router endpoint + * + * @return void + * @throws \Genesis\Exceptions\EnvironmentNotSet + */ + protected function initializeSmartRouter() + { + $this->initApiGatewayConfiguration('transactions', false, 'api_service'); + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Alternative.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Alternative.php similarity index 85% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Alternative.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Alternative.php index 2699e6d..cc1f2e8 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Alternative.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Alternative.php @@ -1,4 +1,5 @@ items) || $this->items->count() === 0) { - throw new \Genesis\Exceptions\ErrorParameter('Empty (null) required parameter: items'); + throw new ErrorParameter('Empty (null) required parameter: items'); } } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Cards/CreditCard.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Cards/CreditCard.php similarity index 88% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Cards/CreditCard.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Cards/CreditCard.php index fddd94a..c45f1f6 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/Financial/Cards/CreditCard.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/Financial/Cards/CreditCard.php @@ -1,4 +1,5 @@ request_path = $requestPath; + $this->request_name = $requestName; + + parent::__construct($this->request_path, Builder::JSON, $allowedVersions); + } + + /** + * Add single value to response field list + * + * @param $value + * @return $this + * @throws InvalidArgument + */ + public function addResponseField($value) + { + if (!in_array($value, $this->getResponseFieldsAllowedValues())) { + throw new InvalidArgument( + 'Invalid value given for response fields. Allowed values: ' . + implode(', ', $this->getResponseFieldsAllowedValues()) + ); + } + + array_push($this->response_fields, $value); + + $this->response_fields = array_unique($this->response_fields); + + return $this; + } + + /** + * Set the fields in the response + * + * @param array $value + * @return $this + * @throws InvalidArgument + */ + public function setResponseFields($value) + { + if ( + CommonUtils::isValidArray($value) + && empty(array_diff($value, $this->getResponseFieldsAllowedValues())) + ) { + $this->response_fields = $value; + $this->response_fields = array_unique($this->response_fields); + + return $this; + } + + throw new InvalidArgument( + 'Invalid value/s given for the response fields array. Allowed values: ' . + implode(', ', $this->getResponseFieldsAllowedValues()) + ); + } + + /** + * Return a formatted string with response fields + * + * @return string + */ + public function getResponseFields() + { + return sprintf('%s', implode(' ', $this->response_fields)); + } + + /** + * Initialize the appropriate token for the request + * + * @return string + */ + abstract protected function initGraphqlToken(); + + /** + * Filters that are used in the request + * + * @return string + */ + abstract protected function getRequestFilters(); + + /** + * List of allowed response fields + * + * @return string[] + */ + abstract protected function getResponseFieldsAllowedValues(); + + /** + * Set the per-request configuration + * + * @return void + * @throws EnvironmentNotSet + */ + protected function initConfiguration() + { + $this->initGraphqlConfiguration(); + + $this->initGraphqlToken(); + + $this->initializeServiceApiRouter($this->request_path); + } + + /** + * Initialize GraphQL endpoint + * + * @param $request_path + * @return void + * @throws \Genesis\Exceptions\EnvironmentNotSet + */ + protected function initializeServiceApiRouter($request_path) + { + $this->initApiGatewayConfiguration( + $request_path . '/' . $this->getVersion() . '/graphql', + false, + 'api_service' + ); + } + + /** + * Additional query data + * + * @return string + */ + protected function getAdditionalData() + { + return ''; + } + + /** + * Create the request's structure + * + * @return void + */ + protected function populateStructure() + { + $treeStructure = [ + 'query' => sprintf( + 'query { + %s( + %s + ) { + items { %s } + %s + } + }', + $this->request_name, + $this->getRequestFilters(), + $this->getRequestStructure(), + $this->getAdditionalData() + ) + ]; + + $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); + } + + /** + * Helper to form parts of GraphQL query + * + * @param array $elements - GraphQL group of elements in the format + * ['name1' => 'value1', + * 'name2' => 'value2'] + * @param string $element_name - the name of the group of elements in GraphQL + * element_name: { name1: value1, name2: value2 } + * @param string $glue - a separator, example: ', ' in name1: value1, name2: value2 + * @param string $format - the used format, example: '%s: %s' for name1: value1 + * @return string + */ + protected function generateGraphQLCode($elements, $element_name, $glue = ', ', $format = '%s: %s') + { + $elements = array_filter($elements); + + if (empty($elements)) { + return ''; + } + + return sprintf( + $element_name . ': { %s }', + implode( + $glue, + array_map( + function ($key, $value) use ($format) { + return sprintf($format, $key, $value); + }, + array_keys($elements), + $elements + ) + ) + ); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Klarna/BaseRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Klarna/BaseRequest.php new file mode 100644 index 0000000..880b7f2 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Klarna/BaseRequest.php @@ -0,0 +1,104 @@ +setRequestRequiredFields() + ); + + $this->requiredFields = Common::createArrayObject($requiredFields); + } + + protected function initBaseConfiguration($requestPath) + { + $this->initXmlConfiguration(); + + $this->initApiGatewayConfiguration($requestPath, false); + } + + protected function populateStructure() + { + $treeStructure = [ + $this->getParentNode() => array_merge( + [ + 'transaction_id' => $this->transaction_id + ], + $this->getRequestStructure() + ) + ]; + + $this->treeStructure = Common::createArrayObject($treeStructure); + } + + /** + * Get additional attributes + * + * @return array + */ + abstract protected function getRequestStructure(); + + /** + * Set additional required fields + * + * @return array + */ + abstract protected function setRequestRequiredFields(); + + /** + * Get the root node of the Populated XML structure + * + * @return string + */ + abstract protected function getParentNode(); +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Trustly/BaseRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Trustly/BaseRequest.php new file mode 100644 index 0000000..28e71eb --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Alternatives/Trustly/BaseRequest.php @@ -0,0 +1,174 @@ +request_path = $requestPath; + + parent::__construct($this->request_path, Builder::JSON, ['v1']); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidArgument + */ + public function setEmail($value) + { + if (empty($value)) { + $this->email = null; + + return $this; + } + + if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { + throw new InvalidArgument('Invalid email given'); + } + + $this->email = $value; + + return $this; + } + + /** + * Generate the proper date format + * + * @return string|null + */ + public function getBirthDate() + { + return (empty($this->birth_date)) ? null : + $this->birth_date->format(DateTimeFormat::YYYY_MM_DD_ISO_8601); + } + + /** + * Set the per-request configuration + * + * @return void + * @throws EnvironmentNotSet + */ + protected function initConfiguration() + { + parent::initConfiguration(); + $this->initApiGatewayConfiguration("{$this->getVersion()}/trustly/$this->request_path", true); + } + + /** + * Create the request's Tree structure + * + * @return void + */ + protected function populateStructure() + { + $this->treeStructure = CommonUtils::createArrayObject( + $this->getRequestStructure() + ); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Consumers/BaseRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Consumers/BaseRequest.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Consumers/BaseRequest.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Consumers/BaseRequest.php index e69dac5..d099964 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Consumers/BaseRequest.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Consumers/BaseRequest.php @@ -1,4 +1,5 @@ page = (int) $value; - - return $this; - } - - /** - * Number of entities on page, default to 100 - * - * @param $value - * @return $this - */ - public function setPerPage($value) - { - $this->per_page = (int) $value; - - return $this; - } - /** * Get formatted Start Date as string * diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Fx/BaseRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Fx/BaseRequest.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Fx/BaseRequest.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Fx/BaseRequest.php index c4e9aa9..df1002f 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/Fx/BaseRequest.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/Fx/BaseRequest.php @@ -1,4 +1,5 @@ request_path = $requestPath; - $this->kyc_subdomain = 'kyc'; parent::__construct($this->request_path, Builder::JSON, ['v1']); } @@ -71,12 +64,11 @@ public function __construct($requestPath) * * @return void * @throws EnvironmentNotSet - * @SuppressWarnings("unused") */ - protected function initConfiguration($subdomain = 'kyc') + protected function initConfiguration() { - parent::initConfiguration($this->kyc_subdomain); - $this->initApiGatewayConfiguration('api/' . $this->getVersion() . '/' . $this->request_path,false, $this->kyc_subdomain); // @codingStandardsIgnoreLine + parent::initConfiguration(); + $this->initApiGatewayConfiguration("api/{$this->getVersion()}/$this->request_path", false, 'kyc'); } /** @@ -86,7 +78,7 @@ protected function initConfiguration($subdomain = 'kyc') */ protected function populateStructure() { - $this->treeStructure = \Genesis\Utils\Common::createArrayObject( + $this->treeStructure = CommonUtils::createArrayObject( $this->getRequestStructure() ); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php index a55dd2f..40186c0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Base/NonFinancial/TokenizationApi/BaseRequest.php @@ -1,4 +1,5 @@ setQuantityUnit($quantity_unit); } - /** - * Verify required field - * - * @param $field - * @param $value - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function verifyRequiredField($field, $value) - { - if (empty($value)) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Empty (null) item required parameter: %s', - $field - ) - ); - } - } - - /** - * Verify non-negative filed - * - * @param $field - * @param $value - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function verifyNonNegativeField($field, $value) - { - if (!empty($value) && $value <= 0) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Item parameter %s is set to %s, but expected to be positive number', - $field, - $value - ) - ); - } - } - - /** - * Verify negative filed - * - * @param $field - * @param $value - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function verifyNegativeField($field, $value) - { - if (!empty($value) && $value > 0) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Item parameter %s is set to %s, but expected to be negative number', - $field, - $value - ) - ); - } - } - - /** - * Verify unit_price filed - * - * @param $value - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function verifyUnitPriceField($value) - { - $this->verifyRequiredField('unit_price', $value); - - if (in_array($this->item_type, [self::ITEM_TYPE_DISCOUNT, self::ITEM_TYPE_STORE_CREDIT])) { - $this->verifyNegativeField('unit_price', $value); - return; - } - - $this->verifyNonNegativeField('unit_price', $value); - } - /** * Set name * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setName($value) { @@ -301,7 +227,7 @@ public function setName($value) * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setUnitPrice($value) { @@ -316,7 +242,7 @@ public function setUnitPrice($value) * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setQuantity($value) { @@ -332,7 +258,7 @@ public function setQuantity($value) * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setTaxRate($value) { @@ -346,7 +272,7 @@ public function setTaxRate($value) * Set total discount amount * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setTotalDiscountAmount($value) { @@ -361,24 +287,17 @@ public function setTotalDiscountAmount($value) * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setItemType($value) { $this->verifyRequiredField('item_type', $value); // check if it is valid type - $item_types = array( - self::ITEM_TYPE_PHYSICAL, - self::ITEM_TYPE_DISCOUNT, - self::ITEM_TYPE_SHIPPING_FEE, - self::ITEM_TYPE_DIGITAL, - self::ITEM_TYPE_GIFT_CARD, - self::ITEM_TYPE_STORE_CREDIT, - self::ITEM_TYPE_SURCHARGE - ); + $item_types = CommonUtils::getClassConstants(__CLASS__); + if (!in_array($value, $item_types)) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( 'Required item parameter item_type is set to %s, but expected to be one of (%s)', $value, @@ -399,12 +318,12 @@ public function setItemType($value) * * @param $value * @return $this - * @throws \Genesis\Exceptions\ErrorParameter + * @throws ErrorParameter */ public function setQuantityUnit($value) { if (!empty($value) && strlen($value) > 8) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( 'Item parameter quantity_unit is set to %s, but expected to be string with max length 8 characters', $value @@ -440,14 +359,18 @@ public function getTotalAmount() public function getTotalTaxAmount() { // Convert to minor units for more accurate calculations - $total_amount = CurrencyUtils::amountToExponent($this->getTotalAmount(), $this->currency); - $tax_rate = CurrencyUtils::amountToExponent($this->tax_rate, $this->currency); + $total_amount = $this->getAmountInProperUnit($this->getTotalAmount()); + $tax_rate = $this->getAmountInProperUnit($this->tax_rate); $total_tax_amount = ceil( $total_amount - ( ($total_amount * 10000) / (10000 + $tax_rate) ) ); - return CurrencyUtils::exponentToAmount($total_tax_amount, $this->currency); + if (!empty($this->currency)) { + return CurrencyUtils::exponentToAmount($total_tax_amount, $this->currency); + } + + return $total_tax_amount; } /** @@ -461,11 +384,11 @@ public function toArray() 'name' => $this->name, 'item_type' => $this->item_type, 'quantity' => $this->quantity, - 'unit_price' => CurrencyUtils::amountToExponent($this->unit_price, $this->currency), - 'tax_rate' => CurrencyUtils::amountToExponent($this->tax_rate, $this->currency), - 'total_discount_amount' => CurrencyUtils::amountToExponent($this->total_discount_amount, $this->currency), - 'total_amount' => CurrencyUtils::amountToExponent($this->getTotalAmount(), $this->currency), - 'total_tax_amount' => CurrencyUtils::amountToExponent($this->getTotalTaxAmount(), $this->currency), + 'unit_price' => $this->getAmountInProperUnit($this->unit_price), + 'tax_rate' => $this->getAmountInProperUnit($this->tax_rate), + 'total_discount_amount' => $this->getAmountInProperUnit($this->total_discount_amount), + 'total_amount' => $this->getAmountInProperUnit($this->getTotalAmount()), + 'total_tax_amount' => $this->getAmountInProperUnit($this->getTotalTaxAmount()), 'reference' => $this->reference, 'image_url' => $this->image_url, 'product_url' => $this->product_url, @@ -488,28 +411,108 @@ public function setProductIdentifiers(ProductIdentifiers $value) } /** - * Builds an array list with all product identifiers params + * Add merchant data: marketplace seller info * - * @return array + * @param $value + * @return $this */ - protected function getProductIdentifiersParamsStructure() + public function addMerchantMarketplaceSellerInfo($value) { - if ($this->product_identifiers instanceof ProductIdentifiers) { - return $this->product_identifiers->toArray(); + array_push($this->marketplace_seller_info, $value); + + return $this; + } + + /** + * Verify required field + * + * @param $field + * @param $value + * @throws ErrorParameter + */ + protected function verifyRequiredField($field, $value) + { + if (empty($value)) { + throw new ErrorParameter( + sprintf( + 'Empty (null) item required parameter: %s', + $field + ) + ); } - return []; } /** - * Add merchant data: marketplace seller info + * Verify non-negative filed * + * @param $field * @param $value - * @return $this + * @throws ErrorParameter */ - public function addMerchantMarketplaceSellerInfo($value) + protected function verifyNonNegativeField($field, $value) { - array_push($this->marketplace_seller_info, $value); - return $this; + if (!empty($value) && $value <= 0) { + throw new ErrorParameter( + sprintf( + 'Item parameter %s is set to %s, but expected to be positive number', + $field, + $value + ) + ); + } + } + + /** + * Verify negative filed + * + * @param $field + * @param $value + * @throws ErrorParameter + */ + protected function verifyNegativeField($field, $value) + { + if (!empty($value) && $value > 0) { + throw new ErrorParameter( + sprintf( + 'Item parameter %s is set to %s, but expected to be negative number', + $field, + $value + ) + ); + } + } + + /** + * Verify unit_price filed + * + * @param $value + * @throws ErrorParameter + */ + protected function verifyUnitPriceField($value) + { + $this->verifyRequiredField('unit_price', $value); + + if (in_array($this->item_type, [self::ITEM_TYPE_DISCOUNT, self::ITEM_TYPE_STORE_CREDIT])) { + $this->verifyNegativeField('unit_price', $value); + + return; + } + + $this->verifyNonNegativeField('unit_price', $value); + } + + /** + * Builds an array list with all product identifiers params + * + * @return array + */ + protected function getProductIdentifiersParamsStructure() + { + if ($this->product_identifiers instanceof ProductIdentifiers) { + return $this->product_identifiers->toArray(); + } + + return []; } /** @@ -526,4 +529,20 @@ function ($marketplace_seller_info) { $this->marketplace_seller_info ); } + + /** + * If the currency is set and the amount is in major unit convert it to minor + * + * @param mixed $value + * @return mixed + * @throws \Genesis\Exceptions\InvalidArgument + */ + private function getAmountInProperUnit($value) + { + if (!empty($this->currency)) { + return CurrencyUtils::amountToExponent($value, $this->currency); + } + + return $value; + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/Items.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/Items.php similarity index 81% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/Items.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/Items.php index 88f6880..2c94fc0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/Items.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/Items.php @@ -1,4 +1,5 @@ currency = $currency; + if (!empty($currency)) { + $this->currency = $currency; + } } /** @@ -68,8 +71,10 @@ public function __construct($currency) */ public function addItem(Item $item) { - // set currency, so amounts transformations can be done - $item->setCurrency($this->currency); + if (!empty($this->currency)) { + // set currency, so amounts transformations can be done + $item->setCurrency($this->currency); + } array_push($this->items, $item); return $this; @@ -115,7 +120,9 @@ public function count() public function toArray() { return [ - 'order_tax_amount' => CurrencyUtils::amountToExponent($this->getOrderTaxAmount(), $this->currency), + 'order_tax_amount' => (!empty($this->currency)) ? + CurrencyUtils::amountToExponent($this->getOrderTaxAmount(), $this->currency) : + $this->getOrderTaxAmount(), 'items' => array_map( function ($item) { return ['item' => $item->toArray()]; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php index 7d6ca26..556fd05 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Klarna/ProductIdentifiers.php @@ -1,4 +1,5 @@ 'EUR' ] ], - PaymentMethods::GIRO_PAY => [ - [ - 'billing_country' => 'DE', - 'currency' => 'EUR' - ] - ], PaymentMethods::BCMC => [ [ 'billing_country' => 'BE', @@ -205,29 +203,6 @@ protected function setRequiredFieldValuesConditional() $this->requiredFieldValuesConditional = CommonUtils::createArrayObject($requiredFieldValuesConditional); } - /** - * Add iban conditional validation if it is present - * - * @return void - * - * @throws InvalidArgument - * @throws \Genesis\Exceptions\ErrorParameter - * @throws \Genesis\Exceptions\InvalidClassMethod - */ - protected function checkRequirements() - { - if ($this->payment_type === PaymentMethods::GIRO_PAY) { - $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( - array_merge( - (array)$this->requiredFieldValuesConditional, - $this->getIbanConditions() - ) - ); - } - - parent::checkRequirements(); - } - /** * Return additional request attributes * @return array diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Sofort.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Sofort.php similarity index 88% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Sofort.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Sofort.php index 26360ee..238c0e2 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Alternatives/Sofort.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Alternatives/Sofort.php @@ -1,4 +1,5 @@ requiredTokenizationFieldsConditional(), $this->requiredCCFieldsConditional(), $this->requiredManagedRecurringFieldsConditional(), - $this->requiredRecurringManagedTypeFieldConditional(), - $this->requiredRecurringSubsequentTypeFieldConditional() + $this->requiredRecurringManagedTypeFieldConditional() ); $this->requiredFieldsConditional = CommonUtils::createArrayObject($requiredFieldsConditional); @@ -113,6 +131,12 @@ protected function setRequiredFields() */ protected function checkRequirements() { + if ($this->recurring_type == Types::SUBSEQUENT) { + $this->checkRequirementsSubsequent(); + + return; + } + $requiredFieldValuesConditional = $this->requiredRecurringAllTypesFieldValuesConditional(); $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( @@ -148,7 +172,8 @@ protected function getTransactionAttributes() 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, 'reference_id' => $this->reference_id, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ], $this->getScaAttributesStructure(), $this->getUcofAttributesStructure() diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Authorize3D.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Authorize3D.php similarity index 74% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Authorize3D.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Authorize3D.php index 7b41837..9efc4e7 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Authorize3D.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Authorize3D.php @@ -1,4 +1,5 @@ $this->getRecurringType(), 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ], $this->getScaAttributesStructure(), $this->get3DSTransactionAttributes() diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Bancontact.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Bancontact.php similarity index 84% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Bancontact.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Bancontact.php index dc66aa9..5184667 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Bancontact.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Bancontact.php @@ -1,4 +1,5 @@ requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); + } + + /** + * Apply transformation: Convert to Minor currency unit + * When there is no currency the amount will not be modified + * + * @param string $amount + * @param string $currency + * + * @return string + */ + protected function transformAmount($amount = '', $currency = '') + { + if (empty($currency)) { + return $amount; + } + + return parent::transformAmount($amount, $currency); + } + + /** + * Returns the Request transaction type + * @return string + */ + protected function getTransactionType() + { + return \Genesis\Api\Constants\Transaction\Types::CREDIT; + } + + /** + * Return additional request attributes + * + * @return array + */ + protected function getPaymentTransactionStructure() + { + return array_merge( + $this->getSourceOfFundsStructure(), + [ + 'reference_id' => $this->reference_id, + 'amount' => $this->transformAmount($this->amount, $this->currency), + 'customer_identification' => $this->getCustomerIdentificationDataStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure(), + 'purpose_of_payment' => $this->purpose_of_payment + ] + ); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Elo.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Elo.php similarity index 84% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Elo.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Elo.php index 951c088..ef8dd0a 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Elo.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Elo.php @@ -1,4 +1,5 @@ $this->getDynamicDescriptorParamsStructure(), 'money_transfer' => $this->getMoneyTransferPayoutStructure(), 'customer_identification' => $this->getCustomerIdentificationDataStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure(), + 'purpose_of_payment' => $this->purpose_of_payment ], $this->getSourceOfFundsStructure() ); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale.php similarity index 72% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale.php index ddd5713..107f06b 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale.php @@ -1,4 +1,5 @@ $this->getBusinessAttributesStructure(), 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale3D.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale3D.php similarity index 76% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale3D.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale3D.php index 282c845..1eecc77 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/InitRecurringSale3D.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/InitRecurringSale3D.php @@ -1,4 +1,5 @@ $this->getBusinessAttributesStructure(), 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ], $this->getScaAttributesStructure(), $this->get3DSTransactionAttributes() diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/RecurringSale.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/RecurringSale.php similarity index 80% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/RecurringSale.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/RecurringSale.php index adf0fb1..32658f0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Recurring/RecurringSale.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Recurring/RecurringSale.php @@ -1,4 +1,5 @@ requiredTokenizationFieldsConditional(), $this->requiredCCFieldsConditional(), - $this->requiredRecurringSubsequentTypeFieldConditional(), $this->requiredManagedRecurringFieldsConditional(), $this->requiredRecurringManagedTypeFieldConditional() ); @@ -113,6 +130,12 @@ protected function setRequiredFields() */ protected function checkRequirements() { + if ($this->recurring_type == Types::SUBSEQUENT) { + $this->checkRequirementsSubsequent(); + + return; + } + $requiredFieldValuesConditional = $this->requiredRecurringAllTypesFieldValuesConditional(); $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( @@ -147,7 +170,8 @@ protected function getTransactionAttributes() 'recurring_type' => $this->getRecurringType(), 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ], $this->getScaAttributesStructure(), $this->getUcofAttributesStructure() diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Sale3D.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Sale3D.php similarity index 74% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Sale3D.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Sale3D.php index b676c3a..6ee20d8 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/Sale3D.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/Sale3D.php @@ -1,4 +1,5 @@ $this->getRecurringType(), 'managed_recurring' => $this->getManagedRecurringAttributesStructure(), 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ], $this->getScaAttributesStructure(), $this->get3DSTransactionAttributes() diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/TarjetaShopping.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/TarjetaShopping.php similarity index 84% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/TarjetaShopping.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/TarjetaShopping.php index dac2205..66bc442 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Cards/TarjetaShopping.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Cards/TarjetaShopping.php @@ -1,4 +1,5 @@ getTransactionUniqueId(), $this->getApiConfig('url')); + return str_replace(':unique_id', (string)$this->getTransactionUniqueId(), $this->getApiConfig('url')); } /** @@ -343,7 +343,8 @@ private function configureEndpointUrl($endpointUrl) */ public static function buildFromResponseObject(\stdClass $responseObject) { - if (!isset($responseObject->threeds_method_continue_url) + if ( + !isset($responseObject->threeds_method_continue_url) || !isset($responseObject->unique_id) || !isset($responseObject->amount) || !isset($responseObject->currency) || !isset($responseObject->timestamp) || !($responseObject->timestamp instanceof \DateTime) diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Baloto.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Baloto.php similarity index 83% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Baloto.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Baloto.php index 51120b1..3518155 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Baloto.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Baloto.php @@ -1,4 +1,5 @@ allowedOptionsSetter( + 'gender', + Gender::getAll(), + $value, + 'Invalid value for parameter gender provided.' + ); + } + + /** + * @param $value + * @return Pix + * @throws \Genesis\Exceptions\InvalidArgument + */ + public function setMaritalStatus($value) + { + return $this->allowedOptionsSetter( + 'marital_status', + MaritalStatuses::getAll(), + $value, + 'Invalid value for marital status parameter provided.' + ); + } + + public function setCompanyType($value) + { + return $this->allowedOptionsSetter( + 'company_type', + CompanyTypes::getAll(), + $value, + 'Invalid value for company type parameter provided.' + ); + } + + /** + * Set the required fields + * + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'transaction_id', + 'amount', + 'currency', + 'document_id' + ]; + + $this->requiredFields = CommonUtils::createArrayObject($requiredFields); + + $requiredFieldValues = [ + 'billing_country' => $this->getAllowedBillingCountries() + ]; + + $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); + + $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( + $this->getDocumentIdConditions() + ); + } + + /** + * Return additional request attributes + * + * @return array + */ + protected function getPaymentTransactionStructure() + { + return array_merge( + [ + 'return_success_url' => $this->return_success_url, + 'return_failure_url' => $this->return_failure_url, + 'return_pending_url' => $this->getReturnPendingUrl(), + 'amount' => $this->transformAmount($this->amount, $this->currency), + 'currency' => $this->currency, + 'customer_email' => $this->customer_email, + 'document_id' => $this->document_id, + 'billing_address' => $this->getBillingAddressParamsStructure(), + 'shipping_address' => $this->getShippingAddressParamsStructure(), + 'birth_date' => $this->getBirthDate(), + 'birth_city' => $this->birth_city, + 'birth_state' => $this->birth_state, + 'gender' => $this->gender, + 'marital_status' => $this->marital_status, + 'sender_occupation' => $this->sender_occupation, + 'nationality' => $this->nationality, + 'country_of_origin' => $this->country_of_origin + + ], + $this->getCustomerParamsStructure() + ); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Redpagos.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Redpagos.php similarity index 83% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Redpagos.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Redpagos.php index 3f64164..dcd2605 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/Redpagos.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/CashPayments/Redpagos.php @@ -1,4 +1,5 @@ [ ['bank_code' => BankCodeParameters::getBankCodesPerCurrency('PLN')] ], + 'AUD' => [ + ['bank_code' => BankCodeParameters::getBankCodesPerCurrency('AUD')] + ] ] ]; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php similarity index 88% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php index 8a3a411..e80bbc3 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/OnlineBanking/Payout.php @@ -1,4 +1,5 @@ $this->getBirthDate(), 'payment_type' => $this->payment_type, 'billing_address' => $this->getBillingAddressParamsStructure(), - 'shipping_address' => $this->getShippingAddressParamsStructure() + 'shipping_address' => $this->getShippingAddressParamsStructure(), + 'pix_key' => $this->pix_key ], $this->getCustomerParamsStructure() ); @@ -456,16 +469,13 @@ protected function validateBRLCurrency() } $requiredFieldsGroups = [ - 'currency' => ['bank_code', 'bank_name'], + 'BRL Currency' => ['bank_code', 'bank_name'] ]; $this->requiredFieldsGroups = Common::createArrayObject($requiredFieldsGroups); - // Allow empty bank_name with non-empty bank_code - if (!empty($this->bank_code)) { - $requiredFieldValuesConditional = (array)$this->requiredFieldValuesConditional; - $requiredFieldValuesConditional['currency']['BRL'][] = ['bank_code' => $this->bank_code]; - - $this->requiredFieldValuesConditional = Common::createArrayObject($requiredFieldValuesConditional); + // Allow empty bank_name, only with Group bank_code and bank_name requirement + if (empty($this->bank_name)) { + unset($this->requiredFieldValuesConditional['currency']['BRL']); } } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/PayU.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/PayU.php similarity index 81% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/PayU.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/PayU.php index eb4fd93..edee64f 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/OnlineBankingPayments/PayU.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/OnlineBankingPayments/PayU.php @@ -1,4 +1,5 @@ $this->getBillingAddressParamsStructure(), 'shipping_address' => $this->getShippingAddressParamsStructure(), 'return_success_url' => $this->return_success_url, - 'return_failure_url' => $this->return_failure_url + 'return_failure_url' => $this->return_failure_url, + 'return_pending_url' => $this->getReturnPendingUrl() ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/TravelData/AirlineItineraryLegData.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/TravelData/AirlineItineraryLegData.php similarity index 96% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/TravelData/AirlineItineraryLegData.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/TravelData/AirlineItineraryLegData.php index fcd4032..b2e8530 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/TravelData/AirlineItineraryLegData.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/TravelData/AirlineItineraryLegData.php @@ -1,4 +1,5 @@ merchant_website = null; + + return $this; + } + + if (!CommonUtils::isValidUrl($value)) { + throw new InvalidArgument('Invalid merchant_website URL is given.'); + } + + $this->merchant_website = $value; + + return $this; + } + /** * Returns the Request transaction type * @return string */ protected function getTransactionType() { - return \Genesis\API\Constants\Transaction\Types::EZEEWALLET; + return \Genesis\Api\Constants\Transaction\Types::EZEEWALLET; } /** @@ -102,11 +139,11 @@ protected function getPaymentTransactionStructure() 'return_failure_url' => $this->return_failure_url, 'notification_url' => $this->notification_url, 'source_wallet_id' => $this->source_wallet_id, - 'source_wallet_pwd' => $this->transformWalletPassword($this->source_wallet_pwd) + 'source_wallet_pwd' => $this->transformWalletPassword($this->source_wallet_pwd), + 'merchant_website' => $this->merchant_website ]; } - /** * Apply transformation: * diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Neteller.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Wallets/Neteller.php similarity index 86% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Neteller.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Wallets/Neteller.php index 1bae700..556164d 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/Wallets/Neteller.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Financial/Wallets/Neteller.php @@ -1,4 +1,5 @@ requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues); - + $requiredFieldsConditional = [ 'is_payout' => [ true => [ diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/EmpreseDeEnergia.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/ReleaseAuthorization.php similarity index 62% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/EmpreseDeEnergia.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/ReleaseAuthorization.php index 3e668bd..5e01f30 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/Financial/CashPayments/EmpreseDeEnergia.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/ReleaseAuthorization.php @@ -1,4 +1,5 @@ config = \Genesis\Utils\Common::createArrayObject( - [ - 'protocol' => Request::PROTOCOL_HTTPS, - 'port' => Request::PORT_HTTPS, - 'type' => Request::METHOD_GET, - 'format' => 'xml' - ] - ); - - $this->initApiGatewayConfiguration('retrieve_abn_ideal_banks', false); + parent::initBaseConfiguration('klarna/update_order_address'); + } + + protected function getRequestStructure() + { + return [ + 'billing_address' => $this->getBillingAddressParamsStructure(), + 'shipping_address' => $this->getShippingAddressParamsStructure() + ]; + } + + protected function getParentNode() + { + return 'update_order_address_request'; + } + + protected function setRequestRequiredFields() + { + return [ + 'billing_country', + 'shipping_country' + ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/UpdateItems.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/UpdateItems.php new file mode 100644 index 0000000..c9bde68 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Klarna/UpdateItems.php @@ -0,0 +1,102 @@ +items = $items; + + return $this; + } + + protected function initConfiguration() + { + parent::initBaseConfiguration('klarna/update_order_items'); + } + + protected function getRequestStructure() + { + return array_merge( + [ + 'amount' => \Genesis\Utils\Currency::amountToExponent($this->amount, $this->currency) + ], + $this->items instanceof Items ? $this->items->toArray() : [] + ); + } + + protected function getParentNode() + { + return 'update_order_items_request'; + } + + protected function setRequestRequiredFields() + { + return [ + 'amount' + ]; + } + + protected function checkRequirements() + { + parent::checkRequirements(); + + // verify there is at least one item added + if (empty($this->items) || $this->items->count() === 0) { + throw new ErrorParameter('Empty (null) required parameter: items'); + } + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Alternatives/TransferTo/Payers.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/TransferTo/Payers.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Alternatives/TransferTo/Payers.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/TransferTo/Payers.php index 8e76c60..1917b05 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Alternatives/TransferTo/Payers.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/TransferTo/Payers.php @@ -1,4 +1,5 @@ 'bank_number' + ]; + } + + /** + * Set the required fields + * + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'first_name', + 'last_name', + 'birth_date', + 'user_id', + 'clearing_house', + 'account_number', + 'bank_number' + ]; + + $this->requiredFields = CommonUtils::createArrayObject($requiredFields); + + $requiredFieldValues = [ + 'clearing_house' => ClearingHouses::getAll() + ]; + + $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); + } + + /** + * @return array + */ + protected function getRequestStructure() + { + return [ + 'first_name' => $this->first_name, + 'last_name' => $this->last_name, + 'email' => $this->email, + 'mobile_phone' => $this->mobile_phone, + 'national_id' => $this->national_id, + 'birth_date' => $this->getBirthDate(), + 'user_id' => $this->user_id, + 'account_number' => $this->account_number, + 'clearing_house' => $this->clearing_house, + 'bank_number' => $this->bank_number + ]; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Trustly/SelectAccount.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Trustly/SelectAccount.php new file mode 100644 index 0000000..7a365d7 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Alternatives/Trustly/SelectAccount.php @@ -0,0 +1,154 @@ +requiredFields = CommonUtils::createArrayObject($requiredFields); + + $requiredFieldValues = [ + 'country' => Country::getList() + ]; + + $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues); + } + + /** + * @return array + */ + protected function getRequestStructure() + { + return [ + 'country' => $this->country, + 'first_name' => $this->first_name, + 'last_name' => $this->last_name, + 'ip_address' => $this->ip_address, + 'email' => $this->email, + 'mobile_phone' => $this->mobile_phone, + 'national_id' => $this->national_id, + 'birth_date' => $this->getBirthDate(), + 'success_url' => $this->success_url, + 'failure_url' => $this->failure_url, + 'user_id' => $this->user_id, + 'unique_id' => $this->unique_id, + 'locale' => $this->locale + ]; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/BillingApi/Transaction.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/BillingApi/Transaction.php new file mode 100644 index 0000000..3c45a81 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/BillingApi/Transaction.php @@ -0,0 +1,536 @@ +setStringArray($value, 'unique_id', 'UniqueId'); + } + + /** + * Return a formatted string with the Unique IDs + * + * @return string + */ + public function getUniqueId() + { + if (empty($this->unique_id)) { + return ''; + } + + return sprintf('[%s]', implode(',', $this->unique_id)); + } + + /** + * Set the list of Billing statement IDs in the filter + * + * @param array $value + * @return $this + * @throws InvalidArgument + */ + public function setBillingStatementId($value) + { + return $this->setStringArray($value, 'billing_statement_id', 'BillingStatementId'); + } + + /** + * Return a formatted string with the Billing statement IDs + * + * @return string + */ + public function getBillingStatementId() + { + if (empty($this->billing_statement_id)) { + return ''; + } + + return sprintf('[%s]', implode(',', $this->billing_statement_id)); + } + + /** + * Set the list of Merchant transaction IDs in the filter + * + * @param array $value + * @return $this + * @throws InvalidArgument + */ + public function setMerchantTransactionId($value) + { + return $this->setStringArray($value, 'merchant_transaction_id', 'MerchantTransactionId'); + } + + /** + * Return a formatted string with the Merchant IDs + * + * @return string + */ + public function getMerchantTransactionId() + { + if (empty($this->merchant_transaction_id)) { + return ''; + } + + return sprintf('[%s]', implode(',', $this->merchant_transaction_id)); + } + + /** + * Set the list of Master Account Names in the filter + * + * @param array $value + * @return $this + * @throws InvalidArgument + */ + public function setMasterAccountName($value) + { + return $this->setStringArray($value, 'master_account_name', 'MasterAccountName'); + } + + /** + * Return a formatted string with the Master Account Names + * + * @return string + */ + public function getMasterAccountName() + { + if (empty($this->master_account_name)) { + return ''; + } + + return sprintf('[%s]', implode(',', $this->master_account_name)); + } + + /** + * Set transaction type parameter + * + * @param string $value + * @return $this + * @throws InvalidArgument + */ + public function setTransactionType($value) + { + return $this->allowedOptionsSetter( + 'transaction_type', + $this->getTransactionTypeAllowedValues(), + $value, + 'Invalid value given for transactionType. Allowed values: ' . + implode(', ', $this->getTransactionTypeAllowedValues()) + ); + } + + /** + * Set order by field parameter + * + * @param string $value + * @return $this + * @throws InvalidArgument + */ + public function setOrderByField($value) + { + return $this->allowedOptionsSetter( + 'order_by_field', + $this->getOrderByFieldAllowedValues(), + $value, + 'Invalid value given for orderByField. Allowed values: ' . + implode(', ', $this->getOrderByFieldAllowedValues()) + ); + } + + /** + * Set Service API token + * + * @return void + */ + protected function initGraphqlToken() + { + $this->setApiConfig('bearer_token', \Genesis\Config::getBillingApiToken()); + } + + /** + * Additional optional filter arguments + * + * @return string + */ + protected function getAdditionalArguments() + { + return sprintf( + '%s %s', + $this->getRequestOrder(), + $this->getRequestPaging() + ); + } + + /** + * Add paging information to the request + * + * @return string + */ + protected function getAdditionalData() + { + return $this->pagingGraphQlFields(); + } + + /** + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'response_fields' + ]; + $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); + + $requiredFieldsGroups = [ + 'filter' => [ + 'start_date', + 'end_date', + 'unique_id', + 'billing_statement_id', + 'merchant_transaction_id', + 'master_account_name', + 'transaction_type' + ] + ]; + $this->requiredFieldsGroups = \Genesis\Utils\Common::createArrayObject($requiredFieldsGroups); + } + + /** + * @return void + * @throws ErrorParameter + * @throws InvalidArgument + */ + protected function checkRequirements() + { + parent::checkRequirements(); + + $this->validateConditionallyRequiredDates(); + $this->validateStatementsMaxCount(); + } + + /** + * Validate dates + * If startDate is provided, then endDate should also be provided and vice versa. + * + * @return void + * @throws ErrorParameter + */ + protected function validateConditionallyRequiredDates() + { + if ( + (!empty($this->start_date) && empty($this->end_date)) + || (!empty($this->end_date) && empty($this->start_date)) + ) { + throw new ErrorParameter( + 'If filter startDate is provided, then endDate should also be provided and vice versa.' + ); + } + } + + /** + * Validate max number of filter elements + * + * @return void + * @throws ErrorParameter + */ + protected function validateStatementsMaxCount() + { + $this->checkArrayMaxSize( + $this->billing_statement_id, + self::MAX_COUNT_BILLING_STATEMENT_ID, + 'billingStatementId' + ); + + $this->checkArrayMaxSize( + $this->unique_id, + self::MAX_COUNT_UNIQUE_ID, + 'uniqueId' + ); + + $this->checkArrayMaxSize( + $this->merchant_transaction_id, + self::MAX_COUNT_MERCHANT_TRANSACTION_ID, + 'merchantTransactionId' + ); + + $this->checkArrayMaxSize( + $this->master_account_name, + self::MAX_COUNT_MASTER_ACCOUNT_NAME, + 'masterAccountName' + ); + } + + /** + * Validate max number of elements in array + * + * @param array $var - the array variable + * @param int $maxSize - max size of the array + * @param string $message - text for the error message + * + * @return void + * @throws ErrorParameter + */ + protected function checkArrayMaxSize($var, $maxSize, $message) + { + if (!empty($var) && count($var) > $maxSize) { + throw new ErrorParameter( + sprintf( + 'Max number of %s elements allowed is %s.', + $message, + $maxSize + ) + ); + } + } + + /** + * Set parameter of type array of strings + * + * @param array $value - value to be set + * @param string $name - name of the array variable + * @param string $message - the message of the exception + * + * @return $this + * @throws InvalidArgument + */ + protected function setStringArray($value, $name, $message) + { + if (CommonUtils::isValidArray($value)) { + $this->{$name} = array_map('strval', $value); + + return $this; + } + + throw new InvalidArgument( + "$message should be an array of strings" + ); + } + + /** + * List of allowed response fields + * + * @return string[] + */ + protected function getResponseFieldsAllowedValues() + { + return ['uniqueId', 'billingStatementId', 'billingStatementDisplayId', 'transactionType', + 'transactionDate', 'transactionCurrency', 'transactionAmount', 'exchangeRate', 'billingCurrency', + 'billingAmount', 'transactionFeeCurrency', 'transactionFeeAmount', 'commissionAmount', 'commissionRuleId', + 'transactionFeeChargedOnBillingStatementId', 'commissionPercent', 'interchangeFee', 'interchangeCurrency', + 'isInterchangeplusplus', 'interchangeplusplusChargedOnBillingStatementId', 'schemeFee', 'vatAmount', + 'vatRate', 'schemeFeeCurrency', 'standardDebitCardRate', 'gstAmount', 'gstRate', 'terminalId', 'region', + 'settlementStatements', 'settlementDates', 'settlementStatus', 'merchantId', 'merchantName', 'valueDate']; + } + + /** + * List of allowed fields for response sorting + * + * @return string[] + */ + protected function getOrderByFieldAllowedValues() + { + return ['billingStatementId', 'transactionDate', 'transactionCurrency', 'transactionAmount', 'exchangeRate', + 'billingAmount', 'transactionFeeAmount', 'commissionPercent', 'commissionAmount', 'interchangeFee', + 'region', 'settlementStatus']; + } + + /** + * List of allowed values for transaction_type parameter + * + * @return string[] + */ + protected function getTransactionTypeAllowedValues() + { + return ['Authorisation Approved', 'Authorisation Declined', 'Settlement Approved', 'Settlement Declined', + 'Sale Approved', 'Sale Declined', 'Refund Approved', 'Refund Declined', 'Payout Approved', + 'Payout Declined', 'CFT Other Approved', 'CFT Declined', 'Chargeback', 'Chargeback Reversal', + 'Chargeback Representment', 'Retrieval Request', 'Void', 'Visa EU Intraregional Fraud Chargeback', + 'MasterCard EU Region Chargeback', 'Second Chargeback', 'CFT Visa Approved', 'CFT MasterCard Approved', + 'Visa RDR', 'RDR Reversal', 'Gateway Transaction Fee', 'Risk Management Transaction Fee', + 'Fraud Engine Transaction Fee']; + } + + /** + * Return a formatted string with request filters + * + * @return string + */ + protected function getRequestFilters() + { + $filters = [ + 'uniqueId' => $this->getUniqueId(), + 'startDate' => $this->getStartDate(), + 'endDate' => $this->getEndDate(), + 'billingStatementId' => $this->getBillingStatementId(), + 'merchantTransactionId' => $this->getMerchantTransactionId(), + 'masterAccountName' => $this->getMasterAccountName(), + 'transactionType' => $this->getTransactionType() + ]; + + $filters = array_filter($filters); + + $filterData = implode( + ', ', + array_map( + function ($key, $value) { + $format = ($key == 'billingStatementId') ? '%s: %s' : '%s: "%s"'; + + return sprintf($format, $key, $value); + }, + array_keys($filters), + $filters + ) + ); + + return sprintf( + 'filter: { %s } %s', + $filterData, + $this->getAdditionalArguments() + ); + } + + /** + * Return a formatted string with paging parameters + * + * @return string + */ + protected function getRequestPaging() + { + $paging = [ + 'page' => $this->getPage(), + 'perPage' => $this->getPerPage() + ]; + + return $this->generateGraphQLCode($paging, 'paging'); + } + + /** + * Return a formatted string with ordering parameters + * + * @return string + */ + protected function getRequestOrder() + { + $elements = [ + 'byDirection' => $this->getOrderByDirection(), + 'byField' => $this->getOrderByField() + ]; + + return $this->generateGraphQLCode($elements, 'sort'); + } + + protected function getRequestStructure() + { + return $this->getResponseFields(); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Blacklist.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Blacklist.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Blacklist.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Blacklist.php index f7891ff..7e94f38 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Blacklist.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Blacklist.php @@ -1,4 +1,5 @@ requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); + } + + /** + * @return array + */ + protected function getRequestStructure() + { + return [ + 'email' => $this->email, + 'consumer_id' => $this->consumer_id + ]; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Consumers/Retrieve.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Consumers/Retrieve.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Consumers/Retrieve.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Consumers/Retrieve.php index 689ad1d..c470f64 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Consumers/Retrieve.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Consumers/Retrieve.php @@ -1,4 +1,5 @@ page = (int) $value; - - return $this; - } - - /** - * Number of entities on page, default to 100 - * - * @param $value - * @return $this - */ - public function setPerPage($value) - { - $this->per_page = (int) $value; - - return $this; - } - /** * Filters chargebacks by being externally processed or being native to Genesis. * diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Fraud/Chargeback/Transaction.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Fraud/Chargeback/Transaction.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Fraud/Chargeback/Transaction.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Fraud/Chargeback/Transaction.php index 5e1ff50..6cf5eee 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Fraud/Chargeback/Transaction.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Fraud/Chargeback/Transaction.php @@ -1,4 +1,5 @@ reference_id = null; + + return $this; + } + + return $this->setLimitedString( + 'reference_id', + $value, + self::REFERENCE_ID_MIN_LENGTH, + self::REFERENCE_ID_MAX_LENGTH + ); + } + /** * Get the request structure * diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/Cnpj/Check.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/Cnpj/Check.php new file mode 100644 index 0000000..b5b8e7a --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/Cnpj/Check.php @@ -0,0 +1,94 @@ +document_id = $value; + + $this->setApiConfig( + 'url', + $this->buildRequestURL('kyc', "api/{$this->getVersion()}/{$this->getRequestPath()}/$this->document_id") + ); + + return $this; + } + + /** + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'document_id' + ]; + + $this->requiredFields = CommonUtils::createArrayObject($requiredFields); + } + + /** + * @return array + */ + protected function getRequestStructure() + { + return []; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/ConsumerRegistration/Create.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/ConsumerRegistration/Create.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/ConsumerRegistration/Create.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/ConsumerRegistration/Create.php index 1fb85fd..0ba1eae 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/ConsumerRegistration/Create.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/ConsumerRegistration/Create.php @@ -1,4 +1,5 @@ document_id = $value; + + $this->setApiConfig( + 'url', + $this->buildRequestURL('kyc', "api/{$this->getVersion()}/{$this->getRequestPath()}/$this->document_id") + ); + + return $this; + } + + /** + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'document_id' + ]; + + $this->requiredFields = CommonUtils::createArrayObject($requiredFields); + } + + /** + * @return array + */ + protected function getRequestStructure() + { + return []; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/IdentityDocument/Download.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/IdentityDocument/Download.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/IdentityDocument/Download.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/IdentityDocument/Download.php index f8f5f5a..f12f96c 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/KYC/IdentityDocument/Download.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Kyc/IdentityDocument/Download.php @@ -1,4 +1,5 @@ batch_slip_number = (string) $value; + + return $this; + } + + protected function initConfiguration() + { + parent::initBaseConfiguration('processed_batches/by_post_date'); + } + + protected function getRequestStructure() + { + return [ + 'batch_slip_number' => $this->batch_slip_number + ]; + } + + protected function getParentNode() + { + return 'processed_batch_request'; + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/ProcessedTransactions/DateRange.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/ProcessedTransactions/DateRange.php similarity index 82% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/ProcessedTransactions/DateRange.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/ProcessedTransactions/DateRange.php index fc0e2c8..d016d49 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/ProcessedTransactions/DateRange.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/ProcessedTransactions/DateRange.php @@ -1,4 +1,5 @@ initXmlConfiguration(); + + $this->initApiGatewayConfiguration('reconcile/by_date'); + } + + /** + * Set the required fields + * + * @return void + */ + protected function setRequiredFields() + { + $requiredFields = [ + 'start_date' + ]; + + $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); + } + + /** + * Create the request's Tree structure + * + * @return void + */ + protected function populateStructure() + { + $treeStructure = [ + 'reconcile' => [ + 'start_date' => $this->getStartDate(), + 'end_date' => $this->getEndDate(), + 'page' => $this->page + ] + ]; + + $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Reconcile/Transaction.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Reconcile/Transaction.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Reconcile/Transaction.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Reconcile/Transaction.php index 782f186..dae064b 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/NonFinancial/Reconcile/Transaction.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/NonFinancial/Reconcile/Transaction.php @@ -1,4 +1,5 @@ 44640) { - throw new InvalidArgument('Valid value ranges between 1 minute and 31 days given in minutes'); + if ($lifetime < 1 || $lifetime > 131487) { + throw new InvalidArgument( + 'Valid value ranges between 1 minute and 3 months given in minutes (131487)' + ); } $this->lifetime = $lifetime; @@ -386,171 +397,6 @@ public function setScaExemption($value) return $this; } - /** - * Verify that transaction type parameters are populated correctly - * - * @param string $transactionType - * @param array $parameters - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function verifyTransactionType($transactionType, $parameters = []) - { - if (!Types::isValidWPFTransactionType($transactionType)) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Transaction type (%s) is not valid. Valid WPF transactions are: %s.', - $transactionType, - implode(', ', Types::getWPFTransactionTypes()) - ) - ); - } - - $txnCustomRequiredParams = Types::getCustomRequiredParameters( - $transactionType - ); - - if (!CommonUtils::isValidArray($txnCustomRequiredParams)) { - return; - } - - $txnCustomRequiredParams = static::validateNativeCustomParameters($transactionType, $txnCustomRequiredParams); - - if (CommonUtils::isValidArray($txnCustomRequiredParams) && !CommonUtils::isValidArray($parameters)) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Custom transaction parameters (%s) are required and none are set.', - implode(', ', array_keys($txnCustomRequiredParams)) - ) - ); - } - - foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) { - $this->validateRequiredParameter( - $transactionType, - $customRequiredParam, - $customRequiredParamValues, - $parameters - ); - } - } - - /** - * @param string $transactionType - * @param array $txnCustomRequiredParams - * - * @return array - */ - protected function validateNativeCustomParameters($transactionType, $txnCustomRequiredParams) - { - foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) { - if (property_exists($this, $customRequiredParam)) { - $this->validateRequiredParameter( - $transactionType, - $customRequiredParam, - $customRequiredParamValues, - [ $customRequiredParam => $this->{$customRequiredParam} ] - ); - - unset($txnCustomRequiredParams[$customRequiredParam]); - } - } - - return $txnCustomRequiredParams; - } - - protected function validateRequiredParameter( - $transactionType, - $customRequiredParam, - $customRequiredParamValues, - $parameters - ) { - $this->checkEmptyRequiredParamsFor( - $transactionType, - $customRequiredParam, - $parameters - ); - - if (!CommonUtils::isValidArray($customRequiredParamValues)) { - return; - } - - if (!CommonUtils::arrayContainsArrayItems($parameters)) { - $this->checkIsParamSet( - $transactionType, - $parameters[$customRequiredParam], - $customRequiredParamValues - ); - - return; - } - - foreach ($parameters as $parameter) { - $this->checkIsParamSet( - $transactionType, - $parameter[$customRequiredParam], - $customRequiredParamValues - ); - } - } - - /** - * @param string $transactionType - * @param array $parameters - * @param mixed $paramValues - * - * @throws \Genesis\Exceptions\ErrorParameter - */ - private function checkIsParamSet($transactionType, $parameters, $paramValues) - { - if (!in_array($parameters, $paramValues)) { - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Invalid value (%s) for required parameter: %s (Transaction type: %s)', - $parameters, - $paramValues, - $transactionType - ) - ); - } - } - - /** - * Performs a check there is an empty required param for the passed transaction type - * - * @param string $transactionType - * @param string $customRequiredParam - * @param array $txnParameters - * - * @throws \Genesis\Exceptions\ErrorParameter - */ - protected function checkEmptyRequiredParamsFor( - $transactionType, - $customRequiredParam, - $txnParameters = [] - ) { - if (CommonUtils::isArrayKeyExists($customRequiredParam, $txnParameters) && - !empty($txnParameters[$customRequiredParam]) - ) { - return; - } - - foreach ($txnParameters as $parameter) { - if (CommonUtils::isArrayKeyExists($customRequiredParam, $parameter) && - !empty($parameter[$customRequiredParam]) - ) { - return; - } - } - - throw new \Genesis\Exceptions\ErrorParameter( - sprintf( - 'Empty (null) required parameter: %s for transaction type %s', - $customRequiredParam, - $transactionType - ) - ); - } - /** * Add ISO 639-1 language code to the URL * @@ -560,7 +406,7 @@ protected function checkEmptyRequiredParamsFor( * * @throws \Genesis\Exceptions\InvalidArgument */ - public function setLanguage($language = \Genesis\API\Constants\i18n::EN) + public function setLanguage($language = \Genesis\Api\Constants\i18n::EN) { $language = CommonUtils::filterLanguageCode($language); @@ -702,7 +548,8 @@ protected function populateStructure() 'threeds_v2_params' => $this->getThreedsV2ParamsStructure(), 'web_payment_form_id' => $this->web_payment_form_id, 'recurring_category' => $this->recurring_category, - 'funding' => $this->getFundingAttributesStructure() + 'funding' => $this->getFundingAttributesStructure(), + 'account_owner' => $this->getAccountOwnerAttributesStructure() ] ]; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/WPF/Reconcile.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Wpf/Reconcile.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/WPF/Reconcile.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Wpf/Reconcile.php index 8b0196d..8777711 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Request/WPF/Reconcile.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Request/Wpf/Reconcile.php @@ -1,4 +1,5 @@ responseRaw = $network->getResponseBody(); + $this->responseRaw = $network->getResponseBody(); + $this->responseCode = $network->getStatus(); try { $parser = $this->getParser($network); $this->responseObj = $parser->getObject(); } catch (\Exception $e) { - throw new \Genesis\Exceptions\InvalidResponse( + throw new InvalidResponse( $e->getMessage(), $e->getCode() ); @@ -101,24 +146,6 @@ public function parseResponse(Network $network) // Apply per-field transformations $this->transform([$this->responseObj]); - - if (isset($this->responseObj->status)) { - $state = new Constants\Transaction\States($this->responseObj->status); - - if (!$state->isValid()) { - throw new \Genesis\Exceptions\InvalidArgument( - 'Unknown transaction status', - isset($this->responseObj->code) ? $this->responseObj->code : 0 - ); - } - - if ($state->isError() && !$this->suppressReconciliationException()) { - throw new \Genesis\Exceptions\ErrorAPI( - $this->responseObj->message, - isset($this->responseObj->code) ? $this->responseObj->code : 0 - ); - } - } } protected function getParser(Network $network) @@ -184,31 +211,6 @@ public function isPartiallyApproved() return null; } - /** - * Suppress Reconciliation responses as their statuses - * reflect their transactions - * - * @return bool - */ - public function suppressReconciliationException() - { - $instances = [ - new \Genesis\API\Request\NonFinancial\Reconcile\DateRange(), - new \Genesis\API\Request\NonFinancial\Reconcile\Transaction(), - new \Genesis\API\Request\WPF\Reconcile() - ]; - - if (isset($this->requestCtx) && isset($this->responseObj->unique_id)) { - foreach ($instances as $instance) { - if ($this->requestCtx instanceof $instance) { - return true; - } - } - } - - return false; - } - /** * Try to fetch a description of the received Error Code * @@ -237,6 +239,16 @@ public function getResponseRaw() return $this->responseRaw; } + /** + * Get the HTTP response status + * + * @return int + */ + public function getResponseCode() + { + return $this->responseCode; + } + /** * Get the parsed response * @@ -355,7 +367,7 @@ public static function transformFilterTimestamp($transaction) { if (isset($transaction->timestamp)) { try { - $transaction->timestamp = new \DateTime($transaction->timestamp); + $transaction->timestamp = new DateTime($transaction->timestamp); } catch (\Exception $e) { // Just log the attempt error_log($e->getMessage()); @@ -364,4 +376,26 @@ public static function transformFilterTimestamp($transaction) return $transaction; } + + /** + * Handle "magic" calls for status check + * + * @param $method + * @param $args + * + * @throws InvalidMethod + * @return bool + */ + public function __call($method, $args) + { + $status = new Constants\Transaction\States( + isset($this->responseObj->status) ? $this->responseObj->status : '' + ); + + if ($status->isValid()) { + return $status->$method(); + } + + return false; + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/MagicAccessors.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/MagicAccessors.php similarity index 95% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/MagicAccessors.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/MagicAccessors.php index 194cbab..db2bdb8 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/MagicAccessors.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/MagicAccessors.php @@ -1,4 +1,5 @@ $this->billing_first_name, - 'last_name' => $this->billing_last_name, - 'address1' => $this->billing_address1, - 'address2' => $this->billing_address2, - 'zip_code' => $this->billing_zip_code, - 'city' => $this->billing_city, - 'state' => $this->billing_state, - 'country' => $this->billing_country + 'first_name' => $this->billing_first_name, + 'last_name' => $this->billing_last_name, + 'address1' => $this->billing_address1, + 'address2' => $this->billing_address2, + 'zip_code' => $this->billing_zip_code, + 'city' => $this->billing_city, + 'state' => $this->billing_state, + 'neighborhood' => $this->billing_neighborhood, + 'country' => $this->billing_country ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/CustomerAddress/CustomerInfoAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/CustomerAddress/CustomerInfoAttributes.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/CustomerAddress/CustomerInfoAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/CustomerAddress/CustomerInfoAttributes.php index 70b0249..3967dc0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/CustomerAddress/CustomerInfoAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/CustomerAddress/CustomerInfoAttributes.php @@ -1,4 +1,5 @@ $this->shipping_first_name, - 'last_name' => $this->shipping_last_name, - 'address1' => $this->shipping_address1, - 'address2' => $this->shipping_address2, - 'zip_code' => $this->shipping_zip_code, - 'city' => $this->shipping_city, - 'state' => $this->shipping_state, - 'country' => $this->shipping_country + 'first_name' => $this->shipping_first_name, + 'last_name' => $this->shipping_last_name, + 'address1' => $this->shipping_address1, + 'address2' => $this->shipping_address2, + 'zip_code' => $this->shipping_zip_code, + 'city' => $this->shipping_city, + 'state' => $this->shipping_state, + 'neighborhood' => $this->shipping_neighborhood, + 'country' => $this->shipping_country ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/DocumentAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/DocumentAttributes.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/DocumentAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/DocumentAttributes.php index 42ae54f..ec2922d 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/DocumentAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/DocumentAttributes.php @@ -1,4 +1,5 @@ 'NonFinancial\AVS', - self::ABNI_DEAL_BANKS => 'NonFinancial\Retrieve\AbniDealBanks', - Types::ACCOUNT_VERIFICATION => 'NonFinancial\AccountVerification' + 'first_name' => $this->account_first_name, + 'middle_name' => $this->account_middle_name, + 'last_name' => $this->account_last_name ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/AsyncAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/AsyncAttributes.php similarity index 91% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/AsyncAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/AsyncAttributes.php index 74e3470..0bc2f4f 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/AsyncAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/AsyncAttributes.php @@ -1,4 +1,5 @@ [ - $this->iban => [ - ['iban' => new RegexValidator(RegexValidator::PATTERN_DE_IBAN)] - ] - ], - ]; - } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/BeneficiaryAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/BeneficiaryAttributes.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/BeneficiaryAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/BeneficiaryAttributes.php index 9397cde..0c4a317 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/BeneficiaryAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/BeneficiaryAttributes.php @@ -1,4 +1,5 @@ [ - Types::SUBSEQUENT => [ - 'reference_id' - ] - ] - ]; - } - /** * Returns Conditional Fields validation applicable for Managed Recurring Type. Managed Recurring attributes are * required in this case. diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Cards/Recurring/SubsequentRecurringTypeAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Cards/Recurring/SubsequentRecurringTypeAttributes.php new file mode 100644 index 0000000..67621c7 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Cards/Recurring/SubsequentRecurringTypeAttributes.php @@ -0,0 +1,87 @@ +recurring_type == Types::SUBSEQUENT && empty($currency)) { + return $amount; + } + + return parent::transformAmount($amount, $currency); + } + + /** + * Extend the Request Validations for Subsequent recurring type + * + * @return void + * @throws \Genesis\Exceptions\ErrorParameter + * @throws \Genesis\Exceptions\InvalidArgument + * @throws \Genesis\Exceptions\InvalidClassMethod + */ + protected function checkRequirementsSubsequent() + { + $requiredFields = [ + 'transaction_id', + 'amount' + ]; + + $this->requiredFields = CommonUtils::createArrayObject($requiredFields); + + unset($this->requiredFieldsOR); + + unset($this->requiredFieldValues); + + $requiredFieldValuesConditional = $this->requiredRecurringAllTypesFieldValuesConditional(); + + $this->requiredFieldValuesConditional = CommonUtils::createArrayObject( + $requiredFieldValuesConditional + ); + + $this->validate(); + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CredentialOnFileAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CredentialOnFileAttributes.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CredentialOnFileAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CredentialOnFileAttributes.php index 1cb225c..0815cce 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CredentialOnFileAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CredentialOnFileAttributes.php @@ -1,4 +1,5 @@ $this->company_type, 'company_activity' => $this->company_activity, 'incorporation_date' => $this->getIncorporationDate(), - 'mothers_name' => $this->mothers_name, - 'pix_key' => $this->pix_key + 'mothers_name' => $this->mothers_name ]; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CustomerIdentificationData.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CustomerIdentificationData.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CustomerIdentificationData.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CustomerIdentificationData.php index 5f267a5..98b5c67 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/CustomerIdentificationData.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/CustomerIdentificationData.php @@ -1,4 +1,5 @@ allowedOptionsSetter( + 'mpi_protocol_sub_version', + MpiProtocolSubVersions::getAll(), + $value, + "Invalid Protocol sub-version value." + ); + } + /** * Set the value for 3DS challenge indicator. Highly recommended to increase approve ratio. * @param $value @@ -189,6 +214,7 @@ protected function get3DSv2ParamsStructure() 'cavv' => $this->mpi_cavv, 'eci' => $this->mpi_eci, 'protocol_version' => $this->mpi_protocol_version, + 'protocol_sub_version' => $this->mpi_protocol_sub_version, 'directory_server_id' => $this->mpi_directory_server_id, 'asc_transaction_id' => $this->mpi_asc_transaction_id, 'threeds_challenge_indicator' => $this->mpi_threeds_challenge_indicator diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/NotificationAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/NotificationAttributes.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/NotificationAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/NotificationAttributes.php index f762704..1880e17 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/NotificationAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/NotificationAttributes.php @@ -1,4 +1,5 @@ $this->getMaxConsumerReferenceLen()) { + if (strlen((string)$value) > $this->getMaxConsumerReferenceLen()) { throw new ErrorParameter("Consumer reference can be max {$this->getMaxConsumerReferenceLen()} characters."); } @@ -99,7 +100,7 @@ public function setConsumerReference($value) */ public function setNationalId($value) { - if (strlen($value) > $this->getNationalIdLen()) { + if (strlen((string)$value) > $this->getNationalIdLen()) { throw new ErrorParameter("National Identifier can be max {$this->getNationalIdLen()} characters."); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/PreauthorizationAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/PreauthorizationAttributes.php similarity index 91% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/PreauthorizationAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/PreauthorizationAttributes.php index da3021e..61a0c4f 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/PreauthorizationAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/PreauthorizationAttributes.php @@ -1,4 +1,5 @@ threeds_v2_merchant_risk_gift_card_count = (int) $value; - if ($this->threeds_v2_merchant_risk_gift_card_count < 0 || + if ( + $this->threeds_v2_merchant_risk_gift_card_count < 0 || $this->threeds_v2_merchant_risk_gift_card_count > 99 ) { throw new InvalidArgument( diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/Threeds/V2/Method.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Threeds/V2/Method.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/Threeds/V2/Method.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Threeds/V2/Method.php index 4bed0ed..fc86b1b 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/Threeds/V2/Method.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/Threeds/V2/Method.php @@ -1,4 +1,5 @@ throwMethodError(__METHOD__); } - + protected function getThreedsV2ParamsStructure() { return array_merge( diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php similarity index 93% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php index e679305..e716a1d 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/AirlineItineraryAttributes.php @@ -1,4 +1,5 @@ getStructureName(); if (count($this->{$structureName}) === $item->getMaxCount()) { - throw new InvalidArgument('Max '. $structureName .' count of ' . $item->getMaxCount() . ' reached.'); + throw new InvalidArgument('Max ' . $structureName . ' count of ' . $item->getMaxCount() . ' reached.'); } $this->{$structureName}[] = $item; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/CarRentalAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/CarRentalAttributes.php similarity index 96% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/CarRentalAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/CarRentalAttributes.php index 42b7c77..3919f5e 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Financial/TravelData/CarRentalAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Financial/TravelData/CarRentalAttributes.php @@ -1,4 +1,5 @@ [ 'version' => $this->token_version, 'data' => $this->token_data, 'signature' => $this->token_signature, 'header' => [ + 'applicationData' => $this->token_application_data, 'ephemeralPublicKey' => $this->token_ephemeral_public_key, + 'wrappedKey' => $this->token_wrapped_key, 'publicKeyHash' => $this->token_public_key_hash, 'transactionId' => $this->token_transaction_id ] @@ -135,6 +167,9 @@ public function getPaymentTokenStructure() 'type' => $this->token_type ], 'transactionIdentifier' => $this->token_transaction_identifier - ], JSON_UNESCAPED_UNICODE); + ] + ); + + return json_encode($structure, JSON_UNESCAPED_UNICODE); } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Mobile/GooglePayAttributes.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Mobile/GooglePayAttributes.php similarity index 97% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Mobile/GooglePayAttributes.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Mobile/GooglePayAttributes.php index 59af8c5..fbcdbab 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/Mobile/GooglePayAttributes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/Mobile/GooglePayAttributes.php @@ -1,4 +1,5 @@ allowedOptionsSetter( + 'order_by_direction', + $this->getOrderByDirectionAllowedValues(), + strtolower($value), + 'Invalid value given for orderByDirection. Allowed values: ' . + implode(', ', $this->getOrderByDirectionAllowedValues()) + ); } /** - * Returns all available Card Types - * @return array + * List of allowed response ordering directions + * + * @return string[] */ - public static function getCardTypes() + protected function getOrderByDirectionAllowedValues() { - $methods = \Genesis\Utils\Common::getClassConstants(__CLASS__); - - return array_values($methods); + return ['asc', 'desc']; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/CustomerInformation.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/CustomerInformation.php similarity index 92% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/CustomerInformation.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/CustomerInformation.php index 6a508c6..c103bdd 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/CustomerInformation.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/CustomerInformation.php @@ -1,4 +1,5 @@ end_date)) ? null : $this->end_date->format($format); } - - /** - * Set the per-request configuration - * - * @return void - */ - protected function initConfiguration() - { - $this->initXmlConfiguration(); - - $this->initApiGatewayConfiguration('reconcile/by_date'); - } - - /** - * Set the required fields - * - * @return void - */ - protected function setRequiredFields() - { - $requiredFields = [ - 'start_date' - ]; - - $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields); - } - - /** - * Create the request's Tree structure - * - * @return void - */ - protected function populateStructure() - { - $treeStructure = [ - 'reconcile' => [ - 'start_date' => $this->getStartDate(), - 'end_date' => $this->getEndDate(), - 'page' => $this->page - ] - ]; - - $this->treeStructure = \Genesis\Utils\Common::createArrayObject($treeStructure); - } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/DepositLimits.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/DepositLimits.php similarity index 91% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/DepositLimits.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/DepositLimits.php index 555e29d..d60ffab 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/DepositLimits.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/DepositLimits.php @@ -1,4 +1,5 @@ allowedOptionsSetter( 'externally_processed', - \Genesis\API\Constants\NonFinancial\Fraud\Chargeback\ExternallyProcessed::getAll(), + \Genesis\Api\Constants\NonFinancial\Fraud\Chargeback\ExternallyProcessed::getAll(), $value, 'Invalid value for externally_processed attribute.' ); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/IdentityDocuments.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/IdentityDocuments.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/IdentityDocuments.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/IdentityDocuments.php index 1efd774..40140a1 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/IdentityDocuments.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/IdentityDocuments.php @@ -1,4 +1,5 @@ expiry_date->format(DateTimeFormat::YYYY_MM_DD_ISO_8601); } - - /** - * Verify Reference ID value - * - * @param $value - * @return $this - * @throws InvalidArgument - */ - public function setReferenceId($value) - { - if (empty($value)) { - $this->reference_id = null; - - return $this; - } - - return $this->setLimitedString( - 'reference_id', - $value, - self::REFERENCE_ID_MIN_LENGTH, - self::REFERENCE_ID_MAX_LENGTH - ); - } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/KycBillingInformation.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/KycBillingInformation.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/KycBillingInformation.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/KycBillingInformation.php index d4fd7a9..5dd8b63 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/KycBillingInformation.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/KycBillingInformation.php @@ -1,4 +1,5 @@ page = (int) $value; - return false; + return $this; } /** - * Returns all available Redeem Types - * @return array + * Set the number of elements per page + * + * @param $value + * @return $this */ - public static function getRedeemTypes() + public function setPerPage($value) { - $methods = \Genesis\Utils\Common::getClassConstants(__CLASS__); + $this->per_page = (int) $value; - return array_values($methods); + return $this; + } + + /** + * GraphQL code to request paging information + * + * @return string + */ + protected function pagingGraphQlFields() + { + return 'paging { + page + perPage + pagesCount + totalCount + }'; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/PaymentDetails.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/PaymentDetails.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/PaymentDetails.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/PaymentDetails.php index d9014f6..30abc06 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/PaymentDetails.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/PaymentDetails.php @@ -1,4 +1,5 @@ allowedOptionsSetter( 'cvv_present', - CVVPresents::getAll(), + CvvPresents::getAll(), $cvvPresent, 'Invalid cvv present indicator.' ); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/ProcessingType.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/ProcessingType.php similarity index 90% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/ProcessingType.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/ProcessingType.php index 7b9846a..dabc4f0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/Request/NonFinancial/ProcessingType.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/Request/NonFinancial/ProcessingType.php @@ -1,4 +1,5 @@ $customRequiredParamValues) { + $this->validateRequiredParameter( + $transactionType, + $customRequiredParam, + $customRequiredParamValues, + $parameters + ); + } + } + + protected function validateRequiredParameter( + $transactionType, + $customRequiredParam, + $customRequiredParamValues, + $parameters + ) { + $this->checkEmptyRequiredParamsFor( + $transactionType, + $customRequiredParam, + $parameters + ); + + if (!CommonUtils::isValidArray($customRequiredParamValues)) { + return; + } + + if (!CommonUtils::arrayContainsArrayItems($parameters)) { + $this->checkIsParamSet( + $transactionType, + $parameters[$customRequiredParam], + $customRequiredParamValues, + $customRequiredParam + ); + + return; + } + + foreach ($parameters as $parameter) { + $this->checkIsParamSet( + $transactionType, + $parameter, + $customRequiredParamValues, + $customRequiredParam + ); + } + } + + /** + * Performs a check there is an empty required param for the passed transaction type + * + * @param string $transactionType + * @param string $customRequiredParam + * @param array $txnParameters + * + * @throws \Genesis\Exceptions\ErrorParameter + */ + protected function checkEmptyRequiredParamsFor( + $transactionType, + $customRequiredParam, + $txnParameters = [] + ) { + if ( + CommonUtils::isArrayKeyExists($customRequiredParam, $txnParameters) && + !empty($txnParameters[$customRequiredParam]) + ) { + return; + } + + foreach ($txnParameters as $parameter) { + if ( + CommonUtils::isArrayKeyExists($customRequiredParam, $parameter) && + !empty($parameter[$customRequiredParam]) + ) { + return; + } + } + + throw new ErrorParameter( + sprintf( + 'Empty (null) required parameter: %s for transaction type %s', + $customRequiredParam, + $transactionType + ) + ); + } + + /** + * @param string $transactionType + * @param array $parameters + * @param mixed $paramValues + * @param string $paramName + * + * @throws \Genesis\Exceptions\ErrorParameter + */ + private function checkIsParamSet($transactionType, $parameters, $paramValues, $paramName) + { + if (!in_array($parameters, $paramValues)) { + throw new ErrorParameter( + sprintf( + 'Invalid value (%s) for required parameter: %s. Allowed values: %s. (Transaction type: %s)', + is_array($parameters) ? implode(', ', $parameters) : $parameters, + $paramName, + is_array($paramValues) ? implode(', ', $paramValues) : $paramValues, + $transactionType + ) + ); + } + } +} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/RestrictedSetter.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/RestrictedSetter.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/RestrictedSetter.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/RestrictedSetter.php index 4019df2..9ba2a67 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Traits/RestrictedSetter.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Traits/RestrictedSetter.php @@ -1,4 +1,5 @@ validations as $property => $method) { if (!empty($this->{$property})) { if (!method_exists($this, $method)) { - throw new \Genesis\Exceptions\InvalidClassMethod(); + throw new InvalidClassMethod(); } $this->{$method}(); } @@ -89,7 +90,7 @@ protected function validateFieldRequirements() { $this->requiredFields->setIteratorClass('RecursiveArrayIterator'); - $iterator = new \RecursiveIteratorIterator($this->requiredFields->getIterator()); + $iterator = new RecursiveIteratorIterator($this->requiredFields->getIterator()); foreach ($iterator as $fieldName) { if ($this->isNotNullAndEmptyValueAllowed($fieldName, $this->$fieldName)) { @@ -98,7 +99,7 @@ protected function validateFieldRequirements() } if (empty($this->$fieldName)) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf('Empty (null) required parameter: %s', $fieldName) ); } @@ -124,7 +125,7 @@ protected function validateFieldValuesRequirements() if (CommonUtils::isValidArray($validator)) { if (!in_array($this->$fieldName, $validator)) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( 'Required parameter %s is set to %s, but expected to be one of (%s)', $fieldName, @@ -141,7 +142,7 @@ protected function validateFieldValuesRequirements() } if ($this->$fieldName !== $validator) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( 'Required parameter %s is set to %s, but expected to be %s', $fieldName, @@ -180,7 +181,7 @@ protected function validateGroupRequirements() } if (!$emptyFlag) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( 'One of the following group/s of field/s must be filled in: %s%s', PHP_EOL, @@ -229,7 +230,7 @@ protected function validateConditionalRequirements() ? var_export($this->$fieldName, true) : $this->$fieldName; - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( '%s with value %s is depending on: %s, which is empty (null)!', $fieldName, @@ -240,7 +241,7 @@ protected function validateConditionalRequirements() } } } elseif (empty($this->$fieldDependency)) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( '%s is depending on: %s, which is empty (null)!', $fieldName, @@ -269,7 +270,7 @@ protected function validateConditionalFieldsOr() } if ($definedFieldsCount > 1) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( 'Only one of following parameters: ' . implode(', ', array_values($fields)) . ' is allowed.' @@ -278,7 +279,7 @@ protected function validateConditionalFieldsOr() } if ($definedFieldsCount === 0) { - throw new \Genesis\Exceptions\ErrorParameter(implode(', ', array_values($fields))); + throw new ErrorParameter(implode(', ', array_values($fields))); } } @@ -346,7 +347,7 @@ protected function validateConditionalValuesRequirements() } if (!$childFieldGroupValuesValidated) { - throw new \Genesis\Exceptions\ErrorParameter( + throw new ErrorParameter( sprintf( '%s with value %s is depending on group of params with specific values. ' . 'Please, refer to the official API documentation for %s transaction type.', diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/Base/Validator.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/Base/Validator.php similarity index 86% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/Base/Validator.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/Base/Validator.php index cf30330..98ba9d8 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/Base/Validator.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/Base/Validator.php @@ -1,4 +1,5 @@ message, $this->field) : "Please check input data for errors. '{$this->field}' has invalid format"; - throw new \Genesis\Exceptions\InvalidArgument($exceptionMessage); + throw new InvalidArgument($exceptionMessage); } /** @@ -108,7 +111,7 @@ protected function throwInvalidArgument() protected function getRequestValue() { if (!property_exists($this->request, $this->field)) { - throw new \Genesis\Exceptions\ErrorParameter("Property {$this->field} not found in API Request"); + throw new ErrorParameter("Property {$this->field} not found in API Request"); } $method = CommonUtils::snakeCaseToCamelCase($this->field); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/RegexValidator.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/RegexValidator.php similarity index 87% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/RegexValidator.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/RegexValidator.php index d2e4697..2f16896 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/API/Validators/Request/RegexValidator.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Api/Validators/Request/RegexValidator.php @@ -1,4 +1,5 @@ context = new Builders\XML(); + $this->context = new Builders\Xml(); break; case self::JSON: - $this->context = new Builders\JSON(); + $this->context = new Builders\Json(); break; case self::FORM: - $this->context = new Builders\FORM(); + $this->context = new Builders\Form(); break; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/FORM.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Form.php similarity index 95% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/FORM.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Form.php index d600e39..6257e0e 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/FORM.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Form.php @@ -1,4 +1,5 @@ output = json_encode($structure); } catch (\Exception $e) { - throw new \Genesis\Exceptions\InvalidArgument('Invalid data/tree'); + throw new InvalidArgument('Invalid data/tree'); } } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/XML.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Xml.php similarity index 95% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/XML.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Xml.php index c4b4da9..a954e84 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/XML.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Builders/Xml.php @@ -1,4 +1,5 @@ context = new \XMLWriter(); + $this->context = new XMLWriter(); $this->context->openMemory(); $this->context->startDocument('1.0', 'UTF-8'); @@ -73,7 +78,7 @@ public function __construct() public function populateNodes($data) { if (!\Genesis\Utils\Common::isValidArray($data)) { - throw new \Genesis\Exceptions\InvalidArgument('Invalid data structure'); + throw new InvalidArgument('Invalid data structure'); } // Ensure that the Array position is 0 diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Config.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Config.php index 9ad3688..673e297 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Config.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Config.php @@ -1,4 +1,5 @@ null, - 'username' => null, - 'password' => null, - 'token' => null, - 'environment' => \Genesis\API\Constants\Environments::STAGING + 'endpoint' => null, + 'username' => null, + 'password' => null, + 'token' => null, + 'environment' => \Genesis\Api\Constants\Environments::STAGING, + 'force_smart_routing' => false, + 'billing_api_token' => null ]; /** @@ -77,17 +87,21 @@ final class Config * @var array */ public static $domains = [ - 'gateway' => [ + 'gateway' => [ 'production' => 'gate.', 'sandbox' => 'staging.gate.' ], - 'wpf' => [ + 'wpf' => [ 'production' => 'wpf.', 'sandbox' => 'staging.wpf.' ], - 'kyc' => [ + 'kyc' => [ 'production' => 'kyc.', 'sandbox' => 'staging.kyc.' + ], + 'api_service' => [ + 'production' => 'prod.api.', + 'sandbox' => 'staging.api.' ] ]; @@ -101,9 +115,9 @@ final class Config */ public static function __callStatic($method, $args) { - $keySetting = strtolower(substr($method, 3)); + list($action, $keySetting) = CommonUtils::resolveDynamicMethod($method); - switch (substr($method, 0, 3)) { + switch ($action) { case 'get': if (isset(self::$vault[$keySetting])) { return self::$vault[$keySetting]; @@ -117,26 +131,6 @@ public static function __callStatic($method, $args) return null; } - /** - * Get the CA PEM - * - * @return string - Path to the Genesis CA Bundle; false otherwise - * - * @throws \Genesis\Exceptions\InvalidArgument - */ - public static function getCertificateBundle() - { - $bundle = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Certificates' . DIRECTORY_SEPARATOR . 'ca-bundle.pem'; - - if (!file_exists($bundle)) { - throw new \Genesis\Exceptions\InvalidArgument( - 'CA Bundle file is missing or inaccessible' - ); - } - - return $bundle; - } - /** * Get configuration for an interface * @@ -188,24 +182,24 @@ public static function getEnvironment() * @param string $environmentArg * @return string * - * @throws \Genesis\Exceptions\InvalidArgument + * @throws InvalidArgument */ public static function setEnvironment($environmentArg) { $environmentArg = strtolower(trim($environmentArg)); $aliases = [ - \Genesis\API\Constants\Environments::STAGING => [ + \Genesis\Api\Constants\Environments::STAGING => [ 'test', 'testing', 'staging', - \Genesis\API\Constants\Environments::STAGING + \Genesis\Api\Constants\Environments::STAGING ], - \Genesis\API\Constants\Environments::PRODUCTION => [ + \Genesis\Api\Constants\Environments::PRODUCTION => [ 'live', 'prod', 'production', - \Genesis\API\Constants\Environments::PRODUCTION + \Genesis\Api\Constants\Environments::PRODUCTION ] ]; @@ -217,7 +211,7 @@ public static function setEnvironment($environmentArg) } } - throw new \Genesis\Exceptions\InvalidArgument( + throw new InvalidArgument( 'Invalid Environment' ); } @@ -238,23 +232,23 @@ public static function getEndpoint() * @param string $endpointArg * @return string * - * @throws \Genesis\Exceptions\InvalidArgument + * @throws InvalidArgument */ public static function setEndpoint($endpointArg) { $endpointArg = strtolower(trim($endpointArg)); $aliases = [ - \Genesis\API\Constants\Endpoints::EMERCHANTPAY => [ + \Genesis\Api\Constants\Endpoints::EMERCHANTPAY => [ 'emp', 'emerchantpay', - \Genesis\API\Constants\Endpoints::EMERCHANTPAY + \Genesis\Api\Constants\Endpoints::EMERCHANTPAY ], - \Genesis\API\Constants\Endpoints::ECOMPROCESSING => [ + \Genesis\Api\Constants\Endpoints::ECOMPROCESSING => [ 'ecp', 'ecomprocessing', 'e-comprocessing', - \Genesis\API\Constants\Endpoints::ECOMPROCESSING + \Genesis\Api\Constants\Endpoints::ECOMPROCESSING ] ]; @@ -266,7 +260,7 @@ public static function setEndpoint($endpointArg) } } - throw new \Genesis\Exceptions\InvalidArgument( + throw new InvalidArgument( 'Invalid Endpoint' ); } @@ -312,17 +306,28 @@ public static function getVersion() return self::VERSION; } + /** + * Set Force Smart Routing endpoint for Financial types + * + * @param $value + * @return bool + */ + public static function setForceSmartRouting($value) + { + return self::$vault['force_smart_routing'] = CommonUtils::toBoolean($value); + } + /** * Load settings from an ini File * * @param string $iniFile Path to an ini file containing the settings * - * @throws \Genesis\Exceptions\InvalidArgument() + * @throws InvalidArgument() */ public static function loadSettings($iniFile) { if (!file_exists($iniFile)) { - throw new \Genesis\Exceptions\InvalidArgument( + throw new InvalidArgument( 'The provided configuration file is invalid or inaccessible!' ); } @@ -331,7 +336,9 @@ public static function loadSettings($iniFile) foreach ($settings['Genesis'] as $option => $value) { if (array_key_exists($option, self::$vault)) { - self::$vault[$option] = $value; + $method = 'set' . CommonUtils::snakeCaseToCamelCase($option); + + self::{$method}($value); } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/DeprecatedMethod.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/DeprecatedMethod.php index 718ed17..e5426c2 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/DeprecatedMethod.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/DeprecatedMethod.php @@ -1,4 +1,5 @@ getMessage(); - - return 'Message: ' . (empty($message) ? 'Unknown error' : $message) . PHP_EOL . - 'Details: ' . \Genesis\API\Constants\Errors::getErrorDescription($this->getCode()); - } -} diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorNetwork.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorNetwork.php index fc0799f..0f73a8d 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorNetwork.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorNetwork.php @@ -1,4 +1,5 @@ getMessage()) ? $this->getMessage() : 'Unknown error during network request!'; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorParameter.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorParameter.php index 04ffb94..ed0fe05 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorParameter.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/ErrorParameter.php @@ -1,4 +1,5 @@ getMessage()) ? + $this->getMessage() : 'You\'re trying to call a non-existent method!' . PHP_EOL . 'For proper usage, please refer to the documentation!'; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/InvalidResponse.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/InvalidResponse.php index f654b0d..a3533b6 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/InvalidResponse.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Exceptions/InvalidResponse.php @@ -1,4 +1,5 @@ context = new Network\cURL(); + $this->context = new Network\Curl(); break; case 'stream': $this->context = new Network\Stream(); @@ -92,7 +94,7 @@ public function getResponseHeaders() /** * Set Header/Body of the HTTP request * - * @param \Genesis\API\Request $apiContext + * @param \Genesis\Api\Request $apiContext * @throws Exceptions\ErrorParameter * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidClassMethod @@ -100,17 +102,20 @@ public function getResponseHeaders() public function setApiCtxData($apiContext) { $this->context->prepareRequestBody( - [ - 'body' => $apiContext->getDocument(), - 'url' => $apiContext->getApiConfig('url'), - 'type' => $apiContext->getApiConfig('type'), - 'port' => $apiContext->getApiConfig('port'), - 'protocol' => $apiContext->getApiConfig('protocol'), - 'format' => $apiContext->getApiConfig('format'), - 'timeout' => \Genesis\Config::getNetworkTimeout(), - 'user_agent' => sprintf('Genesis PHP Client v%s', \Genesis\Config::getVersion()), - 'user_login' => sprintf('%s:%s', \Genesis\Config::getUsername(), \Genesis\Config::getPassword()) - ] + array_merge( + [ + 'body' => $apiContext->getDocument(), + 'url' => $apiContext->getApiConfig('url'), + 'type' => $apiContext->getApiConfig('type'), + 'port' => $apiContext->getApiConfig('port'), + 'protocol' => $apiContext->getApiConfig('protocol'), + 'format' => $apiContext->getApiConfig('format'), + 'timeout' => \Genesis\Config::getNetworkTimeout(), + 'user_agent' => sprintf('Genesis PHP Client v%s', \Genesis\Config::getVersion()), + 'authorization' => $apiContext->getApiConfig('authorization') + ], + $this->setAuthCredentials($apiContext) + ) ); } @@ -121,4 +126,39 @@ public function sendRequest() { $this->context->execute(); } + + /** + * Get HTTP status + * + * @return mixed + */ + public function getStatus() + { + return $this->context->getStatus(); + } + + /** + * Determine the appropriate credentials based on the authorization type + * + * @param \Genesis\Api\Request $apiContext + * @return array + */ + protected function setAuthCredentials($apiContext) + { + switch ($apiContext->getApiConfig('authorization')) { + case \Genesis\Api\Request::AUTH_TYPE_TOKEN: + return [ + 'token' => $apiContext->getApiConfig('bearer_token') + ]; + break; + default: + return [ + 'user_login' => sprintf( + '%s:%s', + \Genesis\Config::getUsername(), + \Genesis\Config::getPassword() + ) + ]; + } + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Base.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Base.php index bafeac0..baff528 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Base.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Base.php @@ -1,4 +1,5 @@ $requestData['url'], CURLOPT_TIMEOUT => $requestData['timeout'], CURLOPT_USERAGENT => $requestData['user_agent'], - CURLOPT_USERPWD => $requestData['user_login'], - CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_ENCODING => 'gzip', CURLOPT_HTTPHEADER => [ 'Content-Type: ' . $this->getRequestContentType($requestData['format']), + $this->authorization($requestData), // Workaround to prevent cURL from parsing HTTP 100 as separate request 'Expect:' ], CURLOPT_HEADER => true, - CURLOPT_FAILONERROR => true, CURLOPT_FRESH_CONNECT => true, CURLOPT_RETURNTRANSFER => true, // SSL/TLS Configuration @@ -134,7 +135,7 @@ public function checkForErrors() $errStr = curl_error($this->curlHandle); if ($errNo > 0) { - throw new \Genesis\Exceptions\ErrorNetwork($errStr, $errNo); + throw new ErrorNetwork($errStr, $errNo); } } @@ -160,4 +161,18 @@ public function getMethodOptionByType($type) return []; } } + + /** + * @param $requestData + * @return string + */ + protected function authorization($requestData) + { + switch ($requestData['authorization']) { + case Request::AUTH_TYPE_TOKEN: + return 'Authorization: Bearer ' . $requestData['token']; + default: + return 'Authorization: Basic ' . base64_encode($requestData['user_login']); + } + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Stream.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Stream.php index f0880f8..7c03155 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Stream.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Network/Stream.php @@ -1,4 +1,5 @@ getRequestContentType($requestData['format']), - sprintf('Authorization: Basic %s', base64_encode($requestData['user_login'])), + $this->authorization($requestData), sprintf('Content-Length: %s', strlen($requestData['body'])), sprintf('User-Agent: %s', $requestData['user_agent']), ]; @@ -150,7 +155,7 @@ public static function processErrors($errNo, $errStr) // the handler. restore_error_handler(); - throw new \Genesis\Exceptions\ErrorNetwork($errStr, $errNo); + throw new ErrorNetwork($errStr, $errNo); } /** @@ -194,4 +199,19 @@ public static function getCiphers() '!SSLv3' ]; } + + /** + * @param $requestData + * @return string + */ + protected function authorization($requestData) + { + switch ($requestData['authorization']) { + case Request::AUTH_TYPE_TOKEN: + return sprintf('Authorization: Bearer %s', base64_encode($requestData['token'])); + break; + default: + return sprintf('Authorization: Basic %s', base64_encode($requestData['user_login'])); + } + } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parser.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parser.php index 4df1179..df0f621 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parser.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parser.php @@ -1,4 +1,5 @@ context = new XML(); + $this->context = new Xml(); break; case self::JSON_INTERFACE: - $this->context = new JSON(); + $this->context = new Json(); break; } } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/JSON.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/Json.php similarity index 94% rename from classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/JSON.php rename to classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/Json.php index dab83fb..87e0638 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/JSON.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Parsers/Json.php @@ -1,4 +1,5 @@ stdClassObj = new stdClass(); + + return; + } + $hasAttributes = false; - $reader = new \XMLReader(); + $reader = new XMLReader(); $reader->XML($xmlDocument); if ($this->skipRootNode) { @@ -109,7 +120,7 @@ public function parseDocument($xmlDocument) */ public function readerLoop($reader, $processRootAttributes = false) { - $tree = new \stdClass(); + $tree = new stdClass(); if ($processRootAttributes === true) { $this->processNodeAttributes($reader, $tree); @@ -155,7 +166,7 @@ public function processElement(&$reader, &$tree) if (is_a($tree->$name, 'stdClass')) { $currentEl = $tree->$name; - $tree->$name = new \ArrayObject(); + $tree->$name = new ArrayObject(); $tree->$name->append($currentEl); } @@ -180,9 +191,9 @@ public function processAttributes(&$reader, &$tree) { $name = $reader->name; - $node = new \stdClass(); + $node = new stdClass(); - $node->attr = new \stdClass(); + $node->attr = new stdClass(); while ($reader->moveToNextAttribute()) { $node->attr->{$reader->name} = $reader->value; @@ -209,7 +220,7 @@ public function processAttributes(&$reader, &$tree) */ public function processNodeAttributes(&$reader, &$tree) { - $node = new \stdClass(); + $node = new stdClass(); while ($reader->moveToNextAttribute()) { $node->{$reader->name} = $reader->value; diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Common.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Common.php index 0f05df3..bc0ce70 100755 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Common.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Common.php @@ -1,4 +1,5 @@ isAbstract(); } @@ -400,7 +410,7 @@ public static function getClassConstants($className) return []; } - $reflection = new \ReflectionClass($className); + $reflection = new ReflectionClass($className); return $reflection->getConstants(); } @@ -471,7 +481,7 @@ public static function toBoolean($string) */ public static function removeMultipleKeys($arrayKeys, $arrayObject) { - if (!self::isValidArray($arrayKeys) || !$arrayObject instanceof \ArrayObject) { + if (!self::isValidArray($arrayKeys) || !$arrayObject instanceof ArrayObject) { throw new Exception(); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Country.php b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Country.php index 656bbcd..b55e0ff 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Country.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Library/Genesis/src/Genesis/Utils/Country.php @@ -1,4 +1,5 @@ findOneBy($condition); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/AEcomprocessing.php b/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/AEcomprocessing.php index 311c3a9..8c6f1c0 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/AEcomprocessing.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/AEcomprocessing.php @@ -19,9 +19,19 @@ namespace XLite\Module\Ecomprocessing\Genesis\Model\Payment\Processor; -use Genesis\API\Constants\Transaction\Types; +use Genesis\Api\Constants\Transaction\Types; use XLite\Module\Ecomprocessing\Genesis\Helpers\Helper; - +use Genesis\Genesis; +use Genesis\Api\Notification; +use Exception; + +/** + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + * @SuppressWarnings(PHPMD.ExcessiveClassLength) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ abstract class AEcomprocessing extends \XLite\Model\Payment\Base\Online { /** @@ -108,6 +118,7 @@ public function getReturnType() * @param boolean $justAdded Flag if the method is just added via administration panel. * * @return string + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getConfigurationURL(\XLite\Model\Payment\Method $method, $justAdded = false) { @@ -139,6 +150,7 @@ public function isConfigured(\XLite\Model\Payment\Method $method) * @param \XLite\Model\Payment\Method $method Payment method * * @return boolean + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function isAvailable(\XLite\Model\Payment\Method $method) { @@ -187,6 +199,7 @@ public function hasModuleSettings() * @param \XLite\Model\Payment\Method $method Payment method * * @return string + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getAdminIconURL(\XLite\Model\Payment\Method $method) { @@ -220,10 +233,10 @@ protected function defineSavedData() * @param \XLite\Model\Payment\BackendTransaction $transaction * * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function doBeforeCapture(\XLite\Model\Payment\BackendTransaction $transaction) { - } /** @@ -246,7 +259,7 @@ public function doCapture(\XLite\Model\Payment\BackendTransaction $transaction) try { // Genesis Request - $capture = new \Genesis\Genesis( + $capture = new Genesis( Types::getCaptureTransactionClass($transactionType) ); @@ -272,7 +285,7 @@ public function doCapture(\XLite\Model\Payment\BackendTransaction $transaction) $gatewayResponseObject = $capture->response()->getResponseObject(); $status = - $gatewayResponseObject->status == \Genesis\API\Constants\Transaction\States::APPROVED + $capture->response()->isApproved() ? \XLite\Model\Payment\Transaction::STATUS_SUCCESS : \XLite\Model\Payment\Transaction::STATUS_FAILED; @@ -316,10 +329,10 @@ public function doCapture(\XLite\Model\Payment\BackendTransaction $transaction) * @param \XLite\Model\Payment\BackendTransaction $transaction * * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function doBeforeRefund(\XLite\Model\Payment\BackendTransaction $transaction) { - } /** @@ -341,7 +354,7 @@ public function doRefund(\XLite\Model\Payment\BackendTransaction $transaction) $transactionType = $this->getReferenceValue($transaction, self::REF_TYPE); try { - $refund = new \Genesis\Genesis( + $refund = new Genesis( Types::getRefundTransactionClass($transactionType) ); @@ -367,7 +380,7 @@ public function doRefund(\XLite\Model\Payment\BackendTransaction $transaction) $gatewayResponseObject = $refund->response()->getResponseObject(); $status = - $gatewayResponseObject->status == \Genesis\API\Constants\Transaction\States::APPROVED + $refund->response()->isApproved() ? \XLite\Model\Payment\Transaction::STATUS_SUCCESS : \XLite\Model\Payment\Transaction::STATUS_FAILED; @@ -411,10 +424,10 @@ public function doRefund(\XLite\Model\Payment\BackendTransaction $transaction) * @param \XLite\Model\Payment\BackendTransaction $transaction * * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function doBeforeVoid(\XLite\Model\Payment\BackendTransaction $transaction) { - } /** @@ -434,7 +447,7 @@ protected function doVoid(\XLite\Model\Payment\BackendTransaction $transaction) $this->doBeforeVoid($transaction); try { - $void = new \Genesis\Genesis('Financial\Void'); + $void = new Genesis('Financial\Void'); $void ->request() @@ -448,7 +461,7 @@ protected function doVoid(\XLite\Model\Payment\BackendTransaction $transaction) $gatewayResponseObject = $void->response()->getResponseObject(); $status = - $gatewayResponseObject->status == \Genesis\API\Constants\Transaction\States::APPROVED + $void->response()->isApproved() ? \XLite\Model\Payment\Transaction::STATUS_SUCCESS : \XLite\Model\Payment\Transaction::STATUS_FAILED; @@ -553,12 +566,12 @@ public function processReturn(\XLite\Model\Payment\Transaction $transaction) * @param \stdClass $reconcile * * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function doProcessCallbackReconciliationObject( \XLite\Model\Payment\Transaction $transaction, \stdClass $reconcile ) { - } /** @@ -582,7 +595,7 @@ public function processCallback(\XLite\Model\Payment\Transaction $transaction) $this->initLibrary(); try { - $notification = new \Genesis\API\Notification($request->getData()); + $notification = new Notification($request->getData()); $notification->initReconciliation(); @@ -881,22 +894,22 @@ protected function isApplePayAuthorize() protected function getTransactionStatus($payment) { switch ($payment->status) { - case \Genesis\API\Constants\Transaction\States::APPROVED: + case \Genesis\Api\Constants\Transaction\States::APPROVED: $status = \XLite\Model\Payment\Transaction::STATUS_SUCCESS; break; default: - case \Genesis\API\Constants\Transaction\States::ERROR: - case \Genesis\API\Constants\Transaction\States::DECLINED: + case \Genesis\Api\Constants\Transaction\States::ERROR: + case \Genesis\Api\Constants\Transaction\States::DECLINED: $status = \XLite\Model\Payment\Transaction::STATUS_FAILED; break; - case \Genesis\API\Constants\Transaction\States::PENDING: - case \Genesis\API\Constants\Transaction\States::PENDING_ASYNC: - case \Genesis\API\Constants\Transaction\States::NEW_STATUS: - case \Genesis\API\Constants\Transaction\States::IN_PROGRESS: - case \Genesis\API\Constants\Transaction\States::USER: + case \Genesis\Api\Constants\Transaction\States::PENDING: + case \Genesis\Api\Constants\Transaction\States::PENDING_ASYNC: + case \Genesis\Api\Constants\Transaction\States::NEW_STATUS: + case \Genesis\Api\Constants\Transaction\States::IN_PROGRESS: + case \Genesis\Api\Constants\Transaction\States::USER: $status = \XLite\Model\Payment\Transaction::STATUS_PENDING; break; - case \Genesis\API\Constants\Transaction\States::VOIDED: + case \Genesis\Api\Constants\Transaction\States::VOIDED: $status = \XLite\Model\Payment\Transaction::STATUS_VOID; break; } @@ -1168,6 +1181,7 @@ protected function getFormattedPrice($price) * $param \XLite\Model\Payment\Method $method * * @return string + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getCheckoutTemplate(\XLite\Model\Payment\Method $method) { @@ -1190,11 +1204,11 @@ protected function initLibrary() static::log('initLibrary()', $error_message); - throw new \Exception($error_message); + throw new Exception($error_message); } // Endpoint - \Genesis\Config::setEndpoint(\Genesis\API\Constants\Endpoints::ECOMPROCESSING); + \Genesis\Config::setEndpoint(\Genesis\Api\Constants\Endpoints::ECOMPROCESSING); // Username \Genesis\Config::setUsername($this->getSetting('username')); // Password @@ -1210,8 +1224,8 @@ protected function initLibrary() // Environment \Genesis\Config::setEnvironment( $this->isTestMode($this->transaction->getPaymentMethod()) ? - \Genesis\API\Constants\Environments::STAGING : - \Genesis\API\Constants\Environments::PRODUCTION + \Genesis\Api\Constants\Environments::STAGING : + \Genesis\Api\Constants\Environments::PRODUCTION ); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/EcomprocessingCheckout.php b/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/EcomprocessingCheckout.php index d8992fa..d0bf0d3 100755 --- a/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/EcomprocessingCheckout.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/Model/Payment/Processor/EcomprocessingCheckout.php @@ -19,20 +19,26 @@ namespace XLite\Module\Ecomprocessing\Genesis\Model\Payment\Processor; -use Genesis\API\Constants\Payment\Methods; -use Genesis\API\Constants\Transaction\Types; +use Genesis\Api\Constants\Payment\Methods; +use Genesis\Api\Constants\Transaction\Types; use Genesis\Utils\Common as CommonUtils; use XLite\Core\Session; use XLite\Module\Ecomprocessing\Genesis\Helpers\Helper; use XLite\Module\Ecomprocessing\Genesis\Helpers\ThreedsHelper; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\DeliveryTimeframes; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\Purchase\Categories; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\RegistrationIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\CardHolderAccount\RegistrationIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\MerchantRisk\DeliveryTimeframes; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\Purchase\Categories; +use Genesis\Genesis; +use Genesis\Api\Constants\Transaction\States; +use Exception; /** * ecomprocessing Checkout Payment Method * * @package XLite\Module\Ecomprocessing\Genesis\Model\Payment\Processor + * + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class EcomprocessingCheckout extends \XLite\Module\Ecomprocessing\Genesis\Model\Payment\Processor\AEcomprocessing { @@ -54,7 +60,7 @@ protected function doInitialPayment() $this->initLibrary(); try { - $genesis = new \Genesis\Genesis('WPF\Create'); + $genesis = new Genesis('Wpf\Create'); $data = $this->collectInitialPaymentData(); @@ -116,29 +122,23 @@ protected function doInitialPayment() $gatewayResponseObject = $genesis->response()->getResponseObject(); - if (isset($gatewayResponseObject->redirect_url)) { - $status = self::PROLONGATION; - - $this->redirectToURL($genesis->response()->getResponseObject()->redirect_url); - } else { + if (!$genesis->response()->isSuccessful() || empty($gatewayResponseObject->redirect_url)) { $errorMessage = isset($gatewayResponseObject->message) ? $gatewayResponseObject->message : ''; - throw new \Exception($errorMessage); + throw new Exception($errorMessage); } - } catch (\Genesis\Exceptions\ErrorAPI $e) { - $errorMessage = $e->getMessage() ?: static::t('Invalid data, please check your input.'); - $this->transaction->setDataCell( - 'status', - $errorMessage, - null, - static::FAILED - ); - $this->transaction->setNote($errorMessage); + + $status = self::PROLONGATION; + + $this->redirectToURL($genesis->response()->getResponseObject()->redirect_url); } catch (\Exception $e) { - $errorMessage = static::t('Failed to initialize payment session, please contact support. ' .$e->getMessage()); + $errorMessage = static::t( + 'Failed to initialize payment session, please contact support. ' + . $e->getMessage() + ); $this->transaction->setDataCell( 'status', $errorMessage, @@ -187,34 +187,27 @@ protected function addTransactionTypesToGatewayRequest(\Genesis\Genesis $genesis * @param $transactionType * @return array * @throws \Exception + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ protected function getCustomRequiredParameters($transactionType) { $parameters = array(); switch ($transactionType) { - case \Genesis\API\Constants\Transaction\Types::PAYBYVOUCHER_SALE: - $parameters = array( - 'card_type' => - \Genesis\API\Constants\Transaction\Parameters\PayByVouchers\CardTypes::VIRTUAL, - 'redeem_type' => - \Genesis\API\Constants\Transaction\Parameters\PayByVouchers\RedeemTypes::INSTANT - ); - break; - case \Genesis\API\Constants\Transaction\Types::IDEBIT_PAYIN: - case \Genesis\API\Constants\Transaction\Types::INSTA_DEBIT_PAYIN: + case \Genesis\Api\Constants\Transaction\Types::IDEBIT_PAYIN: + case \Genesis\Api\Constants\Transaction\Types::INSTA_DEBIT_PAYIN: $parameters = array( 'customer_account_id' => Helper::getCurrentUserIdHash( $this->transaction->getOrder()->getPaymentTransactionId() ) ); break; - case \Genesis\API\Constants\Transaction\Types::KLARNA_AUTHORIZE: + case \Genesis\Api\Constants\Transaction\Types::KLARNA_AUTHORIZE: $parameters = Helper::getKlarnaCustomParamItems( $this->transaction->getOrder() )->toArray(); break; - case \Genesis\API\Constants\Transaction\Types::TRUSTLY_SALE: + case \Genesis\Api\Constants\Transaction\Types::TRUSTLY_SALE: $userId = Helper::getCurrentUserId(); $trustlyUserId = empty($userId) ? Helper::getCurrentUserIdHash($this->transaction->getOrder()->getPaymentTransactionId()) : $userId; @@ -239,7 +232,7 @@ function ($value) { ); } break; - case \Genesis\API\Constants\Transaction\Types::PAYSAFECARD: + case \Genesis\Api\Constants\Transaction\Types::PAYSAFECARD: $userId = Helper::getCurrentUserId(); $customerId = empty($userId) ? Helper::getCurrentUserIdHash($this->transaction->getOrder()->getPaymentTransactionId()) : $userId; @@ -263,7 +256,7 @@ function ($value) { protected static function getConsumerIdFromGenesisGateway($email) { try { - $genesis = new \Genesis\Genesis('NonFinancial\Consumers\Retrieve'); + $genesis = new Genesis('NonFinancial\Consumers\Retrieve'); $genesis->request()->setEmail($email); $genesis->execute(); @@ -289,7 +282,7 @@ protected static function getConsumerIdFromGenesisGateway($email) */ protected static function isErrorResponse($response) { - $state = new \Genesis\API\Constants\Transaction\States($response->status); + $state = new States($response->status); return $state->isError(); } @@ -410,7 +403,6 @@ protected function doProcessCallbackReconciliationObject( * @param \XLite\Model\Payment\BackendTransaction $transaction * * @throws \Genesis\Exceptions\DeprecatedMethod - * @throws \Genesis\Exceptions\ErrorAPI * @throws \Genesis\Exceptions\ErrorParameter * @throws \Genesis\Exceptions\InvalidArgument * @throws \Genesis\Exceptions\InvalidClassMethod @@ -425,7 +417,7 @@ protected function setTerminalToken(\XLite\Model\Payment\BackendTransaction $tra $unique_id = $transaction->getPaymentTransaction()->getDataCell(self::REF_UID); if (isset($unique_id)) { - $reconcile = new \Genesis\Genesis('WPF\Reconcile'); + $reconcile = new Genesis('Wpf\Reconcile'); $reconcile->request()->setUniqueId($unique_id->getValue()); @@ -488,14 +480,7 @@ protected function getCheckoutTransactionTypes() ) ); - $pproSuffix = Helper::PPRO_TRANSACTION_SUFFIX; - $methods = Methods::getMethods(); - - foreach ($methods as $method) { - $aliasMap[$method . $pproSuffix] = Types::PPRO; - } - - $aliasMap = array_merge($aliasMap, [ + $aliasMap = [ Helper::GOOGLE_PAY_TRANSACTION_PREFIX . Helper::GOOGLE_PAY_PAYMENT_TYPE_AUTHORIZE => Types::GOOGLE_PAY, Helper::GOOGLE_PAY_TRANSACTION_PREFIX . Helper::GOOGLE_PAY_PAYMENT_TYPE_SALE => Types::GOOGLE_PAY, Helper::PAYPAL_TRANSACTION_PREFIX . Helper::PAYPAL_PAYMENT_TYPE_AUTHORIZE => Types::PAY_PAL, @@ -503,7 +488,7 @@ protected function getCheckoutTransactionTypes() Helper::PAYPAL_TRANSACTION_PREFIX . Helper::PAYPAL_PAYMENT_TYPE_EXPRESS => Types::PAY_PAL, Helper::APPLE_PAY_TRANSACTION_PREFIX . Helper::APPLE_PAY_PAYMENT_TYPE_AUTHORIZE => Types::APPLE_PAY, Helper::APPLE_PAY_TRANSACTION_PREFIX . Helper::APPLE_PAY_PAYMENT_TYPE_SALE => Types::APPLE_PAY, - ]); + ]; foreach ($selectedTypes as $selectedType) { if (array_key_exists($selectedType, $aliasMap)) { @@ -516,7 +501,6 @@ protected function getCheckoutTransactionTypes() $processedList[$transactionType]['parameters'][] = array( $key => str_replace( [ - $pproSuffix, Helper::GOOGLE_PAY_TRANSACTION_PREFIX, Helper::PAYPAL_TRANSACTION_PREFIX, Helper::APPLE_PAY_TRANSACTION_PREFIX, @@ -558,9 +542,6 @@ public function getCheckoutTemplate(\XLite\Model\Payment\Method $method) private function getCustomParameterKey($transactionType) { switch ($transactionType) { - case Types::PPRO: - $result = 'payment_method'; - break; case Types::PAY_PAL: $result = 'payment_type'; break; @@ -673,7 +654,7 @@ private function setPaymentMethodName() */ private function orderCardTransactionTypes($selected_types) { - $custom_order = \Genesis\API\Constants\Transaction\Types::getCardTransactionTypes(); + $custom_order = \Genesis\Api\Constants\Transaction\Types::getCardTransactionTypes(); asort($selected_types); diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ChallengeIndicator.php b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ChallengeIndicator.php index ac6ba40..ecf31ee 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ChallengeIndicator.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ChallengeIndicator.php @@ -19,7 +19,7 @@ namespace XLite\Module\Ecomprocessing\Genesis\View\FormField\Checkout\Select; -use Genesis\API\Constants\Transaction\Parameters\Threeds\V2\Control\ChallengeIndicators; +use Genesis\Api\Constants\Transaction\Parameters\Threeds\V2\Control\ChallengeIndicators; class ChallengeIndicator extends \XLite\View\FormField\Select\Regular { diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ScaExemption.php b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ScaExemption.php index 2401db5..dd57374 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ScaExemption.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/ScaExemption.php @@ -19,7 +19,7 @@ namespace XLite\Module\Ecomprocessing\Genesis\View\FormField\Checkout\Select; -use Genesis\API\Constants\Transaction\Parameters\ScaExemptions; +use Genesis\Api\Constants\Transaction\Parameters\ScaExemptions; /** * Class ScaExemption diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/TransactionTypes.php b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/TransactionTypes.php index ac93e25..192bbae 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/TransactionTypes.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/View/FormField/Checkout/Select/TransactionTypes.php @@ -19,12 +19,12 @@ namespace XLite\Module\Ecomprocessing\Genesis\View\FormField\Checkout\Select; -use Genesis\API\Constants\Payment\Methods; -use Genesis\API\Constants\Transaction\Types; +use Genesis\Api\Constants\Payment\Methods; +use Genesis\Api\Constants\Transaction\Types; use XLite\Module\Ecomprocessing\Genesis\Helpers\Helper; -use Genesis\API\Constants\Transaction\Parameters\Mobile\ApplePay\PaymentTypes as ApplePaymentTypes; -use Genesis\API\Constants\Transaction\Parameters\Mobile\GooglePay\PaymentTypes as GooglePaymentTypes; -use Genesis\API\Constants\Transaction\Parameters\Wallets\PayPal\PaymentTypes as PayPalPaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Mobile\ApplePay\PaymentTypes as ApplePaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Mobile\GooglePay\PaymentTypes as GooglePaymentTypes; +use Genesis\Api\Constants\Transaction\Parameters\Wallets\PayPal\PaymentTypes as PayPalPaymentTypes; /** * Multi-select handling @@ -61,14 +61,6 @@ protected function getDefaultOptions() // Exclude Transaction Types $transactionTypes = array_diff($transactionTypes, $excludedTypes); - // Add PPRO types - $pproTypes = array_map( - function ($type) { - return $type . Helper::PPRO_TRANSACTION_SUFFIX; - }, - Methods::getMethods() - ); - // Google Pay Payment Methods $googlePayTypes = array_map( function ($type) { @@ -105,7 +97,6 @@ function ($type) { $transactionTypes = array_merge( $transactionTypes, - $pproTypes, $googlePayTypes, $payPalTypes, $applePayTypes @@ -113,7 +104,7 @@ function ($type) { asort($transactionTypes); foreach ($transactionTypes as $type) { - $name = \Genesis\API\Constants\Transaction\Names::getName($type); + $name = \Genesis\Api\Constants\Transaction\Names::getName($type); if (!Types::isValidTransactionType($type)) { $name = strtoupper($type); } diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/View/Model/AEcomprocessing.php b/classes/XLite/Module/Ecomprocessing/Genesis/View/Model/AEcomprocessing.php index 8b21d7a..af53070 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/View/Model/AEcomprocessing.php +++ b/classes/XLite/Module/Ecomprocessing/Genesis/View/Model/AEcomprocessing.php @@ -19,6 +19,8 @@ namespace XLite\Module\Ecomprocessing\Genesis\View\Model; +use XLite\View\Button\Submit; + abstract class AEcomprocessing extends \XLite\View\Model\AModel { const PARAM_PAYMENT_METHOD = 'paymentMethod'; @@ -198,7 +200,7 @@ protected function getFormButtons() { $result = parent::getFormButtons(); - $result['submit'] = new \XLite\View\Button\Submit( + $result['submit'] = new Submit( array( \XLite\View\Button\AButton::PARAM_LABEL => static::t('Save changes'), \XLite\View\Button\AButton::PARAM_BTN_TYPE => 'regular-main-button', diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/5.log b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/5.log new file mode 100644 index 0000000..331365b --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/5.log @@ -0,0 +1,6 @@ +Version 5.4.3.5 + +Features: + + - Updated Genesis PHP library to version 2.0.0 + - Added project license information diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/6.log b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/6.log new file mode 100644 index 0000000..b47e125 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/6.log @@ -0,0 +1,7 @@ +Version 5.4.3.6 + +Features: + + - Updated Genesis PHP SDK to version 2.0.1 + - Removed GiroPay transaction type from the Checkout payment method + - Updated transaction types list in the ecomprocessing Checkout payment method diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/7.log b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/7.log new file mode 100644 index 0000000..d9428c9 --- /dev/null +++ b/classes/XLite/Module/Ecomprocessing/Genesis/changelog/5.4/3/7.log @@ -0,0 +1,9 @@ +Version 5.4.3.7 + +Features: + + - Updated Genesis PHP SDK to version 2.0.2 + - Updated transaction types list in the ecomprocessing Checkout payment method + - Added the following bank codes support through Online Banking transaction type: + - LatiPay + - SPEI diff --git a/classes/XLite/Module/Ecomprocessing/Genesis/main.yaml b/classes/XLite/Module/Ecomprocessing/Genesis/main.yaml index be109ec..c6403d9 100644 --- a/classes/XLite/Module/Ecomprocessing/Genesis/main.yaml +++ b/classes/XLite/Module/Ecomprocessing/Genesis/main.yaml @@ -1,4 +1,4 @@ -version: 5.4.3.4 +version: 5.4.3.7 type: payment authorName: 'E-Comprocessing Ltd.' moduleName: ecomprocessing diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5a02b12 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "ecomprocessing/xcart-ecomprocessing-plugin", + "description": "E-Comprocessing Gateway Module for X-Cart", + "version": "5.4.3.7", + "license": "GPL-2.0", + "authors": [ + { + "name": "ecomprocessing", + "email": "shopping_carts@e-comprocessing.com", + "homepage":"https://e-comprocessing.com" + } + ], + "require-dev": { + "squizlabs/php_codesniffer": "^3.10", + "phpmd/phpmd": "^2.15" + }, + "scripts": { + "php-cs": [ + "vendor/bin/phpcs . --report=summary --standard=.phpcs.xml" + ], + "php-md": [ + "vendor/bin/phpmd . ansi ./.phpmd.xml --not-strict" + ], + "php-cs-jenkins": [ + "vendor/bin/phpcs . --standard=.phpcs.xml --report=checkstyle --report-file=phpcs_report.xml" + ], + "php-md-jenkins": [ + "vendor/bin/phpmd . xml ./.phpmd.xml --reportfile phpmd_report.xml" + ], + "styles": [ + "@php-cs", + "@php-md" + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..3070374 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1188 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "de056e2418366a4511edb3c9ff0d097a", + "packages": [], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, + "require-dev": { + "phpstan/phpstan": "^1.11.8", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.2.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-07-25T09:36:02+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "pdepend/pdepend", + "version": "2.16.2", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/f942b208dc2a0868454d01b29f0c75bbcfc6ed58", + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/polyfill-mbstring": "^1.19" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0|^1.2.3", + "gregwar/rst": "^1.0", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "keywords": [ + "PHP Depend", + "PHP_Depend", + "dev", + "pdepend" + ], + "support": { + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/2.16.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2023-12-17T18:09:59+00:00" + }, + { + "name": "phpmd/phpmd", + "version": "2.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/74a1f56e33afad4128b886e334093e98e1b5e7c0", + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0", + "shasum": "" + }, + "require": { + "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", + "ext-xml": "*", + "pdepend/pdepend": "^2.16.1", + "php": ">=5.3.9" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.3.2", + "ext-json": "*", + "ext-simplexml": "*", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.8", + "squizlabs/php_codesniffer": "^2.9.2 || ^3.7.2" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "https://phpmd.org/", + "keywords": [ + "dev", + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.15.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2023-12-11T08:22:20+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.10.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-07-21T23:26:44+00:00" + }, + { + "name": "symfony/config", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/d4e1db78421163b98dd9971d247fd0df4a57ee5e", + "reference": "d4e1db78421163b98dd9971d247fd0df4a57ee5e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v5.4.42", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", + "reference": "c8409889fdbf48b99271930ea0ebcf3ee5e1ceae", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<5.3", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4.26" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" + }, + "require-dev": { + "symfony/config": "^5.3|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4.26|^5.0|^6.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.42" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-07-25T13:57:40+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-24T14:02:46+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "symfony/process": "^5.4|^6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T09:36:24+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T15:04:16+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/skins/admin/en/modules/EComprocessing/Genesis/css/style.css b/skins/admin/en/modules/Ecomprocessing/Genesis/css/style.css similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/css/style.css rename to skins/admin/en/modules/Ecomprocessing/Genesis/css/style.css diff --git a/skins/admin/en/modules/EComprocessing/Genesis/images/EComProcessing-logo.png b/skins/admin/en/modules/Ecomprocessing/Genesis/images/EComProcessing-logo.png similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/images/EComProcessing-logo.png rename to skins/admin/en/modules/Ecomprocessing/Genesis/images/EComProcessing-logo.png diff --git a/skins/admin/en/modules/EComprocessing/Genesis/images/ecomprocessing_checkout.png b/skins/admin/en/modules/Ecomprocessing/Genesis/images/ecomprocessing_checkout.png similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/images/ecomprocessing_checkout.png rename to skins/admin/en/modules/Ecomprocessing/Genesis/images/ecomprocessing_checkout.png diff --git a/skins/admin/en/modules/EComprocessing/Genesis/method_icon.png b/skins/admin/en/modules/Ecomprocessing/Genesis/method_icon.png similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/method_icon.png rename to skins/admin/en/modules/Ecomprocessing/Genesis/method_icon.png diff --git a/skins/admin/en/modules/EComprocessing/Genesis/method_icon_EComProcessingCheckout.png b/skins/admin/en/modules/Ecomprocessing/Genesis/method_icon_EComProcessingCheckout.png similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/method_icon_EComProcessingCheckout.png rename to skins/admin/en/modules/Ecomprocessing/Genesis/method_icon_EComProcessingCheckout.png diff --git a/skins/admin/en/modules/EComprocessing/Genesis/settings/body.tpl b/skins/admin/en/modules/Ecomprocessing/Genesis/settings/body.tpl similarity index 100% rename from skins/admin/en/modules/EComprocessing/Genesis/settings/body.tpl rename to skins/admin/en/modules/Ecomprocessing/Genesis/settings/body.tpl