From 393af1a9d87aeb14f99e32e24a8b15dad04f2655 Mon Sep 17 00:00:00 2001 From: Nabil Semaoune Date: Fri, 29 Jun 2018 11:22:31 +0200 Subject: [PATCH] Migrate release 1.9.0 to GitHub. --- .../community/Lyra/Payzen/Block/Abstract.php | 20 +- .../Lyra/Payzen/Block/Adminhtml/Redirect.php | 4 +- .../System/Config}/Field/CategoryMapping.php | 11 +- .../Field/Choozeo/CustgroupOptions.php | 7 +- .../Config}/Field/Choozeo/PaymentOptions.php | 9 +- .../Config/Field/Column/EditableLabel.php | 43 + .../System/Config}/Field/Column/Label.php | 6 +- .../System/Config}/Field/Column/List.php | 6 +- .../Adminhtml/System/Config/Field/CtxMode.php | 42 + .../System/Config}/Field/CustgroupOptions.php | 9 +- .../Config/Field/Fullcb/CustgroupOptions.php | 31 + .../Config/Field/Fullcb/PaymentOptions.php | 129 ++ .../System/Config}/Field/Gift/AddedCards.php | 9 +- .../Config}/Field/Gift/UploadButton.php | 6 +- .../System/Config}/Field/InitButton.php | 8 +- .../Adminhtml/System/Config/Field/KeyTest.php | 41 + .../System/Config}/Field/Label.php | 8 +- .../Config}/Field/Multi/PaymentOptions.php | 7 +- .../System/Config}/Field/Multiselect.php | 6 +- .../System/Config/Field/NotifyUrl.php | 46 + .../Config}/Field/Oney/PaymentOptions.php | 23 +- .../System/Config}/Field/SectionTitle.php | 6 +- .../System/Config}/Field/ShipOptions.php | 20 +- .../System/Config/Field/Standard/UseOney.php | 42 + .../Config}/Field/ThreedsCustgroupOptions.php | 9 +- .../System/Config/Fieldset/Payment.php | 56 + .../community/Lyra/Payzen/Block/Choozeo.php | 4 +- .../community/Lyra/Payzen/Block/Fullcb.php | 52 + .../Lyra/Payzen/Block/Fullcb/Review.php | 125 ++ app/code/community/Lyra/Payzen/Block/Gift.php | 6 +- .../community/Lyra/Payzen/Block/Giropay.php | 4 +- .../community/Lyra/Payzen/Block/Ideal.php | 4 +- .../Lyra/Payzen/Block/Iframe/Response.php | 4 +- app/code/community/Lyra/Payzen/Block/Info.php | 6 +- .../community/Lyra/Payzen/Block/Multi.php | 4 +- .../Lyra/Payzen/Block/Oneclick/Cart.php | 4 +- .../Lyra/Payzen/Block/Oneclick/Product.php | 4 +- .../Block/Oneclick/Shipping/Abstract.php | 4 +- .../Block/Oneclick/Shipping/Address.php | 12 +- .../Payzen/Block/Oneclick/Shipping/Method.php | 18 +- app/code/community/Lyra/Payzen/Block/Oney.php | 4 +- .../Lyra/Payzen/Block/Oney/Review.php | 10 +- .../community/Lyra/Payzen/Block/Paypal.php | 4 +- .../Lyra/Payzen/Block/Postfinance.php | 4 +- .../community/Lyra/Payzen/Block/Redirect.php | 4 +- .../community/Lyra/Payzen/Block/Review.php | 4 +- app/code/community/Lyra/Payzen/Block/Sepa.php | 28 + .../community/Lyra/Payzen/Block/Sofort.php | 4 +- .../community/Lyra/Payzen/Block/Standard.php | 10 +- app/code/community/Lyra/Payzen/CHANGELOG.txt | 81 +- .../community/Lyra/Payzen/Helper/Data.php | 51 +- .../community/Lyra/Payzen/Helper/Payment.php | 159 +- .../community/Lyra/Payzen/Helper/Util.php | 43 +- .../community/Lyra/Payzen/Model/Api/Api.php | 6 +- .../Lyra/Payzen/Model/Api/Currency.php | 4 +- .../community/Lyra/Payzen/Model/Api/Field.php | 4 +- .../Lyra/Payzen/Model/Api/Request.php | 8 +- .../Lyra/Payzen/Model/Api/Response.php | 26 +- .../Api/Ws/AuthenticationRequestData.php | 4 +- .../Model/Api/Ws/AuthenticationResultData.php | 4 +- .../Model/Api/Ws/AuthorizationResponse.php | 4 +- .../Model/Api/Ws/BillingDetailsRequest.php | 4 +- .../Model/Api/Ws/BillingDetailsResponse.php | 4 +- .../Payzen/Model/Api/Ws/CancelPayment.php | 4 +- .../Model/Api/Ws/CancelPaymentResponse.php | 4 +- .../Model/Api/Ws/CancelPaymentResult.php | 4 +- .../Model/Api/Ws/CancelSubscription.php | 4 +- .../Api/Ws/CancelSubscriptionResponse.php | 4 +- .../Model/Api/Ws/CancelSubscriptionResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CancelToken.php | 4 +- .../Model/Api/Ws/CancelTokenResponse.php | 4 +- .../Payzen/Model/Api/Ws/CancelTokenResult.php | 4 +- .../Payzen/Model/Api/Ws/CapturePayment.php | 4 +- .../Model/Api/Ws/CapturePaymentResponse.php | 4 +- .../Model/Api/Ws/CapturePaymentResult.php | 4 +- .../Payzen/Model/Api/Ws/CaptureResponse.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CardRequest.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CardResponse.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CartItemInfo.php | 4 +- .../Api/Ws/CheckThreeDSAuthentication.php | 4 +- .../Ws/CheckThreeDSAuthenticationResponse.php | 4 +- .../Ws/CheckThreeDSAuthenticationResult.php | 4 +- .../Payzen/Model/Api/Ws/CommonRequest.php | 4 +- .../Payzen/Model/Api/Ws/CommonResponse.php | 4 +- .../Payzen/Model/Api/Ws/CreatePayment.php | 4 +- .../Model/Api/Ws/CreatePaymentResponse.php | 4 +- .../Model/Api/Ws/CreatePaymentResult.php | 4 +- .../Model/Api/Ws/CreateSubscription.php | 4 +- .../Api/Ws/CreateSubscriptionResponse.php | 4 +- .../Model/Api/Ws/CreateSubscriptionResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CreateToken.php | 4 +- .../Api/Ws/CreateTokenFromTransaction.php | 4 +- .../Ws/CreateTokenFromTransactionResponse.php | 4 +- .../Ws/CreateTokenFromTransactionResult.php | 4 +- .../Model/Api/Ws/CreateTokenResponse.php | 4 +- .../Payzen/Model/Api/Ws/CreateTokenResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/CustStatus.php | 4 +- .../Payzen/Model/Api/Ws/CustomerRequest.php | 4 +- .../Payzen/Model/Api/Ws/CustomerResponse.php | 4 +- .../Payzen/Model/Api/Ws/DeliverySpeed.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/DeliveryType.php | 4 +- .../Payzen/Model/Api/Ws/DuplicatePayment.php | 4 +- .../Model/Api/Ws/DuplicatePaymentResponse.php | 4 +- .../Model/Api/Ws/DuplicatePaymentResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/ExtInfo.php | 4 +- .../Model/Api/Ws/ExtraDetailsRequest.php | 4 +- .../Model/Api/Ws/ExtraDetailsResponse.php | 4 +- .../Payzen/Model/Api/Ws/ExtraResponse.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/FindPayments.php | 4 +- .../Model/Api/Ws/FindPaymentsResponse.php | 4 +- .../Model/Api/Ws/FindPaymentsResult.php | 4 +- .../Model/Api/Ws/FraudManagementResponse.php | 4 +- .../Payzen/Model/Api/Ws/GetPaymentDetails.php | 4 +- .../Api/Ws/GetPaymentDetailsResponse.php | 4 +- .../Model/Api/Ws/GetPaymentDetailsResult.php | 4 +- .../Payzen/Model/Api/Ws/GetPaymentUuid.php | 4 +- .../Model/Api/Ws/GetPaymentUuidResponse.php | 4 +- .../Model/Api/Ws/GetSubscriptionDetails.php | 4 +- .../Api/Ws/GetSubscriptionDetailsResponse.php | 4 +- .../Api/Ws/GetSubscriptionDetailsResult.php | 4 +- .../Payzen/Model/Api/Ws/GetTokenDetails.php | 4 +- .../Model/Api/Ws/GetTokenDetailsResponse.php | 4 +- .../Model/Api/Ws/GetTokenDetailsResult.php | 4 +- .../Api/Ws/LegacyTransactionKeyRequest.php | 4 +- .../Api/Ws/LegacyTransactionKeyResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/MarkResponse.php | 4 +- .../Model/Api/Ws/MpiExtensionRequest.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/OrderRequest.php | 4 +- .../Payzen/Model/Api/Ws/OrderResponse.php | 4 +- .../Payzen/Model/Api/Ws/PaymentRequest.php | 4 +- .../Payzen/Model/Api/Ws/PaymentResponse.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/PaymentType.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/ProductType.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/QueryRequest.php | 4 +- .../Payzen/Model/Api/Ws/ReactivateToken.php | 4 +- .../Model/Api/Ws/ReactivateTokenResponse.php | 4 +- .../Model/Api/Ws/ReactivateTokenResult.php | 4 +- .../Payzen/Model/Api/Ws/RefundPayment.php | 4 +- .../Model/Api/Ws/RefundPaymentResponse.php | 4 +- .../Model/Api/Ws/RefundPaymentResult.php | 4 +- .../Payzen/Model/Api/Ws/ResultWrapper.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/RiskAnalysis.php | 4 +- .../Api/Ws/RiskAnalysisProcessingStatus.php | 4 +- .../Payzen/Model/Api/Ws/RiskAssessments.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/RiskControl.php | 4 +- .../Payzen/Model/Api/Ws/SettlementRequest.php | 4 +- .../Model/Api/Ws/ShippingDetailsRequest.php | 4 +- .../Model/Api/Ws/ShippingDetailsResponse.php | 4 +- .../Model/Api/Ws/ShoppingCartRequest.php | 4 +- .../Model/Api/Ws/ShoppingCartResponse.php | 4 +- .../Model/Api/Ws/SubscriptionRequest.php | 4 +- .../Model/Api/Ws/SubscriptionResponse.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/TechRequest.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/ThreeDSMode.php | 4 +- .../Payzen/Model/Api/Ws/ThreeDSRequest.php | 4 +- .../Payzen/Model/Api/Ws/ThreeDSResponse.php | 4 +- .../Payzen/Model/Api/Ws/TokenResponse.php | 4 +- .../Payzen/Model/Api/Ws/TransactionItem.php | 4 +- .../Payzen/Model/Api/Ws/UpdatePayment.php | 4 +- .../Model/Api/Ws/UpdatePaymentDetails.php | 4 +- .../Api/Ws/UpdatePaymentDetailsResponse.php | 4 +- .../Api/Ws/UpdatePaymentDetailsResult.php | 4 +- .../Model/Api/Ws/UpdatePaymentResponse.php | 4 +- .../Model/Api/Ws/UpdatePaymentResult.php | 4 +- .../Model/Api/Ws/UpdateSubscription.php | 4 +- .../Api/Ws/UpdateSubscriptionResponse.php | 4 +- .../Model/Api/Ws/UpdateSubscriptionResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/UpdateToken.php | 4 +- .../Model/Api/Ws/UpdateTokenResponse.php | 4 +- .../Payzen/Model/Api/Ws/UpdateTokenResult.php | 4 +- .../Payzen/Model/Api/Ws/ValidatePayment.php | 4 +- .../Model/Api/Ws/ValidatePaymentResponse.php | 4 +- .../Model/Api/Ws/ValidatePaymentResult.php | 4 +- .../Model/Api/Ws/VerifyThreeDSEnrollment.php | 4 +- .../Ws/VerifyThreeDSEnrollmentResponse.php | 4 +- .../Api/Ws/VerifyThreeDSEnrollmentResult.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/WsApi.php | 4 +- .../Payzen/Model/Api/Ws/WsApiClassLoader.php | 4 +- .../Lyra/Payzen/Model/Api/Ws/WsResponse.php | 4 +- .../Lyra/Payzen/Model/Field/Array.php | 8 +- .../Payzen/Model/Field/AvailableLanguages.php | 4 +- .../Payzen/Model/Field/CategoryMapping.php | 4 +- .../Lyra/Payzen/Model/Field/CheckUrl.php | 36 - .../Model/Field/Choozeo/CustgroupOptions.php | 6 +- .../Model/Field/Choozeo/PaymentOptions.php | 4 +- .../Payzen/Model/Field/CustgroupOptions.php | 4 +- .../Model/Field/Fullcb/CustgroupOptions.php | 51 + .../Model/Field/Fullcb/PaymentOptions.php | 58 + .../Payzen/Model/Field/Gift/AddedCards.php | 6 +- .../Lyra/Payzen/Model/Field/Logo.php | 4 +- .../Model/Field/Multi/PaymentOptions.php | 4 +- .../Lyra/Payzen/Model/Field/Oney/Active.php | 6 +- .../Model/Field/Oney/CustgroupOptions.php | 6 +- .../Model/Field/Oney/PaymentOptions.php | 4 +- .../Lyra/Payzen/Model/Field/PaymentCards.php | 6 +- .../Lyra/Payzen/Model/Field/ShipOptions.php | 4 +- .../Lyra/Payzen/Model/Field/ShopUrl.php | 6 +- .../Model/Field/Standard/CardInfoModes.php | 6 +- .../Payzen/Model/Field/Standard/UseOney.php | 10 +- .../Lyra/Payzen/Model/Field/ThemeConfig.php | 6 +- .../Lyra/Payzen/Model/Field/Translatable.php | 48 + .../community/Lyra/Payzen/Model/Observer.php | 10 +- .../community/Lyra/Payzen/Model/Order.php | 4 +- .../Lyra/Payzen/Model/Payment/Abstract.php | 22 +- .../Lyra/Payzen/Model/Payment/Choozeo.php | 4 +- .../Lyra/Payzen/Model/Payment/Fullcb.php | 160 ++ .../Lyra/Payzen/Model/Payment/Gift.php | 4 +- .../Lyra/Payzen/Model/Payment/Giropay.php | 4 +- .../Lyra/Payzen/Model/Payment/Ideal.php | 4 +- .../Lyra/Payzen/Model/Payment/Multi.php | 4 +- .../Lyra/Payzen/Model/Payment/Multix.php | 4 +- .../Lyra/Payzen/Model/Payment/Oney.php | 10 +- .../Lyra/Payzen/Model/Payment/Paypal.php | 4 +- .../Lyra/Payzen/Model/Payment/Postfinance.php | 4 +- .../Lyra/Payzen/Model/Payment/Sepa.php | 67 + .../Lyra/Payzen/Model/Payment/Sofort.php | 4 +- .../Lyra/Payzen/Model/Payment/Standard.php | 56 +- .../Lyra/Payzen/Model/Resource/Setup.php | 4 +- .../community/Lyra/Payzen/Model/Session.php | 4 +- .../Lyra/Payzen/Model/Source/Categories.php | 13 +- .../Lyra/Payzen/Model/Source/CtxModes.php | 11 +- .../Payzen/Model/Source/Gift/GiftCards.php | 11 +- .../Lyra/Payzen/Model/Source/Languages.php | 8 +- .../Model/Source/Multi/CardInfoModes.php | 7 +- .../Model/Source/Multi/PaymentCards.php | 6 +- .../Model/Source/Oney/AvailableCountries.php | 10 +- .../Lyra/Payzen/Model/Source/PaymentCards.php | 12 +- .../Lyra/Payzen/Model/Source/ReturnModes.php | 11 +- .../Model/Source/Sepa/AvailableCountries.php | 47 + .../Payzen/Model/Source/Sepa/MandateModes.php | 34 + .../Lyra/Payzen/Model/Source/SignAlgos.php | 11 +- .../Source/Sofort/AvailableCountries.php | 12 +- .../Model/Source/Standard/CardInfoModes.php | 16 +- .../Source/Standard/CardRegisterModes.php | 11 +- .../Source/Standard/OneClickLocations.php | 11 +- .../Payzen/Model/Source/ValidationModes.php | 8 +- .../Lyra/Payzen/Model/WsException.php | 5 +- .../Adminhtml/Payzen/ConfigController.php | 4 +- .../Adminhtml/Payzen/PaymentController.php | 24 +- .../Payzen/controllers/PaymentController.php | 62 +- .../data/payzen_setup/data-install-1.6.0.php | 14 +- .../payzen_setup/data-upgrade-1.8.0-1.9.0.php | 45 + app/code/community/Lyra/Payzen/etc/config.xml | 140 +- app/code/community/Lyra/Payzen/etc/system.xml | 1708 ++++++++++++----- .../Payzen/sql/payzen_setup/install-1.6.0.php | 33 +- .../sql/payzen_setup/mysql4-install-1.6.0.php | 25 +- .../mysql4-upgrade-1.7.1-1.8.0.php | 13 +- .../mysql4-upgrade-1.8.0-1.9.0.php | 50 + .../sql/payzen_setup/upgrade-1.7.1-1.8.0.php | 39 +- .../default/template/payzen/field/array.phtml | 4 +- .../template/payzen/field/init_button.phtml | 4 +- .../default/template/payzen/gift.phtml | 4 +- .../default/template/payzen/info.phtml | 10 +- .../default/template/payzen/multi.phtml | 4 +- .../default/template/payzen/redirect.phtml | 6 +- .../default/template/payzen/standard.phtml | 4 +- .../frontend/base/default/layout/payzen.xml | 13 +- .../default/template/payzen/choozeo.phtml | 4 +- .../base/default/template/payzen/fullcb.phtml | 53 + .../template/payzen/fullcb/review.phtml | 75 + .../base/default/template/payzen/gift.phtml | 4 +- .../default/template/payzen/giropay.phtml | 4 +- .../base/default/template/payzen/ideal.phtml | 4 +- .../base/default/template/payzen/iframe.phtml | 35 +- .../template/payzen/iframe/loader.phtml | 4 +- .../template/payzen/iframe/redirect.phtml | 4 +- .../template/payzen/iframe/response.phtml | 4 +- .../base/default/template/payzen/info.phtml | 10 +- .../base/default/template/payzen/logo.phtml | 4 +- .../base/default/template/payzen/multi.phtml | 8 +- .../template/payzen/oneclick/cart.phtml | 4 +- .../default/template/payzen/oneclick/js.phtml | 17 +- .../template/payzen/oneclick/minicart.phtml | 4 +- .../template/payzen/oneclick/product.phtml | 4 +- .../template/payzen/oneclick/shipping.phtml | 4 +- .../payzen/oneclick/shipping/address.phtml | 4 +- .../payzen/oneclick/shipping/method.phtml | 6 +- .../base/default/template/payzen/oney.phtml | 4 +- .../default/template/payzen/oney/review.phtml | 6 +- .../base/default/template/payzen/paypal.phtml | 4 +- .../default/template/payzen/postfinance.phtml | 4 +- .../default/template/payzen/redirect.phtml | 6 +- .../base/default/template/payzen/sepa.phtml | 20 + .../base/default/template/payzen/sofort.phtml | 4 +- .../default/template/payzen/standard.phtml | 18 +- app/etc/modules/Lyra_Payzen.xml | 4 +- app/locale/de_DE/Lyra_Payzen.csv | 122 +- app/locale/en_US/Lyra_Payzen.csv | 132 +- app/locale/fr_FR/Lyra_Payzen.csv | 127 +- media/payzen/ct/fullcb3x.png | Bin 0 -> 5820 bytes media/payzen/ct/fullcb4x.png | Bin 0 -> 6133 bytes media/payzen/ct/sdd.png | Bin 0 -> 4151 bytes media/payzen/ct/sofort_banking.png | Bin 2997 -> 2813 bytes media/payzen/logos/fullcb.png | Bin 0 -> 14203 bytes media/payzen/logos/sdd.png | Bin 0 -> 4151 bytes media/payzen/logos/sofort_banking.png | Bin 2997 -> 2813 bytes media/payzen/warn.png | Bin 0 -> 2018 bytes skin/adminhtml/default/default/payzen.css | 13 +- skin/frontend/base/default/css/payzen.css | 33 +- 299 files changed, 4097 insertions(+), 1563 deletions(-) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/CategoryMapping.php (91%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Choozeo/CustgroupOptions.php (73%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Choozeo/PaymentOptions.php (87%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/EditableLabel.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Column/Label.php (84%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Column/List.php (84%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/CtxMode.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/CustgroupOptions.php (91%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/CustgroupOptions.php create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/PaymentOptions.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Gift/AddedCards.php (79%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Gift/UploadButton.php (86%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/InitButton.php (86%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/KeyTest.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Label.php (78%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Multi/PaymentOptions.php (90%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Multiselect.php (81%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/NotifyUrl.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/Oney/PaymentOptions.php (76%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/SectionTitle.php (88%) rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/ShipOptions.php (91%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Standard/UseOney.php rename app/code/community/Lyra/Payzen/Block/{ => Adminhtml/System/Config}/Field/ThreedsCustgroupOptions.php (68%) create mode 100644 app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Fieldset/Payment.php create mode 100644 app/code/community/Lyra/Payzen/Block/Fullcb.php create mode 100644 app/code/community/Lyra/Payzen/Block/Fullcb/Review.php create mode 100644 app/code/community/Lyra/Payzen/Block/Sepa.php delete mode 100644 app/code/community/Lyra/Payzen/Model/Field/CheckUrl.php create mode 100644 app/code/community/Lyra/Payzen/Model/Field/Fullcb/CustgroupOptions.php create mode 100644 app/code/community/Lyra/Payzen/Model/Field/Fullcb/PaymentOptions.php create mode 100644 app/code/community/Lyra/Payzen/Model/Field/Translatable.php create mode 100644 app/code/community/Lyra/Payzen/Model/Payment/Fullcb.php create mode 100644 app/code/community/Lyra/Payzen/Model/Payment/Sepa.php create mode 100644 app/code/community/Lyra/Payzen/Model/Source/Sepa/AvailableCountries.php create mode 100644 app/code/community/Lyra/Payzen/Model/Source/Sepa/MandateModes.php create mode 100644 app/code/community/Lyra/Payzen/data/payzen_setup/data-upgrade-1.8.0-1.9.0.php create mode 100644 app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.8.0-1.9.0.php create mode 100644 app/design/frontend/base/default/template/payzen/fullcb.phtml create mode 100644 app/design/frontend/base/default/template/payzen/fullcb/review.phtml create mode 100644 app/design/frontend/base/default/template/payzen/sepa.phtml create mode 100644 media/payzen/ct/fullcb3x.png create mode 100644 media/payzen/ct/fullcb4x.png create mode 100644 media/payzen/ct/sdd.png create mode 100644 media/payzen/logos/fullcb.png create mode 100644 media/payzen/logos/sdd.png create mode 100644 media/payzen/warn.png diff --git a/app/code/community/Lyra/Payzen/Block/Abstract.php b/app/code/community/Lyra/Payzen/Block/Abstract.php index 26b14fc7..c9952cb5 100644 --- a/app/code/community/Lyra/Payzen/Block/Abstract.php +++ b/app/code/community/Lyra/Payzen/Block/Abstract.php @@ -1,6 +1,6 @@ _checkAndGetSkinUrl($this->getConfigData('module_logo')); - if (! Mage::helper('payzen')->isAdmin() && $logoURL) { + if (! $this->_getHelper()->isAdmin() && $logoURL) { $logo = Mage::getConfig()->getBlockClassName('core/template'); $logo = new $logo; $logo->setTemplate('payzen/logo.phtml'); @@ -45,7 +45,7 @@ protected function _checkAndGetSkinUrl($fileName) } $filePath = Mage::getBaseDir('media') . DS . 'payzen' . DS . 'logos' . DS . $fileName; - if (! file_exists($filePath)) { + if (! $this->_getHelper()->fileExists($filePath)) { return false; } @@ -57,7 +57,7 @@ public function getCcTypeImageSrc($card) $card = strtolower($card); $path = Mage::getBaseDir('media') . DS . 'payzen' . DS . 'ct' . DS . $card . '.png'; - if (file_exists($path)) { + if ($this->_getHelper()->fileExists($path)) { return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'payzen/ct/' . $card . '.png'; } else { return false; @@ -73,4 +73,14 @@ public function getConfigData($name) { return $this->_getModel()->getConfigData($name); } + + /** + * Return payzen data helper. + * + * @return Lyra_Payzen_Helper_Data + */ + protected function _getHelper() + { + return Mage::helper('payzen'); + } } diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/Redirect.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/Redirect.php index a668921b..f00738af 100644 --- a/app/code/community/Lyra/Payzen/Block/Adminhtml/Redirect.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/Redirect.php @@ -1,6 +1,6 @@ Mage::helper('payzen')->__('Magento category'), 'style' => 'width: 200px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_Label + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_Label ) ); @@ -38,7 +39,7 @@ public function __construct() array( 'label' => Mage::helper('payzen')->__('PayZen category'), 'style' => 'width: 200px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_List($options) + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_List($options) ) ); diff --git a/app/code/community/Lyra/Payzen/Block/Field/Choozeo/CustgroupOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Choozeo/CustgroupOptions.php similarity index 73% rename from app/code/community/Lyra/Payzen/Block/Field/Choozeo/CustgroupOptions.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Choozeo/CustgroupOptions.php index 4f001345..f13851a2 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Choozeo/CustgroupOptions.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Choozeo/CustgroupOptions.php @@ -1,6 +1,6 @@ Mage::helper('payzen')->__('Label'), 'style' => 'width: 260px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_Label + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_Label ) ); $this->addColumn( diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/EditableLabel.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/EditableLabel.php new file mode 100644 index 00000000..3d60ece7 --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/EditableLabel.php @@ -0,0 +1,43 @@ +column['class'] ? $this->column['class'] : 'input-text') . '"'; + $html .= ' style="'. ($this->column['style'] ? ' ' . $this->column['style'] : '') . '"'; + $html .= '>'; + + $html .= ''; + + $codeInputName = str_replace($this->columnName, 'code', $this->inputName); + $html .= ''; + + $countInputName = str_replace($this->columnName, 'count', $this->inputName); + $html .= ''; + + $html .= ''; + + return $html; + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Field/Column/Label.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/Label.php similarity index 84% rename from app/code/community/Lyra/Payzen/Block/Field/Column/Label.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/Label.php index 6932a1ee..b8a93ddc 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Column/Label.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Column/Label.php @@ -1,6 +1,6 @@ unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); + $element->setDisabled(true); + } + + return parent::render($element); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Field/CustgroupOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/CustgroupOptions.php similarity index 91% rename from app/code/community/Lyra/Payzen/Block/Field/CustgroupOptions.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/CustgroupOptions.php index 32c2fe1e..99303c32 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/CustgroupOptions.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/CustgroupOptions.php @@ -1,6 +1,6 @@ Mage::helper('payzen')->__('Customer group'), 'style' => 'width: 260px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_Label + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_Label ) ); $this->addColumn( diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/CustgroupOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/CustgroupOptions.php new file mode 100644 index 00000000..51fac498 --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/CustgroupOptions.php @@ -0,0 +1,31 @@ +_default = array('amount_min' => '100', 'amount_max' => '1500'); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/PaymentOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/PaymentOptions.php new file mode 100644 index 00000000..512661cc --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Fullcb/PaymentOptions.php @@ -0,0 +1,129 @@ +addColumn( + 'label', + array( + 'label' => Mage::helper('payzen')->__('Label'), + 'style' => 'width: 220px;', + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_EditableLabel + ) + ); + + $this->addColumn( + 'amount_min', + array( + 'label' => Mage::helper('payzen')->__('Min. amount'), + 'style' => 'width: 120px;' + ) + ); + + $this->addColumn( + 'amount_max', + array( + 'label' => Mage::helper('payzen')->__('Max. amount'), + 'style' => 'width: 120px;' + ) + ); + + $this->addColumn( + 'rate', + array( + 'label' => Mage::helper('payzen')->__('Rate'), + 'style' => 'width: 100px;', + ) + ); + + $this->addColumn( + 'cap', + array( + 'label' => Mage::helper('payzen')->__('Cap'), + 'style' => 'width: 100px;', + ) + ); + + $this->_addAfter = false; + + parent::__construct(); + + $this->setTemplate('payzen/field/array.phtml'); + } + + /** + * Obtain existing data from form element. + * + * Each row will be instance of Varien_Object + * + * @return array + */ + public function getArrayRows() + { + /** @var array[string][array] $defaultOptions */ + $defaultOptions = array( + 'FULLCB3X' => array( + 'label' => Mage::helper('payzen')->__('Payment in %s times', '3'), + 'count' => '3', + 'rate' => '1.4', + 'cap' => '9' + ), + 'FULLCB4X' => array( + 'label' => Mage::helper('payzen')->__('Payment in %s times', '4'), + 'count' => '4', + 'rate' => '2.1', + 'cap' => '12' + ) + ); + + $savedOptions = $this->getElement()->getValue(); + if (! is_array($savedOptions)) { + $savedOptions = array(); + } + + foreach ($savedOptions as $id => $savedOption) { + if (key_exists($savedOption['code'], $defaultOptions)) { + unset($defaultOptions[$savedOption['code']]); + } + } + + // add not saved yet options + foreach ($defaultOptions as $code => $defaultOption) { + $option = array( + 'code' => $code, + 'label' => $defaultOption['label'], + 'count' => $defaultOption['count'], + 'amount_min' => '', + 'amount_max' => '', + 'rate' => $defaultOption['rate'], + 'cap' => $defaultOption['cap'] + ); + + $savedOptions[uniqid('_' . $code . '_')] = $option; + } + + $this->getElement()->setValue($savedOptions); + return parent::getArrayRows(); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Field/Gift/AddedCards.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/AddedCards.php similarity index 79% rename from app/code/community/Lyra/Payzen/Block/Field/Gift/AddedCards.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/AddedCards.php index 06e3c448..3a3ae73b 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Gift/AddedCards.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/AddedCards.php @@ -1,6 +1,6 @@ Mage::helper('payzen')->__('Card logo'), 'style' => 'width: 340px;', 'size' => '20', - 'renderer' => new Lyra_Payzen_Block_Field_Gift_UploadButton + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Gift_UploadButton ) ); diff --git a/app/code/community/Lyra/Payzen/Block/Field/Gift/UploadButton.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/UploadButton.php similarity index 86% rename from app/code/community/Lyra/Payzen/Block/Field/Gift/UploadButton.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/UploadButton.php index 6b6483fa..496d225c 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Gift/UploadButton.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Gift/UploadButton.php @@ -1,6 +1,6 @@ addData( array( - 'button_label' => Mage::helper('payzen')->__((string)$fieldConfig->button_label), + 'button_label' => Mage::helper('payzen')->__((string) $fieldConfig->button_label), 'button_url' => $this->getUrl($fieldConfig->button_url), 'html_id' => $element->getHtmlId() ) diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/KeyTest.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/KeyTest.php new file mode 100644 index 00000000..7e62d5b0 --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/KeyTest.php @@ -0,0 +1,41 @@ +unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); $fieldConfig = $element->getFieldConfig(); - if (isset($fieldConfig->is_country) && (bool)$fieldConfig->is_country) { + if (isset($fieldConfig->is_country) && (bool) $fieldConfig->is_country) { $name = Mage::app()->getLocale()->getCountryTranslation($element->getValue()); if (! empty($name)) { $element->setValue($name); diff --git a/app/code/community/Lyra/Payzen/Block/Field/Multi/PaymentOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Multi/PaymentOptions.php similarity index 90% rename from app/code/community/Lyra/Payzen/Block/Field/Multi/PaymentOptions.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Multi/PaymentOptions.php index 67943d57..8245ece9 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Multi/PaymentOptions.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Multi/PaymentOptions.php @@ -1,6 +1,6 @@ unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); + + $store = Mage::app()->getAnyStoreView(); // either default or any other store view + $ipnUrl = Mage::helper('payzen')->prepareUrl($element->getValue(), $store->getId()); + $element->setValue($ipnUrl); + + $warnImg = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'payzen/warn.png'; + $comment = ''; + $comment .= '' + . $element->getComment() . ''; + $element->setComment($comment); + + return str_replace('class="note"', '', parent::render($element)); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Field/Oney/PaymentOptions.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Oney/PaymentOptions.php similarity index 76% rename from app/code/community/Lyra/Payzen/Block/Field/Oney/PaymentOptions.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Oney/PaymentOptions.php index c63a4ae6..6112358a 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/Oney/PaymentOptions.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Oney/PaymentOptions.php @@ -1,6 +1,6 @@ //getElement()->getDisabled()) { $script .= ' - toggleValueElements({checked: true}, $("payment_payzen_oney_payment_options").parentNode);'; + toggleValueElements({checked: true}, $("payment_payzen_oney_oney_payment_options").parentNode);'; } $script .= ' - Event.observe($("payment_payzen_oney_enable_payment_options"), "change", function() { - toggleValueElements( - $("payment_payzen_oney_payment_options_inherit"), - $("payment_payzen_oney_payment_options").parentNode - ); - }); + Event.observe($("payment_payzen_oney_oney_enable_payment_options"), "change", function() { + toggleValueElements( + $("payment_payzen_oney_oney_payment_options_inherit"), + $("payment_payzen_oney_oney_payment_options").parentNode + ); }); + }); //]]> '; } diff --git a/app/code/community/Lyra/Payzen/Block/Field/SectionTitle.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/SectionTitle.php similarity index 88% rename from app/code/community/Lyra/Payzen/Block/Field/SectionTitle.php rename to app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/SectionTitle.php index 1ce6d350..1bace3f5 100644 --- a/app/code/community/Lyra/Payzen/Block/Field/SectionTitle.php +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/SectionTitle.php @@ -1,6 +1,6 @@ Mage::helper('payzen')->__('Method title'), 'style' => 'width: 210px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_Label + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_Label ) ); $this->addColumn( @@ -52,7 +53,7 @@ public function __construct() array( 'label' => Mage::helper('payzen')->__('Type'), 'style' => 'width: 130px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_List($options) + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_List($options) ) ); @@ -68,7 +69,7 @@ public function __construct() array( 'label' => Mage::helper('payzen')->__('Rapidity'), 'style' => 'width: 75px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_List($options) + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_List($options) ) ); @@ -85,7 +86,7 @@ public function __construct() array( 'label' => Mage::helper('payzen')->__('Delay'), 'style' => 'width: 90px;', - 'renderer' => new Lyra_Payzen_Block_Field_Column_List($options) + 'renderer' => new Lyra_Payzen_Block_Adminhtml_System_Config_Field_Column_List($options) ) ); @@ -106,8 +107,6 @@ public function __construct() public function getArrayRows() { $value = array(); - - /** @var array[string][string] $methods */ $methods = $this->_getAllShippingMethods(); $savedMethods = $this->getElement()->getValue(); @@ -169,7 +168,6 @@ protected function _getAllShippingMethods() continue; } - // $carrierTitle = $carrierModel->getConfigData('title'); foreach ($carrierMethods as $methodCode => $methodTitle) { $code = $carrierCode . '_' . $methodCode; @@ -215,7 +213,7 @@ protected function _toHtml() } }); - // enable delay select for rows with speed == PRIORITY & type = RECLAIM_IN_SHOP + // enable delay select for rows with speed equals PRIORITY and type equals RECLAIM_IN_SHOP $$("select.payzen_list_delay").each(function(elt) { var speedName = elt.name.replace("[delay]", "[speed]"); var typeName = elt.name.replace("[delay]", "[type]"); diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Standard/UseOney.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Standard/UseOney.php new file mode 100644 index 00000000..d0ac927f --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Field/Standard/UseOney.php @@ -0,0 +1,42 @@ +_columns['amount_max']); } } diff --git a/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Fieldset/Payment.php b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Fieldset/Payment.php new file mode 100644 index 00000000..39270438 --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Adminhtml/System/Config/Fieldset/Payment.php @@ -0,0 +1,56 @@ +getOriginalData(); + + + if (isset($data['feature']) && key_exists($data['feature'], $features) && ! $features[$data['feature']]) { + return ''; + } + + if (isset($data['feature']) && ($data['feature'] === 'multi')) { + $comment = ''; + if ($features['restrictmulti']) { + $comment = '

'; + $comment .= $element->getComment(); + $comment .= '

'; + } + + $element->setComment($comment); + } + + return parent::render($element); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Choozeo.php b/app/code/community/Lyra/Payzen/Block/Choozeo.php index 78175486..7a9bfe09 100644 --- a/app/code/community/Lyra/Payzen/Block/Choozeo.php +++ b/app/code/community/Lyra/Payzen/Block/Choozeo.php @@ -1,6 +1,6 @@ setTemplate('payzen/fullcb.phtml'); + } + + public function getPaymentOptions() + { + if ($this->_getModel()->getConfigData('enable_payment_options') != 1) { + // local payment options selection is not allowed + return false; + } + + $amount = $this->getMethod()->getInfoInstance()->getQuote()->getBaseGrandTotal(); + return $this->_getModel()->getPaymentOptions($amount); + } + + public function getHtmlReview(array $option, $first) + { + $quote = $this->getMethod()->getInfoInstance()->getQuote(); + $amount = $quote->getGrandTotal(); + + $block = $this->getLayout()->createBlock('payzen/fullcb_review') + ->setOption($option) + ->setAmount($amount) + ->setFirst($first); + + return $block->toHtml(); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Fullcb/Review.php b/app/code/community/Lyra/Payzen/Block/Fullcb/Review.php new file mode 100644 index 00000000..7247df6f --- /dev/null +++ b/app/code/community/Lyra/Payzen/Block/Fullcb/Review.php @@ -0,0 +1,125 @@ +setTemplate('payzen/fullcb/review.phtml'); + } + + /** + * Set Fullcb option to review. + * + * @param string $url + * @return Lyra_Payzen_Block_Fullcb_Review + */ + public function setOption($option) + { + $this->_option = $option; + return $this; + } + + /** + * Set order amount. + * + * @param float $amount + * @return Lyra_Payzen_Block_Fullcb_Review + */ + public function setAmount($amount) + { + $this->_amount = $amount; + return $this; + } + + /** + * Set first option flag. + * + * @param bool $first + * @return Lyra_Payzen_Block_Oney_Review + */ + public function setFirst($first) + { + $this->_first = $first; + return $this; + } + + public function getFirst() + { + return $this->_first; + } + + public function getOptionDetails() + { + $details = new Varien_Object(); + + if (is_array($this->_option) && ! empty($this->_option)) { + $amount = $this->_amount; + $count = (int) $this->_option['count']; + $rate = (float) $this->_option['rate']; + + $maxFees = (int) $this->_option['cap']; + switch ($count) { + case 3: + $maxFees = self::FULLCB_THREE_TIMES_MAX_FEES; + break; + case 4: + $maxFees = self::FULLCB_FOUR_TIMES_MAX_FEES; + break; + default: + $maxFees = null; + break; + } + + $payment = round($amount / $count, 2); + + $fees = round($amount * $rate / 100, 2); + if ($maxFees) { + $fees = min($fees, $maxFees); + } + + $first = $amount - ($payment * ($count - 1)) + $fees; + + $details->setOptionCode($this->_option['code']); + $details->setOrderTotal($this->currency($amount)); + $details->setFirstPayment($this->currency($first)); + $details->setCount($count - 1); // real number of payments concerned by funding + $details->setMonthlyPayment($this->currency($payment)); + $details->setFundingTotal($this->currency($amount + $fees)); + $details->setFundingFees($this->currency($fees)); + } + + return $details; + } + + public function currency($amount) + { + return Mage::helper('core')->currency($amount, true, true); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Gift.php b/app/code/community/Lyra/Payzen/Block/Gift.php index 06454ae2..76bbee62 100644 --- a/app/code/community/Lyra/Payzen/Block/Gift.php +++ b/app/code/community/Lyra/Payzen/Block/Gift.php @@ -1,6 +1,6 @@ _getHelper()->fileExists($path)) { return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'payzen/gift/' . $card . '.png'; } else { return false; diff --git a/app/code/community/Lyra/Payzen/Block/Giropay.php b/app/code/community/Lyra/Payzen/Block/Giropay.php index daf432c7..d08bd6ce 100644 --- a/app/code/community/Lyra/Payzen/Block/Giropay.php +++ b/app/code/community/Lyra/Payzen/Block/Giropay.php @@ -1,6 +1,6 @@ '; diff --git a/app/code/community/Lyra/Payzen/Block/Multi.php b/app/code/community/Lyra/Payzen/Block/Multi.php index 26d30fbc..55e34c60 100644 --- a/app/code/community/Lyra/Payzen/Block/Multi.php +++ b/app/code/community/Lyra/Payzen/Block/Multi.php @@ -1,6 +1,6 @@ getCustomer(); foreach ($customer->getAddresses() as $address) { $options[] = array( - 'value' => $address->getId(), - 'label' => $address->format('oneline') + 'value' => $address->getId(), + 'label' => $address->format('oneline') ); } @@ -40,7 +40,7 @@ public function getHtmlSelect() ->setName('shipping_address') ->setId($this->getUniqId()) ->setClass('payzen-address-select') - ->setExtraParams('onchange="payzenUpdateShippingBlock();" style="width: 100%;"') + ->setExtraParams('onchange="payzenUpdateShippingBlock(event);" style="width: 100%;"') ->setValue($this->getAddress()->getCustomerAddressId()) ->setOptions($options); diff --git a/app/code/community/Lyra/Payzen/Block/Oneclick/Shipping/Method.php b/app/code/community/Lyra/Payzen/Block/Oneclick/Shipping/Method.php index 4ada74c8..71c01cf4 100644 --- a/app/code/community/Lyra/Payzen/Block/Oneclick/Shipping/Method.php +++ b/app/code/community/Lyra/Payzen/Block/Oneclick/Shipping/Method.php @@ -1,6 +1,6 @@ getParentBlock() ? $this->getParentBlock()->getNameInLayout() - : 'payzen_oneclick_product_shipping'; - - if (strpos($parentName, 'product') !== false) { - return Lyra_Payzen_Helper_Payment::ONECLICK_LOCATION_PRODUCT; - } elseif (strpos($parentName, 'cart') !== false) { - return Lyra_Payzen_Helper_Payment::ONECLICK_LOCATION_CART; - } else { - return null; - } - } - protected function _afterToHtml($html) { $this->_method = null; diff --git a/app/code/community/Lyra/Payzen/Block/Oney.php b/app/code/community/Lyra/Payzen/Block/Oney.php index 97e1158d..903e376f 100644 --- a/app/code/community/Lyra/Payzen/Block/Oney.php +++ b/app/code/community/Lyra/Payzen/Block/Oney.php @@ -1,6 +1,6 @@ _option) && ! empty($this->_option)) { $amount = $this->_amount; - $count = (int)$this->_option['count']; - $rate = (float)$this->_option['rate']; + $count = (int) $this->_option['count']; + $rate = (float) $this->_option['rate']; $maxFees = null; switch ($count) { @@ -113,7 +113,7 @@ public function getOptionDetails() $details->setMonthlyPayment($this->currency($payment)); $details->setFundingTotal($this->currency(($count - 1) * $payment - $fees)); $details->setFundingFees($this->currency($fees)); - $details->setTaeg(''); // TODO calculate TAEG + $details->setTaeg(''); } return $details; diff --git a/app/code/community/Lyra/Payzen/Block/Paypal.php b/app/code/community/Lyra/Payzen/Block/Paypal.php index 3d701d36..8badc551 100644 --- a/app/code/community/Lyra/Payzen/Block/Paypal.php +++ b/app/code/community/Lyra/Payzen/Block/Paypal.php @@ -1,6 +1,6 @@ setTemplate('payzen/sepa.phtml'); + } +} diff --git a/app/code/community/Lyra/Payzen/Block/Sofort.php b/app/code/community/Lyra/Payzen/Block/Sofort.php index 690c4c65..c1d7d30f 100644 --- a/app/code/community/Lyra/Payzen/Block/Sofort.php +++ b/app/code/community/Lyra/Payzen/Block/Sofort.php @@ -1,6 +1,6 @@ false, + 'prodfaq' => true, + 'acquis' => true, + 'restrictmulti' => false, + + 'multi' => true, + 'gift' => true, + 'oney' => true, + 'paypal' => true, + 'sofort' => true, + 'postfinance' => false, + 'giropay' => true, + 'ideal' => true, + 'choozeo' => false, + 'fullcb' => true, + 'sepa' => true + ); + /** * Shortcut method to get general PayZen module configuration. * @@ -76,7 +99,7 @@ public function getConfigGroupTitle($group) $config->loadFile(Mage::getConfig()->getModuleDir('etc', 'Lyra_Payzen').DS.'system.xml'); $node = $config->getNode('sections/payment/groups/'.$group); - return Mage::helper('payzen')->__((string)$node->label); + return Mage::helper('payzen')->__((string) $node->label); } /** @@ -146,13 +169,25 @@ public function isCurrentlySecure() public function isMaintenanceMode() { $maintenanceFile = Mage::getRoot() . '/maintenance.flag'; - if (file_exists($maintenanceFile)) { + if ($this->fileExists($maintenanceFile)) { return true; } return false; } + /** + * Return true if file exists. Uses Varien_Io_File API. + * + * @param $fileName + * @return bool + */ + public function fileExists($fileName) + { + $io = new Varien_Io_File(); + return $io->fileExists($fileName); + } + /** * Add a model config parameter for each of given $options (multi payment options). * @@ -214,7 +249,7 @@ public function log($message, $level = null) $currentMethod = $this->_getCallerMethod(); $log = ''; - $log .= 'PayZen 1.8.0'; + $log .= 'PayZen 1.9.0'; $log .= ' - ' . $currentMethod; $log .= ' : ' . $message; @@ -231,7 +266,11 @@ protected function _getCallerMethod() $traces = debug_backtrace(); if (isset($traces[2])) { - return $traces[2]['class'] . '::' . $traces[2]['function']; + $trace = ''; + + $trace .= isset($traces[2]['class']) ? ($traces[2]['class'] . '::') : ''; + $trace .= isset($traces[2]['function']) ? $traces[2]['function'] : ''; + return $trace; } return null; diff --git a/app/code/community/Lyra/Payzen/Helper/Payment.php b/app/code/community/Lyra/Payzen/Helper/Payment.php index 31002afc..55437a23 100644 --- a/app/code/community/Lyra/Payzen/Helper/Payment.php +++ b/app/code/community/Lyra/Payzen/Helper/Payment.php @@ -1,6 +1,6 @@ addStatusHistoryComment( - $this->_getHelper()->__('Client sent to PayZen platform.'), + $this->_getHelper()->__('Client sent to PayZen gateway.'), false )->save(); // clear quote data - $controller->getCheckout()->clear(); + $controller->getCheckout()->setQuoteId(null); + $controller->getCheckout()->setLastSuccessQuoteId(null); // inactivate quote $quote = Mage::getModel('sales/quote')->load($order->getQuoteId()); @@ -85,7 +86,7 @@ public function doPaymentForm($controller) $quote->setIsActive(false)->save(); } - // redirect to platform + // redirect to gateway $this->_getHelper()->log("Display payment form and JavaScript for order #{$order->getId()}."); $controller->loadLayout(); @@ -125,9 +126,9 @@ public function doPaymentReturn($controller) "{$ip} tries to access payzen/payment/return page without valid signature with parameters: " . print_r($request, true), Zend_Log::ERR ); -// $this->_getHelper()->log( -// 'Signature algorithm selected in module settings must be the same as one selected in PayZen Back Office.' -// ); + $this->_getHelper()->log( + 'Signature algorithm selected in module settings must be the same as one selected in PayZen Back Office.' + ); $controller->redirectError($order); return; @@ -146,9 +147,9 @@ public function doPaymentReturn($controller) if ($order->getStatus() == 'pending_payment') { // order waiting for payment - $this->_getHelper()->log("Order #{$order->getId()} is waiting payment."); + $this->_getHelper()->log("Order #{$order->getId()} is waiting for payment."); - if ($response->isAcceptedPayment()) { + if ($this->_isPaymentSuccessfullyProcessed($response)) { $this->_getHelper()->log( "Payment for order #{$order->getId()} has been confirmed by client return ! " . " This means the notification URL did not work.", @@ -182,10 +183,10 @@ public function doPaymentReturn($controller) 'payzen_to_validate' /* payment will be done after manual validation */ ); - if ($response->isAcceptedPayment() && in_array($order->getStatus(), $successStatuses)) { + if ($this->_isPaymentSuccessfullyProcessed($response) && in_array($order->getStatus(), $successStatuses)) { $this->_getHelper()->log("Order #{$order->getId()} is confirmed."); $controller->redirectResponse($order, true /* is success ? */); - } elseif ($order->isCanceled() && ! $response->isAcceptedPayment()) { + } elseif ($order->isCanceled() && ! $this->_isPaymentSuccessfullyProcessed($response)) { $this->_getHelper()->log("Order #{$order->getId()} cancelation is confirmed."); $controller->redirectResponse($order, false /* is success ? */); } else { @@ -231,9 +232,9 @@ public function doPaymentCheck($controller) "{$ip} tries to access payzen/payment/check page without valid signature with parameters: " . print_r($post, true), Zend_Log::ERR ); -// $this->_getHelper()->log( -// 'Signature algorithm selected in module settings must be the same as one selected in PayZen Back Office.' -// ); + $this->_getHelper()->log( + 'Signature algorithm selected in module settings must be the same as one selected in PayZen Back Office.' + ); $controller->getResponse()->setBody($response->getOutputForPlatform('auth_fail')); return; @@ -244,9 +245,9 @@ public function doPaymentCheck($controller) $reviewStatuses = array('payment_review', 'payzen_to_validate', 'fraud'); if ($order->getStatus() == 'pending_payment' || in_array($order->getStatus(), $reviewStatuses)) { // order waiting for payment - $this->_getHelper()->log("Order #{$order->getId()} is waiting payment."); + $this->_getHelper()->log("Order #{$order->getId()} is waiting for payment."); - if ($response->isAcceptedPayment()) { + if ($this->_isPaymentSuccessfullyProcessed($response)) { $this->_getHelper()->log( "Payment for order #{$order->getId()} has been confirmed by notification URL." ); @@ -282,7 +283,7 @@ public function doPaymentCheck($controller) 'complete' /* case of virtual orders */ ); - if ($response->isAcceptedPayment() && in_array($order->getStatus(), $successStatuses)) { + if ($this->_isPaymentSuccessfullyProcessed($response) && in_array($order->getStatus(), $successStatuses)) { $this->_getHelper()->log("Order #{$order->getId()} is confirmed."); if ($response->get('operation_type') == 'CREDIT') { @@ -320,7 +321,7 @@ public function doPaymentCheck($controller) 'Amount' => $amountDetail, 'Transaction ID' => $transactionId, 'Transaction Status' => $response->getTransStatus(), - 'Payment Mean' => $response->get('card_brand'), + 'Means of Payment' => $response->get('card_brand'), 'Credit Card Number' => $response->get('card_number'), 'Expiration Date' => $expiry ); @@ -336,7 +337,7 @@ public function doPaymentCheck($controller) $order->save(); $controller->getResponse()->setBody($response->getOutputForPlatform('payment_ok_already_done')); - } elseif ($order->isCanceled() && ! $response->isAcceptedPayment()) { + } elseif ($order->isCanceled() && ! $this->_isPaymentSuccessfullyProcessed($response)) { $this->_getHelper()->log("Order #{$order->getId()} cancelation is confirmed."); $controller->getResponse()->setBody($response->getOutputForPlatform('payment_ko_already_done')); } else { @@ -350,6 +351,16 @@ public function doPaymentCheck($controller) } } + private function _isPaymentSuccessfullyProcessed(Lyra_Payzen_Model_Api_Response $response) + { + if ($response->isAcceptedPayment()) { + return true; + } + + return ! $response->getTransStatus() && $response->get('identifier') && + in_array($response->get('identifier_status'), array('CREATED', 'UPDATED')); + } + /** * Update order status and eventually create invoice. * @@ -377,7 +388,7 @@ protected function _registerOrder(Mage_Sales_Model_Order $order, Lyra_Payzen_Mod $order->setHoldBeforeStatus($stateObject->getBeforeStatus()); } - // save platform responses + // save gateway responses $this->updatePaymentInfo($order, $response); // try to save PayZen identifier if any @@ -391,7 +402,7 @@ protected function _registerOrder(Mage_Sales_Model_Order $order, Lyra_Payzen_Mod $sendEmail = true; if ($info = $response->get('order_info')) { - $sendEmail = (bool)substr($info, strlen('send_confirmation=')); + $sendEmail = (bool) substr($info, strlen('send_confirmation=')); } if ($sendEmail) { @@ -415,6 +426,11 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) ->setAdditionalInformation(self::ALL_RESULTS, serialize($response->getAllResults())) ->setAdditionalInformation(self::TRANS_UUID, $response->get('trans_uuid')); + if ($response->isCancelledPayment()) { + // no more data to save + return; + } + if ($response->get('brand_management')) { $brandInfo = Mage::helper('core')->jsonDecode($response->get('brand_management'), Zend_Json::TYPE_OBJECT); @@ -422,11 +438,6 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) $order->getPayment()->setAdditionalInformation(self::BRAND_USER_CHOICE, $userChoice); } - if ($response->isCancelledPayment()) { - // no more data to save - return; - } - // save risk control result if any $riskControl = $response->getRiskControl(); if (! empty($riskControl)) { @@ -469,17 +480,18 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) 'Extra Transaction ID' => property_exists($trs, 'ext_trans_id') && isset($trs->{'ext_trans_id'}) ? $trs->{'ext_trans_id'} : '', 'Transaction Status' => $trs->{'trans_status'}, - 'Payment Mean' => $trs->{'card_brand'}, + 'Means of Payment' => $trs->{'card_brand'}, 'Credit Card Number' => $trs->{'card_number'}, 'Expiration Date' => $expiry ); $transactionType = $this->convertTxnType($trs->{'trans_status'}); - - $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + if ($transactionType) { + $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + } } } else { - // 3-DS authentication result + // 3DS authentication result $threedsCavv = ''; if ($response->get('threeds_status') === 'Y') { $threedsCavv = $response->get('threeds_cavv'); @@ -508,7 +520,7 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) $option = @unserialize($order->getPayment()->getAdditionalData()); // get choosen payment option if any if ($response->get('sequence_number') == 1 && (stripos($order->getPayment()->getMethod(), 'payzen_multi') === 0) && is_array($option) && ! empty($option)) { - + // first payment of payment in installments if (isset($option['first']) && $option['first']) { $firstAmount = round($totalAmount * $option['first'] / 100); } else { @@ -518,7 +530,7 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) // double cast to avoid rounding $installmentAmount = (int) (string) (($totalAmount - $firstAmount) / ((int) $option['count'] - 1)); - for ($i = 1; $i <= (int)$option['count']; $i++) { + for ($i = 1; $i <= (int) $option['count']; $i++) { $transactionId = $response->get('trans_id') . '-' . $i; $delay = (int) $option['period'] * ($i - 1); @@ -563,13 +575,15 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) 'Transaction ID' => $transactionId, 'Transaction Status' => ($i == 1) ? $response->getTransStatus() : $this->getNextInstallmentsTransStatus($response->getTransStatus()), - 'Payment Mean' => $response->get('card_brand'), + 'Means of Payment' => $response->get('card_brand'), 'Credit Card Number' => $response->get('card_number'), 'Expiration Date' => $expiry, - '3-DS Authentication' => $threedsCavv + '3DS Authentication' => $threedsCavv ); - $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + if ($transactionType) { + $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + } } } else { // save transaction details to sales_payment_transaction @@ -598,13 +612,15 @@ public function updatePaymentInfo(Mage_Sales_Model_Order $order, $response) 'Presentation Date' => Mage::helper('core')->formatDate(date('Y-m-d', $firstDate)), 'Transaction ID' => $transactionId, 'Transaction Status' => $response->getTransStatus(), - 'Payment Mean' => $response->get('card_brand'), + 'Means of Payment' => $response->get('card_brand'), 'Credit Card Number' => $response->get('card_number'), 'Expiration Date' => $expiry, - '3-DS Authentication' => $threedsCavv + '3DS Authentication' => $threedsCavv ); - $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + if ($transactionType) { + $this->addTransaction($order->getPayment(), $transactionType, $transactionId, $additionalInfo); + } } } @@ -627,27 +643,35 @@ protected function _saveIdentifier(Mage_Sales_Model_Order $order, Lyra_Payzen_Mo $this->_getHelper()->log( "Identifier for customer #{$customer->getId()} successfully " - . "created or updated on payment platform. Let's save it to customer entity." + . "created or updated on payment gateway. Let's save it to customer entity." ); $customer->setData('payzen_identifier', $response->get('identifier')); // mask all card digits unless the last 4 ones $number = $response->get('card_number'); - $part1 = substr($number, 0, strpos($number, 'X')); - $part2 = substr($number, strpos($number, 'X')); - - $maskedCard = str_repeat('X', strlen($part1)) . $part2; - - if ($response->get('expiry_month') && $response->get('expiry_year')) { - // format card expiration data - $maskedCard .= ' '; - $maskedCard .= str_pad($response->get('expiry_month'), 2, '0', STR_PAD_LEFT); - $maskedCard .= '/'; - $maskedCard .= $response->get('expiry_year'); + $masked = ''; + + $matches = array(); + if (preg_match('#^([A-Z]{2}[0-9]{2}[A-Z0-9]{10,30})(_[A-Z0-9]{8,11})?$#i', $number, $matches)) { + // IBAN(_BIC) + $masked .= isset($matches[2]) ? str_replace('_', '', $matches[2]) . ' / ' : ''; // BIC + + $iban = $matches[1]; + $masked .= substr($iban, 0, 4) . str_repeat('X', strlen($iban) - 8) . substr($iban, -4); + } elseif (strlen($number) > 4) { + $masked = str_repeat('X', strlen($number) - 4) . substr($number, -4); + + if ($response->get('expiry_month') && $response->get('expiry_year')) { + // format card expiration data + $masked .= ' '; + $masked .= str_pad($response->get('expiry_month'), 2, '0', STR_PAD_LEFT); + $masked .= ' / '; + $masked .= $response->get('expiry_year'); + } } - $customer->setData('payzen_masked_card', $maskedCard); + $customer->setData('payzen_masked_card', $masked); $customer->save(); @@ -662,7 +686,7 @@ public function createInvoice(Mage_Sales_Model_Order $order) // flag that is true if automatically create invoice $autoCapture = $this->_getHelper()->getCommonConfigData('capture_auto', $order->getStore()->getId()); - if (! $autoCapture || $order->getStatus() != 'processing' || ! $order->canInvoice()) { + if (! $autoCapture || ($order->getState() != 'processing') || ! $order->canInvoice()) { // creating invoice not allowed return; } @@ -693,7 +717,7 @@ protected function _cancelOrder(Mage_Sales_Model_Order $order, Lyra_Payzen_Model $order->registerCancellation($response->getMessage()); - // save platform responses + // save gateway responses $this->updatePaymentInfo($order, $response); $order->save(); @@ -746,7 +770,7 @@ public function addTransaction($payment, $type, $transactionId, $additionalInfo, ->isFailsafe(true); if ($payment->hasIsTransactionClosed()) { - $transaction->setIsClosed((int)$payment->getIsTransactionClosed()); + $transaction->setIsClosed((int) $payment->getIsTransactionClosed()); } //set transaction addition information @@ -795,10 +819,15 @@ public function nextOrderState($response, $order, $ignoreFraud = false) $newStatus = 'payment_review'; $newState = $this->_getHelper()->getReviewState(); } else { - $newStatus = $this->_getHelper()->getCommonConfigData( - 'registered_order_status', - $order->getStore()->getId() - ); + if ($this->isSofort($response) || $this->isSepa($response)) { + // pending funds transfer order state + $newStatus = 'payzen_pending_transfer'; + } else { + $newStatus = $this->_getHelper()->getCommonConfigData( + 'registered_order_status', + $order->getStore()->getId() + ); + } $processingStatuses = Mage::getModel('sales/order_config') ->getStateStatuses(Mage_Sales_Model_Order::STATE_PROCESSING, false); @@ -827,6 +856,16 @@ public function nextOrderState($response, $order, $ignoreFraud = false) return $stateObject; } + public function isSofort($response) + { + return $response->get('card_brand') == 'SOFORT_BANKING'; + } + + public function isSepa($response) + { + return $response->get('card_brand') == 'SDD'; + } + /** * Convert PayZen transaction statuses to magento transaction statuses * @@ -861,7 +900,7 @@ public function convertTxnType($payzenType) break; default: - $type = ''; // unknown + $type = null; // unknown break; } diff --git a/app/code/community/Lyra/Payzen/Helper/Util.php b/app/code/community/Lyra/Payzen/Helper/Util.php index dd200d0b..7969397d 100644 --- a/app/code/community/Lyra/Payzen/Helper/Util.php +++ b/app/code/community/Lyra/Payzen/Helper/Util.php @@ -1,6 +1,6 @@ array( + 'name' => "#^[A-ZÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '-]{1,63}$#ui", + 'street' => "#^[A-Z0-9ÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '.,-]{1,127}$#ui", + 'zip' => '#^[0-9]{5}$#', + 'city' => "#^[A-Z0-9ÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '-]{1,127}$#ui", + 'country' => '#^FR|GP|MQ|GF|RE|YT$#i', + 'phone' => '#^[0-9]{10}$#' + ), + 'fullcb' => array( + 'name' => "#^[A-Za-z0-9àâçèéêîôùû]+([ \-']?[A-Za-z0-9àâçèéêîôùû]+)*$#", + 'street' => '#^[^;]*$#', + 'zip' => '#^[0-9]{5}$#', + 'city' => '#^[^;]*$#', + 'country' => '#^FR$#', + 'phone' => '#^(0|33)[0-9]{9}$#' + ) + ); + /** * Normalize shipping method name. * @@ -250,7 +269,7 @@ public function setCartData($order, &$payzenRequest) } $priceInCents = $currency->convertAmountToInteger($item->getPrice()); - $qty = (int)$item->getQtyOrdered(); + $qty = (int) $item->getQtyOrdered(); $payzenRequest->addProduct( preg_replace($notAllowed, ' ', $label), @@ -385,21 +404,21 @@ public function setAdditionalShippingData($order, &$payzenRequest, $useOney = fa } } - public function checkAddressValidity($address) + public function checkAddressValidity($address, $payment) { if (! $address) { return; } - // oney validation regular expressions - $nameRegex = "#^[A-ZÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '-]{1,63}$#ui"; - $phoneRegex = "#^[0-9]{10}$#"; - $cityRegex = "#^[A-Z0-9ÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '-]{1,127}$#ui"; - $streetRegex = "#^[A-Z0-9ÁÀÂÄÉÈÊËÍÌÎÏÓÒÔÖÚÙÛÜÇ/ '.,-]{1,127}$#ui"; + $regex = self::$address_regex[$payment]; - $availableCountries = Mage::getModel('payzen/source_oney_availableCountries')->getCountryCodes(); - $countryRegex = "#^" . implode('|', $availableCountries) . "$#i"; - $zipRegex = "#^[0-9]{5}$#"; + // specific validation regular expressions + $nameRegex = $regex['name']; + $phoneRegex = $regex['phone']; + $cityRegex = $regex['city']; + $streetRegex = $regex['street']; + $countryRegex = $regex['country']; + $zipRegex = $regex['zip']; // error messages $invalidMsg = 'The field %s of your %s is invalid.'; diff --git a/app/code/community/Lyra/Payzen/Model/Api/Api.php b/app/code/community/Lyra/Payzen/Model/Api/Api.php index c5e338c5..dba84502 100644 --- a/app/code/community/Lyra/Payzen/Model/Api/Api.php +++ b/app/code/community/Lyra/Payzen/Model/Api/Api.php @@ -1,6 +1,6 @@ 'PostFinance mode E-finance', 'RUPAY' => 'RuPay', 'SCT' => 'Virement SEPA', 'SDD' => 'Prélèvement SEPA', 'SOFORT_BANKING' => 'Sofort', 'TRUFFAUT_CDX' => 'Carte cadeau Truffaut', 'VILLAVERDE' => 'Carte cadeau Villaverde', - 'VILLAVERDE_SB' => 'Carte cadeau Villaverde - SandBox' + 'VILLAVERDE_SB' => 'Carte cadeau Villaverde - SandBox', 'ECCARD' => 'EC Card' ); } diff --git a/app/code/community/Lyra/Payzen/Model/Api/Currency.php b/app/code/community/Lyra/Payzen/Model/Api/Currency.php index a269b053..73804235 100644 --- a/app/code/community/Lyra/Payzen/Model/Api/Currency.php +++ b/app/code/community/Lyra/Payzen/Model/Api/Currency.php @@ -1,6 +1,6 @@ get('nb_products') ? $this->get('nb_products') : 0; $ok = true; @@ -454,6 +455,7 @@ public function addProduct($label, $amount, $qty, $ref, $type) $ok &= $this->addField('vads_product_qty' . $index, 'Product quantity', '#^[1-9]\d*$#u', false, 255, $qty); $ok &= $this->addField('vads_product_ref' . $index, 'Product reference', '#^[A-Za-z0-9]{0,64}$#u', false, 64, $ref); $ok &= $this->addField('vads_product_type' . $index, 'Product type', '#^' . implode('|', self::$ACCORD_CATEGORIES) . '$#u', false, 30, $type); + $ok &= $this->addField('vads_product_vat' . $index, 'Product tax rate', '#^((\d{1,12})|(\d{1,2}\.\d{1,4}))$#u', false, 12, $vat); // increment the number of products $ok &= $this->set('nb_products', $index + 1); diff --git a/app/code/community/Lyra/Payzen/Model/Api/Response.php b/app/code/community/Lyra/Payzen/Model/Api/Response.php index ed130eb5..2c1ef699 100644 --- a/app/code/community/Lyra/Payzen/Model/Api/Response.php +++ b/app/code/community/Lyra/Payzen/Model/Api/Response.php @@ -1,6 +1,6 @@ array(true, 'Paiement valide traité'), - 'payment_ko' => array(true, 'Paiement invalide traité'), - 'payment_ok_already_done' => array(true, 'Paiement valide traité, déjà enregistré'), - 'payment_ko_already_done' => array(true, 'Paiement invalide traité, déjà enregistré'), - 'order_not_found' => array(false, 'Impossible de retrouver la commande'), - 'payment_ko_on_order_ok' => array(false, 'Code paiement invalide reçu pour une commande déjà validée'), - 'auth_fail' => array(false, 'Echec d\'authentification'), - 'empty_cart' => array(false, 'Le panier a été vidé avant la redirection'), - 'unknown_status' => array(false, 'Statut de commande inconnu'), - 'amount_error' => array(false, 'Le montant payé est différent du montant intial'), + 'payment_ok' => array(true, 'Accepted payment, order has been updated.'), + 'payment_ko' => array(true, 'Payment failure, order has been cancelled.'), + 'payment_ko_bis' => array(true, 'Payment failure.'), + 'payment_ok_already_done' => array(true, 'Accepted payment, already registered.'), + 'payment_ko_already_done' => array(true, 'Payment failure, already registered.'), + 'order_not_found' => array(false, 'Order not found.'), + 'payment_ko_on_order_ok' => array(false, 'Order status does not match the payment result.'), + 'auth_fail' => array(false, 'An error occurred while computing the signature.'), + 'empty_cart' => array(false, 'Empty cart detected before order processing.'), + 'unknown_status' => array(false, 'Unknown order status.'), + 'amount_error' => array(false, 'Total paid is different from order amount.'), 'ok' => array(true, ''), 'ko' => array(false, '') ); @@ -452,7 +453,6 @@ public function getOutputForPlatform($case = '', $extra_message = '', $original_ } $content = $success ? 'OK-' : 'KO-'; - $content .= $this->get('trans_id'); $content .= "$message\n"; $response = ''; diff --git a/app/code/community/Lyra/Payzen/Model/Api/Ws/AuthenticationRequestData.php b/app/code/community/Lyra/Payzen/Model/Api/Ws/AuthenticationRequestData.php index 877af655..300a39c9 100644 --- a/app/code/community/Lyra/Payzen/Model/Api/Ws/AuthenticationRequestData.php +++ b/app/code/community/Lyra/Payzen/Model/Api/Ws/AuthenticationRequestData.php @@ -1,6 +1,6 @@ __((string)$this->getFieldConfig()->label); - $column = Mage::helper('payzen')->__((string)$column); + $field = Mage::helper('payzen')->__((string) $this->getFieldConfig()->label); + $column = Mage::helper('payzen')->__((string) $column); $group = Mage::helper('payzen')->getConfigGroupTitle($this->getGroupId()); // main message diff --git a/app/code/community/Lyra/Payzen/Model/Field/AvailableLanguages.php b/app/code/community/Lyra/Payzen/Model/Field/AvailableLanguages.php index 99630360..284be870 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/AvailableLanguages.php +++ b/app/code/community/Lyra/Payzen/Model/Field/AvailableLanguages.php @@ -1,6 +1,6 @@ getAnyStoreView(); // either default or any other store view - - $checkUrl = Mage::helper('payzen')->prepareUrl($this->getValue(), $store->getId()); - $this->setValue($checkUrl); - - parent::_afterLoad(); - return $this; - } -} diff --git a/app/code/community/Lyra/Payzen/Model/Field/Choozeo/CustgroupOptions.php b/app/code/community/Lyra/Payzen/Model/Field/Choozeo/CustgroupOptions.php index 98db5fe0..6d428935 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Choozeo/CustgroupOptions.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Choozeo/CustgroupOptions.php @@ -1,6 +1,6 @@ getValue(); $data = $this->getGroups('payzen_choozeo'); // get data of FacilyPay Oney config group - if ($data['fields']['active']['value']) { // FacilyPay Oney is activated + if ($data['fields']['choozeo_active']['value']) { // FacilyPay Oney is activated foreach ($values as $key => $value) { if (empty($value) || ($value['code'] !== 'all')) { continue; diff --git a/app/code/community/Lyra/Payzen/Model/Field/Choozeo/PaymentOptions.php b/app/code/community/Lyra/Payzen/Model/Field/Choozeo/PaymentOptions.php index 1c89ddf3..a1624bc6 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Choozeo/PaymentOptions.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Choozeo/PaymentOptions.php @@ -1,6 +1,6 @@ getValue(); + + $data = $this->getGroups('payzen_fullcb'); // get data of FullCB config group + if ($data['fields']['fullcb_active']['value']) { // FullCB is activated + foreach ($values as $key => $value) { + if (empty($value) || ($value['code'] !== 'all')) { + continue; + } + + if (empty($value['amount_min'])) { + $field = 'Minimum amount'; + } elseif (empty($value['amount_max'])) { + $field = 'Maximum amount'; + } + + if (isset($field)) { + $field = Mage::helper('payzen')->__($field); // translate field name + $group = Mage::helper('payzen')->getConfigGroupTitle($this->getGroupId()); + $msg = Mage::helper('payzen')->__('Please enter a value for «ALL GROUPS - %s» in «%s» section as agreed with your bank.', $field, $group); + + // throw exception + Mage::throwException($msg); + } + } + } + + return parent::_beforeSave(); + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Field/Fullcb/PaymentOptions.php b/app/code/community/Lyra/Payzen/Model/Field/Fullcb/PaymentOptions.php new file mode 100644 index 00000000..04a4ac4a --- /dev/null +++ b/app/code/community/Lyra/Payzen/Model/Field/Fullcb/PaymentOptions.php @@ -0,0 +1,58 @@ +getValue(); + + if (! is_array($values) || empty($values)) { + $this->setValue(array()); + } else { + $i = 0; + foreach ($values as $key => $value) { + $i++; + + if (empty($value)) { + continue; + } + + if (empty($value['label'])) { + $this->_throwError('Label', $i); + } + if (! empty($value['amount_min']) && (! is_numeric($value['amount_min']) || $value['amount_min'] < 0)) { + $this->_throwError('Minimum amount', $i); + } + if (! empty($value['amount_max']) && (! is_numeric($value['amount_max']) || $value['amount_max'] < 0)) { + $this->_throwError('Maximum amount', $i); + } + if (! is_numeric($value['rate']) || $value['rate'] > 100 || $value['rate'] < 0) { + $this->_throwError('Rate', $i); + } + if (! is_numeric($value['cap']) || $value['cap'] < 0) { + $this->_throwError('Cap', $i); + } + } + } + + return parent::_beforeSave(); + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Field/Gift/AddedCards.php b/app/code/community/Lyra/Payzen/Model/Field/Gift/AddedCards.php index 9395e891..a6d53a12 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Gift/AddedCards.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Gift/AddedCards.php @@ -1,6 +1,6 @@ fileExists($uploadDir . strtolower($card['code'] . '.png'))) { $cards[$key]['logo'] = strtolower($card['code'] . '.png'); } diff --git a/app/code/community/Lyra/Payzen/Model/Field/Logo.php b/app/code/community/Lyra/Payzen/Model/Field/Logo.php index e4173c3a..3d517d27 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Logo.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Logo.php @@ -1,6 +1,6 @@ message)) { Mage::throwException( - $this->message . "\n" . Mage::helper('payzen')->__('FacilyPay Oney payment mean cannot be used.') + $this->message . "\n" . Mage::helper('payzen')->__('FacilyPay Oney means of payment cannot be used.') ); } diff --git a/app/code/community/Lyra/Payzen/Model/Field/Oney/CustgroupOptions.php b/app/code/community/Lyra/Payzen/Model/Field/Oney/CustgroupOptions.php index 65a1a03c..0841335c 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Oney/CustgroupOptions.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Oney/CustgroupOptions.php @@ -1,6 +1,6 @@ getValue(); $data = $this->getGroups('payzen_oney'); // get data of FacilyPay Oney config group - if ($data['fields']['active']['value']) { // FacilyPay Oney is activated + if ($data['fields']['oney_active']['value']) { // FacilyPay Oney is activated foreach ($values as $key => $value) { if (empty($value) || ($value['code'] !== 'all')) { continue; diff --git a/app/code/community/Lyra/Payzen/Model/Field/Oney/PaymentOptions.php b/app/code/community/Lyra/Payzen/Model/Field/Oney/PaymentOptions.php index 138dc1c1..e8c752f5 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Oney/PaymentOptions.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Oney/PaymentOptions.php @@ -1,6 +1,6 @@ getValue())) > 127) { - $field = Mage::helper('payzen')->__((string)$this->getFieldConfig()->label); + $field = Mage::helper('payzen')->__((string) $this->getFieldConfig()->label); $group = Mage::helper('payzen')->getConfigGroupTitle($this->getGroupId()); $msg = sprintf(Mage::helper('payzen')->__('Invalid value for field «%s» in section «%s».'), $field, $group); diff --git a/app/code/community/Lyra/Payzen/Model/Field/ShipOptions.php b/app/code/community/Lyra/Payzen/Model/Field/ShipOptions.php index 45224257..81002ad6 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/ShipOptions.php +++ b/app/code/community/Lyra/Payzen/Model/Field/ShipOptions.php @@ -1,6 +1,6 @@ getValue(); if (! empty($value) && ! preg_match('|^https?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $value)) { - $field = Mage::helper('payzen')->__((string)$this->getFieldConfig()->label); + $field = Mage::helper('payzen')->__((string) $this->getFieldConfig()->label); $group = Mage::helper('payzen')->getConfigGroupTitle($this->getGroupId()); $msg = sprintf(Mage::helper('payzen')->__("Invalid value for field «%s» in section «%s»."), $field, $group); diff --git a/app/code/community/Lyra/Payzen/Model/Field/Standard/CardInfoModes.php b/app/code/community/Lyra/Payzen/Model/Field/Standard/CardInfoModes.php index 3172f57d..7af0210b 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Standard/CardInfoModes.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Standard/CardInfoModes.php @@ -1,6 +1,6 @@ error) { - Mage::throwException(Mage::helper('payzen')->__('The card data entry on merchant site cannot be used without enabling SSL.')); + Mage::throwException(Mage::helper('payzen')->__('The bank data acquisition on merchant site cannot be used without enabling SSL.')); } return parent::afterCommitCallback(); diff --git a/app/code/community/Lyra/Payzen/Model/Field/Standard/UseOney.php b/app/code/community/Lyra/Payzen/Model/Field/Standard/UseOney.php index 63744637..77f97995 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/Standard/UseOney.php +++ b/app/code/community/Lyra/Payzen/Model/Field/Standard/UseOney.php @@ -1,6 +1,6 @@ message = ''; - if ($this->getValue() /* propose FacilyPay Oney in standard payment enabled */) { + if ($this->getValue() /* propose FacilyPay Oney in one-time payment enabled */) { $data = $this->getGroups('payzen_oney'); // get data of FacilyPay Oney config group - $oneyActive = isset($data['fields']['active']['value']) && $data['fields']['active']['value']; + $oneyActive = isset($data['fields']['oney_active']['value']) && $data['fields']['oney_active']['value']; if ($oneyActive) { $this->setValue(0); @@ -48,7 +48,7 @@ public function save() public function afterCommitCallback() { if (! empty($this->message)) { - Mage::throwException($this->message . "\n" . Mage::helper('payzen')->__('FacilyPay Oney payment mean cannot be used.')); + Mage::throwException($this->message . "\n" . Mage::helper('payzen')->__('FacilyPay Oney means of payment cannot be used.')); } return parent::afterCommitCallback(); diff --git a/app/code/community/Lyra/Payzen/Model/Field/ThemeConfig.php b/app/code/community/Lyra/Payzen/Model/Field/ThemeConfig.php index 024b503b..47a61293 100644 --- a/app/code/community/Lyra/Payzen/Model/Field/ThemeConfig.php +++ b/app/code/community/Lyra/Payzen/Model/Field/ThemeConfig.php @@ -1,6 +1,6 @@ getValue(); if (! empty($value) && ! preg_match('#^[^;=]+=[^;=]*(;[^;=]+=[^;=]*)*;?$#', $value)) { - $field = Mage::helper('payzen')->__((string)$this->getFieldConfig()->label); + $field = Mage::helper('payzen')->__((string) $this->getFieldConfig()->label); $group = Mage::helper('payzen')->getConfigGroupTitle($this->getGroupId()); $msg = sprintf(Mage::helper('payzen')->__("Invalid value for field «%s» in section «%s»."), $field, $group); diff --git a/app/code/community/Lyra/Payzen/Model/Field/Translatable.php b/app/code/community/Lyra/Payzen/Model/Field/Translatable.php new file mode 100644 index 00000000..f51c215b --- /dev/null +++ b/app/code/community/Lyra/Payzen/Model/Field/Translatable.php @@ -0,0 +1,48 @@ +getValue(); + $default = (string) Mage::getConfig()->getNode('default/' . $this->getPath()); + if ($value && ($value === $default)) { + $translator = Mage::getSingleton('core/translate'); + $locale = $translator->getLocale(); + + // force default view locale + $viewLocale = Mage::getStoreConfig('general/locale/code', 0); + $translator->setLocale($viewLocale)->init('frontend', true); + + $this->setValue(Mage::helper('payzen')->__($value)); + + // restore initial locale + $translator->setLocale($locale)->init('adminhtml', true); + } + + return $this; + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Observer.php b/app/code/community/Lyra/Payzen/Model/Observer.php index e3dff01a..efce9c35 100644 --- a/app/code/community/Lyra/Payzen/Model/Observer.php +++ b/app/code/community/Lyra/Payzen/Model/Observer.php @@ -1,6 +1,6 @@ getRequest()->getPost('order')) { - $flag = isset($data['send_confirmation']) ? (bool)$data['send_confirmation'] : false; + $flag = isset($data['send_confirmation']) ? (bool) $data['send_confirmation'] : false; } $session = Mage::getSingleton('adminhtml/session_quote'); @@ -246,7 +246,7 @@ public function doOneclickQuoteProcess($observer) } } elseif ($block->getNameInLayout() == 'alert.urls') { if (($product = Mage::registry('product')) && $product->getId()) { - $this->_oneclickQuoteProcess($block->getProduct()); + $this->_oneclickQuoteProcess($product); } } } @@ -331,7 +331,7 @@ public function doPaymentButtonsManage($observer) if ($order && $order->getPayment() && stripos($order->getPayment()->getMethod(), 'payzen_') === 0) { switch ($order->getStatus()) { case 'payzen_to_validate': - $message = $this->_getHelper()->__('Are you sure you want to validate this order in PayZen platform ?'); + $message = $this->_getHelper()->__('Are you sure you want to validate this order in PayZen gateway ?'); $block->addButton('payzen_validate_payment', array( 'label' => $this->_getHelper()->__('Validate payment'), diff --git a/app/code/community/Lyra/Payzen/Model/Order.php b/app/code/community/Lyra/Payzen/Model/Order.php index e8e7617a..f48b5477 100644 --- a/app/code/community/Lyra/Payzen/Model/Order.php +++ b/app/code/community/Lyra/Payzen/Model/Order.php @@ -1,6 +1,6 @@ _payzenRequest->set('amount', $currency->convertAmountToInteger($amount)); - $this->_payzenRequest->set('contrib', 'Magento1.4-1.9_1.8.0/' . Mage::getVersion() . '/' . PHP_VERSION); + $this->_payzenRequest->set('contrib', 'Magento1.4-1.9_1.9.0/' . Mage::getVersion() . '/' . PHP_VERSION); // set config parameters $configFields = array('site_id', 'key_test', 'key_prod', 'ctx_mode', 'capture_delay', 'validation_mode', @@ -115,7 +115,7 @@ public function getFormFields($order) // activate 3ds ? $threedsMpi = null; - $configOptions = unserialize($this->getConfigData('custgroup_threeds_min_amount')); + $configOptions = unserialize($this->_getHelper()->getCommonConfigData('custgroup_threeds_min_amount')); if (is_array($configOptions) && ! empty($configOptions)) { $group = $order->getCustomerGroupId(); @@ -144,10 +144,11 @@ public function getFormFields($order) $threedsMinAmount = $allThreedsMinAmount; } - if ($threedsMinAmount && $order->getTotalDue() < $threedsMinAmount) { + if ($threedsMinAmount && ($order->getTotalDue() < $threedsMinAmount)) { $threedsMpi = '2'; } } + $this->_payzenRequest->set('threeds_mpi', $threedsMpi); $this->_payzenRequest->set('cust_email', $order->getCustomerEmail()); @@ -221,7 +222,7 @@ public function getConfigData($field, $storeId = null) } /** - * Return the payment platform URL. + * Return the payment gateway URL. * * @return string */ @@ -454,7 +455,8 @@ public function denyPayment(Mage_Payment_Model_Info $payment) // new transaction status $additionalInfo['Transaction Status'] = 'CANCELLED'; - $this->_getPaymentHelper()->addTransaction($payment, Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID, $transactionId, $additionalInfo); + $transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID; + $this->_getPaymentHelper()->addTransaction($payment, $transactionType, $transactionId, $additionalInfo); return true; // let Magento cancel order } catch(Lyra_Payzen_Model_WsException $e) { @@ -626,8 +628,8 @@ public function validate() $shippingAddress = $info->getQuote()->isVirtual() ? null : $info->getQuote()->getShippingAddress(); } - Mage::helper('payzen/util')->checkAddressValidity($billingAddress); - Mage::helper('payzen/util')->checkAddressValidity($shippingAddress); + Mage::helper('payzen/util')->checkAddressValidity($billingAddress, 'oney'); + Mage::helper('payzen/util')->checkAddressValidity($shippingAddress, 'oney'); return $this; } else { @@ -1004,7 +1006,7 @@ protected function createRefundTransaction($payment, $commonResponse, $paymentRe 'Amount' => $amountDetail, 'Transaction ID' => $transactionId, 'Transaction Status' => $commonResponse->getTransactionStatusLabel(), - 'Payment Mean' => $cardResponse->getBrand(), + 'Means of Payment' => $cardResponse->getBrand(), 'Credit Card Number' => $cardResponse->getNumber(), 'Expiration Date' => $expiry ); diff --git a/app/code/community/Lyra/Payzen/Model/Payment/Choozeo.php b/app/code/community/Lyra/Payzen/Model/Payment/Choozeo.php index 5e0d7e9f..e553f25c 100644 --- a/app/code/community/Lyra/Payzen/Model/Payment/Choozeo.php +++ b/app/code/community/Lyra/Payzen/Model/Payment/Choozeo.php @@ -1,6 +1,6 @@ _payzenRequest->set('cust_status', 'PRIVATE'); + $this->_payzenRequest->set('validation_mode', '0'); + $this->_payzenRequest->set('capture_delay', '0'); + + // override with selected FullCB payment card + $info = $this->getInfoInstance(); + + // set choosen option if any + if ($info->getAdditionalData() && ($option = @unserialize($info->getAdditionalData()))) { + $this->_payzenRequest->set('payment_cards', $option['code']); + } else { + $this->_payzenRequest->set('payment_cards', 'FULLCB3X;FULLCB4X'); + } + } + + /** + * Assign data to info model instance + * + * @param mixed $data + * @return Mage_Payment_Model_Info + */ + public function assignData($data) + { + $info = $this->getInfoInstance(); + + $option = $this->_getOption($data->getPayzenFullcbOption()); + + // init all payment data + $info->setAdditionalData($option ? serialize($option) : null) + ->setCcType(null) + ->setCcLast4(null) + ->setCcNumber(null) + ->setCcCid(null) + ->setCcExpMonth(null) + ->setCcExpYear(null); + + return $this; + } + + /** + * Return true if the method can be used at this time + * + * @return bool + */ + public function isAvailable($quote = null) + { + if (! parent::isAvailable($quote)) { + return false; + } + + $amount = $quote ? $quote->getBaseGrandTotal() : null; + if ($amount) { + if ($this->getConfigData('enable_payment_options') == 1) { + $options = $this->getPaymentOptions($amount); + return ! empty($options); + } + } + + return true; + } + + /** + * Get available payment options for the current cart amount. + * @param double $amount a given amount + * @return array[string][array] an array "$code => $option" of available options + */ + public function getPaymentOptions($amount) + { + $configOptions = unserialize($this->getConfigData('payment_options')); + if (! is_array($configOptions) || empty($configOptions)) { + return false; + } + + $availOptions = array(); + foreach ($configOptions as $code => $value) { + if (empty($value)) { + continue; + } + + if ((! $amount || ! $value['amount_min'] || $amount > $value['amount_min']) + && (! $amount || ! $value['amount_max'] || $amount < $value['amount_max'])) { + // option will be available + $availOptions[$code] = $value; + } + } + + return $availOptions; + } + + protected function _getOption($code) + { + $info = $this->getInfoInstance(); + if ($info instanceof Mage_Sales_Model_Order_Payment) { + $amount = $info->getOrder()->getBaseGrandTotal(); + } else { + $amount = $info->getQuote()->getBaseGrandTotal(); + } + + $options = $this->getPaymentOptions($amount); + if ($code && $options[$code]) { + return $options[$code]; + } else { + return false; + } + } + + /** + * Validate payment method information object + * + * @param Mage_Payment_Model_Info $info + * @return Mage_Payment_Model_Abstract + */ + public function validate() + { + $info = $this->getInfoInstance(); + if ($info instanceof Mage_Sales_Model_Order_Payment) { + $billingAddress = $info->getOrder()->getBillingAddress(); + $shippingAddress = $info->getOrder()->getIsVirtual() ? null : $info->getOrder()->getShippingAddress(); + } else { + $billingAddress = $info->getQuote()->getBillingAddress(); + $shippingAddress = $info->getQuote()->isVirtual() ? null : $info->getQuote()->getShippingAddress(); + } + + Mage::helper('payzen/util')->checkAddressValidity($billingAddress, 'fullcb'); + Mage::helper('payzen/util')->checkAddressValidity($shippingAddress, 'fullcb'); + + return $this; + + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Payment/Gift.php b/app/code/community/Lyra/Payzen/Model/Payment/Gift.php index 24ff7de3..dea545e2 100644 --- a/app/code/community/Lyra/Payzen/Model/Payment/Gift.php +++ b/app/code/community/Lyra/Payzen/Model/Payment/Gift.php @@ -1,6 +1,6 @@ getCustomerId() && ! preg_match(Lyra_Payzen_Helper_Util::CUST_ID_REGEX, $quote->getCustomerId())) { // customer id doesn't match FacilyPay Oney rules - $msg = 'Customer ID "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney payment mean cannot be used.'; + $msg = 'Customer ID "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney means of payment cannot be used.'; $this->_getHelper()->log(sprintf($msg, $quote->getCustomerId(), Lyra_Payzen_Helper_Util::CUST_ID_REGEX), Zend_Log::WARN); return false; } @@ -170,7 +170,7 @@ public function isAvailable($quote = null) if (! preg_match(Lyra_Payzen_Helper_Util::ORDER_ID_REGEX, $quote->getReservedOrderId())) { // order id doesn't match FacilyPay Oney rules - $msg = 'The order ID "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney payment mean cannot be used.'; + $msg = 'The order ID "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney means of payment cannot be used.'; $this->_getHelper()->log(sprintf($msg, $quote->getReservedOrderId(), Lyra_Payzen_Helper_Util::ORDER_ID_REGEX), Zend_Log::WARN); return false; } @@ -184,7 +184,7 @@ public function isAvailable($quote = null) if (! preg_match(Lyra_Payzen_Helper_Util::PRODUCT_REF_REGEX, $item->getProductId())) { // product id doesn't match FacilyPay Oney rules - $msg = 'Product reference "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney payment mean cannot be used.'; + $msg = 'Product reference "%s" does not match PayZen specifications. The regular expression for this field is %s. FacilyPay Oney means of payment cannot be used.'; $this->_getHelper()->log(sprintf($msg, $item->getProductId(), Lyra_Payzen_Helper_Util::PRODUCT_REF_REGEX), Zend_Log::WARN); return false; } diff --git a/app/code/community/Lyra/Payzen/Model/Payment/Paypal.php b/app/code/community/Lyra/Payzen/Model/Payment/Paypal.php index 63c279fd..f064a80f 100644 --- a/app/code/community/Lyra/Payzen/Model/Payment/Paypal.php +++ b/app/code/community/Lyra/Payzen/Model/Payment/Paypal.php @@ -1,6 +1,6 @@ _payzenRequest->set('payment_cards', 'SDD'); + $this->_payzenRequest->set('page_action', $this->getConfigData('mandate_mode')); + } + + /** + * Assign data to info model instance. + * + * @param mixed $data + * @return Mage_Payment_Model_Info + */ + public function assignData($data) + { + $info = $this->getInfoInstance(); + + // init all payment data + $info->setCcType(null) + ->setCcLast4(null) + ->setCcNumber(null) + ->setCcCid(null) + ->setCcExpMonth(null) + ->setCcExpYear(null) + ->setAdditionalData(null); + + return $this; + } + + public function canUseForCountry($country) + { + $availableCountries = Mage::getModel('payzen/source_sepa_availableCountries')->getCountryCodes(); + + if ($this->getConfigData('allowspecific') == 1) { + $availableCountries = explode(',', $this->getConfigData('specificcountry')); + } + + return in_array($country, $availableCountries); + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Payment/Sofort.php b/app/code/community/Lyra/Payzen/Model/Payment/Sofort.php index 2b53258b..ef48437d 100644 --- a/app/code/community/Lyra/Payzen/Model/Payment/Sofort.php +++ b/app/code/community/Lyra/Payzen/Model/Payment/Sofort.php @@ -1,6 +1,6 @@ _getHelper()->isAdmin() && ($this->isLocalCcType() || $this->isLocalCcInfo())) { // set payment_cards $this->_payzenRequest->set('payment_cards', $info->getCcType()); + + if ($info->getCcType() === 'BANCONTACT') { + // may not disable 3-DS for Bancontact Mistercash + $this->_payzenRequest->set('threeds_mpi', null); + } } else { // payment_cards is given as csv by magento $paymentCards = explode(',', $this->getConfigData('payment_cards')); @@ -41,6 +46,7 @@ protected function _setExtraFields($order) // add FacilyPay Oney payment cards $paymentCards .= ';' . ($testMode ? 'ONEY_SANDBOX' : 'ONEY'); } + $this->_payzenRequest->set('payment_cards', $paymentCards); } @@ -78,7 +84,6 @@ protected function _setExtraFields($order) } else { if ($this->isLocalCcInfo() && $info->getAdditionalData()) { // additional_data is used to stock cc_register flag // customer wants to register card data - if ($customer->getPayzenIdentifier()) { // customer has already an identifier $this->_getHelper()->log('Customer ' . $customer->getEmail() . ' has an identifier and chose to update it with new card info.'); @@ -146,7 +151,8 @@ public function getAvailableCcTypes() $cards = array_diff($cards, array('ONEY_SANDBOX', 'ONEY')); } - if (! $this->_getHelper()->isAdmin() && $this->isLocalCcType() && $this->getConfigData('use_oney_in_standard')) { + if (! $this->_getHelper()->isAdmin() && $this->isLocalCcType() + && $this->getConfigData('use_oney_in_standard')) { $testMode = $this->_getHelper()->getCommonConfigData('ctx_mode') == 'TEST'; $cards[] = $testMode ? 'ONEY_SANDBOX' : 'ONEY'; @@ -158,6 +164,7 @@ public function getAvailableCcTypes() $availCards[$code] = $label; } } + return $availCards; } @@ -197,7 +204,8 @@ public function isIdentifierPayment($customer) $info = $this->getInfoInstance(); // payment by identifier - return $customer->getPayzenIdentifier() && $info->getAdditionalInformation(Lyra_Payzen_Helper_Payment::IDENTIFIER); + return $customer->getPayzenIdentifier() + && $info->getAdditionalInformation(Lyra_Payzen_Helper_Payment::IDENTIFIER); } /** @@ -344,16 +352,22 @@ protected function _doInstantPayment($payment) $captureDelay = $this->getConfigData('capture_delay', $storeId); // get sub-module specific param if (! is_numeric($captureDelay)) { - $captureDelay = $this->_getHelper()->getCommonConfigData('capture_delay', $storeId); // get general param + // get general param + $captureDelay = $this->_getHelper()->getCommonConfigData('capture_delay', $storeId); } + if (is_numeric($captureDelay)) { - $paymentRequest->setExpectedCaptureDate(new DateTime('@' . strtotime("+$captureDelay days", $timestamp))); + $paymentRequest->setExpectedCaptureDate( + new DateTime('@' . strtotime("+$captureDelay days", $timestamp)) + ); } $validationMode = $this->getConfigData('validation_mode', $storeId); // get sub-module specific param if ($validationMode === '-1') { - $validationMode = $this->_getHelper()->getCommonConfigData('validation_mode', $storeId); // get general param + // get general param + $validationMode = $this->_getHelper()->getCommonConfigData('validation_mode', $storeId); } + if ($validationMode !== '') { $paymentRequest->setManualValidation($validationMode); } @@ -383,7 +397,10 @@ protected function _doInstantPayment($payment) $billingDetailsRequest->setLastName($order->getBillingAddress()->getLastname()); $billingDetailsRequest->setPhoneNumber($order->getBillingAddress()->getTelephone()); $billingDetailsRequest->setEmail($order->getCustomerEmail()); - $billingDetailsRequest->setAddress(trim($order->getBillingAddress()->getStreet(1) . ' ' . $order->getBillingAddress()->getStreet(2))); + + $address = $order->getBillingAddress()->getStreet(1) . ' ' . $order->getBillingAddress()->getStreet(2); + $billingDetailsRequest->setAddress(trim($address)); + $billingDetailsRequest->setZipCode($order->getBillingAddress()->getPostcode()); $billingDetailsRequest->setCity($order->getBillingAddress()->getCity()); $billingDetailsRequest->setState($order->getBillingAddress()->getRegion()); @@ -396,6 +413,7 @@ protected function _doInstantPayment($payment) } else { $language = $this->_getHelper()->getCommonConfigData('language', $storeId); } + $billingDetailsRequest->setLanguage($language); // shipping details generation @@ -474,7 +492,7 @@ protected function _doInstantPayment($payment) $stateObject->setStatus($stateObject->getBeforeStatus()); } - // save platform responses + // save gateway responses $this->_getPaymentHelper()->updatePaymentInfo($order, $wrapper); // try to create invoice @@ -482,7 +500,6 @@ protected function _doInstantPayment($payment) $stateObject->setIsNotified(true); return $stateObject; - } catch(Lyra_Payzen_Model_WsException $e) { $this->_getHelper()->log("[$requestId] {$e->getMessage()}", Zend_Log::WARN); @@ -491,14 +508,20 @@ protected function _doInstantPayment($payment) $this->_getAdminSession()->addError($this->_getHelper()->__($e->getMessage())); Mage::throwException(''); } catch(\SoapFault $f) { - $this->_getHelper()->log("[$requestId] SoapFault with code {$f->faultcode}: {$f->faultstring}.", Zend_Log::WARN); + $this->_getHelper()->log( + "[$requestId] SoapFault with code {$f->faultcode}: {$f->faultstring}.", + Zend_Log::WARN + ); $warn = $this->_getHelper()->__('Please correct this error to use PayZen web services.'); $this->_getAdminSession()->addWarning($warn); $this->_getAdminSession()->addError($f->faultstring); Mage::throwException(''); } catch(\UnexpectedValueException $e) { - $this->_getHelper()->log("[$requestId] createPayment error with code {$e->getCode()}: {$e->getMessage()}.", Zend_Log::ERR); + $this->_getHelper()->log( + "[$requestId] createPayment error with code {$e->getCode()}: {$e->getMessage()}.", + Zend_Log::ERR + ); if ($e->getCode() === -1) { $this->_getAdminSession()->addError($this->_getHelper()->__('Authentication error ! ')); @@ -508,7 +531,10 @@ protected function _doInstantPayment($payment) Mage::throwException(''); } catch (Exception $e) { - $this->_getHelper()->log("[$requestId] Exception with code {$e->getCode()}: {$e->getMessage()}", Zend_Log::ERR); + $this->_getHelper()->log( + "[$requestId] Exception with code {$e->getCode()}: {$e->getMessage()}", + Zend_Log::ERR + ); $this->_getAdminSession()->addError($e->getMessage()); Mage::throwException(''); @@ -522,7 +548,7 @@ protected function _doInstantPayment($payment) public function isLocalCcInfo() { return $this->_getHelper()->isCurrentlySecure() // this is a double check, it's also done on backend side - && $this->getConfigData('card_info_mode') == 3; + && $this->getConfigData('card_info_mode') == 3; } /** diff --git a/app/code/community/Lyra/Payzen/Model/Resource/Setup.php b/app/code/community/Lyra/Payzen/Model/Resource/Setup.php index 8de73c6d..72adff89 100644 --- a/app/code/community/Lyra/Payzen/Model/Resource/Setup.php +++ b/app/code/community/Lyra/Payzen/Model/Resource/Setup.php @@ -1,6 +1,6 @@ getConfigArray('product_categories') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } - array_unshift($options, array('value' => 'CUSTOM_MAPPING', 'label' => Mage::helper('payzen')->__('(Use category mapping below)'))); + array_unshift($options, array('value' => 'CUSTOM_MAPPING', 'label' => Mage::helper('payzen')->__('(Use category mapping below)'))); return $options; } diff --git a/app/code/community/Lyra/Payzen/Model/Source/CtxModes.php b/app/code/community/Lyra/Payzen/Model/Source/CtxModes.php index 5ea2d27b..9faa8180 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/CtxModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/CtxModes.php @@ -1,6 +1,6 @@ getConfigArray('ctx_modes') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => $name + $options[] = array( + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Gift/GiftCards.php b/app/code/community/Lyra/Payzen/Model/Source/Gift/GiftCards.php index af7bb928..13d83e01 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Gift/GiftCards.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Gift/GiftCards.php @@ -1,6 +1,6 @@ getSupportedGcTypes() as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => $name + $options[] = array( + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Languages.php b/app/code/community/Lyra/Payzen/Model/Source/Languages.php index 7527c5e3..f4a22fb1 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Languages.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Languages.php @@ -1,6 +1,6 @@ $name) { $options[] = array ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Multi/CardInfoModes.php b/app/code/community/Lyra/Payzen/Model/Source/Multi/CardInfoModes.php index 5ea27ee7..cd5660cf 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Multi/CardInfoModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Multi/CardInfoModes.php @@ -1,6 +1,6 @@ getConfigArray('multi_card_info_modes') as $code => $name) { - $options[] = array - ( + $options[] = array( 'value' => $code, 'label' => Mage::helper('payzen')->__($name) ); diff --git a/app/code/community/Lyra/Payzen/Model/Source/Multi/PaymentCards.php b/app/code/community/Lyra/Payzen/Model/Source/Multi/PaymentCards.php index bd0e73aa..c44373e6 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Multi/PaymentCards.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Multi/PaymentCards.php @@ -1,6 +1,6 @@ $code, - 'label' => $name + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/PaymentCards.php b/app/code/community/Lyra/Payzen/Model/Source/PaymentCards.php index c730a7b9..df1525d0 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/PaymentCards.php +++ b/app/code/community/Lyra/Payzen/Model/Source/PaymentCards.php @@ -1,6 +1,6 @@ '', - 'label' => Mage::helper('payzen')->__('ALL') + 'value' => '', + 'label' => Mage::helper('payzen')->__('ALL') ); foreach (Lyra_Payzen_Model_Api_Api::getSupportedCardTypes() as $code => $name) { @@ -32,8 +32,8 @@ public function toOptionArray() } $options[] = array ( - 'value' => $code, - 'label' => $name + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/ReturnModes.php b/app/code/community/Lyra/Payzen/Model/Source/ReturnModes.php index f76f5c60..e7c3108f 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/ReturnModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/ReturnModes.php @@ -1,6 +1,6 @@ getConfigArray('return_modes') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Sepa/AvailableCountries.php b/app/code/community/Lyra/Payzen/Model/Source/Sepa/AvailableCountries.php new file mode 100644 index 00000000..c94e4472 --- /dev/null +++ b/app/code/community/Lyra/Payzen/Model/Source/Sepa/AvailableCountries.php @@ -0,0 +1,47 @@ +_availableCountries as $code) { + $name = Mage::app()->getLocale()->getCountryTranslation($code); + if (empty($name)) { + $name = $code; + } + + $result[] = array( + 'value' => $code, + 'label' => $name + ); + } + + return $result; + } + + public function getCountryCodes() + { + return $this->_availableCountries; + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Source/Sepa/MandateModes.php b/app/code/community/Lyra/Payzen/Model/Source/Sepa/MandateModes.php new file mode 100644 index 00000000..71f8376f --- /dev/null +++ b/app/code/community/Lyra/Payzen/Model/Source/Sepa/MandateModes.php @@ -0,0 +1,34 @@ +getConfigArray('mandate_modes') as $code => $name) { + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) + ); + } + + return $options; + } +} diff --git a/app/code/community/Lyra/Payzen/Model/Source/SignAlgos.php b/app/code/community/Lyra/Payzen/Model/Source/SignAlgos.php index dc3aa551..797aada0 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/SignAlgos.php +++ b/app/code/community/Lyra/Payzen/Model/Source/SignAlgos.php @@ -1,6 +1,6 @@ getConfigArray('sign_algos') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => $name + $options[] = array( + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Sofort/AvailableCountries.php b/app/code/community/Lyra/Payzen/Model/Source/Sofort/AvailableCountries.php index fb6685fd..24355775 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Sofort/AvailableCountries.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Sofort/AvailableCountries.php @@ -1,6 +1,6 @@ $code, - 'label' => $name + 'value' => $code, + 'label' => $name ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Standard/CardInfoModes.php b/app/code/community/Lyra/Payzen/Model/Source/Standard/CardInfoModes.php index 233dea64..08c4c2b9 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Standard/CardInfoModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Standard/CardInfoModes.php @@ -1,6 +1,6 @@ getConfigArray('card_info_modes') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + if (($code == 3) && ! Lyra_Payzen_Helper_Data::$pluginFeatures['acquis']) { + // card data acquisition on merchant website not available for all + continue; + } + + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Standard/CardRegisterModes.php b/app/code/community/Lyra/Payzen/Model/Source/Standard/CardRegisterModes.php index a2f4d11d..44b58b58 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Standard/CardRegisterModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Standard/CardRegisterModes.php @@ -1,6 +1,6 @@ getConfigArray('card_register_modes') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/Standard/OneClickLocations.php b/app/code/community/Lyra/Payzen/Model/Source/Standard/OneClickLocations.php index 77100ba4..adbb65d3 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/Standard/OneClickLocations.php +++ b/app/code/community/Lyra/Payzen/Model/Source/Standard/OneClickLocations.php @@ -1,6 +1,6 @@ getConfigArray('one_click_locations') as $code => $name) { - $options[] = array - ( - 'value' => $code, - 'label' => Mage::helper('payzen')->__($name) + $options[] = array( + 'value' => $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/Source/ValidationModes.php b/app/code/community/Lyra/Payzen/Model/Source/ValidationModes.php index bceab7ca..3c9e325c 100644 --- a/app/code/community/Lyra/Payzen/Model/Source/ValidationModes.php +++ b/app/code/community/Lyra/Payzen/Model/Source/ValidationModes.php @@ -1,6 +1,6 @@ (string)$code, - 'label' => Mage::helper('payzen')->__($name) + 'value' => (string) $code, + 'label' => Mage::helper('payzen')->__($name) ); } diff --git a/app/code/community/Lyra/Payzen/Model/WsException.php b/app/code/community/Lyra/Payzen/Model/WsException.php index cbedfc19..6a8b81a6 100644 --- a/app/code/community/Lyra/Payzen/Model/WsException.php +++ b/app/code/community/Lyra/Payzen/Model/WsException.php @@ -1,6 +1,6 @@ getCheckout()->getMessages(true); $this->getAdminSession()->getMessages(true); - $this->getAdminSession()->addError($this->__('An error has occured during the payment process.')); + $this->getAdminSession()->addError($this->__('An error has occurred during the payment process.')); + + $this->_getDataHelper()->log("Redirecting to order create page for order #{$order->getId()}."); $this->_redirect('adminhtml/sales_order_create/index'); } @@ -113,10 +115,12 @@ public function redirectResponse($order, $success, $checkUrlWarn = false) $storeId = $order->getStore()->getId(); if ($this->_getDataHelper()->getCommonConfigData('ctx_mode', $storeId) == 'TEST') { - // display going to production message - $message = $this->__('

GOING INTO PRODUCTION

You want to know how to put your shop into production mode, please go to this URL : '); - $message .= 'https://secure.payzen.eu/html/faq/prod'; - $this->getAdminSession()->addNotice($message); + if (Lyra_Payzen_Helper_Data::$pluginFeatures['prodfaq']) { + // display going to production message + $message = $this->__('

GOING INTO PRODUCTION

You want to know how to put your shop into production mode, please go to this URL : '); + $message .= 'https://secure.payzen.eu/html/faq/prod'; + $this->getAdminSession()->addNotice($message); + } if ($checkUrlWarn) { // order not validated by notification URL, in TEST mode, user is webmaster @@ -137,7 +141,9 @@ public function redirectResponse($order, $success, $checkUrlWarn = false) if ($success) { $this->_getDataHelper()->log("Redirecting to order review page for order #{$order->getId()}."); $this->getCheckout()->setLastSuccessQuoteId($order->getQuoteId()); - $this->getAdminSession()->addSuccess($this->__('The payment was successful. Your order was registered successfully.')); + $this->getAdminSession()->addSuccess( + $this->__('The payment was successful. Your order was registered successfully.') + ); $this->_redirect('adminhtml/sales_order/view', array('order_id' => $order->getId())); } else { $this->_getDataHelper()->log("Unsetting order data in session for order #{$order->getId()}."); diff --git a/app/code/community/Lyra/Payzen/controllers/PaymentController.php b/app/code/community/Lyra/Payzen/controllers/PaymentController.php index 65c1eae6..40ca86c8 100644 --- a/app/code/community/Lyra/Payzen/controllers/PaymentController.php +++ b/app/code/community/Lyra/Payzen/controllers/PaymentController.php @@ -1,6 +1,6 @@ _getDataHelper()->log('Start ================================================='); + if ($this->getRequest()->getParam('mode', null) === 'cancel') { + // load order + $lastIncrementId = $this->getCheckout()->getLastRealOrderId(); + $order = Mage::getModel('sales/order'); + $order->loadByIncrementId($lastIncrementId); + + if ($order->getId()) { + $this->_getDataHelper()->log("Cancel order #{$order->getId()} to allow payment retry."); + $order->registerCancellation($this->__('Payment canceled.'))->save(); + + $this->_getDataHelper()->log("Clean session for #{$order->getId()} and restore last quote if any."); + $this->getCheckout()->setLastBillingAgreementId(null) + ->setRedirectUrl(null) + ->setLastOrderId(null) + ->setLastRealOrderId(null) + ->setLastRecurringProfileIds(null) + ->setAdditionalMessages(null); + + $quote = Mage::getModel('sales/quote')->load($order->getQuoteId()); + if ($quote->getId()) { + $quote->setIsActive(true)->setReservedOrderId(null)->save(); + $this->getCheckout()->replaceQuote($quote); + } + } + } + $block = $this->getLayout()->createBlock('core/template')->setTemplate('payzen/iframe/loader.phtml'); $this->getResponse()->setBody($block->toHtml()); + $this->_getDataHelper()->log('End ================================================='); } /** @@ -165,7 +193,9 @@ public function oneclickPaymentAction() // restore initial checkout quote if ($this->getPayzenSession()->getPayzenInitialQuoteId()) { - $quote = Mage::getModel('sales/quote')->load((int)$this->getPayzenSession()->getPayzenInitialQuoteId(true)); + $quote = Mage::getModel('sales/quote')->load( + (int) $this->getPayzenSession()->getPayzenInitialQuoteId(true) + ); if ($quote->getId()) { $quote->setIsActive(true)->save(); @@ -218,13 +248,14 @@ protected function _updateOneclickQuote($ignoreNotices = false) if ($productId = $this->getRequest()->getPost('product', false)) { $product = Mage::getModel('catalog/product') ->setStoreId(Mage::app()->getStore()->getId()) - ->load((int)$productId); + ->load((int) $productId); if ($product->getId()) { // remove all 1-Click quote items to refresh it foreach ($oneClickQuote->getItemsCollection() as $item) { $oneClickQuote->removeItem($item->getId()); } + $oneClickQuote->getShippingAddress()->removeAllShippingRates(); $oneClickQuote->setCouponCode(''); @@ -286,9 +317,8 @@ protected function _updateOneclickQuote($ignoreNotices = false) } if (! $allAdded) { - $this->getCoreSession()->addError( - $this->__('Some of the products you requested are not available in the desired quantity.') - ); + $msg = 'Some of the products you requested are not available in the desired quantity.'; + $this->getCoreSession()->addError($this->__($msg)); } } } @@ -297,7 +327,7 @@ protected function _updateOneclickQuote($ignoreNotices = false) } $addressId = $this->getRequest()->getPost('shipping_address', false); - $customerAddress = Mage::getModel('customer/address')->load((int)$addressId); + $customerAddress = Mage::getModel('customer/address')->load((int) $addressId); if (! $oneClickQuote->isVirtual() && $customerAddress->getId()) { if ($customerAddress->getCustomerId() != Mage::getSingleton('customer/session')->getCustomer()->getId()) { Mage::throwException($this->__('Customer Address is not valid.')); @@ -331,7 +361,7 @@ public function redirectBack($msg) } /** - * Redirect to error page (when an unexpected error occured). + * Redirect to error page (when an unexpected error occurred). * * @param Mage_Sales_Model_Order $order */ @@ -360,10 +390,12 @@ public function redirectResponse($order, $success, $checkUrlWarn = false) $storeId = $order->getStore()->getId(); if ($this->_getDataHelper()->getCommonConfigData('ctx_mode', $storeId) == 'TEST') { - // display going to production message - $message = $this->__('

GOING INTO PRODUCTION

You want to know how to put your shop into production mode, please go to this URL : '); - $message .= 'https://secure.payzen.eu/html/faq/prod'; - $this->getCoreSession()->addNotice($message); + if (Lyra_Payzen_Helper_Data::$pluginFeatures['prodfaq']) { + // display going to production message + $message = $this->__('

GOING INTO PRODUCTION

You want to know how to put your shop into production mode, please go to this URL : '); + $message .= 'https://secure.payzen.eu/html/faq/prod'; + $this->getCoreSession()->addNotice($message); + } if ($checkUrlWarn) { // order not validated by notification URL, in TEST mode, user is webmaster @@ -416,7 +448,9 @@ public function redirectResponse($order, $success, $checkUrlWarn = false) $this->getPayzenSession()->unsPayzenInitialQuoteId(); // in case of 1-Click payment , redirect to referer URL - $this->_getDataHelper()->log("Redirecting to referer URL (product view or cart page) for order #{$order->getId()}."); + $this->_getDataHelper()->log( + "Redirecting to referer URL (product view or cart page) for order #{$order->getId()}." + ); $this->_redirectUrl($this->getPayzenSession()->getPayzenOneclickBackUrl(true)); } else { $this->_getDataHelper()->log("Restore cart for order #{$order->getId()} to allow re-order quicker."); diff --git a/app/code/community/Lyra/Payzen/data/payzen_setup/data-install-1.6.0.php b/app/code/community/Lyra/Payzen/data/payzen_setup/data-install-1.6.0.php index e4a83e28..315e16fd 100644 --- a/app/code/community/Lyra/Payzen/data/payzen_setup/data-install-1.6.0.php +++ b/app/code/community/Lyra/Payzen/data/payzen_setup/data-install-1.6.0.php @@ -1,6 +1,6 @@ select()->from($statusTable, 'status')->where('status = "payzen_to_validate"'); if (! $connection->fetchOne($select)) { // status does not exist $connection->insert( - $statusTable, - array('status' => 'payzen_to_validate', 'label' => 'To validate payment') + $statusTable, + array('status' => 'payzen_to_validate', 'label' => 'To validate payment') ); $connection->insert( - $stateTable, - array('status' => 'payzen_to_validate', 'state' => 'payment_review', 'is_default' => 0) + $stateTable, + array('status' => 'payzen_to_validate', 'state' => 'payment_review', 'is_default' => 0) ); } -$installer->endSetup(); \ No newline at end of file +$installer->endSetup(); diff --git a/app/code/community/Lyra/Payzen/data/payzen_setup/data-upgrade-1.8.0-1.9.0.php b/app/code/community/Lyra/Payzen/data/payzen_setup/data-upgrade-1.8.0-1.9.0.php new file mode 100644 index 00000000..493d9581 --- /dev/null +++ b/app/code/community/Lyra/Payzen/data/payzen_setup/data-upgrade-1.8.0-1.9.0.php @@ -0,0 +1,45 @@ +startSetup(); + +$connection = $installer->getConnection(); + +$statusTable = $installer->getTable('sales/order_status'); +$stateTable = $installer->getTable('sales/order_status_state'); + +$select = $connection->select()->from($statusTable, 'status')->where('status = "payzen_pending_transfer"'); +if (! $connection->fetchOne($select)) { // status does not exist + $connection->insert( + $statusTable, + array('status' => 'payzen_pending_transfer', 'label' => 'Pending funds transfer') + ); + + $connection->insert( + $stateTable, + array('status' => 'payzen_pending_transfer', 'state' => 'processing', 'is_default' => 0) + ); +} + +$installer->endSetup(); diff --git a/app/code/community/Lyra/Payzen/etc/config.xml b/app/code/community/Lyra/Payzen/etc/config.xml index 36c7c8b4..81d8d3ae 100644 --- a/app/code/community/Lyra/Payzen/etc/config.xml +++ b/app/code/community/Lyra/Payzen/etc/config.xml @@ -1,7 +1,7 @@ - 1.8.0 + 1.9.0 @@ -65,6 +65,9 @@ + + + @@ -75,6 +78,11 @@ 1 + + + + + @@ -166,7 +174,7 @@ 1 - Card data entry on payment platform + Bank data acquisition on payment gateway 2 @@ -174,11 +182,11 @@ 3 - Card data entry on merchant site + Bank data acquisition on merchant site 4 - Payment page integrated to checkout process + Payment page integrated to checkout process (iframe mode) @@ -285,13 +293,29 @@ 1 - On payment platform + On payment gateway 2 On merchant site + + + + + PAYMENT + One-off SEPA direct debit + + + REGISTER_PAY + Register a recurrent SEPA mandate with direct debit + + + REGISTER + Register a recurrent SEPA mandate without direct debit + + @@ -454,7 +478,7 @@ Lyra Network support@payzen.eu - 1.8.0 + 1.9.0 V2 1 PayZen @@ -464,6 +488,7 @@ 2222222222222222 TEST SHA-1 + payzen/payment/check https://secure.payzen.eu/vads-payment/ fr @@ -471,11 +496,10 @@ 0 5 - Redirection vers la boutique dans quelques instants... + Redirection to shop in a few seconds... 5 - Redirection vers la boutique dans quelques instants... + Redirection to shop in a few seconds... GET - payzen/payment/check processing 1 @@ -488,7 +512,7 @@ 1 0 - Paiement par carte bancaire + Pay by credit card 1 standard.png authorize @@ -499,10 +523,10 @@ 1 0 - Acheter maintenant + Buy now BOTH 1 - Les données de la carte seront enregistrées sur le serveur sécurisé de la plateforme de paiement.]]> + Card data will be stored on the secured server of the payment gateway.]]> @@ -511,7 +535,7 @@ 0 0 - Paiement par carte bancaire en plusieurs fois + Pay by credit card in installments 2 multi.png authorize @@ -528,7 +552,7 @@ 0 0 - Paiement par carte cadeau + Pay by gift card 3 gift.png authorize @@ -536,7 +560,18 @@ -1 - + + payzen/payment_choozeo + payzen + + 0 + 1 + FR + Pay with Choozeo + 4 + choozeo.png + authorize + payzen/payment_oney @@ -545,7 +580,7 @@ 0 1 FR - Paiement FacilyPay Oney + Pay with FacilyPay Oney 5 oney.png authorize @@ -555,14 +590,43 @@ 0 + + payzen/payment_fullcb + payzen + + 0 + 1 + FR + Pay with FullCB + 6 + fullcb.png + authorize + + 0 + + + + payzen/payment_sepa + payzen + + 0 + 0 + Pay with SEPA + 7 + sdd.png + authorize + + PAYMENT + + payzen/payment_paypal payzen 0 0 - Paiement PayPal - 6 + Pay with PayPal + 8 paypal.png authorize @@ -575,15 +639,39 @@ 0 0 - Paiement SOFORT Banking - 7 + Pay with SOFORT Banking + 9 sofort_banking.png authorize - + + payzen/payment_postfinance + payzen + + 0 + 0 + Pay with PostFinance + 10 + postfinance.png + authorize + + -1 + - + + payzen/payment_giropay + payzen + + 0 + 0 + Pay with Giropay + 11 + giropay.png + authorize + + -1 + payzen/payment_ideal @@ -592,8 +680,8 @@ 0 1 NL - Paiement iDEAL - 10 + Pay with iDEAL + 12 ideal.png authorize diff --git a/app/code/community/Lyra/Payzen/etc/system.xml b/app/code/community/Lyra/Payzen/etc/system.xml index 3342097c..494712e6 100644 --- a/app/code/community/Lyra/Payzen/etc/system.xml +++ b/app/code/community/Lyra/Payzen/etc/system.xml @@ -1,7 +1,7 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 @@ -136,6 +136,7 @@ Certificate provided by PayZen for test mode (available in your store Back Office). text + payzen/adminhtml_system_config_field_keyTest payment/payzen/key_test 22 1 @@ -158,6 +159,7 @@ The context mode of this module. select + payzen/adminhtml_system_config_field_ctxMode payzen/source_ctxModes payment/payzen/ctx_mode 24 @@ -166,9 +168,9 @@ 1 - + - - - Link to the payment page. - text - payment/payzen/platform_url + + + Settings > Notification rules.
In multistore mode, notification URL is the same for all the stores.]]>
+ label + payment/payzen/notify_url + payzen/adminhtml_system_config_field_notifyUrl 26 1 1 1 -
+ - - - In multistore mode, notification URL is the same for all the stores.]]> - label - payment/payzen/check_url - payzen/field_checkUrl + + + Link to the payment page. + text + payment/payzen/platform_url 27 1 1 1 - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 30 1 1 @@ -228,7 +230,7 @@ Languages available on the payment page. If you do not select any, all the supported languages will be available. multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payzen/source_languages payzen/field_availableLanguages @@ -267,7 +269,7 @@ label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 40 1 1 @@ -288,7 +290,7 @@ - Shop name to display on the payment page. Leave blank to use platform configuration. + Shop name to display on the payment page. Leave blank to use gateway configuration. text payment/payzen/shop_name 42 @@ -299,7 +301,7 @@ - Shop URL to display on the payment page. Leave blank to use platform configuration. + Shop URL to display on the payment page. Leave blank to use gateway configuration. text payzen/field_shopUrl payment/payzen/shop_url @@ -314,7 +316,7 @@ label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 50 1 1 @@ -322,11 +324,11 @@ - - Needs subscription to Selective 3-D Secure option. - payzen/field_threedsCustgroupOptions + + Amount below which 3DS will be disabled for each customer group. Needs subscription to selective 3DS option. For more information, refer to the module documentation. + payzen/adminhtml_system_config_field_threedsCustgroupOptions payzen/field_custgroupOptions - payment/payzen_standard/custgroup_threeds_min_amount + payment/payzen/custgroup_threeds_min_amount 51 1 1 @@ -337,7 +339,7 @@ label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 60 1 1 @@ -374,6 +376,7 @@ Message displayed on the payment page prior to redirection after a successful payment. text + payzen/field_translatable payment/payzen/redirect_success_message 63 1 @@ -402,6 +405,7 @@ Message displayed on the payment page prior to redirection after a declined payment. text + payzen/field_translatable payment/payzen/redirect_error_message 65 1 @@ -456,7 +460,7 @@ Configure this section if you use advanced risk assessment module or if you have a FacilyPay Oney contract. label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 70 1 0 @@ -477,7 +481,7 @@ Entries marked with * are newly added and must be configured.]]> - payzen/field_categoryMapping + payzen/adminhtml_system_config_field_categoryMapping payzen/field_categoryMapping payment/payzen/category_mapping 72 @@ -492,7 +496,7 @@ Name: The name of the shipping method (use 55 alphanumeric characters, accentuated characters and these special characters: space, slash, hyphen, apostrophe).
Type: The carrier type.
Rapidity: Select the delivery rapidity.
Delay: Select the delivery delay if speed is «Priority».
Entries marked with * are newly added and must be configured.]]>
- payzen/field_shipOptions + payzen/adminhtml_system_config_field_shipOptions payzen/field_shipOptions payment/payzen/ship_options 73 @@ -505,7 +509,7 @@ - + 101 1 1 @@ -513,19 +517,19 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno payment/payzen_standard/active @@ -533,31 +537,32 @@ 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_standard/sort_order + payzen/field_translatable + payment/payzen_standard/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <standard_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_standard/title</config_path> + <config_path>payment/payzen_standard/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image @@ -569,20 +574,20 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - + - + allowspecific payment/payzen_standard/allowspecific @@ -591,12 +596,12 @@ 1 1 1 - + - + multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payment/payzen_standard/specificcountry 22 @@ -605,34 +610,34 @@ 1 1 - 1 + 1 - + - + - payzen/field_custgroupOptions + payzen/adminhtml_system_config_field_custgroupOptions payzen/field_custgroupOptions payment/payzen_standard/custgroup_amount_restrictions 23 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 31 1 1 1 - + - + The number of days before the bank capture. Enter value only if different from PayZen general configuration. text @@ -641,9 +646,9 @@ 1 1 1 - + - + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. select @@ -653,13 +658,13 @@ 1 1 1 - + - + - The card type(s) that can be used for the payment. Select none to use platform configuration. + The card type(s) that can be used for the payment. Select none to use gateway configuration. multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payzen/source_paymentCards payzen/field_paymentCards @@ -668,35 +673,36 @@ 1 1 1 - + - + - + select adminhtml/system_config_source_yesno payzen/field_standard_useOney + payzen/adminhtml_system_config_field_standard_useOney payment/payzen_standard/use_oney_in_standard 35 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 40 1 1 1 - + - + - Select how the credit card infos will be entered. Attention, to use bank data acquisition on the merchant site, you must ensure that you have subscribed to this option with PayZen. + Select how the card data will be entered. Attention, to use bank data acquisition on the merchant site, you must ensure that you have subscribed to this option with PayZen. select payzen/field_standard_cardInfoModes payzen/source_standard_cardInfoModes @@ -705,9 +711,9 @@ 1 1 1 - + - + Enable 1-Click to add PayZen payment button to your cart and / or product pages. select @@ -717,23 +723,24 @@ 1 1 1 - + - + The text to display on the PayZen 1-Click payment button. text + payzen/field_translatable payment/payzen_standard/one_click_title 43 1 1 1 - 1 + 1 - + - + Select where to display PayZen 1-Click payment button. select @@ -744,11 +751,11 @@ 1 1 - 1 + 1 - + - + Select how you want to propose card data registration on your website. select @@ -759,31 +766,35 @@ 1 1 - 3 - 1 + 3 + 1 - + - + Message displayed on your website to invite buyers to register their card data. text + payzen/field_translatable payment/payzen_standard/card_register_message 46 1 1 1 - 3 - 1 + 3 + 1 - + - - + + + If you enable this feature while you have not the associated option, an error 07 - PAYMENT_CONFIG will occur and the buyer will not be able to pay.]]> + payzen/adminhtml_system_config_fieldset_payment + multi 102 1 1 @@ -791,19 +802,19 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno payment/payzen_multi/active @@ -811,31 +822,32 @@ 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_multi/sort_order + payzen/field_translatable + payment/payzen_multi/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <multi_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_multi/title</config_path> + <config_path>payment/payzen_multi/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image @@ -847,20 +859,20 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - + - + allowspecific payment/payzen_multi/allowspecific @@ -869,12 +881,12 @@ 1 1 1 - + - + multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payment/payzen_multi/specificcountry 22 @@ -883,34 +895,34 @@ 1 1 - 1 + 1 - + - + - payzen/field_custgroupOptions + payzen/adminhtml_system_config_field_custgroupOptions payzen/field_custgroupOptions payment/payzen_multi/custgroup_amount_restrictions 23 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 31 1 1 1 - + - + The number of days before the bank capture. Enter value only if different from PayZen general configuration. text @@ -919,9 +931,9 @@ 1 1 1 - + - + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. select @@ -931,13 +943,13 @@ 1 1 1 - + - + - The card type(s) that can be used for the payment. Select none to use platform configuration. + The card type(s) that can be used for the payment. Select none to use gateway configuration. multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payzen/source_multi_paymentCards payzen/field_paymentCards @@ -946,22 +958,22 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 40 1 1 1 - + - + - Select where card type will be selected by buyer. + Select where the card type will be selected by the buyer. select payzen/source_multi_cardInfoModes payment/payzen_multi/card_info_mode @@ -969,22 +981,22 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 50 1 1 1 - + - + - payzen/field_multi_paymentOptions + payzen/adminhtml_system_config_field_multi_paymentOptions payzen/field_multi_paymentOptions payment/payzen_multi/payment_options 51 @@ -992,13 +1004,15 @@ 1 1 Label : The option label to display on the frontend.
Min. amount : Minimum amount to enable the payment option.
Max. amount : Maximum amount to enable the payment option.
Contract : ID of the contract to use with the option.
Count : Total number of payments.
Period : Delay (in days) between payments.
1st payment : Amount of first payment, in percentage of total amount. If empty, all payments will have the same amount.]]>
-
+
- + + payzen/adminhtml_system_config_fieldset_payment + gift 103 1 1 @@ -1006,19 +1020,19 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno payment/payzen_gift/active @@ -1026,31 +1040,32 @@ 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_gift/sort_order + payzen/field_translatable + payment/payzen_gift/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <gift_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_gift/title</config_path> + <config_path>payment/payzen_gift/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image @@ -1062,20 +1077,20 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - + - + allowspecific payment/payzen_gift/allowspecific @@ -1084,12 +1099,12 @@ 1 1 1 - + - + multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payment/payzen_gift/specificcountry 22 @@ -1098,34 +1113,34 @@ 1 1 - 1 + 1 - + - + - payzen/field_custgroupOptions + payzen/adminhtml_system_config_field_custgroupOptions payzen/field_custgroupOptions payment/payzen_gift/custgroup_amount_restrictions 23 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 31 1 1 1 - + - + The number of days before the bank capture. Enter value only if different from PayZen general configuration. This setting is considered only if the buyer uses another CC to complete the payment. text @@ -1134,9 +1149,9 @@ 1 1 1 - + - + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. This setting is considered only if the buyer uses another CC to complete the payment. select @@ -1146,24 +1161,24 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 40 1 1 1 - + - + Select the gift card types that can be used for the payment. multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 payzen/source_gift_giftCards payment/payzen_gift/gift_cards @@ -1171,11 +1186,11 @@ 1 1 1 - + - + - payzen/field_gift_addedCards + payzen/adminhtml_system_config_field_gift_addedCards payzen/field_gift_addedCards payment/payzen_gift/added_gift_cards 42 @@ -1183,17 +1198,16 @@ 1 1 Card code : The PayZen exact gift card code.
Card label : The label of the new gift card.
Card logo : The gift card logo to display on payment method selection page.]]>
-
+
- - - - - - 105 + + + payzen/adminhtml_system_config_fieldset_payment + choozeo + 104 1 1 1 @@ -1201,56 +1215,56 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno - payment/payzen_oney/active - payzen/field_oney_active + payment/payzen_choozeo/active 11 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_oney/sort_order + payzen/field_translatable + payment/payzen_choozeo/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <choozeo_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_oney/title</config_path> + <config_path>payment/payzen_choozeo/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image - payment/payzen_oney/module_logo + payment/payzen_choozeo/module_logo payzen/field_logo payzen/logos payzen/logos @@ -1258,136 +1272,96 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - - - - - allowspecific - payment/payzen_oney/allowspecific - 21 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 1 - + - + - multiselect - payzen/field_multiselect - 5 - payment/payzen_oney/specificcountry - 22 - payzen/source_oney_availableCountries + label + payzen/adminhtml_system_config_field_label + true + payment/payzen_choozeo/specificcountry + 21 1 1 1 - - 1 - - + - + - payzen/field_custgroupOptions - payzen/field_oney_custgroupOptions - payment/payzen_oney/custgroup_amount_restrictions - 23 + payzen/adminhtml_system_config_field_choozeo_custgroupOptions + payzen/field_choozeo_custgroupOptions + payment/payzen_choozeo/custgroup_amount_restrictions + 22 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 31 1 1 1 - + - + The number of days before the bank capture. Enter value only if different from PayZen general configuration. text - payment/payzen_oney/capture_delay + payment/payzen_choozeo/capture_delay 32 1 1 1 - - - - - If manual is selected, you will have to confirm payments manually in your PayZen Back Office. - select - payzen/source_validationModes - payment/payzen_oney/validation_mode - 33 - 1 - 1 - 1 - + - - + + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 40 1 1 1 - - - - - Enable payment options selection on merchant site. - select - adminhtml/system_config_source_yesno - payment/payzen_oney/enable_payment_options - 41 - 1 - 1 - 1 - + - + - Label: The option label to display on the frontend (the %c and %r patterns will be respectively replaced by payments count and option rate).
Code: The option code as defined in your FacilyPay Oney contract.
Min. amount: Minimum amount to enable the payment option.
Max. amount: Maximum amount to enable the payment option.
Count: Total number of payments.
Rate: The interest rate in percentage.]]>
- payzen/field_oney_paymentOptions - payzen/field_oney_paymentOptions - payment/payzen_oney/payment_options - 42 + payzen/adminhtml_system_config_field_choozeo_paymentOptions + payzen/field_choozeo_paymentOptions + payment/payzen_choozeo/payment_options + 41 1 1 1 - - 1 - -
+ Configure Choozeo payment options. +
-
+ - - - 106 + + + payzen/adminhtml_system_config_fieldset_payment + oney + 105 1 1 1 @@ -1395,55 +1369,57 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno - payment/payzen_paypal/active + payment/payzen_oney/active + payzen/field_oney_active 11 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_paypal/sort_order + payzen/field_translatable + payment/payzen_oney/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <oney_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_paypal/title</config_path> + <config_path>payment/payzen_oney/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image - payment/payzen_paypal/module_logo + payment/payzen_oney/module_logo payzen/field_logo payzen/logos payzen/logos @@ -1451,98 +1427,138 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - + - + allowspecific - payment/payzen_paypal/allowspecific + payment/payzen_oney/allowspecific 21 adminhtml/system_config_source_payment_allspecificcountries 1 1 1 - + - + multiselect - payzen/field_multiselect + payzen/adminhtml_system_config_field_multiselect 5 - payment/payzen_paypal/specificcountry + payment/payzen_oney/specificcountry 22 - adminhtml/system_config_source_country + payzen/source_oney_availableCountries 1 1 1 - 1 + 1 - + - + - payzen/field_custgroupOptions - payzen/field_custgroupOptions - payment/payzen_paypal/custgroup_amount_restrictions + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_oney_custgroupOptions + payment/payzen_oney/custgroup_amount_restrictions 23 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 31 1 1 1 - + - + The number of days before the bank capture. Enter value only if different from PayZen general configuration. text - payment/payzen_paypal/capture_delay + payment/payzen_oney/capture_delay 32 1 1 1 - + - + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. select payzen/source_validationModes - payment/payzen_paypal/validation_mode + payment/payzen_oney/validation_mode 33 1 1 1 - + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 40 + 1 + 1 + 1 + + + + + Enable payment options selection on merchant site. + select + adminhtml/system_config_source_yesno + payment/payzen_oney/enable_payment_options + 41 + 1 + 1 + 1 + + + + + Label: The option label to display on the frontend (the %c and %r patterns will be respectively replaced by payments count and option rate).
Code: The option code as defined in your FacilyPay Oney contract.
Min. amount: Minimum amount to enable the payment option.
Max. amount: Maximum amount to enable the payment option.
Count: Total number of payments.
Rate: The interest rate in percentage.]]>
+ payzen/adminhtml_system_config_field_oney_paymentOptions + payzen/field_oney_paymentOptions + payment/payzen_oney/payment_options + 42 + 1 + 1 + 1 + + 1 + +
-
+ - - - 107 + + + payzen/adminhtml_system_config_fieldset_payment + fullcb + 106 1 1 1 @@ -1550,55 +1566,56 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno - payment/payzen_sofort/active + payment/payzen_fullcb/active 11 1 1 1 - + - - - In the payment methods list. + + + Method title to display on payment means page. text - payment/payzen_sofort/sort_order + payzen/field_translatable + payment/payzen_fullcb/title 12 1 1 1 - + - - <label>Method title</label> - <comment>Method title to display on payment means page.</comment> + <fullcb_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> <frontend_type>text</frontend_type> - <config_path>payment/payzen_sofort/title</config_path> + <config_path>payment/payzen_fullcb/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image - payment/payzen_sofort/module_logo + payment/payzen_fullcb/module_logo payzen/field_logo payzen/logos payzen/logos @@ -1606,68 +1623,550 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - - - - - allowspecific - payment/payzen_sofort/allowspecific - 21 - adminhtml/system_config_source_payment_allspecificcountries - 1 - 1 - 1 - + - + - multiselect - payzen/field_multiselect - 5 - payment/payzen_sofort/specificcountry - 22 - payzen/source_sofort_availableCountries + label + payzen/adminhtml_system_config_field_label + true + payment/payzen_fullcb/specificcountry + 21 1 1 1 - - 1 - - + - + - payzen/field_custgroupOptions - payzen/field_custgroupOptions - payment/payzen_sofort/custgroup_amount_restrictions - 23 + payzen/adminhtml_system_config_field_fullcb_custgroupOptions + payzen/field_fullcb_custgroupOptions + payment/payzen_fullcb/custgroup_amount_restrictions + 22 1 1 1 - - - + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 30 + 1 + 1 + 1 + + + + + Enable payment options selection on merchant site. + select + adminhtml/system_config_source_yesno + payment/payzen_fullcb/enable_payment_options + 31 + 1 + 1 + 1 + + + + + Label : The option label to display on the frontend.
Min amount: Minimum amount to enable the payment option.
Max amount: Maximum amount to enable the payment option.
Rate: The interest rate in percentage.
Cap: Maximum fees amount of payment option.]]>
+ payzen/adminhtml_system_config_field_fullcb_paymentOptions + payzen/field_fullcb_paymentOptions + payment/payzen_fullcb/payment_options + 32 + 1 + 1 + 1 + + 1 + +
+ + + + + + + payzen/adminhtml_system_config_fieldset_payment + sepa + 107 + 1 + 1 + 1 + complex + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 10 + 1 + 1 + 1 + + + + + Enables / disables this payment method. + select + adminhtml/system_config_source_yesno + payment/payzen_sepa/active + 11 + 1 + 1 + 1 + + + + + Method title to display on payment means page. + text + payzen/field_translatable + payment/payzen_sepa/title + 12 + 1 + 1 + 1 + + + + + In the payment methods list. + text + payment/payzen_sepa/sort_order + 13 + 1 + 1 + 1 + + + + + Allowed file types: jpeg, gif, png. + image + payment/payzen_sepa/module_logo + payzen/field_logo + payzen/logos + payzen/logos + 14 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 20 + 1 + 1 + 1 + + + + allowspecific + payment/payzen_sepa/allowspecific + 21 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 1 + + + + + multiselect + payzen/adminhtml_system_config_field_multiselect + 5 + payment/payzen_sepa/specificcountry + 22 + payzen/source_sepa_availableCountries + 1 + 1 + 1 + + 1 + + + + + + + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_custgroupOptions + payment/payzen_sepa/custgroup_amount_restrictions + 23 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 30 + 1 + 1 + 1 + + + + + The number of days before the bank capture. Enter value only if different from PayZen general configuration. + text + payment/payzen_sepa/capture_delay + 31 + 1 + 1 + 1 + + + + + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. + select + payzen/source_validationModes + payment/payzen_sepa/validation_mode + 32 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 40 + 1 + 1 + 1 + + + + + Select SEPA direct debit mode. Attention, the two last choices require the payment by token option on PayZen. + select + payzen/source_sepa_mandateModes + payment/payzen_sepa/mandate_mode + 41 + 1 + 1 + 1 + + + + + + + + payzen/adminhtml_system_config_fieldset_payment + paypal + 108 + 1 + 1 + 1 + complex + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 10 + 1 + 1 + 1 + + + + + Enables / disables this payment method. + select + adminhtml/system_config_source_yesno + payment/payzen_paypal/active + 11 + 1 + 1 + 1 + + + + + Method title to display on payment means page. + text + payzen/field_translatable + payment/payzen_paypal/title + 12 + 1 + 1 + 1 + + + + + In the payment methods list. + text + payment/payzen_paypal/sort_order + 13 + 1 + 1 + 1 + + + + + Allowed file types: jpeg, gif, png. + image + payment/payzen_paypal/module_logo + payzen/field_logo + payzen/logos + payzen/logos + 14 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 20 + 1 + 1 + 1 + + + + + allowspecific + payment/payzen_paypal/allowspecific + 21 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 1 + + + + + multiselect + payzen/adminhtml_system_config_field_multiselect + 5 + payment/payzen_paypal/specificcountry + 22 + adminhtml/system_config_source_country + 1 + 1 + 1 + + 1 + + + + + + + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_custgroupOptions + payment/payzen_paypal/custgroup_amount_restrictions + 23 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 31 + 1 + 1 + 1 + + + + + The number of days before the bank capture. Enter value only if different from PayZen general configuration. + text + payment/payzen_paypal/capture_delay + 32 + 1 + 1 + 1 + + + + + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. + select + payzen/source_validationModes + payment/payzen_paypal/validation_mode + 33 + 1 + 1 + 1 + + + + + + + + payzen/adminhtml_system_config_fieldset_payment + sofort + 109 + 1 + 1 + 1 + complex + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 10 + 1 + 1 + 1 + + + + + Enables / disables this payment method. + select + adminhtml/system_config_source_yesno + payment/payzen_sofort/active + 11 + 1 + 1 + 1 + + + + + Method title to display on payment means page. + text + payzen/field_translatable + payment/payzen_sofort/title + 12 + 1 + 1 + 1 + + + + + In the payment methods list. + text + payment/payzen_sofort/sort_order + 13 + 1 + 1 + 1 + + + + + Allowed file types: jpeg, gif, png. + image + payment/payzen_sofort/module_logo + payzen/field_logo + payzen/logos + payzen/logos + 14 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 20 + 1 + 1 + 1 + + + + + allowspecific + payment/payzen_sofort/allowspecific + 21 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 1 + - + + + multiselect + payzen/adminhtml_system_config_field_multiselect + 5 + payment/payzen_sofort/specificcountry + 22 + payzen/source_sofort_availableCountries + 1 + 1 + 1 + + 1 + + + + + + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_custgroupOptions + payment/payzen_sofort/custgroup_amount_restrictions + 23 + 1 + 1 + 1 + + + - - - + + + payzen/adminhtml_system_config_fieldset_payment + postfinance 110 1 1 @@ -1676,51 +2175,368 @@ - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 10 1 1 1 - + - + - Enables / disbales this payment method. + Enables / disables this payment method. select adminhtml/system_config_source_yesno - payment/payzen_ideal/active + payment/payzen_postfinance/active 11 1 1 1 - + + + + + Method title to display on payment means page. + text + payzen/field_translatable + payment/payzen_postfinance/title + 12 + 1 + 1 + 1 + - + In the payment methods list. text - payment/payzen_ideal/sort_order + payment/payzen_postfinance/sort_order + 13 + 1 + 1 + 1 + + + + + Allowed file types: jpeg, gif, png. + image + payment/payzen_postfinance/module_logo + payzen/field_logo + payzen/logos + payzen/logos + 14 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 20 + 1 + 1 + 1 + + + + + allowspecific + payment/payzen_postfinance/allowspecific + 21 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 1 + + + + + multiselect + payzen/adminhtml_system_config_field_multiselect + 5 + payment/payzen_postfinance/specificcountry + 22 + adminhtml/system_config_source_country + 1 + 1 + 1 + + 1 + + + + + + + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_custgroupOptions + payment/payzen_postfinance/custgroup_amount_restrictions + 23 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 31 + 1 + 1 + 1 + + + + + The number of days before the bank capture. Enter value only if different from PayZen general configuration. + text + payment/payzen_postfinance/capture_delay + 32 + 1 + 1 + 1 + + + + + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. + select + payzen/source_validationModes + payment/payzen_postfinance/validation_mode + 33 + 1 + 1 + 1 + + + + + + + + payzen/adminhtml_system_config_fieldset_payment + giropay + 111 + 1 + 1 + 1 + complex + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 10 + 1 + 1 + 1 + + + + + Enables / disables this payment method. + select + adminhtml/system_config_source_yesno + payment/payzen_giropay/active + 11 + 1 + 1 + 1 + + + + + Method title to display on payment means page. + text + payzen/field_translatable + payment/payzen_giropay/title 12 1 1 1 - + + + + + In the payment methods list. + text + payment/payzen_giropay/sort_order + 13 + 1 + 1 + 1 + + + + + Allowed file types: jpeg, gif, png. + image + payment/payzen_giropay/module_logo + payzen/field_logo + payzen/logos + payzen/logos + 14 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 20 + 1 + 1 + 1 + + + + + allowspecific + payment/payzen_giropay/allowspecific + 21 + adminhtml/system_config_source_payment_allspecificcountries + 1 + 1 + 1 + + + + + multiselect + payzen/adminhtml_system_config_field_multiselect + 5 + payment/payzen_giropay/specificcountry + 22 + adminhtml/system_config_source_country + 1 + 1 + 1 + + 1 + + + + + + + payzen/adminhtml_system_config_field_custgroupOptions + payzen/field_custgroupOptions + payment/payzen_giropay/custgroup_amount_restrictions + 23 + 1 + 1 + 1 + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 31 + 1 + 1 + 1 + + + + + The number of days before the bank capture. Enter value only if different from PayZen general configuration. + text + payment/payzen_giropay/capture_delay + 32 + 1 + 1 + 1 + + + + + If manual is selected, you will have to confirm payments manually in your PayZen Back Office. + select + payzen/source_validationModes + payment/payzen_giropay/validation_mode + 33 + 1 + 1 + 1 + + + + + + + + payzen/adminhtml_system_config_fieldset_payment + ideal + 112 + 1 + 1 + 1 + complex + + + + + + label + payzen/adminhtml_system_config_field_sectionTitle + 10 + 1 + 1 + 1 + + + + + Enables / disables this payment method. + select + adminhtml/system_config_source_yesno + payment/payzen_ideal/active + 11 + 1 + 1 + 1 + - + <ideal_title translate="label,comment"> <label>Method title</label> <comment>Method title to display on payment means page.</comment> <frontend_type>text</frontend_type> + <backend_model>payzen/field_translatable</backend_model> <config_path>payment/payzen_ideal/title</config_path> + <sort_order>12</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </ideal_title> + + <ideal_sort_order translate="label,comment"> + <label>Sort order</label> + <comment>In the payment methods list.</comment> + <frontend_type>text</frontend_type> + <config_path>payment/payzen_ideal/sort_order</config_path> <sort_order>13</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> - + - + Allowed file types: jpeg, gif, png. image @@ -1732,42 +2548,42 @@ 1 1 1 - + - + label - payzen/field_sectionTitle + payzen/adminhtml_system_config_field_sectionTitle 20 1 1 1 - + - + label - payzen/field_label + payzen/adminhtml_system_config_field_label true payment/payzen_ideal/specificcountry 21 1 1 1 - + - + - payzen/field_custgroupOptions + payzen/adminhtml_system_config_field_custgroupOptions payzen/field_custgroupOptions payment/payzen_ideal/custgroup_amount_restrictions 22 1 1 1 - + diff --git a/app/code/community/Lyra/Payzen/sql/payzen_setup/install-1.6.0.php b/app/code/community/Lyra/Payzen/sql/payzen_setup/install-1.6.0.php index 87fd1dce..51883387 100644 --- a/app/code/community/Lyra/Payzen/sql/payzen_setup/install-1.6.0.php +++ b/app/code/community/Lyra/Payzen/sql/payzen_setup/install-1.6.0.php @@ -1,6 +1,6 @@ addAttribute('customer', 'payzen_identifier', array( +$installer->addAttribute( + 'customer', + 'payzen_identifier', + array( 'type' => 'varchar', 'input' => 'text', 'label' => 'PayZen identifier', @@ -38,22 +41,26 @@ 'user_defined' => 0, 'default' => '', 'source' => null -)); + ) +); $entityTypeId = $installer->getEntityTypeId('customer'); $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); $attributeGroupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); $installer->addAttributeToGroup( - $entityTypeId, - $attributeSetId, - $attributeGroupId, - 'payzen_identifier', - '999' // sort_order + $entityTypeId, + $attributeSetId, + $attributeGroupId, + 'payzen_identifier', + '999' // sort_order ); // empty log file -$logFileName = Mage::getBaseDir('var') . DS . 'log' . DS . 'payzen.log'; -if (file_exists($logFileName)) { - $f = fopen($logFileName, 'w'); // just for emptying module log file - fclose($f); +$io = new Varien_Io_File(); +$logDir = Mage::getBaseDir('var') . DS . 'log'; +$logFileName = $logDir . DS . 'payzen.log'; +if ($io->fileExists($logFileName)) { + $io->open(array('path' => $logDir)); + $io->streamOpen($logFileName, 'w'); // just for emptying module log file + $io->streamClose(); } diff --git a/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-install-1.6.0.php b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-install-1.6.0.php index acc6873d..9aadeb95 100644 --- a/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-install-1.6.0.php +++ b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-install-1.6.0.php @@ -1,6 +1,6 @@ fileExists($installFile)) { + require_once $installFile; +} + +/* install data just for versions less than 1.6 */ if (version_compare(Mage::getVersion(), '1.6.0.0', '<')) { /** @var $this Lyra_Payzen_Model_Resource_Setup */ $installer = $this; @@ -38,13 +41,13 @@ $select = $connection->select()->from($statusTable, 'status')->where('status = "payzen_to_validate"'); if (! $connection->fetchOne($select)) { // status does not exist $connection->insert( - $statusTable, - array('status' => 'payzen_to_validate', 'label' => 'To validate payment') + $statusTable, + array('status' => 'payzen_to_validate', 'label' => 'To validate payment') ); $connection->insert( - $stateTable, - array('status' => 'payzen_to_validate', 'state' => 'payment_review', 'is_default' => 0) + $stateTable, + array('status' => 'payzen_to_validate', 'state' => 'payment_review', 'is_default' => 0) ); } } diff --git a/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.7.1-1.8.0.php b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.7.1-1.8.0.php index 7ab35d13..c3dafafd 100644 --- a/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.7.1-1.8.0.php +++ b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.7.1-1.8.0.php @@ -1,6 +1,6 @@ fileExists($upgradeFile)) { require_once $upgradeFile; } diff --git a/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.8.0-1.9.0.php b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.8.0-1.9.0.php new file mode 100644 index 00000000..f4306246 --- /dev/null +++ b/app/code/community/Lyra/Payzen/sql/payzen_setup/mysql4-upgrade-1.8.0-1.9.0.php @@ -0,0 +1,50 @@ +startSetup(); + + $connection = $installer->getConnection(); + + $statusTable = $installer->getTable('sales_order_status'); + $stateTable = $installer->getTable('sales_order_status_state'); + + if ($installer->tableExists($statusTable) && $installer->tableExists($stateTable)) { + $select = $connection->select()->from($statusTable, 'status')->where('status = "payzen_pending_transfer"'); + if (! $connection->fetchOne($select)) { // status does not exist + $connection->insert( + $statusTable, + array('status' => 'payzen_pending_transfer', 'label' => 'Pending funds transfer') + ); + + $connection->insert( + $stateTable, + array('status' => 'payzen_pending_transfer', 'state' => 'processing', 'is_default' => 0) + ); + } + } + + $installer->endSetup(); +} diff --git a/app/code/community/Lyra/Payzen/sql/payzen_setup/upgrade-1.7.1-1.8.0.php b/app/code/community/Lyra/Payzen/sql/payzen_setup/upgrade-1.7.1-1.8.0.php index e46cae1e..33992429 100644 --- a/app/code/community/Lyra/Payzen/sql/payzen_setup/upgrade-1.7.1-1.8.0.php +++ b/app/code/community/Lyra/Payzen/sql/payzen_setup/upgrade-1.7.1-1.8.0.php @@ -1,6 +1,6 @@ addAttribute('customer', 'payzen_masked_card', array( - 'type' => 'varchar', - 'input' => 'text', - 'label' => 'PayZen masked card', +$installer->addAttribute( + 'customer', + 'payzen_masked_card', + array( + 'type' => 'varchar', + 'input' => 'text', + 'label' => 'PayZen masked card', - 'global' => 1, - 'visible' => 0, - 'searchable' => 0, - 'filterable' => 0, - 'comparable' => 0, - 'visible_on_front' => 0, - 'required' => 0, - 'user_defined' => 0, - 'default' => '', - 'source' => null -)); + 'global' => 1, + 'visible' => 0, + 'searchable' => 0, + 'filterable' => 0, + 'comparable' => 0, + 'visible_on_front' => 0, + 'required' => 0, + 'user_defined' => 0, + 'default' => '', + 'source' => null + ) +); $entityTypeId = $installer->getEntityTypeId('customer'); $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId); diff --git a/app/design/adminhtml/default/default/template/payzen/field/array.phtml b/app/design/adminhtml/default/default/template/payzen/field/array.phtml index 9b0541f4..1db34bc2 100644 --- a/app/design/adminhtml/default/default/template/payzen/field/array.phtml +++ b/app/design/adminhtml/default/default/template/payzen/field/array.phtml @@ -1,6 +1,6 @@ getCcTransId()) { if ($info->getCcType() == 'MULTI') { echo $this->getTransactionInfoHtml(); } else { - echo Mage::helper('payzen')->__('Payment Mean') . ' : ' . $info->getCcType(); + echo Mage::helper('payzen')->__('Means of Payment') . ' : ' . $info->getCcType(); $userChoice = $info->getAdditionalInformation(Lyra_Payzen_Helper_Payment::BRAND_USER_CHOICE); if ($userChoice === true) { @@ -77,11 +77,11 @@ if ($info->getCcTransId()) { echo '
'; } - echo Mage::helper('payzen')->__('3-DS Authentication') . ' : '; + echo Mage::helper('payzen')->__('3DS Authentication') . ' : '; if ($info->getCcSecureVerify()) { echo Mage::helper('payzen')->__('YES'); echo '
'; - echo Mage::helper('payzen')->__('3-DS Certificate') . ' : ' . $info->getCcSecureVerify(); + echo Mage::helper('payzen')->__('3DS Certificate') . ' : ' . $info->getCcSecureVerify(); } else { echo Mage::helper('payzen')->__('NO'); } diff --git a/app/design/adminhtml/default/default/template/payzen/multi.phtml b/app/design/adminhtml/default/default/template/payzen/multi.phtml index 674453ea..06dc4720 100644 --- a/app/design/adminhtml/default/default/template/payzen/multi.phtml +++ b/app/design/adminhtml/default/default/template/payzen/multi.phtml @@ -1,6 +1,6 @@ "> - __('Please wait a moment. This page will transfer your data to PayZen payment platform in a few seconds.'); ?>
+ __('Please wait a moment. This page will transfer your data to PayZen payment gateway in a few seconds.'); ?>
__('If nothing happens in 10 seconds, click the button below.');?> diff --git a/app/design/adminhtml/default/default/template/payzen/standard.phtml b/app/design/adminhtml/default/default/template/payzen/standard.phtml index d99db76f..851f6271 100644 --- a/app/design/adminhtml/default/default/template/payzen/standard.phtml +++ b/app/design/adminhtml/default/default/template/payzen/standard.phtml @@ -1,6 +1,6 @@ css/payzen.css - @@ -46,10 +45,6 @@ - - - - @@ -61,6 +56,10 @@ + + + + @@ -72,10 +71,6 @@ - - - - diff --git a/app/design/frontend/base/default/template/payzen/choozeo.phtml b/app/design/frontend/base/default/template/payzen/choozeo.phtml index 9a7f54b7..18b3f94a 100644 --- a/app/design/frontend/base/default/template/payzen/choozeo.phtml +++ b/app/design/frontend/base/default/template/payzen/choozeo.phtml @@ -1,6 +1,6 @@ + + diff --git a/app/design/frontend/base/default/template/payzen/fullcb/review.phtml b/app/design/frontend/base/default/template/payzen/fullcb/review.phtml new file mode 100644 index 00000000..51c7b334 --- /dev/null +++ b/app/design/frontend/base/default/template/payzen/fullcb/review.phtml @@ -0,0 +1,75 @@ +getOptionDetails(); + +$date = time(); +?> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
__('Order amount :'); ?>getOrderTotal(); ?>
__('Fees :'); ?>getFundingFees(); ?>

__('Total amount :' ); ?>getFundingTotal(); ?>
+
+ + + + + + + + + + getCount(); $i++) { + $date = strtotime('+30 days', $date); + ?> + + + + + + +
__('Installments'); ?>
formatDate(date('Y-m-d', $date)); ?>getFirstPayment(); ?>
formatDate(date('Y-m-d', $date)); ?>getMonthlyPayment(); ?>
+
\ No newline at end of file diff --git a/app/design/frontend/base/default/template/payzen/gift.phtml b/app/design/frontend/base/default/template/payzen/gift.phtml index c5546135..b3571705 100644 --- a/app/design/frontend/base/default/template/payzen/gift.phtml +++ b/app/design/frontend/base/default/template/payzen/gift.phtml @@ -1,6 +1,6 @@ ' }); $('checkout-review-table-wrapper').hide(); // hide order summary $('checkout-review-submit').hide(); // hide submit buttons - $('payzen_iframe_warn').show(); - $('payzen_iframe').show(); + $$('.payzen-iframe').invoke('show'); - // redirect to payment platform + // redirect to payment gateway $('payzen_iframe').writeAttribute('src', response.redirect); } else { location.href = encodeURI(response.redirect); @@ -85,14 +84,30 @@ if (typeof review !== 'undefined') { review.onSave = Review.prototype.nextStep.bindAsEventListener(review); } + + Event.observe($$('#payzen_iframe_actions a').first(), 'click', function() { + $('payzen_overlay').remove(); + $$('.payzen-iframe').invoke('hide'); + + // redirect to payment gateway + $('payzen_iframe').writeAttribute('src', " 'cancel', '_secure' => true)); ?>"); + + checkout.setLoadWaiting(false, false); + checkout.changeSection('payment'); + }); //]]> -