Version Notes
==== 4.10.1 ====
==== Improvements ====
- Added notification for declined payments for AfterPay payment method
- Compatibility with Onestepcheckout improved
- Giftcard functionality improved for Magento Enterprise
- Updated translations
==== Bug fixes ====
- PayperEmail is available again in the backend
==== 4.10.0 ====
==== New features ====
- Added the AfterPay payment method.
- Added the ability to refund Bancontact / Mr. Cash orders.
==== Improvements ====
- Completely rewrote the Buckaroo payment fee implementation in order to increase reliability and implement several much requested features.
- Removed the BIC field for Dutch orders.
- Improved validation for orders where multiple transactions are created.
- Improved error handling for back-end orders.
==== Bug fixes ====
- Fixed a problem where the order ID would stay reserved after a payment had failed, causing errors.
Release Info
Developer | TIG |
Extension | tig_buckaroo3extended |
Version | 4.10.1 |
Comparing to | |
See all releases |
Version 4.10.1
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Giftcard.php +60 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Giftcard/Edit.php +63 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Giftcard/Edit/Form.php +86 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Giftcard/Grid.php +100 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Create/Totals/Fee.php +105 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Creditmemo/Create/Fee.php +174 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Creditmemo/Create/RefundFields.php +91 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Creditmemo/Totals/Fee.php +144 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Invoice/Totals/Fee.php +140 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/Sales/Order/Totals/Fee.php +133 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/Hint.php +53 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/KlarnaCheck.php +17 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/Paymentmethodbanner.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/SellersProtectionCheck.php +26 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/Singlehint.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Adminhtml/System/Config/SupportTab.php +30 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Customer/Widget/Dob.php +39 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentFee/Checkout/Total/Fee.php +104 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentFee/Sales/Order/Creditmemo/Totals/Fee.php +141 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentFee/Sales/Order/Invoice/Totals/Fee.php +134 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentFee/Sales/Order/Totals/Fee.php +131 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Afterpay/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Afterpay/Checkout/Form.php +44 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Amex/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Amex/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Bancontactmrcash/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Bancontactmrcash/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Cartebancaire/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Cartebancaire/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Cartebleue/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Cartebleue/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Checkout/Form/Abstract.php +235 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Directdebit/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Directdebit/Checkout/Form.php +29 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Directdebit/Info.php +30 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Empayment/Adminhtml/System/Config/Advancedbtn.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Empayment/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Eps/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Eps/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Giftcards/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Giftcards/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Giropay/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Giropay/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Ideal/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Ideal/Checkout/Form.php +109 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Maestro/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Maestro/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Mastercard/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Mastercard/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Onlinegiro/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Onlinegiro/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paymentguarantee/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paymentguarantee/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paypal/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paypal/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Payperemail/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Payperemail/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paysafecard/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Paysafecard/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Sofortueberweisung/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Sofortueberweisung/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Transfer/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Transfer/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Visa/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Visa/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Visaelectron/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Visaelectron/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Vpay/Adminhtml/System/Config/Advancedbtn.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Block/PaymentMethods/Vpay/Checkout/Form.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Block/Refund/Adminhtml/System/Config/NoOptionsAvailable.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Helper/Data.php +415 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Abstract.php +1282 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Adminhtml/System/Config/Backend/Buckaroo/Certificate.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Adminhtml/System/Config/Backend/Buckaroo/Fee.php +35 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Certificate.php +30 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Certificate/Certificate.php +58 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Giftcard.php +29 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Mysql4/Setup.php +5 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Observer.php +71 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Observer/Abstract.php +586 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Observer/BackendOrder.php +25 -0
- app/code/community/TIG/Buckaroo3Extended/Model/OldPaymentMethods/OldPaymentMethod.php +26 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Creditmemo/Total/Fee.php +245 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Creditmemo/Total/Fee/Abstract.php +210 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Creditmemo/Total/FeeTax.php +129 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Invoice/Total/Fee.php +87 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Invoice/Total/FeeTax.php +104 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Invoice/Total/Subtotal.php +143 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Pdf/Total/Fee.php +166 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Pdf/Total/Grandtotal.php +127 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Order/Pdf/Total/Tax.php +127 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Quote/Address/Total/Fee.php +326 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Quote/Address/Total/Fee/Abstract.php +259 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Quote/Address/Total/FeeTax.php +160 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/Service.php +252 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentFee/System/Config/Source/FeeTaxClass.php +53 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Afterpay/Observer.php +481 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Afterpay/PaymentMethod.php +192 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Amex/Observer.php +290 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Amex/PaymentMethod.php +28 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Bancontactmrcash/Observer.php +199 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Bancontactmrcash/PaymentMethod.php +14 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Cartebancaire/Observer.php +178 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Cartebancaire/PaymentMethod.php +11 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Cartebleue/Observer.php +178 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Cartebleue/PaymentMethod.php +34 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Directdebit/Observer.php +144 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Directdebit/PaymentMethod.php +59 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Empayment/Observer.php +269 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Empayment/PaymentMethod.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Eps/Observer.php +129 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Eps/PaymentMethod.php +11 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Giftcards/Observer.php +147 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Giftcards/PaymentMethod.php +14 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Giropay/Observer.php +147 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Giropay/PaymentMethod.php +25 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Ideal/Observer.php +165 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Ideal/PaymentMethod.php +23 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Maestro/Observer.php +129 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Maestro/PaymentMethod.php +34 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Mastercard/Observer.php +178 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Mastercard/PaymentMethod.php +34 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Onlinegiro/Observer.php +196 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Onlinegiro/PaymentMethod.php +31 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/PaymentMethod.php +235 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paymentguarantee/Observer.php +361 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paymentguarantee/PaymentMethod.php +58 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paypal/Observer.php +238 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paypal/PaymentMethod.php +32 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Payperemail/Observer.php +317 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Payperemail/PaymentMethod.php +47 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paysafecard/Observer.php +128 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Paysafecard/PaymentMethod.php +14 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Sofortueberweisung/Observer.php +128 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Sofortueberweisung/PaymentMethod.php +12 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Transfer/Observer.php +156 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Transfer/PaymentMethod.php +46 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Visa/Observer.php +177 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Visa/PaymentMethod.php +34 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Visaelectron/Observer.php +129 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Visaelectron/PaymentMethod.php +34 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Vpay/Observer.php +129 -0
- app/code/community/TIG/Buckaroo3Extended/Model/PaymentMethods/Vpay/PaymentMethod.php +28 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Process.php +168 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Creditmemo.php +317 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Observer.php +51 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Request/Abstract.php +204 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Response/Abstract.php +118 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Response/Push.php +366 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesClosedFailed.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesClosedSuccess.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesCompleteFailed.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesCompleteSuccess.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesProcessingFailed.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Refund/Sources/StatusesProcessingSuccess.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Request/.DS_Store +0 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Request/Abstract.php +256 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Request/Availability.php +163 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Resource/Certificate.php +8 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Resource/Certificate/Collection.php +9 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Resource/Giftcard.php +45 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Resource/Giftcard/Collection.php +46 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Resource/Setup.php +383 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Response/Abstract.php +558 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Response/BackendOrder.php +79 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Response/Push.php +705 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Response/Return.php +39 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Soap.php +666 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/AcceptgiroDirectdebit.php +12 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Afterpay/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Allspecificcountries.php +11 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Amex/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Availablemethods.php +26 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Bancontactmrcash/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/BusinessToBusiness.php +14 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Cartebancaire/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Cartebleue/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Certificates.php +35 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/CultureType.php +12 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Directdebit/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Empayment/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Eps/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/FeePercentageMode.php +63 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Giftcards/AvailableCards.php +21 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Giftcards/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Giropay/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Ideal/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Ideal/ServiceVersion.php +21 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Maestro/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Mastercard/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Onlinegiro/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/PaymentMethodArea.php +13 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Paymentguarantee/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Paypal/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Payperemail/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Paysafecard/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/ReminderLevel.php +14 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Sofortueberweisung/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/States.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/StatusesFailed.php +19 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/StatusesPending.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/StatusesPendingPayment.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/StatusesSuccess.php +18 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/TaxClasses.php +29 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/TestLive.php +12 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Transfer/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Visa/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Visaelectron/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Vpay/AvailableCurrencies.php +16 -0
- app/code/community/TIG/Buckaroo3Extended/Model/Sources/Yesno.php +11 -0
- app/code/community/TIG/Buckaroo3Extended/certificate/Checkout.pem +16 -0
- app/code/community/TIG/Buckaroo3Extended/controllers/Adminhtml/GiftcardController.php +140 -0
- app/code/community/TIG/Buckaroo3Extended/controllers/CheckoutController.php +29 -0
- app/code/community/TIG/Buckaroo3Extended/controllers/NotifyController.php +394 -0
- app/code/community/TIG/Buckaroo3Extended/etc/adminhtml.xml +41 -0
- app/code/community/TIG/Buckaroo3Extended/etc/config.xml +1738 -0
- app/code/community/TIG/Buckaroo3Extended/etc/system.xml +2734 -0
@@ -0,0 +1,60 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Giftcard extends Mage_Adminhtml_Block_Widget_Grid_Container
|
40 |
+
{
|
41 |
+
public function __construct()
|
42 |
+
{
|
43 |
+
$this->_controller = 'adminhtml_giftcard';
|
44 |
+
$this->_blockGroup = 'buckaroo3extended';
|
45 |
+
$this->_headerText = Mage::helper('buckaroo3extended')->__('Buckaroo Giftcards');
|
46 |
+
parent::__construct();
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function _prepareLayout()
|
50 |
+
{
|
51 |
+
$this->setChild('grid',
|
52 |
+
$this->getLayout()->createBlock(
|
53 |
+
$this->_blockGroup.'/' . $this->_controller . '_grid',
|
54 |
+
$this->_controller . '.grid'
|
55 |
+
)->setSaveParametersInSession(true)
|
56 |
+
);
|
57 |
+
|
58 |
+
return parent::_prepareLayout();
|
59 |
+
}
|
60 |
+
}
|
@@ -0,0 +1,63 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Giftcard_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
40 |
+
{
|
41 |
+
public function __construct()
|
42 |
+
{
|
43 |
+
parent::__construct();
|
44 |
+
|
45 |
+
$this->_objectId = 'entity_id';
|
46 |
+
$this->_blockGroup = 'buckaroo3extended';
|
47 |
+
$this->_controller = 'adminhtml_giftcard';
|
48 |
+
$this->_mode = 'edit';
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getHeaderText()
|
52 |
+
{
|
53 |
+
$giftcard = Mage::registry('current_giftcard');
|
54 |
+
|
55 |
+
if ($giftcard->getLabel()) {
|
56 |
+
$headerText = Mage::helper('buckaroo3extended')->__('Edit Giftcard "%s"', $giftcard->getLabel());
|
57 |
+
return $headerText;
|
58 |
+
}
|
59 |
+
|
60 |
+
$headerText = Mage::helper('buckaroo3extended')->__('Create new giftcard');
|
61 |
+
return $headerText;
|
62 |
+
}
|
63 |
+
}
|
@@ -0,0 +1,86 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Giftcard_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
40 |
+
{
|
41 |
+
protected function _prepareForm()
|
42 |
+
{
|
43 |
+
$form = Mage::getModel('varien/data_form', array(
|
44 |
+
'id' => 'edit_form',
|
45 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
46 |
+
'method' => 'post',
|
47 |
+
'enctype' => 'multipart/form-data',
|
48 |
+
));
|
49 |
+
|
50 |
+
$data = Mage::registry('current_giftcard')->getData();
|
51 |
+
$form->setDataObject(Mage::registry('current_giftcard'));
|
52 |
+
|
53 |
+
$fieldset = $form->addFieldset('buckaroo3extended_form', array(
|
54 |
+
'legend' => Mage::helper('buckaroo3extended')->__('General Information')
|
55 |
+
));
|
56 |
+
|
57 |
+
if (!empty($data['entity_id'])) {
|
58 |
+
$fieldset->addField('entity_id', 'hidden', array(
|
59 |
+
'label' => Mage::helper('buckaroo3extended')->__('ID'),
|
60 |
+
'required' => false,
|
61 |
+
'name' => 'entity_id',
|
62 |
+
'value' => '',
|
63 |
+
));
|
64 |
+
}
|
65 |
+
|
66 |
+
$fieldset->addField('servicecode', 'text', array(
|
67 |
+
'label' => Mage::helper('buckaroo3extended')->__('Service Code'),
|
68 |
+
'class' => 'required-entry validate-alpha',
|
69 |
+
'required' => true,
|
70 |
+
'name' => 'giftcard[servicecode]',
|
71 |
+
));
|
72 |
+
|
73 |
+
$fieldset->addField('label', 'text', array(
|
74 |
+
'label' => Mage::helper('buckaroo3extended')->__('Name'),
|
75 |
+
'class' => 'required-entry',
|
76 |
+
'required' => true,
|
77 |
+
'name' => 'giftcard[label]',
|
78 |
+
));
|
79 |
+
|
80 |
+
$form->addValues($data);
|
81 |
+
$form->setUseContainer(true);
|
82 |
+
$this->setForm($form);
|
83 |
+
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
}
|
@@ -0,0 +1,100 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Giftcard_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
40 |
+
{
|
41 |
+
public function __construct()
|
42 |
+
{
|
43 |
+
parent::__construct();
|
44 |
+
|
45 |
+
$this->setSaveParametersInSession(true);
|
46 |
+
$this->setId('giftcard_grid');
|
47 |
+
$this->setUseAjax(true);
|
48 |
+
$this->setDefaultSort('entity_id');
|
49 |
+
$this->setDefaultDir('desc');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Returns collection for grid. Collection has not yet been filtered
|
54 |
+
*/
|
55 |
+
protected function _prepareCollection()
|
56 |
+
{
|
57 |
+
$collection = Mage::getResourceModel('buckaroo3extended/giftcard_collection');
|
58 |
+
|
59 |
+
$this->setCollection($collection);
|
60 |
+
return parent::_prepareCollection();
|
61 |
+
}
|
62 |
+
|
63 |
+
protected function _prepareColumns()
|
64 |
+
{
|
65 |
+
$helper = Mage::helper('buckaroo3extended');
|
66 |
+
$storeId = $this->getStoreId();
|
67 |
+
|
68 |
+
$this->addColumn('entity_id', array(
|
69 |
+
'header' => $helper->__('ID'),
|
70 |
+
'align' =>'right',
|
71 |
+
'width' => '50px',
|
72 |
+
'index' => 'entity_id',
|
73 |
+
'type' => 'number',
|
74 |
+
));
|
75 |
+
|
76 |
+
$this->addColumn('servicecode', array(
|
77 |
+
'header' => $helper->__('Service Code'),
|
78 |
+
'align' =>'left',
|
79 |
+
'index' => 'servicecode',
|
80 |
+
));
|
81 |
+
|
82 |
+
$this->addColumn('label', array(
|
83 |
+
'header' => $helper->__('Name'),
|
84 |
+
'align' =>'left',
|
85 |
+
'index' => 'label',
|
86 |
+
));
|
87 |
+
|
88 |
+
return parent::_prepareColumns();
|
89 |
+
}
|
90 |
+
|
91 |
+
public function getRowUrl($row)
|
92 |
+
{
|
93 |
+
return $this->getUrl('*/*/edit', array('entity_id' => $row->getId()));
|
94 |
+
}
|
95 |
+
|
96 |
+
public function getGridUrl()
|
97 |
+
{
|
98 |
+
return $this->getUrl('*/*/grid', array('_current' => true));
|
99 |
+
}
|
100 |
+
}
|
@@ -0,0 +1,105 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method Varien_Object getTotal()
|
40 |
+
*/
|
41 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Create_Totals_Fee extends Mage_Adminhtml_Block_Sales_Order_Create_Totals
|
42 |
+
{
|
43 |
+
/**
|
44 |
+
* Display modes for the Buckaroo Payment fee.
|
45 |
+
*/
|
46 |
+
const DISPLAY_MODE_EXCL = 1;
|
47 |
+
const DISPLAY_MODE_INCL = 2;
|
48 |
+
const DISPLAY_MODE_BOTH = 3;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Xpath to the Buckaroo Paymentfee display mode setting.
|
52 |
+
*/
|
53 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/cart_display/buckaroo_fee';
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
protected $_template = 'buckaroo3extended/sales/order/create/totals/fee.phtml';
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Get the display mode for the Buckaroo fee.
|
62 |
+
*
|
63 |
+
* @return int
|
64 |
+
*/
|
65 |
+
public function getDisplayMode()
|
66 |
+
{
|
67 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
68 |
+
|
69 |
+
return $displayMode;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Get the tax label for either incl. or excl. tax.
|
74 |
+
*
|
75 |
+
* @param boolean $inclTax
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function getTaxLabel($inclTax = false)
|
80 |
+
{
|
81 |
+
$taxLabel = Mage::helper('tax')->getIncExcTaxLabel($inclTax);
|
82 |
+
|
83 |
+
return $taxLabel;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Get the Buckaroo fee value incl or excl. tax.
|
88 |
+
*
|
89 |
+
* @param bool $inclTax
|
90 |
+
*
|
91 |
+
* @return bool
|
92 |
+
*/
|
93 |
+
public function getValue($inclTax = false)
|
94 |
+
{
|
95 |
+
$address = $this->getTotal()->getAddress();
|
96 |
+
|
97 |
+
$exclTax = $address->getBuckarooFee();
|
98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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Creditmemo_Create_Fee extends Mage_Adminhtml_Block_Template
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Xpath to the Buckaroo Payment fee including tax setting.
|
43 |
+
*/
|
44 |
+
const XPATH_BUCKAROO_FEE_INCLUDING_TAX = 'tax/calculation/buckaroo_fee_including_tax';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Source model.
|
48 |
+
*
|
49 |
+
* @var Mage_Sales_Model_Order_Creditmemo
|
50 |
+
*/
|
51 |
+
protected $_source;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @var boolean|null
|
55 |
+
*/
|
56 |
+
protected $_feeIsInclTax = null;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Initialize creditmemo Buckaroo Payment fee totals
|
60 |
+
*
|
61 |
+
* @return $this
|
62 |
+
*/
|
63 |
+
public function initTotals()
|
64 |
+
{
|
65 |
+
/**
|
66 |
+
* @var Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals $parent
|
67 |
+
*/
|
68 |
+
$parent = $this->getParentBlock();
|
69 |
+
|
70 |
+
$this->_source = $parent->getSource();
|
71 |
+
|
72 |
+
$total = new Varien_Object(
|
73 |
+
array(
|
74 |
+
'code' => 'buckaroo_fee',
|
75 |
+
'block_name' => $this->getNameInLayout()
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
$parent->addTotalBefore($total, 'agjustments');
|
80 |
+
|
81 |
+
return $this;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Get the source model.
|
86 |
+
*
|
87 |
+
* @return Mage_Sales_Model_Order_Creditmemo
|
88 |
+
*/
|
89 |
+
public function getSource()
|
90 |
+
{
|
91 |
+
return $this->_source;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* get whether the fee is incl or excl tax.
|
96 |
+
*
|
97 |
+
* @return boolean
|
98 |
+
*/
|
99 |
+
public function getFeeIsInclTax()
|
100 |
+
{
|
101 |
+
if ($this->_feeIsInclTax !== null) {
|
102 |
+
return $this->_feeIsInclTax;
|
103 |
+
}
|
104 |
+
|
105 |
+
$source = $this->getSource();
|
106 |
+
|
107 |
+
$feeIsInclTax = Mage::getStoreConfigFlag(self::XPATH_BUCKAROO_FEE_INCLUDING_TAX, $source->getStoreId());
|
108 |
+
|
109 |
+
$this->setFeeIsInclTax($feeIsInclTax);
|
110 |
+
return $feeIsInclTax;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @param bool $feeIsInclTax
|
115 |
+
*
|
116 |
+
* @return $this
|
117 |
+
*/
|
118 |
+
public function setFeeIsInclTax($feeIsInclTax)
|
119 |
+
{
|
120 |
+
$this->_feeIsInclTax = $feeIsInclTax;
|
121 |
+
|
122 |
+
return $this;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Get the fee amount.
|
127 |
+
*
|
128 |
+
* @return float
|
129 |
+
*/
|
130 |
+
public function getBuckarooFeeAmount()
|
131 |
+
{
|
132 |
+
$source = $this->getSource();
|
133 |
+
|
134 |
+
$feeAmount = $source->getBaseBuckarooFee();
|
135 |
+
if ($this->getFeeIsInclTax()) {
|
136 |
+
$feeAmount += $source->getBaseBuckarooFeeTax();
|
137 |
+
}
|
138 |
+
|
139 |
+
$feeAmount = Mage::app()->getStore()->roundPrice($feeAmount) * 1;
|
140 |
+
return $feeAmount;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Get the fee label.
|
145 |
+
*
|
146 |
+
* @return string
|
147 |
+
*/
|
148 |
+
public function getBuckarooFeeLabel()
|
149 |
+
{
|
150 |
+
$source = $this->getSource();
|
151 |
+
|
152 |
+
$paymentMethod = $source->getOrder()->getPayment()->getMethod();
|
153 |
+
|
154 |
+
$label = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($source->getStoreId(),$paymentMethod);
|
155 |
+
|
156 |
+
$label .= ' ' . Mage::helper('tax')->getIncExcTaxLabel($this->getFeeIsInclTax());
|
157 |
+
|
158 |
+
return $label;
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* If no fee is available, return an empty string.
|
163 |
+
*
|
164 |
+
* @return string
|
165 |
+
*/
|
166 |
+
protected function _toHtml()
|
167 |
+
{
|
168 |
+
if (!$this->_source->getBuckarooFee()) {
|
169 |
+
return '';
|
170 |
+
}
|
171 |
+
|
172 |
+
return parent::_toHtml();
|
173 |
+
}
|
174 |
+
}
|
@@ -0,0 +1,91 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method boolean hasPaymentMethod()
|
40 |
+
* @method TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Creditmemo_Create_RefundFields setPaymentMethod(string $value)
|
41 |
+
*/
|
42 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Creditmemo_Create_RefundFields
|
43 |
+
extends Mage_Adminhtml_Block_Abstract
|
44 |
+
{
|
45 |
+
/**
|
46 |
+
* Get the current creditmemo's payment method. Will return false if no payment or creditmemo instance can be found.
|
47 |
+
*
|
48 |
+
* @return string|false
|
49 |
+
*/
|
50 |
+
public function getPaymentMethod()
|
51 |
+
{
|
52 |
+
if ($this->hasPaymentMethod()) {
|
53 |
+
return $this->_getData('payment_method');
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @var Mage_Sales_Model_Order_Creditmemo $creditmemo
|
58 |
+
*/
|
59 |
+
$creditmemo = Mage::registry('current_creditmemo');
|
60 |
+
if (!$creditmemo) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @var Mage_Sales_Model_Order_Payment $payment
|
66 |
+
*/
|
67 |
+
$payment = Mage::getModel('sales/order_payment')->load($creditmemo->getOrderId(), 'parent_id');
|
68 |
+
if (!$payment || !$payment->getId()) {
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
|
72 |
+
$paymentMethod = $payment->getMethod();
|
73 |
+
|
74 |
+
$this->setPaymentMethod($paymentMethod);
|
75 |
+
return $paymentMethod;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Check if a payment method can be found before rendering the template.
|
80 |
+
*
|
81 |
+
* @return string
|
82 |
+
*/
|
83 |
+
protected function _toHtml()
|
84 |
+
{
|
85 |
+
if (!$this->getPaymentMethod()) {
|
86 |
+
return '';
|
87 |
+
}
|
88 |
+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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Creditmemo_Totals_Fee
|
40 |
+
extends Mage_Adminhtml_Block_Sales_Order_Creditmemo_Totals
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Display modes for the Buckaroo Payment fee.
|
44 |
+
*/
|
45 |
+
const DISPLAY_MODE_EXCL = 1;
|
46 |
+
const DISPLAY_MODE_INCL = 2;
|
47 |
+
const DISPLAY_MODE_BOTH = 3;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
51 |
+
*/
|
52 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Initialize order totals array
|
56 |
+
*
|
57 |
+
* @return $this
|
58 |
+
*/
|
59 |
+
public function initTotals()
|
60 |
+
{
|
61 |
+
/**
|
62 |
+
* @var Mage_Adminhtml_Block_Sales_Order_Invoice_Totals $parent
|
63 |
+
* @var Mage_Sales_Model_Order_Creditmemo $creditmemo
|
64 |
+
*/
|
65 |
+
$parent = $this->getParentBlock();
|
66 |
+
$creditmemo = $parent->getCreditmemo();
|
67 |
+
|
68 |
+
$fee = $creditmemo->getBuckarooFee();
|
69 |
+
$baseFee = $creditmemo->getBaseBuckarooFee();
|
70 |
+
|
71 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
$paymentMethod = $creditmemo->getOrder()->getPayment()->getMethod();
|
76 |
+
|
77 |
+
$displayMode = $this->getDisplayMode();
|
78 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($creditmemo->getStoreId(), $paymentMethod);
|
79 |
+
|
80 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL
|
81 |
+
|| $displayMode === self::DISPLAY_MODE_BOTH
|
82 |
+
&& $creditmemo->getId()
|
83 |
+
) {
|
84 |
+
$label = $baseLabel;
|
85 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
86 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
87 |
+
}
|
88 |
+
|
89 |
+
$total = new Varien_Object();
|
90 |
+
$total->setLabel($label)
|
91 |
+
->setValue($fee)
|
92 |
+
->setBaseValue($baseFee)
|
93 |
+
->setCode('buckaroo_fee');
|
94 |
+
|
95 |
+
$parent->addTotal($total, 'subtotal_incl');
|
96 |
+
}
|
97 |
+
|
98 |
+
if ($displayMode === self::DISPLAY_MODE_INCL
|
99 |
+
|| $displayMode === self::DISPLAY_MODE_BOTH
|
100 |
+
&& $creditmemo->getId()
|
101 |
+
) {
|
102 |
+
$label = $baseLabel;
|
103 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
104 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
105 |
+
}
|
106 |
+
|
107 |
+
$totalInclTax = new Varien_Object();
|
108 |
+
$totalInclTax->setLabel($label)
|
109 |
+
->setValue($fee + $creditmemo->getBuckarooFeeTax())
|
110 |
+
->setBaseValue($baseFee + $creditmemo->getBaseBuckarooFeeTax())
|
111 |
+
->setCode('buckaroo_fee_incl_tax');
|
112 |
+
|
113 |
+
$parent->addTotal($totalInclTax, 'subtotal_incl');
|
114 |
+
}
|
115 |
+
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Get the display mode for the Buckaroo Payment fee.
|
121 |
+
*
|
122 |
+
* @return int
|
123 |
+
*/
|
124 |
+
public function getDisplayMode()
|
125 |
+
{
|
126 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
127 |
+
|
128 |
+
return $displayMode;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Get the tax label for either incl. or excl. tax.
|
133 |
+
*
|
134 |
+
* @param boolean $inclTax
|
135 |
+
*
|
136 |
+
* @return string
|
137 |
+
*/
|
138 |
+
public function getTaxLabel($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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Invoice_Totals_Fee
|
40 |
+
extends Mage_Adminhtml_Block_Sales_Order_Invoice_Totals
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Display modes for the Buckaroo Payment fee.
|
44 |
+
*/
|
45 |
+
const DISPLAY_MODE_EXCL = 1;
|
46 |
+
const DISPLAY_MODE_INCL = 2;
|
47 |
+
const DISPLAY_MODE_BOTH = 3;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
51 |
+
*/
|
52 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Initialize order totals array
|
56 |
+
*
|
57 |
+
* @return $this
|
58 |
+
*/
|
59 |
+
public function initTotals()
|
60 |
+
{
|
61 |
+
/**
|
62 |
+
* @var Mage_Adminhtml_Block_Sales_Order_Invoice_Totals $parent
|
63 |
+
*/
|
64 |
+
$parent = $this->getParentBlock();
|
65 |
+
/**
|
66 |
+
* @var Mage_Sales_Model_Order_Invoice $invoice
|
67 |
+
*/
|
68 |
+
$invoice = $parent->getInvoice();
|
69 |
+
|
70 |
+
$fee = $invoice->getOrder()->getBuckarooFee();
|
71 |
+
$baseFee = $invoice->getOrder()->getBaseBuckarooFee();
|
72 |
+
|
73 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
74 |
+
return $this;
|
75 |
+
}
|
76 |
+
|
77 |
+
$paymentMethod = $invoice->getOrder()->getPayment()->getMethod();
|
78 |
+
|
79 |
+
$displayMode = $this->getDisplayMode();
|
80 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($invoice->getStoreId(),$paymentMethod);
|
81 |
+
|
82 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
83 |
+
$label = $baseLabel;
|
84 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
85 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
86 |
+
}
|
87 |
+
|
88 |
+
$total = new Varien_Object();
|
89 |
+
$total->setLabel($label)
|
90 |
+
->setValue($fee)
|
91 |
+
->setBaseValue($baseFee)
|
92 |
+
->setCode('buckaroo_fee');
|
93 |
+
|
94 |
+
$parent->addTotalBefore($total, 'shipping');
|
95 |
+
}
|
96 |
+
|
97 |
+
if ($displayMode === self::DISPLAY_MODE_INCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
98 |
+
$label = $baseLabel;
|
99 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
100 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
101 |
+
}
|
102 |
+
|
103 |
+
$totalInclTax = new Varien_Object();
|
104 |
+
$totalInclTax->setLabel($label)
|
105 |
+
->setValue($fee + $invoice->getBuckarooFeeTax())
|
106 |
+
->setBaseValue($baseFee + $invoice->getBaseBuckarooFeeTax())
|
107 |
+
->setCode('buckaroo_fee_incl_tax');
|
108 |
+
|
109 |
+
$parent->addTotalBefore($totalInclTax, 'shipping');
|
110 |
+
}
|
111 |
+
|
112 |
+
return $this;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Get the display mode for the Buckaroo Payment fee.
|
117 |
+
*
|
118 |
+
* @return int
|
119 |
+
*/
|
120 |
+
public function getDisplayMode()
|
121 |
+
{
|
122 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
123 |
+
|
124 |
+
return $displayMode;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Get the tax label for either incl. or excl. tax.
|
129 |
+
*
|
130 |
+
* @param boolean $inclTax
|
131 |
+
*
|
132 |
+
* @return string
|
133 |
+
*/
|
134 |
+
public function getTaxLabel($inclTax = false)
|
135 |
+
{
|
136 |
+
$taxLabel = Mage::hel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
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_Sales_Order_Totals_Fee extends Mage_Adminhtml_Block_Sales_Order_Totals
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Display modes for the Buckaroo Payment fee.
|
43 |
+
*/
|
44 |
+
const DISPLAY_MODE_EXCL = 1;
|
45 |
+
const DISPLAY_MODE_INCL = 2;
|
46 |
+
const DISPLAY_MODE_BOTH = 3;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
50 |
+
*/
|
51 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Initialize order totals array
|
55 |
+
*
|
56 |
+
* @return $this
|
57 |
+
*/
|
58 |
+
public function initTotals()
|
59 |
+
{
|
60 |
+
$parent = $this->getParentBlock();
|
61 |
+
$order = $this->getOrder();
|
62 |
+
|
63 |
+
$fee = $order->getBuckarooFee();
|
64 |
+
$baseFee = $order->getBaseBuckarooFee();
|
65 |
+
|
66 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
$paymentMethod = $order->getPayment()->getMethod();
|
71 |
+
|
72 |
+
$displayMode = $this->getDisplayMode();
|
73 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($order->getStoreId(),$paymentMethod);
|
74 |
+
|
75 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
76 |
+
$label = $baseLabel;
|
77 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
78 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
79 |
+
}
|
80 |
+
|
81 |
+
$total = new Varien_Object();
|
82 |
+
$total->setLabel($label)
|
83 |
+
->setValue($fee)
|
84 |
+
->setBaseValue($baseFee)
|
85 |
+
->setCode('buckaroo_fee');
|
86 |
+
|
87 |
+
$parent->addTotalBefore($total, 'shipping');
|
88 |
+
}
|
89 |
+
|
90 |
+
if ($displayMode === self::DISPLAY_MODE_INCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
91 |
+
$label = $baseLabel;
|
92 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
93 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
94 |
+
}
|
95 |
+
|
96 |
+
$totalInclTax = new Varien_Object();
|
97 |
+
$totalInclTax->setLabel($label)
|
98 |
+
->setValue($fee + $order->getBuckarooFeeTax())
|
99 |
+
->setBaseValue($baseFee + $order->getBaseBuckarooFeeTax())
|
100 |
+
->setCode('buckaroo_fee_incl_tax');
|
101 |
+
|
102 |
+
$parent->addTotalBefore($totalInclTax, 'shipping');
|
103 |
+
}
|
104 |
+
|
105 |
+
return $this;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Get the display mode for the Buckaroo fee.
|
110 |
+
*
|
111 |
+
* @return int
|
112 |
+
*/
|
113 |
+
public function getDisplayMode()
|
114 |
+
{
|
115 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
116 |
+
|
117 |
+
return $displayMode;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Get the tax label for either incl. or excl. tax.
|
122 |
+
*
|
123 |
+
* @param boolean $inclTax
|
124 |
+
*
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
public function getTaxLabel($inclTax = false)
|
128 |
+
{
|
129 |
+
$taxLabel = Mage::helper('tax')->getIncExcText($inclTax);
|
130 |
+
|
131 |
+
return $taxLabel;
|
132 |
+
}
|
133 |
+
}
|
@@ -0,0 +1,53 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_Hint
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/hint.phtml';
|
7 |
+
|
8 |
+
public $methods = array(
|
9 |
+
'amex',
|
10 |
+
'directdebit',
|
11 |
+
'giropay',
|
12 |
+
'ideal',
|
13 |
+
'mastercard',
|
14 |
+
'cartebancaire',
|
15 |
+
'cartebleue',
|
16 |
+
'onlinegiro',
|
17 |
+
'paypal',
|
18 |
+
'paysafecard',
|
19 |
+
'sofortueberweisung',
|
20 |
+
'transfer',
|
21 |
+
'visa',
|
22 |
+
'payperemail',
|
23 |
+
'paymentguarantee',
|
24 |
+
'giftcards',
|
25 |
+
'empayment',
|
26 |
+
'maestro',
|
27 |
+
'visaelectron',
|
28 |
+
'vpay',
|
29 |
+
'bancontactmrcash',
|
30 |
+
'eps',
|
31 |
+
'afterpay',
|
32 |
+
);
|
33 |
+
|
34 |
+
public $services = array(
|
35 |
+
'refund',
|
36 |
+
);
|
37 |
+
|
38 |
+
public $config = array(
|
39 |
+
'advanced',
|
40 |
+
'certificate',
|
41 |
+
);
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Render fieldset html
|
45 |
+
*
|
46 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
50 |
+
{
|
51 |
+
return $this->toHtml();
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,17 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_KlarnaCheck
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/klarnaCheck.phtml';
|
7 |
+
|
8 |
+
public function getIsKlarnaEnabled()
|
9 |
+
{
|
10 |
+
return Mage::helper('buckaroo3extended')->getIsKlarnaEnabled();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
return $this->toHtml();
|
16 |
+
}
|
17 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_Paymentmethodbanner
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/paymentmethodbanner.phtml';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_SellersProtectionCheck
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/paypalRegionCheck.phtml';
|
7 |
+
|
8 |
+
public function getIsRegionRequired()
|
9 |
+
{
|
10 |
+
//check if the paymentmethod is set to enabled for a particular storeview
|
11 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/active', Mage::app()->getRequest()->getParam('store'))) {
|
12 |
+
return true;
|
13 |
+
}
|
14 |
+
|
15 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/sellers_protection', Mage::app()->getRequest()->getParam('store'))) {
|
16 |
+
return true;
|
17 |
+
}
|
18 |
+
|
19 |
+
return Mage::helper('buckaroo3extended')->checkRegionRequired();
|
20 |
+
}
|
21 |
+
|
22 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
23 |
+
{
|
24 |
+
return $this->toHtml();
|
25 |
+
}
|
26 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_Singlehint
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/singlehint.phtml';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,30 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Adminhtml_System_Config_SupportTab
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/system/config/supportTab.phtml';
|
7 |
+
|
8 |
+
public $buckarooSupport = '<a href="mailto:support@buckaroo.nl">Buckaroo support</a>';
|
9 |
+
public $anchorClose = '</a>';
|
10 |
+
public $totalEmail = '<a href="mailto:info@totalinternetgroup.nl">';
|
11 |
+
public $buckarooUrl = '<a href="http://www.buckaroo.nl">Buckaroo</a>';
|
12 |
+
|
13 |
+
protected function _prepareLayout()
|
14 |
+
{
|
15 |
+
//placed here, instead of in layout.xml to make sure it is only loaded for Buckaroo's section
|
16 |
+
$this->getLayout()->getBlock('head')->addCss('css/tig_buckaroo3extended/supportTab.css');
|
17 |
+
return parent::_prepareLayout();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Render fieldset html
|
22 |
+
*
|
23 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
24 |
+
* @return string
|
25 |
+
*/
|
26 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
27 |
+
{
|
28 |
+
return $this->toHtml();
|
29 |
+
}
|
30 |
+
}
|
@@ -0,0 +1,39 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Customer
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
class TIG_Buckaroo3Extended_Block_Customer_Widget_Dob extends Mage_Customer_Block_Widget_Dob
|
28 |
+
{
|
29 |
+
public function _construct()
|
30 |
+
{
|
31 |
+
parent::_construct();
|
32 |
+
$this->setTemplate('buckaroo3extended/customer/widget/dob.phtml');
|
33 |
+
}
|
34 |
+
|
35 |
+
public function isRequired()
|
36 |
+
{
|
37 |
+
return (bool) $this->getIsRequired();
|
38 |
+
}
|
39 |
+
}
|
@@ -0,0 +1,104 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method Varien_Object getTotal()
|
40 |
+
*/
|
41 |
+
class TIG_Buckaroo3Extended_Block_PaymentFee_Checkout_Total_Fee extends Mage_Checkout_Block_Total_Default
|
42 |
+
{
|
43 |
+
/**
|
44 |
+
* Display modes for the Buckaroo Payment fee.
|
45 |
+
*/
|
46 |
+
const DISPLAY_MODE_EXCL = 1;
|
47 |
+
const DISPLAY_MODE_INCL = 2;
|
48 |
+
const DISPLAY_MODE_BOTH = 3;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
52 |
+
*/
|
53 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/cart_display/buckaroo_fee';
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @var string
|
57 |
+
*/
|
58 |
+
protected $_template = 'buckaroo3extended/paymentFee/checkout/fee.phtml';
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Get the display mode for the Buckaroo Payment fee.
|
62 |
+
*
|
63 |
+
* @return int
|
64 |
+
*/
|
65 |
+
public function getDisplayMode()
|
66 |
+
{
|
67 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
68 |
+
return $displayMode;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Get the tax label for either incl. or excl. tax.
|
73 |
+
*
|
74 |
+
* @param boolean $inclTax
|
75 |
+
*
|
76 |
+
* @return string
|
77 |
+
*/
|
78 |
+
public function getTaxLabel($inclTax = false)
|
79 |
+
{
|
80 |
+
$taxLabel = Mage::helper('tax')->getIncExcTaxLabel($inclTax);
|
81 |
+
|
82 |
+
return $taxLabel;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Get the Buckaroo Payment fee value incl or excl. tax.
|
87 |
+
*
|
88 |
+
* @param bool $inclTax
|
89 |
+
*
|
90 |
+
* @return bool
|
91 |
+
*/
|
92 |
+
public function getValue($inclTax = false)
|
93 |
+
{
|
94 |
+
$address = $this->getTotal()->getAddress();
|
95 |
+
|
96 |
+
$exclTax = $address->getBuckarooFee();
|
97 |
+
if (!$inclTax) {
|
98 |
+
return $exclTax;
|
99 |
+
}
|
100 |
+
|
101 |
+
$inclTax = $exclTax + $address->getBuckarooFeeTax();
|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â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_PaymentFee_Sales_Order_Creditmemo_Totals_Fee extends Mage_Sales_Block_Order_Creditmemo_Totals
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Display modes for the Buckaroo Payment fee.
|
43 |
+
*/
|
44 |
+
const DISPLAY_MODE_EXCL = 1;
|
45 |
+
const DISPLAY_MODE_INCL = 2;
|
46 |
+
const DISPLAY_MODE_BOTH = 3;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
50 |
+
*/
|
51 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Initialize order totals array
|
55 |
+
*
|
56 |
+
* @return $this
|
57 |
+
*/
|
58 |
+
public function initTotals()
|
59 |
+
{
|
60 |
+
/**
|
61 |
+
* @var Mage_Adminhtml_Block_Sales_Order_Invoice_Totals $parent
|
62 |
+
* @var Mage_Sales_Model_Order_Creditmemo $creditmemo
|
63 |
+
*/
|
64 |
+
$parent = $this->getParentBlock();
|
65 |
+
$creditmemo = $parent->getCreditmemo();
|
66 |
+
|
67 |
+
$fee = $creditmemo->getBuckarooFee();
|
68 |
+
$baseFee = $creditmemo->getBaseBuckarooFee();
|
69 |
+
|
70 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
71 |
+
return $this;
|
72 |
+
}
|
73 |
+
|
74 |
+
$displayMode = $this->getDisplayMode();
|
75 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($creditmemo->getStoreId());
|
76 |
+
|
77 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL
|
78 |
+
|| $displayMode === self::DISPLAY_MODE_BOTH
|
79 |
+
&& $creditmemo->getId()
|
80 |
+
) {
|
81 |
+
$label = $baseLabel;
|
82 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
83 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
84 |
+
}
|
85 |
+
|
86 |
+
$total = new Varien_Object();
|
87 |
+
$total->setLabel($label)
|
88 |
+
->setValue($fee)
|
89 |
+
->setBaseValue($baseFee)
|
90 |
+
->setCode('buckaroo_fee');
|
91 |
+
|
92 |
+
$parent->addTotal($total, 'subtotal_incl');
|
93 |
+
}
|
94 |
+
|
95 |
+
if ($displayMode === self::DISPLAY_MODE_INCL
|
96 |
+
|| $displayMode === self::DISPLAY_MODE_BOTH
|
97 |
+
&& $creditmemo->getId()
|
98 |
+
) {
|
99 |
+
$label = $baseLabel;
|
100 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
101 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
102 |
+
}
|
103 |
+
|
104 |
+
$totalInclTax = new Varien_Object();
|
105 |
+
$totalInclTax->setLabel($label)
|
106 |
+
->setValue($fee + $creditmemo->getBuckarooFeeTax())
|
107 |
+
->setBaseValue($baseFee + $creditmemo->getBaseBuckarooFeeTax())
|
108 |
+
->setCode('buckaroo_fee_incl_tax');
|
109 |
+
|
110 |
+
$parent->addTotal($totalInclTax, 'subtotal_incl');
|
111 |
+
}
|
112 |
+
|
113 |
+
return $this;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Get the display mode for the Buckaroo fee.
|
118 |
+
*
|
119 |
+
* @return int
|
120 |
+
*/
|
121 |
+
public function getDisplayMode()
|
122 |
+
{
|
123 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
124 |
+
|
125 |
+
return $displayMode;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Get the tax label for either incl. or excl. tax.
|
130 |
+
*
|
131 |
+
* @param boolean $inclTax
|
132 |
+
*
|
133 |
+
* @return string
|
134 |
+
*/
|
135 |
+
public function getTaxLabel($inclTax = false)
|
136 |
+
{
|
137 |
+
$taxLabel = Mage::helper('tax')->getIncExcText($inclTax);
|
138 |
+
|
139 |
+
return $taxLabel;
|
140 |
+
}
|
141 |
+
}
|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|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_PaymentFee_Sales_Order_Invoice_Totals_Fee extends Mage_Sales_Block_Order_Invoice_Totals
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Display modes for the Buckaroo fee.
|
43 |
+
*/
|
44 |
+
const DISPLAY_MODE_EXCL = 1;
|
45 |
+
const DISPLAY_MODE_INCL = 2;
|
46 |
+
const DISPLAY_MODE_BOTH = 3;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Xpath to the Buckaroo fee display mode setting.
|
50 |
+
*/
|
51 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Initialize order totals array
|
55 |
+
*
|
56 |
+
* @return $this
|
57 |
+
*/
|
58 |
+
public function initTotals()
|
59 |
+
{
|
60 |
+
/**
|
61 |
+
* @var Mage_Adminhtml_Block_Sales_Order_Invoice_Totals $parent
|
62 |
+
*/
|
63 |
+
$parent = $this->getParentBlock();
|
64 |
+
$invoice = $parent->getInvoice();
|
65 |
+
|
66 |
+
$fee = $invoice->getBuckarooFee();
|
67 |
+
$baseFee = $invoice->getBaseBuckarooFee();
|
68 |
+
|
69 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
$displayMode = $this->getDisplayMode();
|
74 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($invoice->getStoreId());
|
75 |
+
|
76 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
77 |
+
$label = $baseLabel;
|
78 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
79 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
80 |
+
}
|
81 |
+
|
82 |
+
$total = new Varien_Object();
|
83 |
+
$total->setLabel($label)
|
84 |
+
->setValue($fee)
|
85 |
+
->setBaseValue($baseFee)
|
86 |
+
->setCode('buckaroo_fee');
|
87 |
+
|
88 |
+
$parent->addTotalBefore($total, 'shipping');
|
89 |
+
}
|
90 |
+
|
91 |
+
if ($displayMode === self::DISPLAY_MODE_INCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
92 |
+
$label = $baseLabel;
|
93 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
94 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
95 |
+
}
|
96 |
+
|
97 |
+
$totalInclTax = new Varien_Object();
|
98 |
+
$totalInclTax->setLabel($label)
|
99 |
+
->setValue($fee + $invoice->getBuckarooFeeTax())
|
100 |
+
->setBaseValue($baseFee + $invoice->getBaseBuckarooFeeTax())
|
101 |
+
->setCode('buckaroo_fee_incl_tax');
|
102 |
+
|
103 |
+
$parent->addTotalBefore($totalInclTax, 'shipping');
|
104 |
+
}
|
105 |
+
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Get the display mode for the Buckaroo fee.
|
111 |
+
*
|
112 |
+
* @return int
|
113 |
+
*/
|
114 |
+
public function getDisplayMode()
|
115 |
+
{
|
116 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
117 |
+
|
118 |
+
return $displayMode;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Get the tax label for either incl. or excl. tax.
|
123 |
+
*
|
124 |
+
* @param boolean $inclTax
|
125 |
+
*
|
126 |
+
* @return string
|
127 |
+
*/
|
128 |
+
public function getTaxLabel($inclTax = false)
|
129 |
+
{
|
130 |
+
$taxLabel = Mage::helper('tax')->getIncExcText($inclTax);
|
131 |
+
|
132 |
+
return $taxLabel;
|
133 |
+
}
|
134 |
+
}
|
@@ -0,0 +1,131 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Block_PaymentFee_Sales_Order_Totals_Fee extends Mage_Sales_Block_Order_Totals
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Display modes for the Buckaroo fee.
|
43 |
+
*/
|
44 |
+
const DISPLAY_MODE_EXCL = 1;
|
45 |
+
const DISPLAY_MODE_INCL = 2;
|
46 |
+
const DISPLAY_MODE_BOTH = 3;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Xpath to the Buckaroo fee display mode setting.
|
50 |
+
*/
|
51 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/sales_display/buckaroo_fee';
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Initialize order totals array
|
55 |
+
*
|
56 |
+
* @return $this
|
57 |
+
*/
|
58 |
+
public function initTotals()
|
59 |
+
{
|
60 |
+
$parent = $this->getParentBlock();
|
61 |
+
$order = $this->getOrder();
|
62 |
+
|
63 |
+
$fee = $order->getBuckarooFee();
|
64 |
+
$baseFee = $order->getBaseBuckarooFee();
|
65 |
+
|
66 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
$displayMode = $this->getDisplayMode();
|
71 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($order->getStoreId());
|
72 |
+
|
73 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
74 |
+
$label = $baseLabel;
|
75 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
76 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
77 |
+
}
|
78 |
+
|
79 |
+
$total = new Varien_Object();
|
80 |
+
$total->setLabel($label)
|
81 |
+
->setValue($fee)
|
82 |
+
->setBaseValue($baseFee)
|
83 |
+
->setCode('buckaroo_fee');
|
84 |
+
|
85 |
+
$parent->addTotalBefore($total, 'shipping');
|
86 |
+
}
|
87 |
+
|
88 |
+
if ($displayMode === self::DISPLAY_MODE_INCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
89 |
+
$label = $baseLabel;
|
90 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
91 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
92 |
+
}
|
93 |
+
|
94 |
+
$totalInclTax = new Varien_Object();
|
95 |
+
$totalInclTax->setLabel($label)
|
96 |
+
->setValue($fee + $order->getBuckarooFeeTax())
|
97 |
+
->setBaseValue($baseFee + $order->getBaseBuckarooFeeTax())
|
98 |
+
->setCode('buckaroo_fee_incl_tax');
|
99 |
+
|
100 |
+
$parent->addTotalBefore($totalInclTax, 'shipping');
|
101 |
+
}
|
102 |
+
|
103 |
+
return $this;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Get the display mode for the Buckaroo fee.
|
108 |
+
*
|
109 |
+
* @return int
|
110 |
+
*/
|
111 |
+
public function getDisplayMode()
|
112 |
+
{
|
113 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->_store);
|
114 |
+
|
115 |
+
return $displayMode;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Get the tax label for either incl. or excl. tax.
|
120 |
+
*
|
121 |
+
* @param boolean $inclTax
|
122 |
+
*
|
123 |
+
* @return string
|
124 |
+
*/
|
125 |
+
public function getTaxLabel($inclTax = false)
|
126 |
+
{
|
127 |
+
$taxLabel = Mage::helper('tax')->getIncExcText($inclTax);
|
128 |
+
|
129 |
+
return $taxLabel;
|
130 |
+
}
|
131 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Afterpay_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/afterpay_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,44 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Afterpay_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/afterpay/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getPaymethod()
|
11 |
+
{
|
12 |
+
return Mage::getStoreConfig('buckaroo/' . $this->getMethodCode() . '/paymethod', Mage::app()->getStore()->getStoreId());
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getBusiness()
|
16 |
+
{
|
17 |
+
return Mage::getStoreConfig('buckaroo/' . $this->getMethodCode() . '/business', Mage::app()->getStore()->getStoreId());
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getCompanyCOCRegistration()
|
21 |
+
{
|
22 |
+
return $this->getSession()->getData($this->getMethodCode() . '_BPE_CompanyCOCRegistration');
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getCompanyName()
|
26 |
+
{
|
27 |
+
return $this->getSession()->getData($this->getMethodCode() . '_BPE_CompanyName');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getCostCentre()
|
31 |
+
{
|
32 |
+
return $this->getSession()->getData($this->getMethodCode() . '_BPE_CostCentre');
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getVatNumber()
|
36 |
+
{
|
37 |
+
return $this->getSession()->getData($this->getMethodCode() . '_BPE_VatNumber');
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getBusinessSelect()
|
41 |
+
{
|
42 |
+
return $this->getSession()->getData($this->getMethodCode() . '_BPE_BusinessSelect');
|
43 |
+
}
|
44 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Amex_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/amex_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Amex_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/amex/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Bancontactmrcash_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/bancontactmrcash_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Bancontactmrcash_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/bancontactmrcash/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Cartebancaire_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/cartebancaire_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Cartebancaire_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/cartebancaire/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Cartebleue_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/cartebleue_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Cartebleue_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/cartebleue/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,235 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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Abstract extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Xpath to the Buckaroo fee setting.
|
6 |
+
*/
|
7 |
+
const XPATH_BUCKAROO_FEE = 'buckaroo/%s/payment_fee';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* construct method
|
11 |
+
*/
|
12 |
+
protected function _construct()
|
13 |
+
{
|
14 |
+
$session = Mage::getSingleton('checkout/session');
|
15 |
+
$this->setSession($session);
|
16 |
+
$this->setCustomer(Mage::getSingleton('customer/session')->getCustomer());
|
17 |
+
$this->setAddress($session->getQuote()->getBillingAddress());
|
18 |
+
$this->setQuote($session->getQuote());
|
19 |
+
|
20 |
+
return parent::_construct();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @param bool $useSpan
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getMethodLabelAfterHtml($useSpan = true)
|
28 |
+
{
|
29 |
+
if(Mage::helper('buckaroo3extended')->getIsKlarnaEnabled()) {
|
30 |
+
return '';
|
31 |
+
}
|
32 |
+
|
33 |
+
$code = $this->getMethod()->getCode();
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
$quote = $this->getQuote();
|
38 |
+
/** @todo generate the fee amount dynamic, based on TAX-settings */
|
39 |
+
//$paymentFeeModel = Mage::getModel('buckaroo3extended/paymentFee_quote_address_total_fee');
|
40 |
+
//$paymentFee = $paymentFeeModel->getPaymentFeeBeforeSelect($quote, $code);
|
41 |
+
$paymentFee = Mage::getStoreConfig(
|
42 |
+
sprintf(self::XPATH_BUCKAROO_FEE, $code),
|
43 |
+
$quote->getStoreId()
|
44 |
+
);
|
45 |
+
|
46 |
+
if($paymentFee < 1){
|
47 |
+
return '';
|
48 |
+
}
|
49 |
+
|
50 |
+
$fee = str_replace(',', '.', $paymentFee);
|
51 |
+
|
52 |
+
if (strpos($fee, '%') === false) {
|
53 |
+
$fee = Mage::helper('core')->currency($fee, true, false);
|
54 |
+
}
|
55 |
+
|
56 |
+
$feeText = '';
|
57 |
+
|
58 |
+
if ($useSpan) {
|
59 |
+
$feeText .= '<span class="buckaroo_fee '
|
60 |
+
. $code
|
61 |
+
. '">';
|
62 |
+
}
|
63 |
+
|
64 |
+
$feeText .= '(+ ' . $fee . ')';
|
65 |
+
|
66 |
+
if ($useSpan) {
|
67 |
+
$feeText .= '</span>';
|
68 |
+
}
|
69 |
+
|
70 |
+
return $feeText;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
public function getName()
|
77 |
+
{
|
78 |
+
$name = $this->getSession()->getData($this->getMethodCode() . '_BPE_Customername');
|
79 |
+
if (!$name) {
|
80 |
+
$address = $this->getAddress();
|
81 |
+
$firstname = $this->getFirstname();
|
82 |
+
$lastname = $this->getLastname();
|
83 |
+
|
84 |
+
$name = $firstname . ' ' . $lastname;
|
85 |
+
}
|
86 |
+
|
87 |
+
return $name;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @return mixed
|
92 |
+
*/
|
93 |
+
public function getFirstname()
|
94 |
+
{
|
95 |
+
$firstname = $this->getSession()->getData($this->getMethodCode() . '_BPE_Customerfirstname');
|
96 |
+
|
97 |
+
if (!$firstname) {
|
98 |
+
$firstname = $this->getAddress()->getFirstname();
|
99 |
+
}
|
100 |
+
|
101 |
+
if (!$firstname && $this->getCustomer()) {
|
102 |
+
$firstname = $this->getCustomer()->getFirstname();
|
103 |
+
}
|
104 |
+
|
105 |
+
return $firstname;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @return mixed
|
110 |
+
*/
|
111 |
+
public function getLastname()
|
112 |
+
{
|
113 |
+
$lastname = $this->getSession()->getData($this->getMethodCode() . '_BPE_Customerlastname');
|
114 |
+
|
115 |
+
if (!$lastname) {
|
116 |
+
$lastname = $this->getAddress()->getLastname();
|
117 |
+
}
|
118 |
+
|
119 |
+
if (!$lastname && $this->getCustomer()) {
|
120 |
+
$lastname = $this->getCustomer()->getLastname();
|
121 |
+
}
|
122 |
+
|
123 |
+
return $lastname;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* @return int
|
128 |
+
*/
|
129 |
+
public function getGender()
|
130 |
+
{
|
131 |
+
$gender = (int) $this->getSession()->getData($this->getMethodCode() . '_BPE_Customergender');
|
132 |
+
if (!$gender) {
|
133 |
+
$customerId = $this->getAddress()->getCustomerId();
|
134 |
+
$customer = Mage::getModel('customer/customer')->load($customerId);
|
135 |
+
$gender = (int) $customer->getGender();
|
136 |
+
}
|
137 |
+
|
138 |
+
return $gender;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @return array|string
|
143 |
+
*/
|
144 |
+
public function getDob()
|
145 |
+
{
|
146 |
+
$dob = array(
|
147 |
+
false,
|
148 |
+
false,
|
149 |
+
false,
|
150 |
+
);
|
151 |
+
if (!is_null($this->getSession()->getData($this->getMethodCode() . '_customerbirthdate[day]'))) {
|
152 |
+
$dob = array(
|
153 |
+
$this->getSession()->getData($this->getMethodCode() . '_customerbirthdate[day]'),
|
154 |
+
$this->getSession()->getData($this->getMethodCode() . '_customerbirthdate[month]'),
|
155 |
+
$this->getSession()->getData($this->getMethodCode() . '_customerbirthdate[year]'),
|
156 |
+
);
|
157 |
+
} else {
|
158 |
+
$customerId = $this->getAddress()->getCustomerId();
|
159 |
+
$customer = Mage::getModel('customer/customer')->load($customerId);
|
160 |
+
$customerDob = $customer->getDob();
|
161 |
+
if (!$customerDob) {
|
162 |
+
return $dob;
|
163 |
+
}
|
164 |
+
|
165 |
+
$dob = Mage::getModel('core/date')->date('d,m,Y', $customerDob);
|
166 |
+
$dob = explode(',', $dob);
|
167 |
+
}
|
168 |
+
|
169 |
+
return $dob;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* @return mixed
|
174 |
+
*/
|
175 |
+
public function getEmail()
|
176 |
+
{
|
177 |
+
$email = $this->getSession()->getData($this->getMethodCode() . '_BPE_Customeremail');
|
178 |
+
|
179 |
+
if (!$email) {
|
180 |
+
$this->getAddress()->getEmail();
|
181 |
+
}
|
182 |
+
|
183 |
+
if (!$email && $this->getCustomer()) {
|
184 |
+
$email = $this->getCustomer()->getEmail();
|
185 |
+
}
|
186 |
+
|
187 |
+
return $email;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* @return mixed
|
192 |
+
*/
|
193 |
+
public function getBankAccount()
|
194 |
+
{
|
195 |
+
$account = $this->getSession()->getData($this->getMethodCode() . '_bpe_customer_account_number');
|
196 |
+
|
197 |
+
return $account;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* @return null|string
|
202 |
+
*/
|
203 |
+
public function getPhoneNumber()
|
204 |
+
{
|
205 |
+
$phoneNumber = $this->getSession()->getData($this->getMethodCode() . '_bpe_customer_phone_number');
|
206 |
+
|
207 |
+
if (!$phoneNumber) {
|
208 |
+
$phoneNumber = $this->getAddress()->getTelephone();
|
209 |
+
}
|
210 |
+
|
211 |
+
if (!$phoneNumber || $phoneNumber == '-') {
|
212 |
+
$billingAddress = $this->getCustomer()->getDefaultBillingAddress();
|
213 |
+
if ($billingAddress) {
|
214 |
+
$phoneNumber = $billingAddress->getTelephone();
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
if ($phoneNumber == '-') {
|
219 |
+
return null;
|
220 |
+
}
|
221 |
+
|
222 |
+
return $phoneNumber;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* @return mixed
|
227 |
+
*/
|
228 |
+
public function getBillingCountry()
|
229 |
+
{
|
230 |
+
/** @var Mage_Sales_Model_Quote $quote */
|
231 |
+
$quote = $this->getQuote();
|
232 |
+
|
233 |
+
return $quote->getBillingAddress()->getCountry();
|
234 |
+
}
|
235 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Directdebit_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/directdebit_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Directdebit_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/directdebit/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function getAccountOwner()
|
11 |
+
{
|
12 |
+
$accountHolder = $this->getSession()->getData('payment[account_owner]');
|
13 |
+
|
14 |
+
if (!$accountHolder) {
|
15 |
+
$accountHolder = $this->getName();
|
16 |
+
}
|
17 |
+
return $accountHolder;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getAccountNumber()
|
21 |
+
{
|
22 |
+
return $this->getSession()->getData('payment[account_number]');
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getBankNumber()
|
26 |
+
{
|
27 |
+
return $this->getSession()->getData('payment[bank_number]');
|
28 |
+
}
|
29 |
+
}
|
@@ -0,0 +1,30 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Directdebit_Info extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
protected $_mandateReference;
|
5 |
+
|
6 |
+
protected function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->setTemplate('buckaroo3extended/directdebit/info.phtml');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getMandateReference()
|
13 |
+
{
|
14 |
+
if (is_null($this->_mandateReference)) {
|
15 |
+
$this->_convertAdditionalData();
|
16 |
+
}
|
17 |
+
return $this->_mandateReference;
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _convertAdditionalData()
|
21 |
+
{
|
22 |
+
$details = unserialize($this->getInfo()->getAdditionalData());
|
23 |
+
if (is_array($details)) {
|
24 |
+
$this->_mandateReference = isset($details['mandate_reference']) ? (string) $details['mandate_reference'] : '';
|
25 |
+
} else {
|
26 |
+
$this->_mandateReference = '';
|
27 |
+
}
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Empayment_Adminhtml_System_Config_Advancedbtn
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/empayment_system/config/advancedbtn.phtml';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
|
17 |
+
return $this->toHtml();
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Empayment_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/empayment/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Eps_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/eps_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Eps_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/eps/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Amex_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/amex_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Giftcards_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/giftcards/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Giropay_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/giropay_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Giropay_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/giropay/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Ideal_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/ideal_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,109 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Ideal_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/ideal/checkout/form.phtml');
|
7 |
+
$this->setIssuers();
|
8 |
+
parent::_construct();
|
9 |
+
}
|
10 |
+
|
11 |
+
public function setIssuers()
|
12 |
+
{
|
13 |
+
$issuersArray = array(
|
14 |
+
'version1' => array(
|
15 |
+
'0031' => array(
|
16 |
+
'name' => 'ABN AMRO',
|
17 |
+
'logo' => 'logo_abn_s.gif',
|
18 |
+
),
|
19 |
+
'0761' => array(
|
20 |
+
'name' => 'ASN Bank',
|
21 |
+
'logo' => 'icon_asn.gif',
|
22 |
+
),
|
23 |
+
'0721' => array(
|
24 |
+
'name' => 'ING',
|
25 |
+
'logo' => 'logo_ing_s.gif',
|
26 |
+
),
|
27 |
+
'0021' => array(
|
28 |
+
'name' => 'Rabobank',
|
29 |
+
'logo' => 'logo_rabo_s.gif',
|
30 |
+
),
|
31 |
+
'0751' => array(
|
32 |
+
'name' => 'SNS Bank',
|
33 |
+
'logo' => 'logo_sns_s.gif',
|
34 |
+
),
|
35 |
+
'0771' => array(
|
36 |
+
'name' => 'RegioBank',
|
37 |
+
'logo' => 'logo_sns_s.gif',
|
38 |
+
),
|
39 |
+
'0511' => array(
|
40 |
+
'name' => 'Triodos Bank',
|
41 |
+
'logo' => 'logo_triodos.gif',
|
42 |
+
),
|
43 |
+
'0161' => array(
|
44 |
+
'name' => 'Van Lanschot',
|
45 |
+
'logo' => 'logo_lanschot_s.gif',
|
46 |
+
),
|
47 |
+
'9998' => array(
|
48 |
+
'name' => 'Knab',
|
49 |
+
'logo' => 'logo_knab_s.gif',
|
50 |
+
),
|
51 |
+
),
|
52 |
+
'version2' => array(
|
53 |
+
'ABNANL2A' => array(
|
54 |
+
'name' => 'ABN AMRO',
|
55 |
+
'logo' => 'logo_abn_s.gif',
|
56 |
+
),
|
57 |
+
'ASNBNL21' => array(
|
58 |
+
'name' => 'ASN Bank',
|
59 |
+
'logo' => 'icon_asn.gif',
|
60 |
+
),
|
61 |
+
'INGBNL2A' => array(
|
62 |
+
'name' => 'ING',
|
63 |
+
'logo' => 'logo_ing_s.gif',
|
64 |
+
),
|
65 |
+
'RABONL2U' => array(
|
66 |
+
'name' => 'Rabobank',
|
67 |
+
'logo' => 'logo_rabo_s.gif',
|
68 |
+
),
|
69 |
+
'SNSBNL2A' => array(
|
70 |
+
'name' => 'SNS Bank',
|
71 |
+
'logo' => 'logo_sns_s.gif',
|
72 |
+
),
|
73 |
+
'RBRBNL21' => array(
|
74 |
+
'name' => 'RegioBank',
|
75 |
+
'logo' => 'logo_sns_s.gif',
|
76 |
+
),
|
77 |
+
'TRIONL2U' => array(
|
78 |
+
'name' => 'Triodos Bank',
|
79 |
+
'logo' => 'logo_triodos.gif',
|
80 |
+
),
|
81 |
+
'FVLBNL22' => array(
|
82 |
+
'name' => 'Van Lanschot',
|
83 |
+
'logo' => 'logo_lanschot_s.gif',
|
84 |
+
),
|
85 |
+
'KNABNL2H' => array(
|
86 |
+
'name' => 'Knab bank',
|
87 |
+
'logo' => 'logo_knab_s.gif',
|
88 |
+
),
|
89 |
+
),
|
90 |
+
);
|
91 |
+
|
92 |
+
$issuers = new Varien_Object($issuersArray);
|
93 |
+
$this->issuers = $issuers;
|
94 |
+
|
95 |
+
return $this;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getIssuerList()
|
99 |
+
{
|
100 |
+
$version = (int) Mage::getStoreConfig('buckaroo/buckaroo3extended_ideal/service_version', Mage::app()->getStore()->getId());
|
101 |
+
$issuers = $this->getIssuers();
|
102 |
+
|
103 |
+
if ($version === 2) {
|
104 |
+
return $issuers->getVersion2();
|
105 |
+
}
|
106 |
+
|
107 |
+
return $issuers->getVersion1();
|
108 |
+
}
|
109 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Maestro_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extendedmaestro_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Maestro_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/maestro/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Mastercard_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/mastercard_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Mastercard_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/mastercard/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Onlinegiro_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/onlinegiro_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Onlinegiro_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/onlinegiro/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paymentguarantee_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/paymentguarantee_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paymentguarantee_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/paymentguarantee/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paypal_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/paypal_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paypal_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/paypal/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Payperemail_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/payperemail_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Payperemail_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/payperemail/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paysafecard_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/paysafecard_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Paysafecard_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/paysafecard/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Sofortueberweisung_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/sofortueberweisung_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Sofortueberweisung_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/sofortueberweisung/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Transfer_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/transfer_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Transfer_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/transfer/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Visa_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/visa_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Visa_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/visa/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Visaelectron_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/visaelectron_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Visaelectron_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/visaelectron/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Vpay_Adminhtml_System_Config_Advancedbtn extends Mage_Adminhtml_Block_Abstract
|
3 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
4 |
+
{
|
5 |
+
protected $_template = 'buckaroo3extended/vpay_system/config/advancedbtn.phtml';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Render fieldset html
|
9 |
+
*
|
10 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
11 |
+
* @return string
|
12 |
+
*/
|
13 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
14 |
+
{
|
15 |
+
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_PaymentMethods_Vpay_Checkout_Form extends TIG_Buckaroo3Extended_Block_PaymentMethods_Checkout_Form_Abstract
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->setTemplate('buckaroo3extended/vpay/checkout/form.phtml');
|
7 |
+
parent::_construct();
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Block_Refund_Adminhtml_System_Config_NoOptionsAvailable
|
3 |
+
extends Mage_Adminhtml_Block_Abstract
|
4 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
5 |
+
{
|
6 |
+
protected $_template = 'buckaroo3extended/refund/system/config/noOptionsAvailable.phtml';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
return $this->toHtml();
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,415 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @category TIG
|
37 |
+
* @package TIG_Buckaroo3Extended
|
38 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
|
39 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
40 |
+
*/
|
41 |
+
|
42 |
+
class TIG_Buckaroo3Extended_Helper_Data extends Mage_Core_Helper_Abstract
|
43 |
+
{
|
44 |
+
/**
|
45 |
+
* Xpath to Buckaroo fee tax class.
|
46 |
+
*/
|
47 |
+
const XPATH_BUCKAROO_FEE_TAX_CLASS = 'tax/classes/buckaroo_fee';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @var TIG_Buckaroo3Extended_Model_PaymentFee_Service
|
51 |
+
*/
|
52 |
+
protected $_serviceModel;
|
53 |
+
|
54 |
+
public function isAdmin()
|
55 |
+
{
|
56 |
+
if(Mage::app()->getStore()->isAdmin()) {
|
57 |
+
return true;
|
58 |
+
}
|
59 |
+
|
60 |
+
if(Mage::getDesign()->getArea() == 'adminhtml') {
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function log($message, $force = false)
|
68 |
+
{
|
69 |
+
Mage::log($message, Zend_Log::DEBUG, 'TIG_B3E.log', $force);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function logException($e)
|
73 |
+
{
|
74 |
+
if (is_string($e)) {
|
75 |
+
Mage::log($e, Zend_Log::ERR, 'TIG_B3E_Exception.log', true);
|
76 |
+
} else {
|
77 |
+
Mage::log($e->getMessage(), Zend_Log::ERR, 'TIG_B3E_Exception.log', true);
|
78 |
+
Mage::log($e->getTraceAsString(), Zend_Log::ERR, 'TIG_B3E_Exception.log', true);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
public function isOneStepCheckout()
|
83 |
+
{
|
84 |
+
$moduleName = Mage::app()->getRequest()->getModuleName();
|
85 |
+
|
86 |
+
if ($moduleName == 'onestepcheckout') {
|
87 |
+
return true;
|
88 |
+
}
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getFeeLabel($paymentMethodCode = false)
|
93 |
+
{
|
94 |
+
if ($paymentMethodCode) {
|
95 |
+
$feeLabel = Mage::helper('buckaroo3extended')->__(
|
96 |
+
Mage::getStoreConfig('buckaroo/' . $paymentMethodCode . '/payment_fee_label', Mage::app()->getStore()->getId())
|
97 |
+
)
|
98 |
+
;
|
99 |
+
if (empty($feeLabel)) {
|
100 |
+
$feeLabel = Mage::helper('buckaroo3extended')->__('Fee');
|
101 |
+
}
|
102 |
+
} else {
|
103 |
+
$feeLabel = Mage::helper('buckaroo3extended')->__('Fee');
|
104 |
+
}
|
105 |
+
|
106 |
+
return $feeLabel;
|
107 |
+
}
|
108 |
+
|
109 |
+
public function resetBuckarooFeeInvoicedValues($order, $invoice)
|
110 |
+
{
|
111 |
+
$baseBuckarooFee = $invoice->getBaseBuckarooFee();
|
112 |
+
$paymentFee = $invoice->getBuckarooFee();
|
113 |
+
$baseBuckarooFeeTax = $invoice->getBaseBuckarooFeeTax();
|
114 |
+
$paymentFeeTax = $invoice->getBuckarooFeeTax();
|
115 |
+
|
116 |
+
$baseBuckarooFeeInvoiced = $order->getBaseBuckarooFeeInvoiced();
|
117 |
+
$paymentFeeInvoiced = $order->getBuckarooFeeInvoiced();
|
118 |
+
$baseBuckarooFeeTaxInvoiced = $order->getBaseBuckarooFeeTaxInvoiced();
|
119 |
+
$paymentFeeTaxInvoiced = $order->getBuckarooFeeTaxInvoiced();
|
120 |
+
|
121 |
+
if ($baseBuckarooFeeInvoiced && $baseBuckarooFee && $baseBuckarooFeeInvoiced >= $baseBuckarooFee) {
|
122 |
+
$order->setBaseBuckarooFeeInvoiced($baseBuckarooFeeInvoiced - $baseBuckarooFee)
|
123 |
+
->setBuckarooFeeInvoiced($paymentFeeInvoiced - $paymentFee)
|
124 |
+
->setBaseBuckarooFeeTaxInvoiced($baseBuckarooFeeTaxInvoiced - $baseBuckarooFeeTax)
|
125 |
+
->setBaseBuckarooFeeInvoiced($paymentFeeTaxInvoiced - $paymentFeeTax);
|
126 |
+
$order->save();
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Checks if the current edition of Magento is enterprise. Uses Mage::getEdition if available. If not, look for the
|
132 |
+
* Enterprise_Enterprise extension. Finally, check the version number.
|
133 |
+
*
|
134 |
+
* @return boolean
|
135 |
+
*
|
136 |
+
*/
|
137 |
+
public function isEnterprise()
|
138 |
+
{
|
139 |
+
/**
|
140 |
+
* Use Mage::getEdition, which is available since CE 1.7 and EE 1.12.
|
141 |
+
*/
|
142 |
+
if (method_exists('Mage', 'getEdition')) {
|
143 |
+
$edition = Mage::getEdition();
|
144 |
+
if ($edition == Mage::EDITION_ENTERPRISE) {
|
145 |
+
return true;
|
146 |
+
}
|
147 |
+
|
148 |
+
if ($edition == Mage::EDITION_COMMUNITY) {
|
149 |
+
return false;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Check if the Enterprise_Enterprise extension is installed.
|
155 |
+
*/
|
156 |
+
if (Mage::getConfig()->getNode('modules')->Enterprise_Enterprise) {
|
157 |
+
return true;
|
158 |
+
}
|
159 |
+
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
+
public function getIsKlarnaEnabled()
|
164 |
+
{
|
165 |
+
return Mage::helper('core')->isModuleEnabled('Klarna_KlarnaPaymentModule');
|
166 |
+
}
|
167 |
+
|
168 |
+
public function checkRegionRequired()
|
169 |
+
{
|
170 |
+
$storeId = Mage::app()->getRequest()->getParam('store');
|
171 |
+
$allowSpecific = Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/allowspecific', $storeId);
|
172 |
+
if ($allowSpecific) {
|
173 |
+
$allowedCountries = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/specificcountry', $storeId));
|
174 |
+
} else {
|
175 |
+
$allowedCountries = Mage::getModel('directory/country')->getResourceCollection()
|
176 |
+
->loadByStore($storeId)
|
177 |
+
->toOptionArray(true);
|
178 |
+
}
|
179 |
+
|
180 |
+
foreach ($allowedCountries as $country) {
|
181 |
+
if (!Mage::helper('directory')->isregionRequired($country)) {
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
return true;
|
186 |
+
}
|
187 |
+
|
188 |
+
public function checkSellersProtection($order)
|
189 |
+
{
|
190 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/active', $order->getStoreId())) {
|
191 |
+
return false;
|
192 |
+
}
|
193 |
+
|
194 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/sellers_protection', $order->getStoreId())) {
|
195 |
+
return false;
|
196 |
+
}
|
197 |
+
|
198 |
+
if ($order->getIsVirtual()) {
|
199 |
+
return false;
|
200 |
+
}
|
201 |
+
return true;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Get the Buckaroo fee label for a given store & paymentmethod
|
206 |
+
*
|
207 |
+
* @param null $store
|
208 |
+
* @param boolean|string $paymentMethod
|
209 |
+
* @return string
|
210 |
+
*/
|
211 |
+
public function getBuckarooFeeLabel($store = null, $paymentMethod = false)
|
212 |
+
{
|
213 |
+
if (is_null($store)) {
|
214 |
+
$store = Mage::app()->getStore();
|
215 |
+
}
|
216 |
+
|
217 |
+
if(!$paymentMethod){
|
218 |
+
return Mage::helper('buckaroo3extended')->__('Buckaroo Fee');
|
219 |
+
}
|
220 |
+
|
221 |
+
$xpath = 'buckaroo/' . $paymentMethod . '/payment_fee_label';
|
222 |
+
$label = Mage::getStoreConfig($xpath, $store);
|
223 |
+
return $label;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Add Buckaroo fee tax info by updating an incorrect tax record.
|
228 |
+
*
|
229 |
+
* @param Mage_Sales_Model_Order $order
|
230 |
+
* @param array $fullInfo
|
231 |
+
*
|
232 |
+
* @return array
|
233 |
+
*/
|
234 |
+
protected function _updateTaxAmountForTaxInfo($order, $fullInfo)
|
235 |
+
{
|
236 |
+
$taxCollection = Mage::getResourceModel('sales/order_tax_collection')
|
237 |
+
->addFieldToSelect('amount')
|
238 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Go through each tax record and update the tax info entry that has the same title, but a different amount.
|
242 |
+
*/
|
243 |
+
foreach ($taxCollection as $tax) {
|
244 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
245 |
+
if ($tax->getTitle() == $taxInfo['title'] && $tax->getAmount() != $taxInfo['tax_amount']) {
|
246 |
+
/**
|
247 |
+
* Update the amounts.
|
248 |
+
*/
|
249 |
+
$fullInfo[$key]['tax_amount'] = $tax->getAmount();
|
250 |
+
$fullInfo[$key]['base_tax_amount'] = $tax->getBaseAmount();
|
251 |
+
}
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
return $fullInfo;
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Add Buckaroo fee tax info by updating or adding a missing tax record.
|
260 |
+
*
|
261 |
+
* @param Mage_Sales_Model_Resource_Order_Tax_Collection $taxCollection
|
262 |
+
* @param array $fullInfo
|
263 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
264 |
+
*
|
265 |
+
* @return array
|
266 |
+
*/
|
267 |
+
protected function _addBuckarooFeeTaxInfoFromCollection($taxCollection, $fullInfo, $source)
|
268 |
+
{
|
269 |
+
/**
|
270 |
+
* Go through all tax records and add the Buckaroo fee tax to the entry that has the right title. If no entry exists
|
271 |
+
* with that title, add it.
|
272 |
+
*/
|
273 |
+
foreach ($taxCollection as $tax) {
|
274 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
275 |
+
/**
|
276 |
+
* Update an existing entry.
|
277 |
+
*/
|
278 |
+
if ($taxInfo['title'] == $tax->getTitle()) {
|
279 |
+
$fullInfo[$key]['tax_amount'] += $source->getBuckarooFeeTax();
|
280 |
+
$fullInfo[$key]['base_tax_amount'] += $source->getBaseBuckarooFeeTax();
|
281 |
+
|
282 |
+
break(2);
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Add a missing entry.
|
288 |
+
*/
|
289 |
+
$fullInfo[] = array(
|
290 |
+
'tax_amount' => $source->getBuckarooFeeTax(),
|
291 |
+
'base_tax_amount' => $source->getBaseBuckarooFeeTax(),
|
292 |
+
'title' => $tax->getTitle(),
|
293 |
+
'percent' => $tax->getPercent(),
|
294 |
+
);
|
295 |
+
}
|
296 |
+
|
297 |
+
return $fullInfo;
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Add Buckaroo fee tax info by recreating the tax request.
|
302 |
+
*
|
303 |
+
* @param Mage_Sales_Model_Order $order
|
304 |
+
* @param array $fullInfo
|
305 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
306 |
+
*
|
307 |
+
* @return array
|
308 |
+
*/
|
309 |
+
protected function _addBuckarooFeeTaxInfoFromRequest($order, $fullInfo, $source)
|
310 |
+
{
|
311 |
+
$store = $order->getStore();
|
312 |
+
$taxCalculation = Mage::getSingleton('tax/calculation');
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Recalculate the tax request.
|
316 |
+
*/
|
317 |
+
$customerTaxClass = $order->getCustomerTaxClassId();
|
318 |
+
$shippingAddress = $order->getShippingAddress();
|
319 |
+
$billingAddress = $order->getBillingAddress();
|
320 |
+
$codTaxClass = Mage::getStoreConfig(self::XPATH_BUCKAROO_FEE_TAX_CLASS, $store);
|
321 |
+
|
322 |
+
$taxRequest = $taxCalculation->getRateRequest(
|
323 |
+
$shippingAddress,
|
324 |
+
$billingAddress,
|
325 |
+
$customerTaxClass,
|
326 |
+
$store
|
327 |
+
);
|
328 |
+
|
329 |
+
$taxRequest->setProductClassId($codTaxClass);
|
330 |
+
|
331 |
+
/**
|
332 |
+
* If the tax request fails, there is nothing more we can do. This might occur, if the tax rules have been
|
333 |
+
* changed since this order was placed. Unfortunately there is nothing we can do about this.
|
334 |
+
*/
|
335 |
+
if (!$taxRequest) {
|
336 |
+
return $fullInfo;
|
337 |
+
}
|
338 |
+
|
339 |
+
/**
|
340 |
+
* Get the applied rates.
|
341 |
+
*/
|
342 |
+
$appliedRates = Mage::getSingleton('tax/calculation')
|
343 |
+
->getAppliedRates($taxRequest);
|
344 |
+
|
345 |
+
if (!isset($appliedRates[0]['rates'][0]['title'])) {
|
346 |
+
return $fullInfo;
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Get the tax title from the applied rates.
|
351 |
+
*/
|
352 |
+
$buckarooFeeTaxTitle = $appliedRates[0]['rates'][0]['title'];
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Fo through all tax info entries and try to match the title.
|
356 |
+
*/
|
357 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
358 |
+
if ($taxInfo['title'] == $buckarooFeeTaxTitle) {
|
359 |
+
/**
|
360 |
+
* Update the tax info entry with the COD fee tax.
|
361 |
+
*/
|
362 |
+
$fullInfo[$key]['tax_amount'] += $source->getBuckarooFeeTax();
|
363 |
+
$fullInfo[$key]['base_tax_amount'] += $source->getBaseBuckarooFeeTax();
|
364 |
+
break;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
|
368 |
+
return $fullInfo;
|
369 |
+
}
|
370 |
+
|
371 |
+
/**
|
372 |
+
* Alias for TIG_Buckaroo3Extended_Model_PaymentFee_Service::addBuckarooFeeTaxInfo()
|
373 |
+
*
|
374 |
+
* @param array $fullInfo
|
375 |
+
* @param Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
376 |
+
* @param Mage_Sales_Model_Order $order
|
377 |
+
*
|
378 |
+
* @return array
|
379 |
+
*
|
380 |
+
* @see TIG_Buckaroo3Extended_Model_PaymentFee_Service::addBuckarooFeeTaxInfo()
|
381 |
+
*/
|
382 |
+
public function addBuckarooFeeTaxInfo($fullInfo, $source, Mage_Sales_Model_Order $order)
|
383 |
+
{
|
384 |
+
$fullInfo = $this->getServiceModel()->addBuckarooFeeTaxInfo($fullInfo, $source, $order);
|
385 |
+
|
386 |
+
return $fullInfo;
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* @return TIG_Buckaroo3Extended_Model_PaymentFee_Service
|
391 |
+
*/
|
392 |
+
public function getServiceModel()
|
393 |
+
{
|
394 |
+
if ($this->_serviceModel) {
|
395 |
+
return $this->_serviceModel;
|
396 |
+
}
|
397 |
+
|
398 |
+
$serviceModel = Mage::getModel('buckaroo3extended/paymentFee_service');
|
399 |
+
|
400 |
+
$this->setServiceModel($serviceModel);
|
401 |
+
return $serviceModel;
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* @param TIG_Buckaroo3Extended_Model_PaymentFee_Service $serviceModel
|
406 |
+
*
|
407 |
+
* @return $this
|
408 |
+
*/
|
409 |
+
public function setServiceModel(TIG_Buckaroo3Extended_Model_PaymentFee_Service $serviceModel)
|
410 |
+
{
|
411 |
+
$this->_serviceModel = $serviceModel;
|
412 |
+
|
413 |
+
return $this;
|
414 |
+
}
|
415 |
+
}
|
@@ -0,0 +1,1282 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_Abstract extends Mage_Payment_Model_Method_Abstract
|
24 |
+
{
|
25 |
+
const BUCKAROO_SUCCESS = 'BUCKAROO_SUCCESS';
|
26 |
+
const BUCKAROO_FAILED = 'BUCKAROO_FAILED';
|
27 |
+
const BUCKAROO_ERROR = 'BUCKAROO_ERROR';
|
28 |
+
const BUCKAROO_NEUTRAL = 'BUCKAROO_NEUTRAL';
|
29 |
+
const BUCKAROO_PENDING_PAYMENT = 'BUCKAROO_PENDING_PAYMENT';
|
30 |
+
const BUCKAROO_INCORRECT_PAYMENT = 'BUCKAROO_INCORRECT_PAYMENT';
|
31 |
+
const BUCKAROO_REJECTED = 'BUCKAROO_REJECTED';
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var Mage_Sales_Model_Order $_order
|
36 |
+
*/
|
37 |
+
protected $_order = '';
|
38 |
+
protected $_debugEmail;
|
39 |
+
protected $_billingInfo = '';
|
40 |
+
protected $_session = '';
|
41 |
+
protected $_storeId = '';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* List of possible response codes sent by buckaroo.
|
45 |
+
* This is the list for the BPE 3.0 gateway.
|
46 |
+
*/
|
47 |
+
public $responseCodes = array(
|
48 |
+
190 => array(
|
49 |
+
'message' => 'Success',
|
50 |
+
'status' => self::BUCKAROO_SUCCESS,
|
51 |
+
),
|
52 |
+
490 => array(
|
53 |
+
'message' => 'Payment failure',
|
54 |
+
'status' => self::BUCKAROO_FAILED,
|
55 |
+
),
|
56 |
+
491 => array(
|
57 |
+
'message' => 'Validation error',
|
58 |
+
'status' => self::BUCKAROO_FAILED,
|
59 |
+
),
|
60 |
+
492 => array(
|
61 |
+
'message' => 'Technical error',
|
62 |
+
'status' => self::BUCKAROO_ERROR,
|
63 |
+
),
|
64 |
+
690 => array(
|
65 |
+
'message' => 'Payment rejected',
|
66 |
+
'status' => self::BUCKAROO_REJECTED,
|
67 |
+
),
|
68 |
+
790 => array(
|
69 |
+
'message' => 'Waiting for user input',
|
70 |
+
'status' => self::BUCKAROO_PENDING_PAYMENT,
|
71 |
+
),
|
72 |
+
791 => array(
|
73 |
+
'message' => 'Waiting for processor',
|
74 |
+
'status' => self::BUCKAROO_PENDING_PAYMENT,
|
75 |
+
),
|
76 |
+
792 => array(
|
77 |
+
'message' => 'Waiting on consumer action',
|
78 |
+
'status' => self::BUCKAROO_PENDING_PAYMENT,
|
79 |
+
),
|
80 |
+
793 => array(
|
81 |
+
'message' => 'Payment on hold',
|
82 |
+
'status' => self::BUCKAROO_PENDING_PAYMENT,
|
83 |
+
),
|
84 |
+
890 => array(
|
85 |
+
'message' => 'Cancelled by consumer',
|
86 |
+
'status' => self::BUCKAROO_FAILED,
|
87 |
+
),
|
88 |
+
891 => array(
|
89 |
+
'message' => 'Cancelled by merchant',
|
90 |
+
'status' => self::BUCKAROO_FAILED,
|
91 |
+
),
|
92 |
+
);
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Retrieves instance of the last used order
|
96 |
+
*/
|
97 |
+
protected function _loadLastOrder()
|
98 |
+
{
|
99 |
+
if (!empty($this->_order)) {
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
|
103 |
+
$session = Mage::getSingleton('checkout/session');
|
104 |
+
$orderId = $session->getLastRealOrderId();
|
105 |
+
if (!empty($orderId)) {
|
106 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
107 |
+
}
|
108 |
+
|
109 |
+
return $this;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function setOrder($order) {
|
113 |
+
$this->_order = $order;
|
114 |
+
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getOrder()
|
119 |
+
{
|
120 |
+
return $this->_order;
|
121 |
+
}
|
122 |
+
|
123 |
+
public function setLastOrder($order)
|
124 |
+
{
|
125 |
+
$this->_order = $order;
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getLastOrder()
|
131 |
+
{
|
132 |
+
return $this->_order;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function setDebugEmail($debugEmail)
|
136 |
+
{
|
137 |
+
$this->_debugEmail = $debugEmail;
|
138 |
+
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getDebugEmail()
|
143 |
+
{
|
144 |
+
return $this->_debugEmail;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setBillingInfo($billingInfo)
|
148 |
+
{
|
149 |
+
$this->_billingInfo = $billingInfo;
|
150 |
+
|
151 |
+
return $this;
|
152 |
+
}
|
153 |
+
|
154 |
+
public function getBillingInfo()
|
155 |
+
{
|
156 |
+
return $this->_billingInfo;
|
157 |
+
}
|
158 |
+
|
159 |
+
public function setSession($session)
|
160 |
+
{
|
161 |
+
$this->_session = $session;
|
162 |
+
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getSession()
|
167 |
+
{
|
168 |
+
return $this->_session;
|
169 |
+
}
|
170 |
+
|
171 |
+
public function setStoreId($storeId)
|
172 |
+
{
|
173 |
+
$this->_storeId = $storeId;
|
174 |
+
|
175 |
+
return $this;
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getStoreId()
|
179 |
+
{
|
180 |
+
return $this->_storeId;
|
181 |
+
}
|
182 |
+
|
183 |
+
public function __construct($debugEmail = false)
|
184 |
+
{
|
185 |
+
if (strpos(dirname(__FILE__), DS .'Model') !== false) {
|
186 |
+
$dir = str_replace(DS .'Model', DS .'certificate', dirname(__FILE__));
|
187 |
+
} else {
|
188 |
+
$dir = str_replace(
|
189 |
+
DS
|
190 |
+
.'includes'
|
191 |
+
. DS
|
192 |
+
. 'src',
|
193 |
+
DS
|
194 |
+
. 'app'
|
195 |
+
. DS
|
196 |
+
. 'code'
|
197 |
+
. DS
|
198 |
+
. 'community'
|
199 |
+
. DS
|
200 |
+
. 'TIG'
|
201 |
+
. DS
|
202 |
+
. 'Buckaroo3Extended'
|
203 |
+
. DS
|
204 |
+
. 'certificate',
|
205 |
+
dirname(__FILE__)
|
206 |
+
);
|
207 |
+
}
|
208 |
+
|
209 |
+
if (!defined('CERTIFICATE_DIR')) {
|
210 |
+
define('CERTIFICATE_DIR', $dir);
|
211 |
+
}
|
212 |
+
|
213 |
+
$this->_loadLastOrder();
|
214 |
+
|
215 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin()) {
|
216 |
+
$this->setSession(Mage::getSingleton('checkout/session'));
|
217 |
+
} else {
|
218 |
+
$this->setSession(Mage::getSingleton('core/session'));
|
219 |
+
}
|
220 |
+
$this->_setOrderBillingInfo();
|
221 |
+
|
222 |
+
if ($debugEmail) {
|
223 |
+
$this->setDebugEmail($debugEmail);
|
224 |
+
} else {
|
225 |
+
$this->setDebugEmail('');
|
226 |
+
}
|
227 |
+
|
228 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin() && !Mage::registry('buckaroo_push-error')) {
|
229 |
+
$this->_checkExpired();
|
230 |
+
}
|
231 |
+
|
232 |
+
if ($this->getOrder()) {
|
233 |
+
$this->setStoreId($this->getOrder()->getStoreId());
|
234 |
+
} else {
|
235 |
+
$this->setStoreId(Mage::app()->getStore()->getId());
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Checks if the order object is still there. Prevents errors when session has expired.
|
241 |
+
*/
|
242 |
+
protected function _checkExpired()
|
243 |
+
{
|
244 |
+
if (empty($this->_order)) {
|
245 |
+
$returnUrl = Mage::getUrl(Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/failure_redirect', $this->getStoreId()));
|
246 |
+
header('location:' . $returnUrl);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
public function setOrderBillingInfo() {
|
251 |
+
return $this->_setOrderBillingInfo();
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* retrieve billing information from order
|
256 |
+
*
|
257 |
+
*/
|
258 |
+
protected function _setOrderBillingInfo()
|
259 |
+
{
|
260 |
+
if (empty($this->_order)) {
|
261 |
+
return false;
|
262 |
+
}
|
263 |
+
$billingAddress = $this->_order->getBillingAddress();
|
264 |
+
|
265 |
+
$firstname = $billingAddress->getFirstname();
|
266 |
+
$lastname = $billingAddress->getLastname();
|
267 |
+
$city = $billingAddress->getCity();
|
268 |
+
$state = $billingAddress->getState();
|
269 |
+
$address = $billingAddress->getStreetFull();
|
270 |
+
$zip = $billingAddress->getPostcode();
|
271 |
+
$email = $this->_order->getCustomerEmail();
|
272 |
+
$telephone = $billingAddress->getTelephone();
|
273 |
+
$fax = $billingAddress->getFax();
|
274 |
+
$countryCode = $billingAddress->getCountry();
|
275 |
+
|
276 |
+
$billingInfo = array(
|
277 |
+
'firstname' => $firstname,
|
278 |
+
'lastname' => $lastname,
|
279 |
+
'city' => $city,
|
280 |
+
'state' => $state,
|
281 |
+
'address' => $address,
|
282 |
+
'zip' => $zip,
|
283 |
+
'email' => $email,
|
284 |
+
'telephone' => $telephone,
|
285 |
+
'fax' => $fax,
|
286 |
+
'countryCode' => $countryCode
|
287 |
+
);
|
288 |
+
|
289 |
+
$this->setBillingInfo($billingInfo);
|
290 |
+
|
291 |
+
return $this;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Restores a previously closed quote so that the cart stays filled after an unsuccessfull order
|
296 |
+
*/
|
297 |
+
public function restoreQuote()
|
298 |
+
{
|
299 |
+
$quoteId = $this->_order->getQuoteId();
|
300 |
+
|
301 |
+
$quote = Mage::getModel('sales/quote')
|
302 |
+
->load($quoteId)
|
303 |
+
->setIsActive(true)
|
304 |
+
->setReservedOrderId(null)
|
305 |
+
->save();
|
306 |
+
Mage::getSingleton('checkout/session')->replaceQuote($quote);
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Empties the cart after a successfull order. To prevent the cart from staying filled when the user
|
311 |
+
* has a modified shop that doesn't automatically clear the cart when placing an order.
|
312 |
+
*/
|
313 |
+
public function emptyCart()
|
314 |
+
{
|
315 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/manual_empty_cart', $this->getStoreId())) {
|
316 |
+
return false;
|
317 |
+
}
|
318 |
+
|
319 |
+
$cartHelper = Mage::helper('checkout/cart');
|
320 |
+
|
321 |
+
$items = $cartHelper->getCart()->getItems();
|
322 |
+
|
323 |
+
foreach ($items as $item) {
|
324 |
+
$itemId = $item->getItemId();
|
325 |
+
$cartHelper->getCart()->removeItem($itemId)->save();
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Determines the totalamount of the order and the currency to be used based on which currencies are available
|
331 |
+
* and which currency the customer has selected.
|
332 |
+
*
|
333 |
+
* Will default to base currency if the selected currency is unavailable.
|
334 |
+
*
|
335 |
+
* @return array
|
336 |
+
*/
|
337 |
+
protected function _determineAmountAndCurrency()
|
338 |
+
{
|
339 |
+
$code = $this->_order->getPayment()->getMethod();
|
340 |
+
|
341 |
+
// availability currency codes for this Payment Module
|
342 |
+
switch($code)
|
343 |
+
{
|
344 |
+
case 'buckaroo3extended_ideal':
|
345 |
+
case 'buckaroogiftcard':
|
346 |
+
case 'buckaroo2012giftcard':
|
347 |
+
case 'buckarooideal':
|
348 |
+
case 'buckaroo':
|
349 |
+
case 'buckaroo2012ideal': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_ideal_paymentMethod');
|
350 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_ideal/allowed_currencies', $this->getStoreId());
|
351 |
+
break;
|
352 |
+
case 'buckaroo3extended_visa':
|
353 |
+
case 'buckaroocc':
|
354 |
+
case 'buckaroo2012creditcard': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_visa_paymentMethod');
|
355 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_visa/allowed_currencies', $this->getStoreId());
|
356 |
+
break;
|
357 |
+
case 'buckaroo3extended_amex': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_amex_paymentMethod');
|
358 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_amex/allowed_currencies', $this->getStoreId());
|
359 |
+
break;
|
360 |
+
case 'buckaroo3extended_mastercard':
|
361 |
+
case 'mastercard': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_mastercard_paymentMethod');
|
362 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_mastercard/allowed_currencies', $this->getStoreId());
|
363 |
+
break;
|
364 |
+
case 'buckaroo3extended_directdebit':
|
365 |
+
case 'buckaroocollect':
|
366 |
+
case 'buckaroo2012machtiging': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_directdebit_paymentMethod');
|
367 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_directdebit/allowed_currencies', $this->getStoreId());
|
368 |
+
break;
|
369 |
+
case 'buckaroo3extended_paypal':
|
370 |
+
case 'buckaroopaypal':
|
371 |
+
case 'buckaroo2012paypal': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_paypal_paymentMethod');
|
372 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_paypal/allowed_currencies', $this->getStoreId());
|
373 |
+
break;
|
374 |
+
case 'buckaroo3extended_transfer':
|
375 |
+
case 'buckarootransfer':
|
376 |
+
case 'buckaroo2012overschrijving': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_transfer_paymentMethod');
|
377 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/allowed_currencies', $this->getStoreId());
|
378 |
+
break;
|
379 |
+
case 'buckaroo3extended_paymentguarantee':
|
380 |
+
case 'buckarootransfergarant':
|
381 |
+
case 'buckaroo2012betaalgarant': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_paymentguarantee_paymentMethod');
|
382 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_paymentguarantee/allowed_currencies', $this->getStoreId());
|
383 |
+
break;
|
384 |
+
case 'buckaroo3extended_giropay':
|
385 |
+
case 'buckaroogiropay':
|
386 |
+
case 'buckaroo2012giropay': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_giropay_paymentMethod');
|
387 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_giropay/allowed_currencies', $this->getStoreId());
|
388 |
+
break;
|
389 |
+
case 'buckaroo3extended_paysafecard':
|
390 |
+
case 'buckaroocashticket':
|
391 |
+
case 'buckaroopaysafecard':
|
392 |
+
case 'buckaroo2012cashticketpaysafecard': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_paysafecard_paymentMethod');
|
393 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_paysafecard/allowed_currencies', $this->getStoreId());
|
394 |
+
break;
|
395 |
+
case 'buckaroo3extended_payperemail':
|
396 |
+
case 'buckaroopayperemail':
|
397 |
+
case 'buckaroo2012payperemail': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_payperemail_paymentMethod');
|
398 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_payperemail/allowed_currencies', $this->getStoreId());
|
399 |
+
break;
|
400 |
+
case 'buckaroo3extended_sofortueberweisung': $paymentMethod = Mage::getModel('buckaroo3extended/paymentMethods_sofortueberweisung_paymentMethod');
|
401 |
+
$currenciesAllowedConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_sofortueberweisung/allowed_currencies', $this->getStoreId());
|
402 |
+
break;
|
403 |
+
default: $paymentMethod = null;
|
404 |
+
$currenciesAllowedConfig = 'EUR';
|
405 |
+
}
|
406 |
+
|
407 |
+
if (!is_null($paymentMethod)) {
|
408 |
+
$currenciesAllowed = $paymentMethod->allowedCurrencies;
|
409 |
+
} else {
|
410 |
+
$currenciesAllowed = array('EUR');
|
411 |
+
}
|
412 |
+
$currenciesAllowedConfig = explode(',', $currenciesAllowedConfig);
|
413 |
+
|
414 |
+
$currentCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
|
415 |
+
|
416 |
+
// currency is not available for this module
|
417 |
+
if (in_array($currentCurrency, $currenciesAllowed)
|
418 |
+
&& in_array($currentCurrency, $currenciesAllowedConfig))
|
419 |
+
{
|
420 |
+
$currency = $currentCurrency;
|
421 |
+
$totalAmount = $this->_order->getGrandTotal();
|
422 |
+
} else {
|
423 |
+
$totalAmount = $this->_order->getBaseGrandTotal();
|
424 |
+
$currency = $this->_order->getBaseCurrency()->getCode();
|
425 |
+
}
|
426 |
+
|
427 |
+
return array($currency, $totalAmount);
|
428 |
+
}
|
429 |
+
|
430 |
+
/**
|
431 |
+
* get locale based on country
|
432 |
+
* locale is formatted as language-LOCALE
|
433 |
+
*
|
434 |
+
* @return array
|
435 |
+
*/
|
436 |
+
protected function _getLocale()
|
437 |
+
{
|
438 |
+
$country = $this->_order->getBillingAddress()->getCountry();
|
439 |
+
|
440 |
+
$locale = Mage::getStoreConfig('general/locale/code', $this->_order->getStoreId());
|
441 |
+
$locale = str_replace('_', '-', $locale);
|
442 |
+
$lang = strtoupper(substr($locale, 0, 2));
|
443 |
+
|
444 |
+
return array($country, $locale, $lang);
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
|
449 |
+
/**
|
450 |
+
* Retrieves an array with information related to a recieved response code.
|
451 |
+
* This method will only be called when it's child cant find it itself. This list
|
452 |
+
* is a general list of known status codes. Its not as inclusive as the lists used\
|
453 |
+
* by its children. However, this list also contains general error codes not
|
454 |
+
* carried by its children.
|
455 |
+
*
|
456 |
+
* @return array $returnArray
|
457 |
+
*/
|
458 |
+
protected function _parseResponse()
|
459 |
+
{
|
460 |
+
$code = $this->_response->Status->Code->Code;
|
461 |
+
|
462 |
+
if (!isset($this->responseCodes[$code]))
|
463 |
+
{
|
464 |
+
return array(
|
465 |
+
'message' => 'Onbekende responsecode: ' . $code,
|
466 |
+
'status' => self::BUCKAROO_NEUTRAL
|
467 |
+
);
|
468 |
+
}
|
469 |
+
|
470 |
+
$returnArray = $this->responseCodes[$code];
|
471 |
+
if (is_object($this->_response)
|
472 |
+
&& isset($this->_response->Status->SubCode))
|
473 |
+
{
|
474 |
+
//the subcode is additional information sometimes returned by Buckaroo. Currently not used,
|
475 |
+
//but it may be of use when debugging.
|
476 |
+
$returnArray['subCode'] = array(
|
477 |
+
'message' => $this->_response->Status->SubCode->_,
|
478 |
+
'code' => $this->_response->Status->SubCode->Code,
|
479 |
+
);
|
480 |
+
}
|
481 |
+
|
482 |
+
$returnArray['code'] = $code;
|
483 |
+
|
484 |
+
return $returnArray;
|
485 |
+
}
|
486 |
+
|
487 |
+
/**
|
488 |
+
* Retrieves an array with information related to a received response code.
|
489 |
+
* This method will only be called when it's child cant find it itself. This list
|
490 |
+
* is a general list of known status codes. Its not as inclusive as the lists used\
|
491 |
+
* by its children. However, this list also contains general error codes not
|
492 |
+
*
|
493 |
+
* @param $code
|
494 |
+
* @return array|bool
|
495 |
+
*/
|
496 |
+
protected function _parsePostResponse($code)
|
497 |
+
{
|
498 |
+
$isCorrect = $this->_checkCorrectAmount();
|
499 |
+
|
500 |
+
if ($isCorrect !== true) {
|
501 |
+
return $isCorrect;
|
502 |
+
}
|
503 |
+
|
504 |
+
if (isset($this->responseCodes[$code]))
|
505 |
+
{
|
506 |
+
$returnArray = $this->responseCodes[$code];
|
507 |
+
|
508 |
+
if ($this->_response) {
|
509 |
+
$returnArray['code'] = $code;
|
510 |
+
}
|
511 |
+
|
512 |
+
return $returnArray;
|
513 |
+
} elseif (isset($this->oldResponseCodes[$code])) {
|
514 |
+
return array(
|
515 |
+
'message' => $this->oldResponseCodes[$code]['*']['omschrijving'],
|
516 |
+
'status' => $this->oldResponseCodes[$code]['*']['code'],
|
517 |
+
'code' => $code
|
518 |
+
);
|
519 |
+
} else {
|
520 |
+
return array(
|
521 |
+
'message' => 'Onbekende responsecode: ' . $code,
|
522 |
+
'status' => self::BUCKAROO_NEUTRAL,
|
523 |
+
'code' => $code,
|
524 |
+
);
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Checks if the correct amount has been paid.
|
530 |
+
*/
|
531 |
+
protected function _checkCorrectAmount()
|
532 |
+
{
|
533 |
+
$amountPaid = $this->_postArray['brq_amount'];
|
534 |
+
|
535 |
+
$this->_debugEmail .= 'Currency used is '
|
536 |
+
. $this->_postArray['brq_currency']
|
537 |
+
. '. Order currency is '
|
538 |
+
. $this->_order->getOrderCurrencyCode()
|
539 |
+
. ".\n";
|
540 |
+
|
541 |
+
if ($this->_postArray['brq_currency'] == $this->_order->getOrderCurrencyCode()) {
|
542 |
+
$this->_debugEmail .= "Currency used is same as order currency \n";
|
543 |
+
$amountOrdered = $this->_order->getGrandTotal();
|
544 |
+
} else {
|
545 |
+
$this->_debugEmail .= "Currency used is different from order currency \n";
|
546 |
+
$amountOrdered = $this->_order->getBaseGrandTotal();
|
547 |
+
}
|
548 |
+
|
549 |
+
$this->_debugEmail .= "Amount paid: {$amountPaid}. Amount ordered: {$amountOrdered} \n";
|
550 |
+
|
551 |
+
if (($amountPaid - $amountOrdered) > 0.01 || ($amountPaid - $amountOrdered) < -0.01) {
|
552 |
+
return array(
|
553 |
+
'message' => 'Incorrect amount transfered',
|
554 |
+
'status' => self::BUCKAROO_INCORRECT_PAYMENT,
|
555 |
+
);
|
556 |
+
} else {
|
557 |
+
return true;
|
558 |
+
}
|
559 |
+
}
|
560 |
+
|
561 |
+
/**
|
562 |
+
* cleans all elements in the array per instructions from Buckaroo PSP
|
563 |
+
*
|
564 |
+
* @param array $array
|
565 |
+
* @return array $cleanArray
|
566 |
+
*/
|
567 |
+
public function _cleanArrayForSoap($array)
|
568 |
+
{
|
569 |
+
$cleanArray = array();
|
570 |
+
|
571 |
+
foreach ($array as $key => $value) {
|
572 |
+
$value = str_replace('\r', ' ', $value);
|
573 |
+
$value = str_replace('\n', ' ', $value);
|
574 |
+
$cleanArray[$key] = $value;
|
575 |
+
}
|
576 |
+
|
577 |
+
return $cleanArray;
|
578 |
+
}
|
579 |
+
|
580 |
+
/**
|
581 |
+
* function which converts special characters to html numeric equivalents
|
582 |
+
*/
|
583 |
+
public function htmlNumeric($string) {
|
584 |
+
preg_match_all('/[^\!-\~\s]/', $string, $specialChars);
|
585 |
+
if ($specialChars) {
|
586 |
+
foreach ($specialChars[0] as $char) {
|
587 |
+
$newChar = ord($char);
|
588 |
+
$numericChars[] = '&#'.$newChar.';';
|
589 |
+
$patterns[] = "/{$char}/";
|
590 |
+
}
|
591 |
+
if (isset($numericChars) && isset($patterns)) {
|
592 |
+
$string = preg_replace($patterns, $numericChars, $string);
|
593 |
+
}
|
594 |
+
}
|
595 |
+
return $string;
|
596 |
+
}
|
597 |
+
|
598 |
+
public function log($message, $force = false)
|
599 |
+
{
|
600 |
+
Mage::helper('buckaroo3extended')->log($message, $force);
|
601 |
+
}
|
602 |
+
|
603 |
+
public function logException($e)
|
604 |
+
{
|
605 |
+
Mage::helper('buckaroo3extended')->logException($e);
|
606 |
+
}
|
607 |
+
|
608 |
+
public function sendDebugEmail()
|
609 |
+
{
|
610 |
+
$debugEmailConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->getStoreId());
|
611 |
+
if (empty($debugEmailConfig))
|
612 |
+
{
|
613 |
+
return;
|
614 |
+
}
|
615 |
+
|
616 |
+
$mail = $this->_debugEmail;
|
617 |
+
|
618 |
+
$recipients = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->getStoreId()));
|
619 |
+
|
620 |
+
foreach($recipients as $recipient) {
|
621 |
+
mail(
|
622 |
+
trim($recipient),
|
623 |
+
'Buckaroo 3 Extended Debug Email',
|
624 |
+
$mail
|
625 |
+
);
|
626 |
+
}
|
627 |
+
}
|
628 |
+
|
629 |
+
public function buckarooSort($array)
|
630 |
+
{
|
631 |
+
$arrayToSort = array();
|
632 |
+
$origArray = array();
|
633 |
+
foreach ($array as $key => $value) {
|
634 |
+
$arrayToSort[strtolower($key)] = $value;
|
635 |
+
$origArray[strtolower($key)] = $key;
|
636 |
+
}
|
637 |
+
|
638 |
+
ksort($arrayToSort);
|
639 |
+
|
640 |
+
$sortedArray = array();
|
641 |
+
foreach($arrayToSort as $key => $value) {
|
642 |
+
$key = $origArray[$key];
|
643 |
+
$sortedArray[$key] = $value;
|
644 |
+
}
|
645 |
+
|
646 |
+
return $sortedArray;
|
647 |
+
}
|
648 |
+
|
649 |
+
protected function _updateRefundedOrderStatus($success = false)
|
650 |
+
{
|
651 |
+
$successString = $success ? 'success' : 'failed';
|
652 |
+
if (!is_object($this->_order)) {
|
653 |
+
return $this;
|
654 |
+
}
|
655 |
+
$state = $this->_order->getState();
|
656 |
+
|
657 |
+
if ($success) {
|
658 |
+
$comment = 'Buckaroo refund request was successfully processed.';
|
659 |
+
} else {
|
660 |
+
$comment = 'Unfortunately the Buckaroo refund request could not be processed succesfully.';
|
661 |
+
}
|
662 |
+
|
663 |
+
if ($this->_order->getBaseGrandTotal() != $this->_order->getBaseTotalRefunded()) {
|
664 |
+
$configField = "buckaroo/buckaroo3extended_refund/order_status_partial_{$state}_{$successString}";
|
665 |
+
$status = Mage::getStoreConfig($configField);
|
666 |
+
} else {
|
667 |
+
$status = null;
|
668 |
+
}
|
669 |
+
|
670 |
+
if (!empty($status)) {
|
671 |
+
$this->_order->setStatus($status)->save();
|
672 |
+
$this->_order->addStatusHistoryComment($comment, $status)
|
673 |
+
->save();
|
674 |
+
} else {
|
675 |
+
$this->_order->addStatusHistoryComment($comment)
|
676 |
+
->save();
|
677 |
+
}
|
678 |
+
}
|
679 |
+
|
680 |
+
/**
|
681 |
+
* Long list of response codes used by BPE 2.0 gateway. Added here for backwards compatibility. Added
|
682 |
+
* to the bottem of the page so it doesn't take up as much space
|
683 |
+
*/
|
684 |
+
public $oldResponseCodes = array(
|
685 |
+
0 => array( '*'=>array( "omschrijving" => "De credit card transactie is pending.",
|
686 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
687 |
+
"type" => "creditcard")),
|
688 |
+
001 => array( '*'=>array( "omschrijving" => "De credit card transactie is pending. De MPI-status van de klant wordt gecheckt.",
|
689 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
690 |
+
"type" => "creditcard")),
|
691 |
+
070 => array( '*'=>array( "omschrijving" => "De refund is nog niet verwerkt.",
|
692 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
693 |
+
"type" => "creditcard")),
|
694 |
+
071 => array( '*'=>array( "omschrijving" => "De refund is succesvol verwerkt.",
|
695 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
696 |
+
"type" => "creditcard")),
|
697 |
+
072 => array( '*'=>array( "omschrijving" => "Er is een fout opgetreden bij het refunden.",
|
698 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
699 |
+
"type" => "creditcard")),
|
700 |
+
073 => array( '*'=>array( "omschrijving" => "De refund is geannuleerd.",
|
701 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
702 |
+
"type" => "creditcard")),
|
703 |
+
100 => array( '*'=>array( "omschrijving" => "De transactie is door de credit-maatschappij goedgekeurd.",
|
704 |
+
"code" => self::BUCKAROO_SUCCESS,
|
705 |
+
"type" => "creditcard")),
|
706 |
+
101 => array( '*'=>array( "omschrijving" => "De transactie is door de credit-maatschappij afgekeurd.",
|
707 |
+
"code" => self::BUCKAROO_FAILED,
|
708 |
+
"type" => "creditcard")),
|
709 |
+
102 => array( '*'=>array( "omschrijving" => "De transactie is mislukt. Er is een fout opgetreden in de verwerking bij de creditmaatschappij.",
|
710 |
+
"code" => self::BUCKAROO_FAILED,
|
711 |
+
"type" => "creditcard")),
|
712 |
+
103 => array( '*'=>array( "omschrijving" => "Deze creditcardtransactie is niet binnen de maximale, toegestane tijd uitgevoerd.",
|
713 |
+
"code" => self::BUCKAROO_FAILED,
|
714 |
+
"type" => "creditcard")),
|
715 |
+
104 => array( '*'=>array( "omschrijving" => "De kaart is verlopen.",
|
716 |
+
"code" => self::BUCKAROO_FAILED,
|
717 |
+
"type" => "creditcard")),
|
718 |
+
120 => array( '*'=>array( "omschrijving" => "Deze PayPal transactie is nog niet volledig verwerkt.",
|
719 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
720 |
+
"type" => "paypal")),
|
721 |
+
121 => array( '*'=>array( "omschrijving" => "Transactiestatus: autorisatie geslaagd.",
|
722 |
+
"code" => self::BUCKAROO_SUCCESS,
|
723 |
+
"type" => "paypal")),
|
724 |
+
122 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is door de consument geannuleerd.",
|
725 |
+
"code" => self::BUCKAROO_FAILED,
|
726 |
+
"type" => "paypal")),
|
727 |
+
123 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is niet binnen de maximale, toegestane tijd uitgevoerd.",
|
728 |
+
"code" => self::BUCKAROO_FAILED,
|
729 |
+
"type" => "paypal")),
|
730 |
+
124 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is om onbekende reden bij PayPal mislukt.",
|
731 |
+
"code" => self::BUCKAROO_FAILED,
|
732 |
+
"type" => "paypal")),
|
733 |
+
125 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is niet geaccepteerd.",
|
734 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
735 |
+
"type" => "paypal")),
|
736 |
+
126 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is in afwachting.",
|
737 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
738 |
+
"type" => "paypal")),
|
739 |
+
135 => array( '*'=>array( "omschrijving" => "Deze PayPal-transactie is nog niet volledig verwerkt.",
|
740 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
741 |
+
"type" => "paypal")),
|
742 |
+
136 => array( '*'=>array( "omschrijving" => "Om technische reden kon de status van deze transactie nog niet bij PayPal worden achterhaald. De transactie is mogelijk nog niet afgerond",
|
743 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
744 |
+
"type" => "paypal")),
|
745 |
+
137 => array( '*'=>array( "omschrijving" => "De afschrijvingscode is ongeldig.",
|
746 |
+
"code" => self::BUCKAROO_FAILED,
|
747 |
+
"type" => "paypal")),
|
748 |
+
138 => array( '*'=>array( "omschrijving" => "Er is een systeemfout opgetreden.",
|
749 |
+
"code" => self::BUCKAROO_FAILED,
|
750 |
+
"type" => "paypal")),
|
751 |
+
139 => array( '*'=>array( "omschrijving" => "Het PayPal transactie-ID is ongeldig of niet beschikbaar.",
|
752 |
+
"code" => self::BUCKAROO_FAILED,
|
753 |
+
"type" => "paypal")),
|
754 |
+
140 => array( '*'=>array( "omschrijving" => "Er kon geen transactie worden gevonden.",
|
755 |
+
"code" => self::BUCKAROO_FAILED,
|
756 |
+
"type" => "paypal")),
|
757 |
+
150 => array( '*'=>array( "omschrijving" => "Deze Paysafecard-transactie is nog niet volledig verwerkt.",
|
758 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
759 |
+
"type" => "paypal")),
|
760 |
+
151 => array( '*'=>array( "omschrijving" => "Transactiestatus: authorisatie geslaagd.",
|
761 |
+
"code" => self::BUCKAROO_SUCCESS,
|
762 |
+
"type" => "paypal")),
|
763 |
+
152 => array( '*'=>array( "omschrijving" => "Deze Paysafecard-transactie is door de consument geannuleerd.",
|
764 |
+
"code" => self::BUCKAROO_FAILED,
|
765 |
+
"type" => "paypal")),
|
766 |
+
153 => array( '*'=>array( "omschrijving" => "Deze Paysafecard-transactie is niet binnen de maximale, toegestane tijd uitgevoerd.",
|
767 |
+
"code" => self::BUCKAROO_FAILED,
|
768 |
+
"type" => "paypal")),
|
769 |
+
155 => array( '*'=>array( "omschrijving" => "Deze Paysafecard-transactie is niet geaccepteerd.",
|
770 |
+
"code" => self::BUCKAROO_FAILED,
|
771 |
+
"type" => "paypal")),
|
772 |
+
156 => array( '*'=>array( "omschrijving" => "Deze Paysafecard-transactie is nog niet volledig verwerkt.",
|
773 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
774 |
+
"type" => "paypal")),
|
775 |
+
157 => array( '*'=>array( "omschrijving" => "Om technische reden kon de status van deze transactie nog niet bij Paysafecard worden achterhaald. De transactie is mogelijk nog niet afgerond.",
|
776 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
777 |
+
"type" => "paypal")),
|
778 |
+
158 => array( '*'=>array( "omschrijving" => "Er is een systeemfout opgetreden bij Paysafecard. Onze excuses voor het ongemak.",
|
779 |
+
"code" => self::BUCKAROO_FAILED,
|
780 |
+
"type" => "paypal")),
|
781 |
+
159 => array( '*'=>array( "omschrijving" => "Het Paysafecard transactie-id is ongeldig of niet beschikbaar.",
|
782 |
+
"code" => self::BUCKAROO_FAILED,
|
783 |
+
"type" => "paypal")),
|
784 |
+
170 => array( '*'=>array( "omschrijving" => "Deze Cash-Ticket transactie is nog niet volledig verwerkt.",
|
785 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
786 |
+
"type" => "paypal")),
|
787 |
+
171 => array( '*'=>array( "omschrijving" => "Transactiestatus: authorisatie geslaagd",
|
788 |
+
"code" => self::BUCKAROO_SUCCESS,
|
789 |
+
"type" => "creditcard")),
|
790 |
+
172 => array( '*'=>array( "omschrijving" => "Deze Cash-Ticket transactie is door de consument geannuleerd.",
|
791 |
+
"code" => self::BUCKAROO_FAILED,
|
792 |
+
"type" => "creditcard")),
|
793 |
+
173 => array( '*'=>array( "omschrijving" => "Deze Cash-Ticket transactie is niet binnen de maximale, toegestane tijd uitgevoerd.",
|
794 |
+
"code" => self::BUCKAROO_FAILED,
|
795 |
+
"type" => "creditcard")),
|
796 |
+
175 => array( '*'=>array( "omschrijving" => "Deze Cash-Ticket transactie is niet geaccepteerd.",
|
797 |
+
"code" => self::BUCKAROO_FAILED,
|
798 |
+
"type" => "creditcard")),
|
799 |
+
176 => array( '*'=>array( "omschrijving" => "Deze Cash-Ticket transactie is nog niet volledig verwerkt.",
|
800 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
801 |
+
"type" => "creditcard")),
|
802 |
+
177 => array( '*'=>array( "omschrijving" => "Om technische reden kon de status van deze transactie nog niet bij Cash-Ticket worden achterhaald. De transactie is mogelijk nog niet afgerond.",
|
803 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
804 |
+
"type" => "creditcard")),
|
805 |
+
178 => array( '*'=>array( "omschrijving" => "Er is een systeemfout opgetreden bij Cash-Ticket. Onze excuses voor het ongemak.",
|
806 |
+
"code" => self::BUCKAROO_FAILED,
|
807 |
+
"type" => "creditcard")),
|
808 |
+
179 => array( '*'=>array( "omschrijving" => "Het Cash-Ticket transactie-id is ongeldig of niet beschikbaar.",
|
809 |
+
"code" => self::BUCKAROO_FAILED,
|
810 |
+
"type" => "creditcard")),
|
811 |
+
201 => array( '*'=>array( "omschrijving" => "Er is timeout opgetreden bij het verwerken van de transactie.Gebruik de TransactionKey om de verwerkingsstatus nogmaals te controleren.",
|
812 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
813 |
+
"type" => "creditcard")),
|
814 |
+
203 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd. Het creditcardnummer is geblokkeerd.",
|
815 |
+
"code" => self::BUCKAROO_FAILED,
|
816 |
+
"type" => "creditcard")),
|
817 |
+
204 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd. Het ip-adres is geblokkeerd",
|
818 |
+
"code" => self::BUCKAROO_FAILED,
|
819 |
+
"type" => "creditcard")),
|
820 |
+
205 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd. Het land van uitgifte van deze creditcard is geblokkeerd",
|
821 |
+
"code" => self::BUCKAROO_FAILED,
|
822 |
+
"type" => "creditcard")),
|
823 |
+
206 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd. De faktuur [waarde] wordt momenteel of is reeds betaald.",
|
824 |
+
"code" => self::BUCKAROO_FAILED,
|
825 |
+
"type" => "creditcard")),
|
826 |
+
207 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd. Het maximaal aantal betaalpogingen voor faktuur [waarde] is overschreden.",
|
827 |
+
"code" => self::BUCKAROO_FAILED,
|
828 |
+
"type" => "creditcard")),
|
829 |
+
242 => array( '*'=>array( "omschrijving" => "Provisie BetaalGarant succesvol verwerkt.",
|
830 |
+
"code" => self::BUCKAROO_SUCCESS,
|
831 |
+
"type" => "garant")),
|
832 |
+
243 => array( '*'=>array( "omschrijving" => "Provisie incassobureau BetaalGarant succesvol verwerkt.",
|
833 |
+
"code" => self::BUCKAROO_SUCCESS,
|
834 |
+
"type" => "garant")),
|
835 |
+
244 => array( '*'=>array( "omschrijving" => "Provisie Buckaroo BetaalGarant succesvol verwerkt.",
|
836 |
+
"code" => self::BUCKAROO_SUCCESS,
|
837 |
+
"type" => "garant")),
|
838 |
+
245 => array( '*'=>array( "omschrijving" => "Toetskosten incassobureau BetaalGarant succesvol verwerkt.",
|
839 |
+
"code" => self::BUCKAROO_SUCCESS,
|
840 |
+
"type" => "garant")),
|
841 |
+
246 => array( '*'=>array( "omschrijving" => "Btw incassobureau BetaalGarant succesvol verwerkt.",
|
842 |
+
"code" => self::BUCKAROO_SUCCESS,
|
843 |
+
"type" => "garant")),
|
844 |
+
247 => array( '*'=>array( "omschrijving" => "Btw buckaroo BetaalGarant succesvol verwerkt.",
|
845 |
+
"code" => self::BUCKAROO_SUCCESS,
|
846 |
+
"type" => "garant")),
|
847 |
+
252 => array( '*'=>array( "omschrijving" => "Kredietwaardigheidcontrole resultaat negatief.",
|
848 |
+
"code" => self::BUCKAROO_FAILED,
|
849 |
+
"type" => "garant")),
|
850 |
+
254 => array( '*'=>array( "omschrijving" => "Betaalgarant verzoek succesvol verwerkt.",
|
851 |
+
"code" => self::BUCKAROO_SUCCESS,
|
852 |
+
"type" => "garant")),
|
853 |
+
260 => array( '*'=>array( "omschrijving" => "Kredietwaardigheidcontrole abonnement niet actief.",
|
854 |
+
"code" => self::BUCKAROO_FAILED,
|
855 |
+
"type" => "garant")),
|
856 |
+
261 => array( '*'=>array( "omschrijving" => "Technische fout opgetreden tijdens kredietwaardigheidcontrole.",
|
857 |
+
"code" => self::BUCKAROO_FAILED,
|
858 |
+
"type" => "garant")),
|
859 |
+
262 => array( '*'=>array( "omschrijving" => "Verplichte velden voor kredietwaardigheidcontrole ontbreken of zijn onjuist",
|
860 |
+
"code" => self::BUCKAROO_FAILED,
|
861 |
+
"type" => "garant")),
|
862 |
+
300 => array( '*'=>array("omschrijving" => "Betaling voor deze overschrijving wordt nog verwacht.",
|
863 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
864 |
+
"type" => "transfer"),
|
865 |
+
'buckarootransfergarant'=>array("omschrijving" => "Uw bestelling is geaccepteerd.",
|
866 |
+
"code" => self::BUCKAROO_SUCCESS,
|
867 |
+
"type" => "transfer")),
|
868 |
+
301 => array( '*'=>array( "omschrijving" => "De overschrijving is ontvangen.",
|
869 |
+
"code" => self::BUCKAROO_SUCCESS,
|
870 |
+
"type" => "transfer")),
|
871 |
+
302 => array( '*'=>array( "omschrijving" => "De transactie is geweigerd of afgewezen.",
|
872 |
+
"code" => self::BUCKAROO_FAILED,
|
873 |
+
"type" => "transfer")),
|
874 |
+
303 => array( '*'=>array( "omschrijving" => "De uiterste betaaldatum voor deze overschrijving is verstreken.",
|
875 |
+
"code" => self::BUCKAROO_FAILED,
|
876 |
+
"type" => "transfer")),
|
877 |
+
304 => array( '*'=>array( "omschrijving" => "De datum voor ingebrekestelling is verstreken.",
|
878 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
879 |
+
"type" => "transfer")),
|
880 |
+
305 => array( '*'=>array( "omschrijving" => "Het ontvangen bedrag voor de overschrijving is lager dan het bedrag van de transactie.",
|
881 |
+
"code" => 'BUCKAROO_INCORRECT_AMOUNT',
|
882 |
+
"type" => "transfer")),
|
883 |
+
306 => array( '*'=>array( "omschrijving" => "Het ontvangen bedrag voor de overschrijving is groter dan het bedrag van de transactie.",
|
884 |
+
"code" => 'BUCKAROO_INCORRECT_AMOUNT',
|
885 |
+
"type" => "transfer")),
|
886 |
+
309 => array( '*'=>array( "omschrijving" => "De overschrijving is geannuleerd.",
|
887 |
+
"code" => self::BUCKAROO_FAILED,
|
888 |
+
"type" => "transfer")),
|
889 |
+
345 => array( '*'=>array( "omschrijving" => "Oorspronkelijk transactie-bedrag gedeeld.",
|
890 |
+
"code" => self::BUCKAROO_FAILED,
|
891 |
+
"type" => "transfer")),
|
892 |
+
371 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is verwerkt.",
|
893 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
894 |
+
"type" => "creditcard")),
|
895 |
+
372 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is verwerkt.",
|
896 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
897 |
+
"type" => "transfer")),
|
898 |
+
373 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is verwerkt.",
|
899 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
900 |
+
"type" => "transfer")),
|
901 |
+
381 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is mislukt.",
|
902 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
903 |
+
"type" => "transfer")),
|
904 |
+
382 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is mislukt.",
|
905 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
906 |
+
"type" => "transfer")),
|
907 |
+
383 => array( '*'=>array( "omschrijving" => "De refund voor deze overschrijving is mislukt.",
|
908 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
909 |
+
"type" => "transfer")),
|
910 |
+
390 => array( '*'=>array( "omschrijving" => "De transactie is buiten Buckaroo om met de klant afgehandeld.",
|
911 |
+
"code" => self::BUCKAROO_SUCCESS,
|
912 |
+
"type" => "transfer")),
|
913 |
+
392 => array( '*'=>array( "omschrijving" => "Anders betaald.",
|
914 |
+
"code" => self::BUCKAROO_SUCCESS,
|
915 |
+
"type" => "transfer")),
|
916 |
+
400 => array( '*'=>array( "omschrijving" => "De kadokaart-transactie is nog in behandeling",
|
917 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
918 |
+
"type" => "giftcard")),
|
919 |
+
401 => array( '*'=>array( "omschrijving" => "De betaling middels kado-kaart is geslaagd.",
|
920 |
+
"code" => self::BUCKAROO_SUCCESS,
|
921 |
+
"type" => "giftcard")),
|
922 |
+
402 => array( '*'=>array( "omschrijving" => "Betaling middels de kadokaart is afgewezen.",
|
923 |
+
"code" => self::BUCKAROO_FAILED,
|
924 |
+
"type" => "giftcard")),
|
925 |
+
409 => array( '*'=>array( "omschrijving" => "Betaling middels de kadokaart is geannuleerd.",
|
926 |
+
"code" => self::BUCKAROO_FAILED,
|
927 |
+
"type" => "giftcard")),
|
928 |
+
403 => array( '*'=>array( "omschrijving" => "Deze Giftcard transactie is niet binnen de maximale, toegestane tijd uitgevoerd.",
|
929 |
+
"code" => self::BUCKAROO_FAILED,
|
930 |
+
"type" => "giftcard")),
|
931 |
+
404 => array( '*'=>array( "omschrijving" => "Deze Giftcard transactie is om onbekende reden bij de kaartuitgever mislukt.",
|
932 |
+
"code" => self::BUCKAROO_FAILED,
|
933 |
+
"type" => "giftcard")),
|
934 |
+
409 => array( '*'=>array( "omschrijving" => "Betaling middels de kadokaart is geannuleerd.",
|
935 |
+
"code" => self::BUCKAROO_FAILED,
|
936 |
+
"type" => "giftcard")),
|
937 |
+
410 => array( '*'=>array( "omschrijving" => "De Merchant Account Code is ongeldig",
|
938 |
+
"code" => self::BUCKAROO_FAILED,
|
939 |
+
"type" => "giftcard")),
|
940 |
+
411 => array( '*'=>array( "omschrijving" => "De betaling middels kadokaart is voorlopig geaccepteerd.",
|
941 |
+
"code" => 'BUCKAROO_PENDINGPAYMENT',
|
942 |
+
"type" => "giftcard")),
|
943 |
+
414 => array( '*'=>array( "omschrijving" => "Er is een systeem-fout opgetreden.",
|
944 |
+
"code" => self::BUCKAROO_FAILED,
|
945 |
+
"type" => "giftcard")),
|
946 |
+
421 => array( '*'=>array( "omschrijving" => "Er is een onbekende Issuer voor de kado-kaart opgegeven.",
|
947 |
+
"code" => self::BUCKAROO_FAILED,
|
948 |
+
"type" => "giftcard")),
|
949 |
+
422 => array( '*'=>array( "omschrijving" => "Er is een fout opgetreden bij de Issuer. De betaling is mislukt. [waarde].",
|
950 |
+
"code" => self::BUCKAROO_FAILED,
|
951 |
+
"type" => "giftcard")),
|
952 |
+
425 => array( '*'=>array( "omschrijving" => "Niet genoeg saldo om deze transactie uit te voeren.",
|
953 |
+
"code" => self::BUCKAROO_FAILED,
|
954 |
+
"type" => "giftcard")),
|
955 |
+
461 => array( '*'=>array( "omschrijving" => "Transactie voltooid.",
|
956 |
+
"code" => self::BUCKAROO_SUCCESS,
|
957 |
+
"type" => "giftcard")),
|
958 |
+
462 => array( '*'=>array( "omschrijving" => "Transactie voltooid.",
|
959 |
+
"code" => self::BUCKAROO_SUCCESS,
|
960 |
+
"type" => "giftcard")),
|
961 |
+
463 => array( '*'=>array( "omschrijving" => "Transactie voltooid.",
|
962 |
+
"code" => self::BUCKAROO_SUCCESS,
|
963 |
+
"type" => "giftcard")),
|
964 |
+
464 => array( '*'=>array( "omschrijving" => "Transactie voltooid.",
|
965 |
+
"code" => self::BUCKAROO_SUCCESS,
|
966 |
+
"type" => "giftcard")),
|
967 |
+
468 => array( '*'=>array( "omschrijving" => "Originele factuur voor deze vordering niet gevonden.",
|
968 |
+
"code" => self::BUCKAROO_FAILED,
|
969 |
+
"type" => "giftcard")),
|
970 |
+
471 => array( '*'=>array( "omschrijving" => "De refund voor deze giftcardbetaling is verwerkt.",
|
971 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
972 |
+
"type" => "giftcard")),
|
973 |
+
472 => array( '*'=>array( "omschrijving" => "De refund voor deze giftcardbetaling is mislukt.",
|
974 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
975 |
+
"type" => "giftcard")),
|
976 |
+
500 => array( '*'=>array( "omschrijving" => "Paypermail: transactie pending",
|
977 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
978 |
+
"type" => "paypermail")),
|
979 |
+
541 => array( '*'=>array( "omschrijving" => "Transactiekosten zijn verrekend met saldo.",
|
980 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
981 |
+
"type" => "paypermail")),
|
982 |
+
550 => array( '*'=>array( "omschrijving" => "De uitbetaling is nog niet verwerkt.",
|
983 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
984 |
+
"type" => "paypermail")),
|
985 |
+
551 => array( '*'=>array( "omschrijving" => "De uitbetaling is succesvol verwerkt.",
|
986 |
+
"code" => self::BUCKAROO_SUCCESS,
|
987 |
+
"type" => "paypermail")),
|
988 |
+
552 => array( '*'=>array( "omschrijving" => "Transactiekosten zijn verrekend met saldo.",
|
989 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
990 |
+
"type" => "paypermail")),
|
991 |
+
553 => array( '*'=>array( "omschrijving" => "Transactiekosten zijn verrekend met saldo.",
|
992 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
993 |
+
"type" => "paypermail")),
|
994 |
+
560 => array( '*'=>array( "omschrijving" => "Correctiebetaling uitgevoerd door Buckaroo.",
|
995 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
996 |
+
"type" => "paypermail")),
|
997 |
+
581 => array( '*'=>array( "omschrijving" => "Overschrijving van of naar ander Buckaroo-account.",
|
998 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
999 |
+
"type" => "paypermail")),
|
1000 |
+
600 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is nog niet verwerkt.",
|
1001 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1002 |
+
"type" => "collect")),
|
1003 |
+
601 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is met succes verwerkt.",
|
1004 |
+
"code" => self::BUCKAROO_SUCCESS,
|
1005 |
+
"type" => "collect")),
|
1006 |
+
602 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is door de bank afgewezen.",
|
1007 |
+
"code" => self::BUCKAROO_FAILED,
|
1008 |
+
"type" => "collect")),
|
1009 |
+
605 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is gestorneerd.",
|
1010 |
+
"code" => self::BUCKAROO_FAILED,
|
1011 |
+
"type" => "collect")),
|
1012 |
+
609 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is geannuleerd voordat incasso plaatsvond.",
|
1013 |
+
"code" => self::BUCKAROO_FAILED,
|
1014 |
+
"type" => "collect")),
|
1015 |
+
610 => array( '*'=>array( "omschrijving" => "Eenmalige machtiging is door de bank afgewezen. Rekening ongeldig.",
|
1016 |
+
"code" => self::BUCKAROO_FAILED,
|
1017 |
+
"type" => "collect")),
|
1018 |
+
612 => array( '*'=>array( "omschrijving" => "Terugboeking wegens Melding Onterechte Incasso",
|
1019 |
+
"code" => self::BUCKAROO_FAILED,
|
1020 |
+
"type" => "collect")),
|
1021 |
+
671 => array( '*'=>array( "omschrijving" => "De refund voor deze machtiging is verwerkt.",
|
1022 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1023 |
+
"type" => "collect")),
|
1024 |
+
672 => array( '*'=>array( "omschrijving" => "De refund voor deze machtiging is mislukt.",
|
1025 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1026 |
+
"type" => "collect")),
|
1027 |
+
700 => array( '*'=>array( "omschrijving" => "De betaalopdracht is geaccepteerd en wordt in behandeling genomen.",
|
1028 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1029 |
+
"type" => "batch")),
|
1030 |
+
701 => array( '*'=>array( "omschrijving" => "De betaalopdracht is verwerkt.",
|
1031 |
+
"code" => self::BUCKAROO_SUCCESS,
|
1032 |
+
"type" => "batch")),
|
1033 |
+
702 => array( '*'=>array( "omschrijving" => "De betaalopdracht is door de bank teruggestort wegens incorrecte rekeninggegevens.",
|
1034 |
+
"code" => self::BUCKAROO_FAILED,
|
1035 |
+
"type" => "batch")),
|
1036 |
+
703 => array( '*'=>array( "omschrijving" => "De betaalopdracht is afgewezen door Buckaroo.",
|
1037 |
+
"code" => self::BUCKAROO_FAILED,
|
1038 |
+
"type" => "batch")),
|
1039 |
+
704 => array( '*'=>array( "omschrijving" => "Betaalopdracht geannuleerd.",
|
1040 |
+
"code" => self::BUCKAROO_FAILED,
|
1041 |
+
"type" => "batch")),
|
1042 |
+
705 => array( '*'=>array( "omschrijving" => "De batch kon niet worden ingepland. Error: [waarde]",
|
1043 |
+
"code" => self::BUCKAROO_FAILED,
|
1044 |
+
"type" => "batch")),
|
1045 |
+
710 => array( '*'=>array( "omschrijving" => "Betaalopdracht nog niet geverifieerd.",
|
1046 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1047 |
+
"type" => "batch")),
|
1048 |
+
711 => array( '*'=>array( "omschrijving" => "De batch kon niet gevonden worden: [waarde].",
|
1049 |
+
"code" => self::BUCKAROO_FAILED,
|
1050 |
+
"type" => "batch")),
|
1051 |
+
712 => array( '*'=>array( "omschrijving" => "De batch is reeds verwerkt: [waarde].",
|
1052 |
+
"code" => self::BUCKAROO_SUCCESS,
|
1053 |
+
"type" => "batch")),
|
1054 |
+
720 => array( '*'=>array( "omschrijving" => "Er is voor deze batch-transactie geen klant-id opgegeven.",
|
1055 |
+
"code" => self::BUCKAROO_FAILED,
|
1056 |
+
"type" => "batch")),
|
1057 |
+
721 => array( '*'=>array( "omschrijving" => "Het opgegeven klant-id kon niet worden gevonden.",
|
1058 |
+
"code" => self::BUCKAROO_FAILED,
|
1059 |
+
"type" => "batch")),
|
1060 |
+
800 => array( '*'=>array( "omschrijving" => "Deze iDeal-transactie is nog niet volledig verwerkt.",
|
1061 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1062 |
+
"type" => "ideal")),
|
1063 |
+
801 => array( '*'=>array( "omschrijving" => "Deze iDeal-transactie is met succes verwerkt.",
|
1064 |
+
"code" => self::BUCKAROO_SUCCESS,
|
1065 |
+
"type" => "ideal")),
|
1066 |
+
802 => array( '*'=>array( "omschrijving" => "Deze iDeal-transactie is door de consument geannuleerd. Trx: [waarde]",
|
1067 |
+
"code" => self::BUCKAROO_FAILED,
|
1068 |
+
"type" => "ideal")),
|
1069 |
+
803 => array( '*'=>array( "omschrijving" => "Deze iDeal-transactie is niet binnen de maximale toegestane tijd uitgevoerd. Trx: [waarde]",
|
1070 |
+
"code" => self::BUCKAROO_FAILED,
|
1071 |
+
"type" => "ideal")),
|
1072 |
+
804 => array( '*'=>array( "omschrijving" => "Deze iDeal-transactie is om onbekende reden bij de bank mislukt. Trx: [waarde]",
|
1073 |
+
"code" => self::BUCKAROO_FAILED,
|
1074 |
+
"type" => "ideal")),
|
1075 |
+
810 => array( '*'=>array( "omschrijving" => "Issuer (bank) is onbekend: [waarde]",
|
1076 |
+
"code" => self::BUCKAROO_FAILED,
|
1077 |
+
"type" => "ideal")),
|
1078 |
+
811 => array( '*'=>array( "omschrijving" => "Om technische reden kon de status van deze transactie nog niet bij de bank worden achterhaald. De transactie is nog niet afgerond.",
|
1079 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1080 |
+
"type" => "ideal")),
|
1081 |
+
812 => array( '*'=>array( "omschrijving" => "De entrance-code [waarde] is ongeldig.",
|
1082 |
+
"code" => self::BUCKAROO_FAILED,
|
1083 |
+
"type" => "ideal")),
|
1084 |
+
813 => array( '*'=>array( "omschrijving" => "Acquirer-code is onbekend: [waarde].",
|
1085 |
+
"code" => self::BUCKAROO_FAILED,
|
1086 |
+
"type" => "ideal")),
|
1087 |
+
814 => array( '*'=>array( "omschrijving" => "Er is een systeemfout opgetreden. We zullen deze zo snel mogelijk verhelpen. De status zal daarna worden herzien.",
|
1088 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1089 |
+
"type" => "ideal")),
|
1090 |
+
815 => array( '*'=>array( "omschrijving" => "Op dit moment is de betaalmethode iDEAL niet beschikbaar wegens een storing bij de bank.",
|
1091 |
+
"code" => self::BUCKAROO_FAILED,
|
1092 |
+
"type" => "ideal")),
|
1093 |
+
816 => array( '*'=>array( "omschrijving" => "Er kon geen transactie worden gevonden. Criteria: [waarde]",
|
1094 |
+
"code" => self::BUCKAROO_FAILED,
|
1095 |
+
"type" => "ideal")),
|
1096 |
+
820 => array( '*'=>array( "omschrijving" => "Deze Giropay-transactie is nog niet volledig verwerkt.",
|
1097 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1098 |
+
"type" => "ideal")),
|
1099 |
+
821 => array( '*'=>array( "omschrijving" => "Deze Giropay-transactie is met succes verwerkt.",
|
1100 |
+
"code" => self::BUCKAROO_SUCCESS,
|
1101 |
+
"type" => "ideal")),
|
1102 |
+
822 => array( '*'=>array( "omschrijving" => "Deze Giropay-transactie is door de consument geannuleerd. Trx: [waarde]",
|
1103 |
+
"code" => self::BUCKAROO_FAILED,
|
1104 |
+
"type" => "ideal")),
|
1105 |
+
823 => array( '*'=>array( "omschrijving" => "Deze Giropay-transactie is niet binnen de maximale toegestane tijd uitgevoerd. Trx: [waarde]",
|
1106 |
+
"code" => self::BUCKAROO_FAILED,
|
1107 |
+
"type" => "ideal")),
|
1108 |
+
824 => array( '*'=>array( "omschrijving" => "Deze Giropay-transactie is door de bank afgewezen.",
|
1109 |
+
"code" => self::BUCKAROO_FAILED,
|
1110 |
+
"type" => "ideal")),
|
1111 |
+
830 => array( '*'=>array( "omschrijving" => "Issuer (bankleitzahl) is onbekend: [waarde]",
|
1112 |
+
"code" => self::BUCKAROO_FAILED,
|
1113 |
+
"type" => "ideal")),
|
1114 |
+
831 => array( '*'=>array( "omschrijving" => "Om technische reden kon de status van deze transactie nog niet bij de bank worden achterhaald. De transactie is nog niet afgerond.",
|
1115 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1116 |
+
"type" => "ideal")),
|
1117 |
+
833 => array( '*'=>array( "omschrijving" => "De entrance-code [waarde] is ongeldig.",
|
1118 |
+
"code" => self::BUCKAROO_FAILED,
|
1119 |
+
"type" => "ideal")),
|
1120 |
+
834 => array( '*'=>array( "omschrijving" => "Er is een systeemfout opgetreden. We zullen deze zo snel mogelijk verhelpen. De status zal daarna worden herzien.",
|
1121 |
+
"code" => self::BUCKAROO_FAILED,
|
1122 |
+
"type" => "ideal")),
|
1123 |
+
835 => array( '*'=>array( "omschrijving" => "Het Giropay transactie-id is ongeldig of niet beschikbaar.",
|
1124 |
+
"code" => self::BUCKAROO_FAILED,
|
1125 |
+
"type" => "ideal")),
|
1126 |
+
836 => array( '*'=>array( "omschrijving" => "Er kon geen transactie worden gevonden. Criteria: [waarde]",
|
1127 |
+
"code" => self::BUCKAROO_FAILED,
|
1128 |
+
"type" => "ideal")),
|
1129 |
+
871 => array( '*'=>array( "omschrijving" => "De refund voor deze iDeal-cardbetaling is verwerkt.",
|
1130 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1131 |
+
"type" => "ideal")),
|
1132 |
+
872 => array( '*'=>array( "omschrijving" => "De refund voor deze iDeal-cardbetaling is mislukt.",
|
1133 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1134 |
+
"type" => "ideal")),
|
1135 |
+
873 => array( '*'=>array( "omschrijving" => "De refund voor deze GiroPay-cardbetaling is verwerkt.",
|
1136 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1137 |
+
"type" => "ideal")),
|
1138 |
+
874 => array( '*'=>array( "omschrijving" => "De refund voor deze GiroPay-betaling is mislukt.",
|
1139 |
+
"code" => self::BUCKAROO_NEUTRAL,
|
1140 |
+
"type" => "ideal")),
|
1141 |
+
900 => array( '*'=>array( "omschrijving" => "Geen XML-bericht ontvangen.",
|
1142 |
+
"code" => self::BUCKAROO_FAILED,
|
1143 |
+
"type" => "xml")),
|
1144 |
+
901 => array( '*'=>array( "omschrijving" => "Ongeldig XML-bericht. [waarde]",
|
1145 |
+
"code" => self::BUCKAROO_FAILED,
|
1146 |
+
"type" => "xml")),
|
1147 |
+
910 => array( '*'=>array( "omschrijving" => "0 EUR transactie, Customergegevens opgeslagen.",
|
1148 |
+
"code" => self::BUCKAROO_FAILED,
|
1149 |
+
"type" => "xml")),
|
1150 |
+
931 => array( '*'=>array( "omschrijving" => "[nodetype] [element] ontbreekt.",
|
1151 |
+
"code" => self::BUCKAROO_FAILED,
|
1152 |
+
"type" => "xml")),
|
1153 |
+
932 => array( '*'=>array( "omschrijving" => "Teveel elementen type [element] (max. 1).",
|
1154 |
+
"code" => self::BUCKAROO_FAILED,
|
1155 |
+
"type" => "xml")),
|
1156 |
+
933 => array( '*'=>array( "omschrijving" => "Waarde [nodetype] [element] ontbreekt.",
|
1157 |
+
"code" => self::BUCKAROO_FAILED,
|
1158 |
+
"type" => "xml")),
|
1159 |
+
934 => array( '*'=>array( "omschrijving" => "Waarde [nodetype] [element] (occurance [occurance]) ontbreekt.",
|
1160 |
+
"code" => self::BUCKAROO_FAILED,
|
1161 |
+
"type" => "xml")),
|
1162 |
+
935 => array( '*'=>array( "omschrijving" => "Waarde attribuut [attribuut] ontbreekt in element [element].",
|
1163 |
+
"code" => self::BUCKAROO_FAILED,
|
1164 |
+
"type" => "xml")),
|
1165 |
+
940 => array( '*'=>array( "omschrijving" => "Ongeldig request: [waarde].",
|
1166 |
+
"code" => self::BUCKAROO_FAILED,
|
1167 |
+
"type" => "xml")),
|
1168 |
+
941 => array( '*'=>array( "omschrijving" => "Waarde veld [veld] ongeldig: [waarde].",
|
1169 |
+
"code" => self::BUCKAROO_FAILED,
|
1170 |
+
"type" => "xml")),
|
1171 |
+
942 => array( '*'=>array( "omschrijving" => "Waarde attribuut [veld] ongeldig: [waarde].",
|
1172 |
+
"code" => self::BUCKAROO_FAILED,
|
1173 |
+
"type" => "xml")),
|
1174 |
+
943 => array( '*'=>array( "omschrijving" => "Creditcard-type onbekend: [waarde]. (mastercard of visa)",
|
1175 |
+
"code" => self::BUCKAROO_FAILED,
|
1176 |
+
"type" => "xml")),
|
1177 |
+
944 => array( '*'=>array( "omschrijving" => "Kaartnummer ongeldig (Luhn-check): [waarde].",
|
1178 |
+
"code" => self::BUCKAROO_FAILED,
|
1179 |
+
"type" => "xml")),
|
1180 |
+
945 => array( '*'=>array( "omschrijving" => "Valuta onbekend ongeldig: [waarde].",
|
1181 |
+
"code" => self::BUCKAROO_FAILED,
|
1182 |
+
"type" => "xml")),
|
1183 |
+
946 => array( '*'=>array( "omschrijving" => "Bedrag is geen numerieke waarde: [waarde].",
|
1184 |
+
"code" => self::BUCKAROO_FAILED,
|
1185 |
+
"type" => "xml")),
|
1186 |
+
947 => array( '*'=>array( "omschrijving" => "Bedrag ongeldig: [waarde].",
|
1187 |
+
"code" => self::BUCKAROO_FAILED,
|
1188 |
+
"type" => "xml")),
|
1189 |
+
948 => array( '*'=>array( "omschrijving" => "CVC-code ongeldig: [waarde].",
|
1190 |
+
"code" => self::BUCKAROO_FAILED,
|
1191 |
+
"type" => "xml")),
|
1192 |
+
949 => array( '*'=>array( "omschrijving" => "Maand geldigheidsduur creditcard ongeldig: [waarde].",
|
1193 |
+
"code" => self::BUCKAROO_FAILED,
|
1194 |
+
"type" => "xml")),
|
1195 |
+
950 => array( '*'=>array( "omschrijving" => "Jaar geldigheidsduur creditcard ongeldig: [waarde].",
|
1196 |
+
"code" => self::BUCKAROO_FAILED,
|
1197 |
+
"type" => "xml")),
|
1198 |
+
951 => array( '*'=>array( "omschrijving" => "Taal onbekend of niet ondersteund: [waarde].",
|
1199 |
+
"code" => self::BUCKAROO_FAILED,
|
1200 |
+
"type" => "xml")),
|
1201 |
+
952 => array( '*'=>array( "omschrijving" => "Het factuurnummer ontbreekt. Dit veld is verplicht.",
|
1202 |
+
"code" => self::BUCKAROO_FAILED,
|
1203 |
+
"type" => "xml")),
|
1204 |
+
953 => array( '*'=>array( "omschrijving" => "Geblokkeerd door velocitycheck",
|
1205 |
+
"code" => self::BUCKAROO_FAILED,
|
1206 |
+
"type" => "xml")),
|
1207 |
+
954 => array( '*'=>array( "omschrijving" => "Het transactie-ID [waarde] is al in gebruik.",
|
1208 |
+
"code" => self::BUCKAROO_FAILED,
|
1209 |
+
"type" => "xml")),
|
1210 |
+
955 => array( '*'=>array( "omschrijving" => "Authenticatie voor deze creditcard betaling is afgewezen",
|
1211 |
+
"code" => self::BUCKAROO_FAILED,
|
1212 |
+
"type" => "xml")),
|
1213 |
+
956 => array( '*'=>array( "omschrijving" => "De enrolled status van de creditcard kon niet achterhaald worden.",
|
1214 |
+
"code" => self::BUCKAROO_FAILED,
|
1215 |
+
"type" => "xml")),
|
1216 |
+
960 => array( '*'=>array( "omschrijving" => "Klantnummer ongeldig: [waarde].",
|
1217 |
+
"code" => self::BUCKAROO_FAILED,
|
1218 |
+
"type" => "xml")),
|
1219 |
+
961 => array( '*'=>array( "omschrijving" => "Creditcard-type niet geactiveerd: [waarde].",
|
1220 |
+
"code" => self::BUCKAROO_FAILED,
|
1221 |
+
"type" => "xml")),
|
1222 |
+
962 => array( '*'=>array( "omschrijving" => "Gekozen valuta ongeldig voor Merchant: [waarde].",
|
1223 |
+
"code" => self::BUCKAROO_FAILED,
|
1224 |
+
"type" => "xml")),
|
1225 |
+
963 => array( '*'=>array( "omschrijving" => "Het transactie-id is ongeldig: [waarde]",
|
1226 |
+
"code" => self::BUCKAROO_FAILED,
|
1227 |
+
"type" => "xml")),
|
1228 |
+
964 => array( '*'=>array( "omschrijving" => "Er zijn geen betaalmethoden geactiveerd.",
|
1229 |
+
"code" => self::BUCKAROO_FAILED,
|
1230 |
+
"type" => "xml")),
|
1231 |
+
971 => array( '*'=>array( "omschrijving" => "Er is geen naam opgegeven.",
|
1232 |
+
"code" => self::BUCKAROO_FAILED,
|
1233 |
+
"type" => "xml")),
|
1234 |
+
972 => array( '*'=>array( "omschrijving" => "Er is geen adres opgegeven.",
|
1235 |
+
"code" => self::BUCKAROO_FAILED,
|
1236 |
+
"type" => "xml")),
|
1237 |
+
973 => array( '*'=>array( "omschrijving" => "Er is geen postcode ingevuld.",
|
1238 |
+
"code" => self::BUCKAROO_FAILED,
|
1239 |
+
"type" => "xml")),
|
1240 |
+
974 => array( '*'=>array( "omschrijving" => "Er is geen plaats ingevuld.",
|
1241 |
+
"code" => self::BUCKAROO_FAILED,
|
1242 |
+
"type" => "xml")),
|
1243 |
+
975 => array( '*'=>array( "omschrijving" => "Er is geen land ingevuld.",
|
1244 |
+
"code" => self::BUCKAROO_FAILED,
|
1245 |
+
"type" => "xml")),
|
1246 |
+
976 => array( '*'=>array( "omschrijving" => "Er is geen geslacht ingevuld.",
|
1247 |
+
"code" => self::BUCKAROO_FAILED,
|
1248 |
+
"type" => "xml")),
|
1249 |
+
977 => array( '*'=>array( "omschrijving" => "Mailadres ongeldig.",
|
1250 |
+
"code" => self::BUCKAROO_FAILED,
|
1251 |
+
"type" => "xml")),
|
1252 |
+
978 => array( '*'=>array( "omschrijving" => "De XML koppeling voor creditcards is nog niet geactiveerd.",
|
1253 |
+
"code" => self::BUCKAROO_FAILED,
|
1254 |
+
"type" => "xml")),
|
1255 |
+
980 => array( '*'=>array( "omschrijving" => "De betaalmethode [waarde] is niet geactiveerd.",
|
1256 |
+
"code" => self::BUCKAROO_FAILED,
|
1257 |
+
"type" => "xml")),
|
1258 |
+
981 => array( '*'=>array( "omschrijving" => "De datum van het abonnement is geen geldige datum.",
|
1259 |
+
"code" => self::BUCKAROO_FAILED,
|
1260 |
+
"type" => "xml")),
|
1261 |
+
982 => array( '*'=>array( "omschrijving" => "Het abonnement is nog niet ingegaan.",
|
1262 |
+
"code" => self::BUCKAROO_FAILED,
|
1263 |
+
"type" => "xml")),
|
1264 |
+
983 => array( '*'=>array( "omschrijving" => "Het abonnement is verlopen.",
|
1265 |
+
"code" => self::BUCKAROO_FAILED,
|
1266 |
+
"type" => "xml")),
|
1267 |
+
990 => array( '*'=>array( "omschrijving" => "De digitale handtekening is incorrect: [waarde].",
|
1268 |
+
"code" => self::BUCKAROO_FAILED,
|
1269 |
+
"type" => "xml")),
|
1270 |
+
991 => array( '*'=>array( "omschrijving" => "Er is een fout opgetreden bij het verwerken van de transactie. De Merchant Account Code kon niet worden gelocaliseerd.",
|
1271 |
+
"code" => self::BUCKAROO_FAILED,
|
1272 |
+
"type" => "xml")),
|
1273 |
+
992 => array( '*'=>array( "omschrijving" => "Er is fout opgetreden bij het verwerken van de response. We zullen de storing zo snel mogelijk verhelpen.",
|
1274 |
+
"code" => self::BUCKAROO_FAILED,
|
1275 |
+
"type" => "xml")),
|
1276 |
+
993 => array( '*'=>array( "omschrijving" => "Er is een fout opgetreden bij het verwerken van de transactie. We zullen de storing zo snel mogelijk verhelpen.",
|
1277 |
+
"code" => self::BUCKAROO_FAILED,
|
1278 |
+
"type" => "xml")),
|
1279 |
+
999 => array( '*'=>array( "omschrijving" => "Er is een fout opgetreden waarvan de oorzaak vooralsnog onbekend is. We zullen de storing zo snel mogelijk verhelpen.",
|
1280 |
+
"code" => self::BUCKAROO_FAILED))
|
1281 |
+
);
|
1282 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TIG_Buckaroo3Extended_Model_Adminhtml_System_Config_Backend_Buckaroo_Certificate extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
public function _afterSave()
|
6 |
+
{
|
7 |
+
Mage::getModel('buckaroo3extended/certificate_certificate')->uploadAndImport($this);
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,35 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TIG_Buckaroo3Extended_Model_Adminhtml_System_Config_Backend_Buckaroo_Fee extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
public function _beforeSave()
|
6 |
+
{
|
7 |
+
$groups = $this->getGroups();
|
8 |
+
foreach($groups as &$group) {
|
9 |
+
$fields = $group['fields'];
|
10 |
+
if (array_key_exists('payment_fee', $fields)) {
|
11 |
+
$fee = $group['fields']['payment_fee']['value'];
|
12 |
+
if ($fee) {
|
13 |
+
$group['fields']['payment_fee']['value'] = $this->_validateFee($fee);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
$this->setGroups($groups);
|
19 |
+
|
20 |
+
return parent::_beforeSave();
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _validateFee($fee)
|
24 |
+
{
|
25 |
+
$fee = str_replace(',', '.', $fee);
|
26 |
+
preg_match("#^0*(100(\.00?)?|[0-9]?[0-9](\.[0-9][0-9]?)?)%?$#", $fee, $matches);
|
27 |
+
|
28 |
+
if (empty($matches)) {
|
29 |
+
Mage::throwException(
|
30 |
+
Mage::helper('buckaroo3extended')->__('Fee value is improperly formatted. Fee must be a positive number or a percentage with a single decimal seperator.')
|
31 |
+
);
|
32 |
+
}
|
33 |
+
return $matches[0];
|
34 |
+
}
|
35 |
+
}
|
@@ -0,0 +1,30 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_BUckaroo3Extended_Model_Certificate extends Mage_Core_Model_Abstract
|
24 |
+
{
|
25 |
+
public function _construct()
|
26 |
+
{
|
27 |
+
parent::_construct();
|
28 |
+
$this->_init('buckaroo3extended/certificate');
|
29 |
+
}
|
30 |
+
}
|
@@ -0,0 +1,58 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TIG_Buckaroo3Extended_Model_Certificate_Certificate extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Uploads the certificate file.
|
7 |
+
*
|
8 |
+
* @param Varien_Object $object
|
9 |
+
*/
|
10 |
+
public function uploadAndImport(Varien_Object $object)
|
11 |
+
{
|
12 |
+
if (
|
13 |
+
isset($_FILES['groups']['name']['buckaroo3extended_certificate']['fields']['certificate_upload']['value'])
|
14 |
+
&& !empty($_FILES['groups']['name']['buckaroo3extended_certificate']['fields']['certificate_upload']['value'])
|
15 |
+
&& file_exists($_FILES['groups']['tmp_name']['buckaroo3extended_certificate']['fields']['certificate_upload']['value'])
|
16 |
+
) {
|
17 |
+
try {
|
18 |
+
//check if a certificate name is defined
|
19 |
+
if (!isset($_POST['groups']['buckaroo3extended_certificate']['fields']['certificate_name']['value'])
|
20 |
+
|| empty($_POST['groups']['buckaroo3extended_certificate']['fields']['certificate_name']['value'])
|
21 |
+
) {
|
22 |
+
Mage::throwException('please enter a name for this certificate');
|
23 |
+
}
|
24 |
+
|
25 |
+
if (strpos($_FILES['groups']['name']['buckaroo3extended_certificate']['fields']['certificate_upload']['value'], '.pem') === false) {
|
26 |
+
Mage::throwException('invalid certificate file uploaded');
|
27 |
+
}
|
28 |
+
|
29 |
+
$model = Mage::getModel('buckaroo3extended/certificate');
|
30 |
+
$collection = $model->getCollection()->load();
|
31 |
+
$names = $collection->getColumnValues('certificate_name');
|
32 |
+
|
33 |
+
//check if chosen certificate name is already in use
|
34 |
+
if (in_array($_POST['groups']['buckaroo3extended_certificate']['fields']['certificate_name']['value'], $names)) {
|
35 |
+
Mage::throwException(
|
36 |
+
'The certificate name \''
|
37 |
+
. $_POST['groups']['buckaroo3extended_certificate']['fields']['certificate_name']['value']
|
38 |
+
. '\' is already in use.'
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
$data = array(
|
43 |
+
'certificate' => file_get_contents($_FILES['groups']['tmp_name']['buckaroo3extended_certificate']['fields']['certificate_upload']['value']),
|
44 |
+
'certificate_name' => $_POST['groups']['buckaroo3extended_certificate']['fields']['certificate_name']['value'],
|
45 |
+
'upload_date' => date('Y:m:d H:i:s'),
|
46 |
+
);
|
47 |
+
$model->setData($data);
|
48 |
+
$model->save();
|
49 |
+
} catch (Exception $e) {
|
50 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
51 |
+
|
52 |
+
return $object;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
return $object;
|
57 |
+
}
|
58 |
+
}
|
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_Giftcard extends Mage_Core_Model_Abstract
|
24 |
+
{
|
25 |
+
public function _construct()
|
26 |
+
{
|
27 |
+
$this->_init('buckaroo3extended/giftcard');
|
28 |
+
}
|
29 |
+
}
|
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Mysql4_Setup extends Mage_Core_Model_Mysql4_Setup
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
@@ -0,0 +1,71 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_Observer extends Mage_Core_Model_Abstract
|
24 |
+
{
|
25 |
+
|
26 |
+
/**
|
27 |
+
* When config settings are saved in the backend, retrieve the title of all buckaroo payment methods that have been activated.
|
28 |
+
* These titles are using the following path: 'buckaroo/buckaroo3extended_PAYMENTCODE/title'.
|
29 |
+
* Retrieve this and enter it in the DB using the following path: 'payment/buckaroo3extended_PAYMENTCODE/title'.
|
30 |
+
* This way, magento will know what label to give the payment methods in the frontend.
|
31 |
+
* The same goes for the sort_order
|
32 |
+
*
|
33 |
+
* @param Varien_Event_Observer $observer
|
34 |
+
* @return bool
|
35 |
+
*/
|
36 |
+
public function controller_action_postdispatch_adminhtml_system_config_save(Varien_Event_Observer $observer)
|
37 |
+
{
|
38 |
+
//check if the section being saved is 'buckaroo'
|
39 |
+
$buckarooRequest = strpos(Mage::getSingleton('core/app')->getRequest()->getRequestUri(), 'section/buckaroo/');
|
40 |
+
if ($buckarooRequest === false) {
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
//get all activated payment methods
|
45 |
+
$payments = Mage::getSingleton('payment/config')->getActiveMethods();
|
46 |
+
foreach ($payments as $payment) {
|
47 |
+
|
48 |
+
//get the code and check if its a buckaroo2012 payment method
|
49 |
+
$code = $payment->getCode();
|
50 |
+
$isBuckaroo = strpos($code, 'buckaroo3extended');
|
51 |
+
if ($isBuckaroo !== false) {
|
52 |
+
foreach(Mage::app()->getStores() as $eachStore => $storeVal)
|
53 |
+
{
|
54 |
+
//retrieve the title as set in the backend
|
55 |
+
$title = Mage::getStoreConfig('buckaroo/' . $code . '/title', Mage::app()->getStore($eachStore)->getId());
|
56 |
+
$sort_order = Mage::getStoreConfig('buckaroo/' . $code . '/sort_order', Mage::app()->getStore($eachStore)->getId());
|
57 |
+
|
58 |
+
if (!is_null($title) && $title !== '') {
|
59 |
+
//set the title as the new path
|
60 |
+
Mage::getModel('core/config')->saveConfig('payment/' . $code . '/title', $title, 'stores', Mage::app()->getStore($eachStore)->getId());
|
61 |
+
}
|
62 |
+
if (!is_null($sort_order) && $title !== '') {
|
63 |
+
//set the sort_order as the new path
|
64 |
+
Mage::getModel('core/config')->saveConfig('payment/' . $code . '/sort_order', $sort_order, 'stores', Mage::app()->getStore($eachStore)->getId());
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
@@ -0,0 +1,586 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Observer_Abstract extends TIG_Buckaroo3Extended_Model_Abstract
|
3 |
+
{
|
4 |
+
protected $_storeId;
|
5 |
+
/**
|
6 |
+
* @var Mage_Sales_Model_Order $_order
|
7 |
+
*/
|
8 |
+
protected $_order;
|
9 |
+
protected $_billingInfo;
|
10 |
+
protected $_method = '';
|
11 |
+
|
12 |
+
public function getMethod()
|
13 |
+
{
|
14 |
+
return $this->_method;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function setMethod($method)
|
18 |
+
{
|
19 |
+
$this->_method = $method;
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->setStoreId(Mage::app()->getStore()->getId());
|
26 |
+
$this->_loadLastOrder();
|
27 |
+
$this->_setOrderBillingInfo();
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Each payment method has it's own observer. When one of the observers is called, this checks if it's
|
32 |
+
* payment method is being used and therefore, if this observer needs to do anything.
|
33 |
+
*
|
34 |
+
* @param $observer
|
35 |
+
* @return bool
|
36 |
+
*/
|
37 |
+
protected function _isChosenMethod($observer)
|
38 |
+
{
|
39 |
+
$ret = false;
|
40 |
+
|
41 |
+
$chosenMethod = $observer->getOrder()->getPayment()->getMethod();
|
42 |
+
|
43 |
+
if ($chosenMethod === $this->_code) {
|
44 |
+
$ret = true;
|
45 |
+
if($observer->getOrder()->getPaymentMethodUsedForTransaction()) {
|
46 |
+
$this->setMethod($observer->getOrder()->getPaymentMethodUsedForTransaction());
|
47 |
+
}
|
48 |
+
}
|
49 |
+
return $ret;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Add credit management required fields to the request
|
54 |
+
*
|
55 |
+
* @param $vars
|
56 |
+
* @param string $serviceName
|
57 |
+
* @return mixed
|
58 |
+
*/
|
59 |
+
protected function _addCreditManagement(&$vars, $serviceName = 'creditmanagement')
|
60 |
+
{
|
61 |
+
$method = $this->_order->getPayment()->getMethod();
|
62 |
+
|
63 |
+
$dueDaysInvoice = Mage::getStoreConfig('buckaroo/' . $method . '/due_date_invoice', $this->getStoreId());
|
64 |
+
$dueDays = Mage::getStoreConfig('buckaroo/' . $method . '/due_date', $this->getStoreId());
|
65 |
+
|
66 |
+
$invoiceDate = date('Y-m-d', mktime(0, 0, 0, date("m") , (date("d") + $dueDaysInvoice), date("Y")));
|
67 |
+
$dueDate = date('Y-m-d', mktime(0, 0, 0, date("m") , (date("d") + $dueDaysInvoice + $dueDays), date("Y")));
|
68 |
+
|
69 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($serviceName, $vars['customVars']) && is_array($vars['customVars'][$serviceName])) {
|
70 |
+
$vars['customVars'][$serviceName] = array_merge($vars['customVars'][$serviceName], array(
|
71 |
+
'DateDue' => $dueDate,
|
72 |
+
'InvoiceDate' => $invoiceDate,
|
73 |
+
));
|
74 |
+
} else {
|
75 |
+
$vars['customVars'][$serviceName] = array(
|
76 |
+
'DateDue' => $dueDate,
|
77 |
+
'InvoiceDate' => $invoiceDate,
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
return $vars;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Currently used by all payment methods except payment guarantee
|
86 |
+
*
|
87 |
+
* @param $vars
|
88 |
+
*/
|
89 |
+
protected function _addAdditionalCreditManagementVariables(&$vars)
|
90 |
+
{
|
91 |
+
$VAT = 0;
|
92 |
+
foreach($this->_order->getFullTaxInfo() as $taxRecord)
|
93 |
+
{
|
94 |
+
$VAT += $taxRecord['amount'];
|
95 |
+
}
|
96 |
+
|
97 |
+
$reminderLevel = Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/reminder_level', $this->getStoreId());
|
98 |
+
|
99 |
+
$creditmanagementArray = array(
|
100 |
+
'AmountVat' => $VAT,
|
101 |
+
'CustomerType' => 1,
|
102 |
+
'MaxReminderLevel' => $reminderLevel,
|
103 |
+
);
|
104 |
+
|
105 |
+
if (array_key_exists('customVars', $vars) && is_array($vars['customVars']['creditmanagement'])) {
|
106 |
+
$vars['customVars']['creditmanagement'] = array_merge($vars['customVars']['creditmanagement'], $creditmanagementArray);
|
107 |
+
} else {
|
108 |
+
$vars['customVars']['creditmanagement'] = $creditmanagementArray;
|
109 |
+
}
|
110 |
+
|
111 |
+
if (empty($vars['customVars']['creditmanagement']['PhoneNumber']) && !empty($vars['customVars']['creditmanagement']['MobilePhoneNumber'])) {
|
112 |
+
$vars['customVars']['creditmanagement']['PhoneNumber'] = $vars['customVars']['creditmanagement']['MobilePhoneNumber'];
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Add the customer variables to the request
|
118 |
+
*
|
119 |
+
* @param $vars
|
120 |
+
* @param string $serviceName
|
121 |
+
* @return mixed
|
122 |
+
*/
|
123 |
+
protected function _addCustomerVariables(&$vars, $serviceName = 'creditmanagement')
|
124 |
+
{
|
125 |
+
if (Mage::helper('buckaroo3extended')->isAdmin()) {
|
126 |
+
$additionalFields = Mage::getSingleton('core/session')->getData('additionalFields');
|
127 |
+
} else {
|
128 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
129 |
+
}
|
130 |
+
|
131 |
+
if (isset($additionalFields['BPE_Customergender'])) {
|
132 |
+
$gender = $additionalFields['BPE_Customergender'];
|
133 |
+
} else {
|
134 |
+
$gender = 0;
|
135 |
+
}
|
136 |
+
|
137 |
+
if (isset($additionalFields['BPE_customerbirthdate'])) {
|
138 |
+
$dob = $additionalFields['BPE_customerbirthdate'];
|
139 |
+
} else {
|
140 |
+
$dob = '';
|
141 |
+
}
|
142 |
+
|
143 |
+
if (isset($additionalFields['BPE_Customermail'])) {
|
144 |
+
$mail = $additionalFields['BPE_Customermail'];
|
145 |
+
} else {
|
146 |
+
$mail = $this->_billingInfo['email'];
|
147 |
+
}
|
148 |
+
|
149 |
+
$customerId = $this->_order->getCustomerId()
|
150 |
+
? $this->_order->getCustomerId()
|
151 |
+
: $this->_order->getIncrementId();
|
152 |
+
|
153 |
+
$firstName = $this->_billingInfo['firstname'];
|
154 |
+
$lastName = $this->_billingInfo['lastname'];
|
155 |
+
$address = $this->_processAddressCM();
|
156 |
+
$houseNumber = $address['house_number'];
|
157 |
+
$houseNumberSuffix = $address['number_addition'];
|
158 |
+
$street = $address['street'];
|
159 |
+
$zipcode = $this->_billingInfo['zip'];
|
160 |
+
$city = $this->_billingInfo['city'];
|
161 |
+
$state = $this->_billingInfo['state'];
|
162 |
+
$fax = $this->_billingInfo['fax'];
|
163 |
+
$country = $this->_billingInfo['countryCode'];
|
164 |
+
$processedPhoneNumber = $this->_processPhoneNumberCM();
|
165 |
+
$customerLastNamePrefix = $this->_getCustomerLastNamePrefix();
|
166 |
+
$customerInitials = $this->_getInitialsCM();
|
167 |
+
|
168 |
+
$array = array(
|
169 |
+
'CustomerCode' => $customerId,
|
170 |
+
'CustomerFirstName' => $firstName,
|
171 |
+
'CustomerLastName' => $lastName,
|
172 |
+
'FaxNumber' => $fax,
|
173 |
+
'CustomerInitials' => $customerInitials,
|
174 |
+
'CustomerLastNamePrefix' => $customerLastNamePrefix,
|
175 |
+
'CustomerBirthDate' => $dob,
|
176 |
+
'Customergender' => $gender,
|
177 |
+
'Customeremail' => $mail,
|
178 |
+
'ZipCode' => array(
|
179 |
+
'value' => $zipcode,
|
180 |
+
'group' => 'address'
|
181 |
+
),
|
182 |
+
'City' => array(
|
183 |
+
'value' => $city,
|
184 |
+
'group' => 'address'
|
185 |
+
),
|
186 |
+
'State' => array(
|
187 |
+
'value' => $state,
|
188 |
+
'group' => 'address'
|
189 |
+
),
|
190 |
+
'Street' => array(
|
191 |
+
'value' => $street,
|
192 |
+
'group' => 'address'
|
193 |
+
),
|
194 |
+
'HouseNumber' => array(
|
195 |
+
'value' => $houseNumber,
|
196 |
+
'group' => 'address'
|
197 |
+
),
|
198 |
+
'HouseNumberSuffix' => array(
|
199 |
+
'value' => $houseNumberSuffix,
|
200 |
+
'group' => 'address'
|
201 |
+
),
|
202 |
+
'Country' => array(
|
203 |
+
'value' => $country,
|
204 |
+
'group' => 'address'
|
205 |
+
)
|
206 |
+
);
|
207 |
+
|
208 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($serviceName, $vars['customVars']) && is_array($vars['customVars'][$serviceName])) {
|
209 |
+
$vars['customVars'][$serviceName] = array_merge($vars['customVars'][$serviceName], $array);
|
210 |
+
} else {
|
211 |
+
$vars['customVars'][$serviceName] = $array;
|
212 |
+
}
|
213 |
+
|
214 |
+
if ($processedPhoneNumber['mobile']) {
|
215 |
+
$vars['customVars'][$serviceName] = array_merge($vars['customVars'][$serviceName], array(
|
216 |
+
'MobilePhoneNumber' => $processedPhoneNumber['clean'],
|
217 |
+
));
|
218 |
+
} else {
|
219 |
+
$vars['customVars'][$serviceName] = array_merge($vars['customVars'][$serviceName], array(
|
220 |
+
'PhoneNumber' => $processedPhoneNumber['clean'],
|
221 |
+
));
|
222 |
+
}
|
223 |
+
|
224 |
+
return $vars;
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
*
|
229 |
+
* Processes billingInfo array to get the initials of the customer
|
230 |
+
*
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
protected function _getInitialsCM()
|
234 |
+
{
|
235 |
+
$firstname = $this->_billingInfo['firstname'];
|
236 |
+
|
237 |
+
$initials = '';
|
238 |
+
$firstnameParts = explode(' ', $firstname);
|
239 |
+
|
240 |
+
foreach ($firstnameParts as $namePart) {
|
241 |
+
$initials .= strtoupper($namePart[0]) . '.';
|
242 |
+
}
|
243 |
+
|
244 |
+
return $initials;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
*
|
249 |
+
* Processes the customer's billing_address so as to fit the SOAP request. returning an array
|
250 |
+
*
|
251 |
+
* @return array
|
252 |
+
*/
|
253 |
+
protected function _processAddressCM()
|
254 |
+
{
|
255 |
+
//get address from billingInfo
|
256 |
+
$address = $this->_billingInfo['address'];
|
257 |
+
|
258 |
+
$ret = array();
|
259 |
+
$ret['house_number'] = '';
|
260 |
+
$ret['number_addition'] = '';
|
261 |
+
if (preg_match('#^(.*?)([0-9]+)(.*)#s', $address, $matches)) {
|
262 |
+
if ('' == $matches[1]) {
|
263 |
+
// Number at beginning
|
264 |
+
$ret['house_number'] = trim($matches[2]);
|
265 |
+
$ret['street'] = trim($matches[3]);
|
266 |
+
} else {
|
267 |
+
// Number at end
|
268 |
+
$ret['street'] = trim($matches[1]);
|
269 |
+
$ret['house_number'] = trim($matches[2]);
|
270 |
+
$ret['number_addition'] = trim($matches[3]);
|
271 |
+
}
|
272 |
+
} else {
|
273 |
+
// No number
|
274 |
+
$ret['street'] = $address;
|
275 |
+
}
|
276 |
+
|
277 |
+
return $ret;
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* processes the customer's phone number so as to fit the betaalgarant SOAP request
|
282 |
+
*
|
283 |
+
* @return array
|
284 |
+
*/
|
285 |
+
protected function _processPhoneNumberCM()
|
286 |
+
{
|
287 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
288 |
+
if (isset($additionalFields['BPE_PhoneNumber'])) {
|
289 |
+
$number = $additionalFields['BPE_PhoneNumber'];
|
290 |
+
} else {
|
291 |
+
$number = ($this->_billingInfo['telephone'])?:'1234567890';
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
//the final output must like this: 0031123456789 for mobile: 0031612345678
|
296 |
+
//so 13 characters max else number is not valid
|
297 |
+
//but for some error correction we try to find if there is some faulty notation
|
298 |
+
|
299 |
+
$return = array("orginal" => $number, "clean" => false, "mobile" => false, "valid" => false);
|
300 |
+
//first strip out the non-numeric characters:
|
301 |
+
$match = preg_replace('/[^0-9]/Uis', '', $number);
|
302 |
+
if ($match) {
|
303 |
+
$number = $match;
|
304 |
+
}
|
305 |
+
|
306 |
+
if (strlen((string)$number) == 13) {
|
307 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
308 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
309 |
+
//now we can almost say that the number is valid
|
310 |
+
$return['valid'] = true;
|
311 |
+
$return['clean'] = $number;
|
312 |
+
} elseif (strlen((string) $number) > 13) {
|
313 |
+
//if the number is bigger then 13, it means that there are probably a zero to much
|
314 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
315 |
+
$return['clean'] = $this->_isValidNotation($number);
|
316 |
+
if(strlen((string)$return['clean']) == 13) {
|
317 |
+
$return['valid'] = true;
|
318 |
+
}
|
319 |
+
|
320 |
+
} elseif (strlen((string)$number) == 12 or strlen((string)$number) == 11) {
|
321 |
+
//if the number is equal to 11 or 12, it means that they used a + in their number instead of 00
|
322 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
323 |
+
$return['clean'] = $this->_isValidNotation($number);
|
324 |
+
if(strlen((string)$return['clean']) == 13) {
|
325 |
+
$return['valid'] = true;
|
326 |
+
}
|
327 |
+
|
328 |
+
} elseif (strlen((string)$number) == 10) {
|
329 |
+
//this means that the user has no trailing "0031" and therfore only
|
330 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
331 |
+
$return['clean'] = '0031'.substr($number,1);
|
332 |
+
if (strlen((string) $return['clean']) == 13) {
|
333 |
+
$return['valid'] = true;
|
334 |
+
}
|
335 |
+
} else {
|
336 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
337 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
338 |
+
//now we can almost say that the number is valid
|
339 |
+
$return['valid'] = true;
|
340 |
+
$return['clean'] = $number;
|
341 |
+
}
|
342 |
+
|
343 |
+
return $return;
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* validate the phonenumber
|
348 |
+
*
|
349 |
+
* @param $number
|
350 |
+
* @return mixed
|
351 |
+
*/
|
352 |
+
protected function _isValidNotation($number) {
|
353 |
+
//checks if the number is valid, if not: try to fix it
|
354 |
+
$invalidNotations = array("00310", "0310", "310", "31");
|
355 |
+
foreach($invalidNotations as $invalid) {
|
356 |
+
if( strpos( substr( $number, 0, strlen($invalid) ), $invalid ) !== false ) {
|
357 |
+
$valid = substr($invalid, 0, -1);
|
358 |
+
if (substr($valid, 0, 2) == '31') {
|
359 |
+
$valid = "00" . $valid;
|
360 |
+
}
|
361 |
+
if (substr($valid, 0, 2) == '03') {
|
362 |
+
$valid = "0" . $valid;
|
363 |
+
}
|
364 |
+
if ($valid == '3'){
|
365 |
+
$valid = "0" . $valid . "1";
|
366 |
+
}
|
367 |
+
$number = str_replace($invalid, $valid, $number);
|
368 |
+
}
|
369 |
+
}
|
370 |
+
return $number;
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Checks if the number is a mobile number or not.
|
375 |
+
*
|
376 |
+
* @param string $number
|
377 |
+
*
|
378 |
+
* @return boolean
|
379 |
+
*/
|
380 |
+
protected function _isMobileNumber($number) {
|
381 |
+
//this function only checks if it is a mobile number, not checking valid notation
|
382 |
+
$checkMobileArray = array("3106","316","06","00316","003106");
|
383 |
+
foreach($checkMobileArray as $key => $value) {
|
384 |
+
|
385 |
+
if(strpos(substr($number, 0, strlen($value)), $value) !== false) {
|
386 |
+
|
387 |
+
return true;
|
388 |
+
}
|
389 |
+
}
|
390 |
+
return false;
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* @return string
|
395 |
+
*/
|
396 |
+
protected function _getCustomerLastNamePrefix()
|
397 |
+
{
|
398 |
+
$lastName = $this->_billingInfo['lastname'];
|
399 |
+
|
400 |
+
$lastNameBits = explode(' ', $lastName);
|
401 |
+
|
402 |
+
if (count($lastNameBits === 1)) {
|
403 |
+
return '';
|
404 |
+
}
|
405 |
+
|
406 |
+
$lastNameEnd = end($lastNameBits);
|
407 |
+
unset($lastNameEnd);
|
408 |
+
|
409 |
+
$prefix = implode(' ', $lastNameBits);
|
410 |
+
return $prefix;
|
411 |
+
}
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Certain payment methods require a list of other payment methods that will be used to finalize the payment.
|
415 |
+
* This method forms that list
|
416 |
+
*
|
417 |
+
* @return string
|
418 |
+
*/
|
419 |
+
protected function _getPaymentMethodsAllowed()
|
420 |
+
{
|
421 |
+
$configAllowed = Mage::getStoreConfig('buckaroo/' . $this->_code . '/allowed_methods', $this->getStoreId());
|
422 |
+
|
423 |
+
$allowedArray = explode(',', $configAllowed);
|
424 |
+
|
425 |
+
if (in_array('all', $allowedArray)) {
|
426 |
+
$allowedArray = array(
|
427 |
+
'amex',
|
428 |
+
'directdebit',
|
429 |
+
'giropay',
|
430 |
+
'ideal',
|
431 |
+
'mastercard',
|
432 |
+
'onlinegiro',
|
433 |
+
'paypal',
|
434 |
+
'paysafecard',
|
435 |
+
'sofortueberweisung',
|
436 |
+
'transfer',
|
437 |
+
'visa',
|
438 |
+
'maestro',
|
439 |
+
'visaelectron',
|
440 |
+
'vpay',
|
441 |
+
'bancontactmrcash',
|
442 |
+
);
|
443 |
+
}
|
444 |
+
|
445 |
+
$allowedString = implode(',', $allowedArray);
|
446 |
+
|
447 |
+
return $allowedString;
|
448 |
+
}
|
449 |
+
|
450 |
+
/**
|
451 |
+
* @param $enrolled
|
452 |
+
* @param $authenticated
|
453 |
+
* @param $order Mage_Sales_Model_Order
|
454 |
+
* @return mixed|null
|
455 |
+
*/
|
456 |
+
protected function _getSecureStatus($enrolled, $authenticated, $order)
|
457 |
+
{
|
458 |
+
$status = null;
|
459 |
+
$useSuccessStatus = Mage::getStoreConfig('buckaroo/' . $this->_code . '/active_status', $order->getStoreId());
|
460 |
+
|
461 |
+
if ($enrolled && $authenticated && $useSuccessStatus) {
|
462 |
+
switch ($order->getState()) {
|
463 |
+
case Mage_Sales_Model_Order::STATE_PROCESSING:
|
464 |
+
$status = Mage::getStoreConfig(
|
465 |
+
'buckaroo/' . $this->_code . '/secure_status_processing',
|
466 |
+
$order->getStoreId());
|
467 |
+
break;
|
468 |
+
}
|
469 |
+
} elseif (!$enrolled || !$authenticated) {
|
470 |
+
switch ($order->getState()) {
|
471 |
+
case Mage_Sales_Model_Order::STATE_PROCESSING:
|
472 |
+
$status = Mage::getStoreConfig(
|
473 |
+
'buckaroo/' . $this->_code . '/unsecure_status_processing',
|
474 |
+
$order->getStoreId());
|
475 |
+
break;
|
476 |
+
}
|
477 |
+
}
|
478 |
+
|
479 |
+
return $status;
|
480 |
+
}
|
481 |
+
|
482 |
+
/**
|
483 |
+
* @param $enrolled
|
484 |
+
* @param $authenticated
|
485 |
+
* @param $order Mage_Sales_Model_Order
|
486 |
+
*/
|
487 |
+
protected function _updateSecureStatus($enrolled, $authenticated, $order)
|
488 |
+
{
|
489 |
+
$shouldHold = Mage::getStoreConfig('buckaroo/' . $this->_code . '/unsecure_hold', $order->getStoreId());
|
490 |
+
|
491 |
+
if (
|
492 |
+
(!$enrolled || !$authenticated)
|
493 |
+
&& $shouldHold
|
494 |
+
&& $order->canHold())
|
495 |
+
{
|
496 |
+
$order->hold()->save();
|
497 |
+
}
|
498 |
+
|
499 |
+
$status = $this->_getSecureStatus($enrolled, $authenticated, $order);
|
500 |
+
|
501 |
+
$enrolledString = $enrolled ? 'yes' : 'no';
|
502 |
+
$authenticatedString = $authenticated ? 'yes' : 'no';
|
503 |
+
|
504 |
+
if ($status) {
|
505 |
+
$order->setStatus($status)
|
506 |
+
->addStatusHistoryComment(
|
507 |
+
Mage::helper('buckaroo3extended')->__("3D Secure enrolled: %s<br/>3D Secure authenticated: %s", $enrolledString, $authenticatedString),
|
508 |
+
$status
|
509 |
+
);
|
510 |
+
} else {
|
511 |
+
$order->addStatusHistoryComment(
|
512 |
+
Mage::helper('buckaroo3extended')->__("3D Secure enrolled: %s<br/>3D Secure authenticated: %s", $enrolledString, $authenticatedString)
|
513 |
+
);
|
514 |
+
}
|
515 |
+
|
516 |
+
$order->save();
|
517 |
+
}
|
518 |
+
|
519 |
+
/**
|
520 |
+
* @return int|mixed
|
521 |
+
*/
|
522 |
+
protected function _getServiceVersion()
|
523 |
+
{
|
524 |
+
$version = Mage::getStoreConfig('buckaroo/' . $this->_code . '/service_version', $this->getStoreId());
|
525 |
+
if (is_null($version)) {
|
526 |
+
$version = 1;
|
527 |
+
}
|
528 |
+
|
529 |
+
return $version;
|
530 |
+
}
|
531 |
+
|
532 |
+
/**
|
533 |
+
* @param $order Mage_Sales_Model_Order
|
534 |
+
* @return int|mixed
|
535 |
+
*/
|
536 |
+
protected function _getRefundServiceVersion($order)
|
537 |
+
{
|
538 |
+
$versionUsed = $order->getBuckarooServiceVersionUsed();
|
539 |
+
|
540 |
+
if (!is_null($versionUsed)) {
|
541 |
+
return $versionUsed;
|
542 |
+
}
|
543 |
+
|
544 |
+
return $this->_getServiceVersion();
|
545 |
+
}
|
546 |
+
|
547 |
+
/**
|
548 |
+
* @param $order
|
549 |
+
* @param $shippingAddress
|
550 |
+
* @return array|bool
|
551 |
+
*/
|
552 |
+
protected function _getSellerProtectionVars($order, $shippingAddress)
|
553 |
+
{
|
554 |
+
$checkForSellerProtection = Mage::helper('buckaroo3extended')->checkSellersProtection($order);
|
555 |
+
|
556 |
+
if ($checkForSellerProtection){
|
557 |
+
$arrayCustom = array(
|
558 |
+
'Name' => $shippingAddress['lastname'],
|
559 |
+
'Street1' => $shippingAddress['street'],
|
560 |
+
'CityName' => $shippingAddress['city'],
|
561 |
+
'StateOrProvince' => $shippingAddress['region'],
|
562 |
+
'PostalCode' => $shippingAddress['postcode'],
|
563 |
+
'Country' => $shippingAddress['country_id'],
|
564 |
+
'AddressOverride' => 'TRUE'
|
565 |
+
);
|
566 |
+
return $arrayCustom;
|
567 |
+
} else {
|
568 |
+
return false;
|
569 |
+
}
|
570 |
+
}
|
571 |
+
|
572 |
+
/**
|
573 |
+
* @param $order Mage_Sales_Model_Order
|
574 |
+
*/
|
575 |
+
protected function _addCommentHistoryForVirtual($order)
|
576 |
+
{
|
577 |
+
if($order->getIsVirtual()) {
|
578 |
+
$checkForSellerProtection = Mage::helper('buckaroo3extended')->checkSellersProtection($order);
|
579 |
+
if (!$checkForSellerProtection) {
|
580 |
+
$commentVirtual = Mage::helper('buckaroo3extended')->__('The order consists of virtual product(s), which is not supported by Seller Protection.');
|
581 |
+
$order->addStatusHistoryComment($commentVirtual)
|
582 |
+
->save();
|
583 |
+
}
|
584 |
+
}
|
585 |
+
}
|
586 |
+
}
|
@@ -0,0 +1,25 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Observer_BackendOrder extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function checkout_submit_all_after(Varien_Event_Observer $observer)
|
5 |
+
{
|
6 |
+
$order = $observer->getOrder();
|
7 |
+
$method = $order->getPayment()->getMethod();
|
8 |
+
|
9 |
+
if (strpos($method, 'buckaroo3extended') === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
try {
|
14 |
+
$request = Mage::getModel('buckaroo3extended/request_abstract');
|
15 |
+
$request->setOrder($order)
|
16 |
+
->setOrderBillingInfo();
|
17 |
+
|
18 |
+
$request->sendRequest();
|
19 |
+
} catch (Exception $e) {
|
20 |
+
Mage::throwException($e->getMessage());
|
21 |
+
}
|
22 |
+
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
}
|
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_OldPaymentMethods_OldPaymentMethod extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'oldBuckaroo';
|
5 |
+
|
6 |
+
protected $_isGateway = false;
|
7 |
+
protected $_canAuthorize = false;
|
8 |
+
protected $_canCapture = false;
|
9 |
+
protected $_canCapturePartial = false;
|
10 |
+
protected $_canRefund = false;
|
11 |
+
protected $_canVoid = false;
|
12 |
+
protected $_canUseInternal = false;
|
13 |
+
protected $_canUseCheckout = false;
|
14 |
+
protected $_canUseForMultishipping = false;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* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Creditmemo_Total_Fee
|
40 |
+
extends TIG_Buckaroo3Extended_Model_PaymentFee_Order_Creditmemo_Total_Fee_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Xpath to the Buckaroo Payment fee including tax setting.
|
44 |
+
*/
|
45 |
+
const XPATH_BUCKAROO_FEE_INCLUDING_TAX = 'tax/calculation/buckaroo_fee_including_tax';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Get the Buckaroo Payment fee total amount.
|
49 |
+
*
|
50 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
51 |
+
*
|
52 |
+
* @return $this
|
53 |
+
*
|
54 |
+
*/
|
55 |
+
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
|
56 |
+
{
|
57 |
+
$order = $creditmemo->getOrder();
|
58 |
+
|
59 |
+
$fee = $creditmemo->getBuckarooFee();
|
60 |
+
$baseFee = $creditmemo->getBaseBuckarooFee();
|
61 |
+
|
62 |
+
/**
|
63 |
+
* If the creditmemo has a fee already, we only need to set the totals. This is the case for existing
|
64 |
+
* creditmemos that are being viewed.
|
65 |
+
*/
|
66 |
+
if ($fee && $baseFee) {
|
67 |
+
$this->_updateCreditmemoTotals($creditmemo, $order, $fee, $baseFee);
|
68 |
+
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* If we are currently in the backend and logged in, we need to check the POST parameters to see if any fee
|
74 |
+
* amount is to be refunded.
|
75 |
+
*/
|
76 |
+
if (Mage::helper('buckaroo3extended')->isAdmin() && Mage::getSingleton('admin/session')->isLoggedIn()) {
|
77 |
+
/**
|
78 |
+
* This is unfortunately the only way to determine the fee amount that needs to be refunded without
|
79 |
+
* rewriting a core class. If anybody knows of a better way, please let us know at
|
80 |
+
* servicedesk@tig.nl.
|
81 |
+
*/
|
82 |
+
$creditmemoParameters = Mage::app()->getRequest()
|
83 |
+
->getParam('creditmemo', array());
|
84 |
+
|
85 |
+
if (isset($creditmemoParameters['buckaroo_fee'])
|
86 |
+
&& $creditmemoParameters['buckaroo_fee'] !== null
|
87 |
+
&& $creditmemoParameters['buckaroo_fee'] !== ''
|
88 |
+
) {
|
89 |
+
$this->_updateCreditmemoTotalsFromParams($creditmemo, $order, $creditmemoParameters);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* If none of the above are true, we are creating a new creditmemo and need to show the fee amounts that may be
|
97 |
+
* refunded (if any).
|
98 |
+
*/
|
99 |
+
$fee = $order->getBuckarooFee() - $order->getBuckarooFeeRefunded();
|
100 |
+
$baseFee = $order->getBaseBuckarooFee() - $order->getBaseBuckarooFeeRefunded();
|
101 |
+
|
102 |
+
if ($fee && $baseFee) {
|
103 |
+
$this->_updateCreditmemoTotals($creditmemo, $order, $fee, $baseFee);
|
104 |
+
|
105 |
+
return $this;
|
106 |
+
}
|
107 |
+
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
113 |
+
* @param Mage_Sales_Model_Order $order
|
114 |
+
* @param float $fee
|
115 |
+
* @param float $baseFee
|
116 |
+
*
|
117 |
+
* @return $this
|
118 |
+
*/
|
119 |
+
protected function _updateCreditmemoTotals(Mage_Sales_Model_Order_Creditmemo $creditmemo,
|
120 |
+
Mage_Sales_Model_Order $order, $fee, $baseFee)
|
121 |
+
{
|
122 |
+
$creditmemo->setBuckarooFee($fee)
|
123 |
+
->setBaseBuckarooFee($baseFee)
|
124 |
+
->setGrandTotal($creditmemo->getGrandTotal() + $fee)
|
125 |
+
->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseFee);
|
126 |
+
|
127 |
+
$order->setBuckarooFeeRefunded($order->getBuckarooFeeRefunded() + $fee)
|
128 |
+
->setBaseBuckarooFeeRefunded($order->getBaseBuckarooFeeRefunded() + $baseFee);
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Update the creditmemo's totals based on POST params.
|
135 |
+
*
|
136 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
137 |
+
* @param Mage_Sales_Model_Order $order
|
138 |
+
* @param array $creditmemoParameters
|
139 |
+
*
|
140 |
+
* @return $this
|
141 |
+
*
|
142 |
+
* @throws Mage_Exception
|
143 |
+
*/
|
144 |
+
protected function _updateCreditmemoTotalsFromParams(Mage_Sales_Model_Order_Creditmemo $creditmemo,
|
145 |
+
Mage_Sales_Model_Order $order, array $creditmemoParameters)
|
146 |
+
{
|
147 |
+
/**
|
148 |
+
* Get the fee amounts that are to be refunded.
|
149 |
+
*/
|
150 |
+
$baseFee = (float) $creditmemoParameters['buckaroo_fee'];
|
151 |
+
|
152 |
+
/**
|
153 |
+
* If the fee was entered incl. tax calculate the fee without tax.
|
154 |
+
*/
|
155 |
+
if ($this->getFeeIsInclTax($order->getStore())) {
|
156 |
+
$baseFee = $this->_getBuckarooFeeExclTax($baseFee, $order);
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Get the order's Buckaroo Payment fee amounts.
|
161 |
+
*/
|
162 |
+
$orderFee = $order->getBuckarooFee();
|
163 |
+
$orderFeeRefunded = $order->getBuckarooFeeRefunded();
|
164 |
+
$orderBaseFee = $order->getBaseBuckarooFee();
|
165 |
+
$orderBaseFeeRefunded = $order->getBaseBuckarooFeeRefunded();
|
166 |
+
|
167 |
+
/**
|
168 |
+
* If the total amount refunded exceeds the available fee amount, we have a rounding error. Modify the fee
|
169 |
+
* amounts accordingly.
|
170 |
+
*/
|
171 |
+
$totalBaseFee = $baseFee - $orderBaseFee - $orderBaseFeeRefunded;
|
172 |
+
if ($totalBaseFee < 0.01 && $totalBaseFee > -0.01) {
|
173 |
+
$baseFee = $orderBaseFee - $orderBaseFeeRefunded;
|
174 |
+
}
|
175 |
+
|
176 |
+
$fee = $baseFee * $order->getBaseToOrderRate();
|
177 |
+
|
178 |
+
$totalFee = $fee - $orderFee - $orderFeeRefunded;
|
179 |
+
if ($totalFee < 0.01 && $totalFee > -0.01) {
|
180 |
+
$fee = $orderFee - $orderFeeRefunded;
|
181 |
+
}
|
182 |
+
|
183 |
+
if (round($orderBaseFeeRefunded + $baseFee, 4) > $orderBaseFee) {
|
184 |
+
throw new Mage_Exception(
|
185 |
+
Mage::helper('buckaroo3extended')->__(
|
186 |
+
'Maximum Buckaroo Payment fee amount available to refunds is %s.',
|
187 |
+
$order->formatPriceTxt(
|
188 |
+
$orderBaseFee - $orderBaseFeeRefunded
|
189 |
+
)
|
190 |
+
)
|
191 |
+
);
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Update the creditmemo totals with the new amounts.
|
196 |
+
*/
|
197 |
+
$creditmemo->setBuckarooFee($fee)
|
198 |
+
->setBaseBuckarooFee($baseFee)
|
199 |
+
->setGrandTotal($creditmemo->getGrandTotal() + $fee)
|
200 |
+
->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseFee);
|
201 |
+
|
202 |
+
$order->setBuckarooFeeRefunded($orderFeeRefunded + $fee)
|
203 |
+
->setBaseBuckarooFeeRefunded($orderBaseFeeRefunded + $baseFee);
|
204 |
+
|
205 |
+
return $this;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Gets the configured Buckaroo Payment fee excl. tax for a given quote.
|
210 |
+
*
|
211 |
+
* @param float $fee
|
212 |
+
* @param Mage_Sales_Model_Order $order
|
213 |
+
*
|
214 |
+
* @return float|int
|
215 |
+
*/
|
216 |
+
protected function _getBuckarooFeeExclTax($fee, Mage_Sales_Model_Order $order)
|
217 |
+
{
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Build a tax request to calculate the fee tax.
|
221 |
+
*/
|
222 |
+
$taxRequest = $this->_getBuckarooFeeTaxRequest($order);
|
223 |
+
|
224 |
+
if (!$taxRequest) {
|
225 |
+
return $fee;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Get the tax rate for the request.
|
230 |
+
*/
|
231 |
+
$taxRate = $this->_getBuckarooFeeTaxRate($taxRequest);
|
232 |
+
|
233 |
+
if (!$taxRate || $taxRate <= 0) {
|
234 |
+
return $fee;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Remove the tax from the fee.
|
239 |
+
*/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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
abstract class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Creditmemo_Total_Fee_Abstract
|
40 |
+
extends Mage_Sales_Model_Order_Creditmemo_Total_Tax
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Xpath to the Buckaroo Payment fee setting.
|
44 |
+
*/
|
45 |
+
const XPATH_BUCKAROO_FEE = 'buckaroo/%s/payment_fee';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Xpath to Buckaroo Payment fee tax class.
|
49 |
+
*/
|
50 |
+
const XPATH_BUCKAROO_TAX_CLASS = 'tax/classes/buckaroo_fee';
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Xpath to the Buckaroo Payment fee including tax setting.
|
54 |
+
*/
|
55 |
+
const XPATH_BUCKAROO_FEE_INCLUDING_TAX = 'tax/calculation/buckaroo_fee_including_tax';
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @return Mage_Tax_Model_Calculation
|
59 |
+
*/
|
60 |
+
public function getTaxCalculation()
|
61 |
+
{
|
62 |
+
$taxCalculation = $this->_calculator;
|
63 |
+
if ($taxCalculation) {
|
64 |
+
return $taxCalculation;
|
65 |
+
}
|
66 |
+
|
67 |
+
$taxCalculation = Mage::getSingleton('tax/calculation');
|
68 |
+
|
69 |
+
$this->setTaxCalculation($taxCalculation);
|
70 |
+
return $taxCalculation;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @param Mage_Tax_Model_Calculation $taxCalculation
|
75 |
+
*
|
76 |
+
* @return $this
|
77 |
+
*/
|
78 |
+
public function setTaxCalculation(Mage_Tax_Model_Calculation $taxCalculation)
|
79 |
+
{
|
80 |
+
$this->_calculator = $taxCalculation;
|
81 |
+
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Get whether the Buckaroo Payment fee is incl. tax.
|
87 |
+
*
|
88 |
+
* @param int|Mage_Core_Model_Store|null $store
|
89 |
+
*
|
90 |
+
* @return bool
|
91 |
+
*/
|
92 |
+
public function getFeeIsInclTax($store = null)
|
93 |
+
{
|
94 |
+
if (is_null($store)) {
|
95 |
+
$storeId = Mage::app()->getStore()->getId();
|
96 |
+
} elseif ($store instanceof Mage_Core_Model_Store) {
|
97 |
+
$storeId = $store->getId();
|
98 |
+
} else {
|
99 |
+
$storeId = $store;
|
100 |
+
}
|
101 |
+
|
102 |
+
return Mage::getStoreConfigFlag(self::XPATH_BUCKAROO_FEE_INCLUDING_TAX, $storeId);
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get the tax request object for the current quote.
|
107 |
+
*
|
108 |
+
* @param Mage_Sales_Model_Order $order
|
109 |
+
*
|
110 |
+
* @return bool|Varien_Object
|
111 |
+
*/
|
112 |
+
protected function _getBuckarooFeeTaxRequest(Mage_Sales_Model_Order $order)
|
113 |
+
{
|
114 |
+
$store = $order->getStore();
|
115 |
+
$feeTaxClass = Mage::getStoreConfig(self::XPATH_BUCKAROO_TAX_CLASS, $store);
|
116 |
+
|
117 |
+
/**
|
118 |
+
* If no tax class is configured for the Buckaroo Payment fee, there is no tax to be calculated.
|
119 |
+
*/
|
120 |
+
if (!$feeTaxClass) {
|
121 |
+
return false;
|
122 |
+
}
|
123 |
+
|
124 |
+
$taxCalculation = $this->getTaxCalculation();
|
125 |
+
$customerTaxClass = $order->getCustomerTaxClassId();
|
126 |
+
$shippingAddress = $order->getShippingAddress();
|
127 |
+
$billingAddress = $order->getBillingAddress();
|
128 |
+
|
129 |
+
$request = $taxCalculation->getRateRequest(
|
130 |
+
$shippingAddress,
|
131 |
+
$billingAddress,
|
132 |
+
$customerTaxClass,
|
133 |
+
$store
|
134 |
+
);
|
135 |
+
|
136 |
+
$request->setProductClassId($feeTaxClass);
|
137 |
+
|
138 |
+
return $request;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get the tax rate based on the previously created tax request.
|
143 |
+
*
|
144 |
+
* @param Varien_Object $request
|
145 |
+
*
|
146 |
+
* @return float
|
147 |
+
*/
|
148 |
+
protected function _getBuckarooFeeTaxRate($request)
|
149 |
+
{
|
150 |
+
$rate = $this->getTaxCalculation()->getRate($request);
|
151 |
+
|
152 |
+
return $rate;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Get the fee tax based on the shipping address and tax rate.
|
157 |
+
*
|
158 |
+
* @param Mage_Customer_Model_Address_Abstract $address
|
159 |
+
* @param float $taxRate
|
160 |
+
* @param float|null $fee
|
161 |
+
* @param boolean $isInclTax
|
162 |
+
*
|
163 |
+
* @return float
|
164 |
+
*/
|
165 |
+
protected function _getBuckarooFeeTax($address, $taxRate, $fee = null, $isInclTax = false)
|
166 |
+
{
|
167 |
+
if (is_null($fee)) {
|
168 |
+
$fee = (float) $address->getBuckarooFee();
|
169 |
+
}
|
170 |
+
|
171 |
+
$taxCalculation = $this->getTaxCalculation();
|
172 |
+
|
173 |
+
$feeTax = $taxCalculation->calcTaxAmount(
|
174 |
+
$fee,
|
175 |
+
$taxRate,
|
176 |
+
$isInclTax,
|
177 |
+
false
|
178 |
+
);
|
179 |
+
|
180 |
+
return $feeTax;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Get the base fee tax based on the shipping address and tax rate.
|
185 |
+
*
|
186 |
+
* @param Mage_Customer_Model_Address_Abstract $address
|
187 |
+
* @param float $taxRate
|
188 |
+
* @param float|null $fee
|
189 |
+
* @param boolean $isInclTax
|
190 |
+
*
|
191 |
+
* @return float
|
192 |
+
*/
|
193 |
+
protected function _getBaseBuckarooFeeTax($address, $taxRate, $fee = null, $isInclTax = false)
|
194 |
+
{
|
195 |
+
if (is_null($fee)) {
|
196 |
+
$fee = (float) $address->getBaseBuckarooFee();
|
197 |
+
}
|
198 |
+
|
199 |
+
$taxCalculation = $this->getTaxCalculation();
|
200 |
+
|
201 |
+
$baseFeeTax = $taxCalculation->calcTaxAmount(
|
202 |
+
$fee,
|
203 |
+
$taxRate,
|
204 |
+
$isInclTax,
|
205 |
+
false
|
206 |
+
);
|
207 |
+
|
208 |
+
return $baseFeeTax;
|
209 |
+
}
|
210 |
+
}
|
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Creditmemo_Total_FeeTax
|
40 |
+
extends TIG_Buckaroo3Extended_Model_PaymentFee_Order_Creditmemo_Total_Fee_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Get the Buckaroo Payment fee tax total amount.
|
44 |
+
*
|
45 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
46 |
+
*
|
47 |
+
* @return $this
|
48 |
+
*/
|
49 |
+
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
|
50 |
+
{
|
51 |
+
$order = $creditmemo->getOrder();
|
52 |
+
|
53 |
+
$feeTax = $creditmemo->getBuckarooFeeTax();
|
54 |
+
$baseFeeTax = $creditmemo->getBaseBuckarooFeeTax();
|
55 |
+
|
56 |
+
/**
|
57 |
+
* If a creditmemo already has a fee tax, we only need to update the totals.
|
58 |
+
*/
|
59 |
+
if ($feeTax && $baseFeeTax) {
|
60 |
+
$creditmemo->setBuckarooFeeTax($feeTax)
|
61 |
+
->setBaseBuckarooFeeTax($baseFeeTax)
|
62 |
+
->setTaxAmount($creditmemo->getTaxAmount() + $feeTax)
|
63 |
+
->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $baseFeeTax)
|
64 |
+
->setGrandTotal($creditmemo->getGrandTotal() + $feeTax)
|
65 |
+
->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseFeeTax);
|
66 |
+
|
67 |
+
$order->setBuckarooFeeTaxRefunded($order->getBuckarooFeeTaxRefunded() + $feeTax)
|
68 |
+
->setBaseBuckarooFeeTaxRefunded($order->getBaseBuckarooFeeTaxRefunded() + $baseFeeTax);
|
69 |
+
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* If the creditmemo has a fee, but no fee tax, we need to calculate the fee tax.
|
75 |
+
*/
|
76 |
+
$fee = $creditmemo->getBuckarooFee();
|
77 |
+
$baseFee = $creditmemo->getBaseBuckarooFee();
|
78 |
+
|
79 |
+
if ($fee && $baseFee) {
|
80 |
+
/**
|
81 |
+
* First we need to determine what percentage of the fee is being refunded. We need to refund the same
|
82 |
+
* percentage of fee tax.
|
83 |
+
*/
|
84 |
+
$totalBaseFee = $order->getBaseBuckarooFee();
|
85 |
+
$ratio = $baseFee / $totalBaseFee;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Calculate the fee and base fee tax based on the same ratio.
|
89 |
+
*/
|
90 |
+
$totalBaseFeeTax = $order->getBaseBuckarooFeeTax();
|
91 |
+
$baseFeeTax = $totalBaseFeeTax * $ratio;
|
92 |
+
|
93 |
+
$totalFeeTax = $order->getBuckarooFeeTax();
|
94 |
+
$feeTax = $totalFeeTax * $ratio;
|
95 |
+
|
96 |
+
/**
|
97 |
+
* If the total amount refunded exceeds the available fee tax amount, we have a rounding error. Modify the
|
98 |
+
* fee tax amounts accordingly.
|
99 |
+
*/
|
100 |
+
$totalBaseFeeTax = $baseFeeTax - $order->getBaseBuckarooFeeTax()
|
101 |
+
- $order->getBaseBuckarooFeeTaxRefunded();
|
102 |
+
if ($totalBaseFeeTax < 0.0001 && $totalBaseFeeTax > -0.0001) {
|
103 |
+
$baseFeeTax = $order->getBaseBuckarooFeeTax() - $order->getBaseBuckarooFeeTaxRefunded();
|
104 |
+
}
|
105 |
+
|
106 |
+
$totalFeeTax = $feeTax - $order->getBuckarooFeeTax() - $order->getBuckarooFeeTaxRefunded();
|
107 |
+
if ($totalFeeTax < 0.0001 && $totalFeeTax > -0.0001) {
|
108 |
+
$feeTax = $order->getBuckarooFeeTax() - $order->getBuckarooFeeTaxRefunded();
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Update the creditmemo totals.
|
113 |
+
*/
|
114 |
+
$creditmemo->setBuckarooFeeTax($feeTax)
|
115 |
+
->setBaseBuckarooFeeTax($baseFeeTax)
|
116 |
+
->setTaxAmount($creditmemo->getTaxAmount() + $feeTax)
|
117 |
+
->setBaseTaxAmount($creditmemo->getBaseTaxAmount() + $baseFeeTax)
|
118 |
+
->setGrandTotal($creditmemo->getGrandTotal() + $feeTax)
|
119 |
+
->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseFeeTax);
|
120 |
+
|
121 |
+
$order->setBuckarooFeeTaxRefunded($order->getBuckarooFeeTaxRefunded() + $feeTax)
|
122 |
+
->setBaseBuckarooFeeTaxRefunded($order->getBaseBuckarooFeeTaxRefunded() + $baseFeeTax);
|
123 |
+
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
@@ -0,0 +1,87 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Invoice_Total_Fee extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
43 |
+
*
|
44 |
+
* @return $this
|
45 |
+
*/
|
46 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
|
47 |
+
{
|
48 |
+
$order = $invoice->getOrder();
|
49 |
+
|
50 |
+
/**
|
51 |
+
* The COD fee is always added to the first invoice, so if this order already has invoices, we don't have to add
|
52 |
+
* anything.
|
53 |
+
*/
|
54 |
+
if ($order->hasInvoices()) {
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get the COD fee amounts.
|
60 |
+
*/
|
61 |
+
$fee = $order->getBuckarooFee();
|
62 |
+
$baseFee = $order->getBaseBuckarooFee();
|
63 |
+
|
64 |
+
/**
|
65 |
+
* If no COD fee is set, there is nothing to add/
|
66 |
+
*/
|
67 |
+
if ($fee < 0.01 || $baseFee < 0.01) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Add the COD fee amounts to the invoice and update the amounts for the order.
|
73 |
+
*/
|
74 |
+
$grandTotal = $invoice->getGrandTotal();
|
75 |
+
$baseGrandTotal = $invoice->getBaseGrandTotal();
|
76 |
+
|
77 |
+
$invoice->setBuckarooFee($fee)
|
78 |
+
->setBaseBuckarooFee($baseFee)
|
79 |
+
->setGrandTotal($grandTotal + $fee)
|
80 |
+
->setBaseGrandTotal($baseGrandTotal + $baseFee);
|
81 |
+
|
82 |
+
$order->setBuckarooFeeInvoiced($fee)
|
83 |
+
->setBaseBuckarooFeeInvoiced($baseFee);
|
84 |
+
|
85 |
+
return $this;
|
86 |
+
}
|
87 |
+
}
|
@@ -0,0 +1,104 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Invoice_Total_FeeTax extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
43 |
+
*
|
44 |
+
* @return $this
|
45 |
+
*/
|
46 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
|
47 |
+
{
|
48 |
+
$order = $invoice->getOrder();
|
49 |
+
|
50 |
+
/**
|
51 |
+
* The COD fee tax is always added to the first invoice, so if this order already has invoices, we don't have to
|
52 |
+
* add anything.
|
53 |
+
*/
|
54 |
+
if ($order->hasInvoices()) {
|
55 |
+
return $this;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get the COD fee tax amounts.
|
60 |
+
*/
|
61 |
+
$feeTax = $order->getBuckarooFeeTax();
|
62 |
+
$baseFeeTax = $order->getBaseBuckarooFeeTax();
|
63 |
+
|
64 |
+
/**
|
65 |
+
* If no COD fee tax is set, there is nothing to add/
|
66 |
+
*/
|
67 |
+
if ($feeTax < 0.01 || $baseFeeTax < 0.01) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Add the COD fee tax amounts to the invoice.
|
73 |
+
*/
|
74 |
+
$invoice->setBuckarooFeeTax($feeTax)
|
75 |
+
->setBaseBuckarooFeeTax($baseFeeTax)
|
76 |
+
->setTaxAmount($invoice->getTaxAmount() + $feeTax)
|
77 |
+
->setBaseTaxAmount($invoice->getBaseTaxAmount() + $baseFeeTax);
|
78 |
+
|
79 |
+
/**
|
80 |
+
* For all versions except 1.13.0.X and 1.8.0.X we need to add the Payment fee tax to the grand total amounts.
|
81 |
+
*/
|
82 |
+
$helper = Mage::helper('buckaroo3extended');
|
83 |
+
|
84 |
+
//fix for Magento 1.6.2.0 for showing correctly taxes in the order totals
|
85 |
+
if (!$helper->isEnterprise() && version_compare(Mage::getVersion(), '1.6.2.0', '==')){
|
86 |
+
$grandTotal = $invoice->getGrandTotal();
|
87 |
+
$baseGrandTotal = $invoice->getBaseGrandTotal();
|
88 |
+
}else{
|
89 |
+
$grandTotal = $invoice->getGrandTotal() + $feeTax;
|
90 |
+
$baseGrandTotal = $invoice->getBaseGrandTotal() + $baseFeeTax;
|
91 |
+
}
|
92 |
+
|
93 |
+
$invoice->setGrandTotal($grandTotal)
|
94 |
+
->setBaseGrandTotal($baseGrandTotal);
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Update the order's COD fee tax amounts.
|
98 |
+
*/
|
99 |
+
$order->setBuckarooFeeTaxInvoiced($feeTax)
|
100 |
+
->setBaseBuckarooFeeTaxInvoiced($baseFeeTax);
|
101 |
+
|
102 |
+
return $this;
|
103 |
+
}
|
104 |
+
}
|
@@ -0,0 +1,143 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Order_Invoice_Total_Subtotal
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Collect invoice subtotal.
|
43 |
+
*
|
44 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
45 |
+
*
|
46 |
+
* @return $this
|
47 |
+
*/
|
48 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice)
|
49 |
+
{
|
50 |
+
$subtotal = 0;
|
51 |
+
$baseSubtotal = 0;
|
52 |
+
$subtotalInclTax= 0;
|
53 |
+
$baseSubtotalInclTax = 0;
|
54 |
+
|
55 |
+
$order = $invoice->getOrder();
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @var Mage_Sales_Model_Order_Invoice_Item $item
|
59 |
+
*/
|
60 |
+
foreach ($invoice->getAllItems() as $item) {
|
61 |
+
if ($item->getOrderItem()->isDummy()) {
|
62 |
+
continue;
|
63 |
+
}
|
64 |
+
|
65 |
+
$item->calcRowTotal();
|
66 |
+
|
67 |
+
$subtotal += $item->getRowTotal();
|
68 |
+
$baseSubtotal += $item->getBaseRowTotal();
|
69 |
+
$subtotalInclTax += $item->getRowTotalInclTax();
|
70 |
+
$baseSubtotalInclTax += $item->getBaseRowTotalInclTax();
|
71 |
+
}
|
72 |
+
|
73 |
+
$allowedSubtotal = $order->getSubtotal() - $order->getSubtotalInvoiced();
|
74 |
+
$baseAllowedSubtotal = $order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced();
|
75 |
+
|
76 |
+
$allowedSubtotalInclTax = $allowedSubtotal
|
77 |
+
+ $order->getHiddenTaxAmount()
|
78 |
+
+ $order->getTaxAmount()
|
79 |
+
- $order->getTaxInvoiced()
|
80 |
+
- $order->getHiddenTaxInvoiced();
|
81 |
+
|
82 |
+
$baseAllowedSubtotalInclTax = $baseAllowedSubtotal
|
83 |
+
+ $order->getBaseHiddenTaxAmount()
|
84 |
+
+ $order->getBaseTaxAmount()
|
85 |
+
- $order->getBaseTaxInvoiced()
|
86 |
+
- $order->getBaseHiddenTaxInvoiced();
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Check if shipping tax calculation and Buckaroo Payment fee tax is included to current invoice.
|
90 |
+
*
|
91 |
+
* @var Mage_Sales_Model_Order_Invoice $previousInvoice
|
92 |
+
*/
|
93 |
+
$includeShippingTax = true;
|
94 |
+
$includeBuckarooFeeTax = true;
|
95 |
+
foreach ($invoice->getOrder()->getInvoiceCollection() as $previousInvoice) {
|
96 |
+
if ($previousInvoice->isCanceled()) {
|
97 |
+
continue;
|
98 |
+
}
|
99 |
+
|
100 |
+
if ($previousInvoice->getShippingAmount()) {
|
101 |
+
$includeShippingTax = false;
|
102 |
+
}
|
103 |
+
|
104 |
+
if ($previousInvoice->getBuckarooFeeTax()) {
|
105 |
+
$includeBuckarooFeeTax = false;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
if ($includeShippingTax) {
|
110 |
+
$allowedSubtotalInclTax -= $order->getShippingTaxAmount();
|
111 |
+
$baseAllowedSubtotalInclTax -= $order->getBaseShippingTaxAmount();
|
112 |
+
} else {
|
113 |
+
$allowedSubtotalInclTax += $order->getShippingHiddenTaxAmount();
|
114 |
+
$baseAllowedSubtotalInclTax += $order->getBaseShippingHiddenTaxAmount();
|
115 |
+
}
|
116 |
+
|
117 |
+
if ($includeBuckarooFeeTax) {
|
118 |
+
$allowedSubtotalInclTax -= $order->getBuckarooFeeTax();
|
119 |
+
$baseAllowedSubtotalInclTax -= $order->getBaseBuckarooFeeTax();
|
120 |
+
}
|
121 |
+
|
122 |
+
if ($invoice->isLast()) {
|
123 |
+
$subtotal = $allowedSubtotal;
|
124 |
+
$baseSubtotal = $baseAllowedSubtotal;
|
125 |
+
$subtotalInclTax = $allowedSubtotalInclTax;
|
126 |
+
$baseSubtotalInclTax = $baseAllowedSubtotalInclTax;
|
127 |
+
} else {
|
128 |
+
$subtotal = min($allowedSubtotal, $subtotal);
|
129 |
+
$baseSubtotal = min($baseAllowedSubtotal, $baseSubtotal);
|
130 |
+
$subtotalInclTax = min($allowedSubtotalInclTax, $subtotalInclTax);
|
131 |
+
$baseSubtotalInclTax = min($baseAllowedSubtotalInclTax, $baseSubtotalInclTax);
|
132 |
+
}
|
133 |
+
|
134 |
+
$invoice->setSubtotal($subtotal);
|
135 |
+
$invoice->setBaseSubtotal($baseSubtotal);
|
136 |
+
$invoice->setSubtotalInclTax($subtotalInclTax);
|
137 |
+
$invoice->setBaseSubtotalInclTax($baseSubtotalInclTax);
|
138 |
+
|
139 |
+
$invoice->setGrandTotal($invoice->getGrandTotal() + $subtotal);
|
140 |
+
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseSubtotal);
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
}
|
@@ -0,0 +1,166 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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\\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method int|string getFontSize()
|
40 |
+
* @method Mage_Sales_Model_Order getOrder()
|
41 |
+
* @method string getAmountPrefix()
|
42 |
+
* @method string getTitle()
|
43 |
+
* @method Mage_Sales_Model_Abstract getSource()
|
44 |
+
*/
|
45 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Pdf_Total_Fee extends Mage_Sales_Model_Order_Pdf_Total_Default
|
46 |
+
{
|
47 |
+
/**
|
48 |
+
* Display modes for the Buckaroo Payment fee.
|
49 |
+
*/
|
50 |
+
const DISPLAY_MODE_EXCL = 1;
|
51 |
+
const DISPLAY_MODE_INCL = 2;
|
52 |
+
const DISPLAY_MODE_BOTH = 3;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Xpath to the Buckaroo Payment fee display mode setting.
|
56 |
+
*/
|
57 |
+
const XPATH_DISPLAY_MODE_BUCKAROO_FEE = 'tax/cart_display/buckaroo_fee';
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Get the Buckaroo Payment fee total amounts to display on the pdf.
|
61 |
+
*
|
62 |
+
* @return array
|
63 |
+
*/
|
64 |
+
public function getTotalsForDisplay()
|
65 |
+
{
|
66 |
+
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
|
67 |
+
|
68 |
+
$totals = array();
|
69 |
+
|
70 |
+
$displayMode = $this->getDisplayMode();
|
71 |
+
$paymentMethod = $this->getOrder()->getPayment()->getMethod();
|
72 |
+
$baseLabel = Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($this->getOrder()->getStoreId(),$paymentMethod);
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Get the fee excl. tax.
|
76 |
+
*/
|
77 |
+
if ($displayMode === self::DISPLAY_MODE_EXCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
78 |
+
/**
|
79 |
+
* Get the amount excl. tax and format it.
|
80 |
+
*/
|
81 |
+
$amount = $this->getAmount();
|
82 |
+
$formattedAmount = $this->getOrder()->formatPriceTxt($amount);
|
83 |
+
if ($this->getAmountPrefix()) {
|
84 |
+
$formattedAmount = $this->getAmountPrefix() . $formattedAmount;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Determine the label.
|
89 |
+
*/
|
90 |
+
$label = $baseLabel;
|
91 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
92 |
+
$label .= ' (' . $this->getTaxLabel(false) . ')';
|
93 |
+
}
|
94 |
+
$label .= ':';
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Add the total amount.
|
98 |
+
*/
|
99 |
+
$totals[] = array(
|
100 |
+
'amount' => $formattedAmount,
|
101 |
+
'label' => $label,
|
102 |
+
'font_size' => $fontSize
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Get the fee incl. tax.
|
108 |
+
*/
|
109 |
+
if ($displayMode === self::DISPLAY_MODE_INCL || $displayMode === self::DISPLAY_MODE_BOTH) {
|
110 |
+
/**
|
111 |
+
* Get the amount incl. tax and format it.
|
112 |
+
*/
|
113 |
+
$amount = $this->getAmount() + $this->getSource()->getBuckarooFeeTax();
|
114 |
+
$formattedAmount = $this->getOrder()->formatPriceTxt($amount);
|
115 |
+
if ($this->getAmountPrefix()) {
|
116 |
+
$formattedAmount = $this->getAmountPrefix() . $formattedAmount;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Determine the label.
|
121 |
+
*/
|
122 |
+
$label = $baseLabel;
|
123 |
+
if ($displayMode === self::DISPLAY_MODE_BOTH) {
|
124 |
+
$label .= ' (' . $this->getTaxLabel(true) . ')';
|
125 |
+
}
|
126 |
+
$label .= ':';
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Add the total amount.
|
130 |
+
*/
|
131 |
+
$totals[] = array(
|
132 |
+
'amount' => $formattedAmount,
|
133 |
+
'label' => $label,
|
134 |
+
'font_size' => $fontSize
|
135 |
+
);
|
136 |
+
}
|
137 |
+
|
138 |
+
return $totals;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get the display mode for the Buckaroo Payment fee.
|
143 |
+
*
|
144 |
+
* @return int
|
145 |
+
*/
|
146 |
+
public function getDisplayMode()
|
147 |
+
{
|
148 |
+
$displayMode = (int) Mage::getStoreConfig(self::XPATH_DISPLAY_MODE_BUCKAROO_FEE, $this->getOrder()->getStoreId());
|
149 |
+
|
150 |
+
return $displayMode;
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Get the tax label for either incl. or excl. tax.
|
155 |
+
*
|
156 |
+
* @param boolean $inclTax
|
157 |
+
*
|
158 |
+
* @return string
|
159 |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Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method Mage_Sales_Model_Order getOrder()
|
40 |
+
* @method Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo getSource()
|
41 |
+
* @method int|string getFontSize()
|
42 |
+
* @method string getAmountPrefix()
|
43 |
+
*/
|
44 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Pdf_Total_Grandtotal extends Mage_Tax_Model_Sales_Pdf_Grandtotal
|
45 |
+
{
|
46 |
+
/**
|
47 |
+
* Get array of arrays with tax information for display in PDF
|
48 |
+
* array(
|
49 |
+
* $index => array(
|
50 |
+
* 'amount' => $amount,
|
51 |
+
* 'label' => $label,
|
52 |
+
* 'font_size'=> $font_size
|
53 |
+
* )
|
54 |
+
* )
|
55 |
+
* @return array
|
56 |
+
*/
|
57 |
+
public function getFullTaxInfo()
|
58 |
+
{
|
59 |
+
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
|
60 |
+
|
61 |
+
if (method_exists($this, '_getCalculatedTaxes')) {
|
62 |
+
$taxClassAmount = $this->_getCalculatedTaxes();
|
63 |
+
} else {
|
64 |
+
$taxClassAmount = Mage::helper('tax')->getCalculatedTaxes($this->getOrder());
|
65 |
+
}
|
66 |
+
|
67 |
+
if (method_exists($this, '_getShippingTax')) {
|
68 |
+
$shippingTax = $this->_getShippingTax();
|
69 |
+
} else {
|
70 |
+
$shippingTax = Mage::helper('tax')->getShippingTax($this->getOrder());
|
71 |
+
}
|
72 |
+
|
73 |
+
$taxClassAmount = array_merge($taxClassAmount, $shippingTax);
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Add the Buckaroo Payment fee tax info.
|
77 |
+
*/
|
78 |
+
$taxClassAmount = Mage::helper('buckaroo3extended')->addBuckarooFeeTaxInfo(
|
79 |
+
$taxClassAmount,
|
80 |
+
$this->getSource(),
|
81 |
+
$this->getOrder()
|
82 |
+
);
|
83 |
+
|
84 |
+
if (!empty($taxClassAmount)) {
|
85 |
+
foreach ($taxClassAmount as &$tax) {
|
86 |
+
$percent = $tax['percent'] ? ' (' . $tax['percent']. '%)' : '';
|
87 |
+
$tax['amount'] = $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($tax['tax_amount']);
|
88 |
+
$tax['label'] = $this->_getTaxHelper()->__($tax['title']) . $percent . ':';
|
89 |
+
$tax['font_size'] = $fontSize;
|
90 |
+
}
|
91 |
+
} else {
|
92 |
+
$fullInfo = $this->_getFullRateInfo();
|
93 |
+
$tax_info = array();
|
94 |
+
|
95 |
+
if ($fullInfo) {
|
96 |
+
foreach ($fullInfo as $info) {
|
97 |
+
if (isset($info['hidden']) && $info['hidden']) {
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
+
$_amount = $info['amount'];
|
102 |
+
|
103 |
+
foreach ($info['rates'] as $rate) {
|
104 |
+
$percent = $rate['percent'] ? ' (' . $rate['percent']. '%)' : '';
|
105 |
+
|
106 |
+
$tax_info[] = array(
|
107 |
+
'amount' => $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($_amount),
|
108 |
+
'label' => $this->_getTaxHelper()->__($rate['title']) . $percent . ':',
|
109 |
+
'font_size' => $fontSize
|
110 |
+
);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$taxClassAmount = $tax_info;
|
115 |
+
}
|
116 |
+
|
117 |
+
return $taxClassAmount;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @return Mage_Tax_Helper_Data
|
122 |
+
*/
|
123 |
+
protected function _getTaxHelper()
|
124 |
+
{
|
125 |
+
return Mage::helper('tax');
|
126 |
+
}
|
127 |
+
}
|
@@ -0,0 +1,127 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*
|
39 |
+
* @method Mage_Sales_Model_Order getOrder()
|
40 |
+
* @method Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo getSource()
|
41 |
+
* @method int|string getFontSize()
|
42 |
+
* @method string getAmountPrefix()
|
43 |
+
*/
|
44 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Order_Pdf_Total_Tax extends Mage_Tax_Model_Sales_Pdf_Tax
|
45 |
+
{
|
46 |
+
/**
|
47 |
+
* Get array of arrays with tax information for display in PDF
|
48 |
+
* array(
|
49 |
+
* $index => array(
|
50 |
+
* 'amount' => $amount,
|
51 |
+
* 'label' => $label,
|
52 |
+
* 'font_size'=> $font_size
|
53 |
+
* )
|
54 |
+
* )
|
55 |
+
* @return array
|
56 |
+
*/
|
57 |
+
public function getFullTaxInfo()
|
58 |
+
{
|
59 |
+
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
|
60 |
+
|
61 |
+
if (method_exists($this, '_getCalculatedTaxes')) {
|
62 |
+
$taxClassAmount = $this->_getCalculatedTaxes();
|
63 |
+
} else {
|
64 |
+
$taxClassAmount = Mage::helper('tax')->getCalculatedTaxes($this->getOrder());
|
65 |
+
}
|
66 |
+
|
67 |
+
if (method_exists($this, '_getShippingTax')) {
|
68 |
+
$shippingTax = $this->_getShippingTax();
|
69 |
+
} else {
|
70 |
+
$shippingTax = Mage::helper('tax')->getShippingTax($this->getOrder());
|
71 |
+
}
|
72 |
+
|
73 |
+
$taxClassAmount = array_merge($taxClassAmount, $shippingTax);
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Add the Buckaroo Payment fee tax info.
|
77 |
+
*/
|
78 |
+
$taxClassAmount = Mage::helper('buckaroo3extended')->addBuckarooFeeTaxInfo(
|
79 |
+
$taxClassAmount,
|
80 |
+
$this->getSource(),
|
81 |
+
$this->getOrder()
|
82 |
+
);
|
83 |
+
|
84 |
+
if (!empty($taxClassAmount)) {
|
85 |
+
foreach ($taxClassAmount as &$tax) {
|
86 |
+
$percent = $tax['percent'] ? ' (' . $tax['percent']. '%)' : '';
|
87 |
+
$tax['amount'] = $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($tax['tax_amount']);
|
88 |
+
$tax['label'] = $this->_getTaxHelper()->__($tax['title']) . $percent . ':';
|
89 |
+
$tax['font_size'] = $fontSize;
|
90 |
+
}
|
91 |
+
} else {
|
92 |
+
$fullInfo = $this->_getFullRateInfo();
|
93 |
+
$tax_info = array();
|
94 |
+
|
95 |
+
if ($fullInfo) {
|
96 |
+
foreach ($fullInfo as $info) {
|
97 |
+
if (isset($info['hidden']) && $info['hidden']) {
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
+
$_amount = $info['amount'];
|
102 |
+
|
103 |
+
foreach ($info['rates'] as $rate) {
|
104 |
+
$percent = $rate['percent'] ? ' (' . $rate['percent']. '%)' : '';
|
105 |
+
|
106 |
+
$tax_info[] = array(
|
107 |
+
'amount' => $this->getAmountPrefix() . $this->getOrder()->formatPriceTxt($_amount),
|
108 |
+
'label' => $this->_getTaxHelper()->__($rate['title']) . $percent . ':',
|
109 |
+
'font_size' => $fontSize
|
110 |
+
);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$taxClassAmount = $tax_info;
|
115 |
+
}
|
116 |
+
|
117 |
+
return $taxClassAmount;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @return Mage_Tax_Helper_Data
|
122 |
+
*/
|
123 |
+
protected function _getTaxHelper()
|
124 |
+
{
|
125 |
+
return Mage::helper('tax');
|
126 |
+
}
|
127 |
+
}
|
@@ -0,0 +1,326 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Quote_Address_Total_Fee
|
40 |
+
extends TIG_Buckaroo3Extended_Model_PaymentFee_Quote_Address_Total_Fee_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Xpath to Idev's OneStepCheckout's 'display_tax_included' setting.
|
44 |
+
*/
|
45 |
+
const XPATH_ONESTEPCHECKOUT_DISPLAY_TAX_INCLUDED = 'onestepcheckout/general/display_tax_included';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Module name used by OneStepCheckout.
|
49 |
+
*/
|
50 |
+
const ONESTEPCHECKOUT_MODULE_NAME = 'onestepcheckout';
|
51 |
+
|
52 |
+
/**
|
53 |
+
* The code of this 'total'.
|
54 |
+
*
|
55 |
+
* @var string
|
56 |
+
*/
|
57 |
+
protected $_totalCode = 'buckaroo_fee';
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Collect the Buckaroo fee for the given address.
|
61 |
+
*
|
62 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
63 |
+
*
|
64 |
+
* @return $this
|
65 |
+
*/
|
66 |
+
public function collect(Mage_Sales_Model_Quote_Address $address)
|
67 |
+
{
|
68 |
+
/**
|
69 |
+
* We can only add the fee to the shipping address.
|
70 |
+
*/
|
71 |
+
if ($address->getAddressType() != 'shipping') {
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
$quote = $address->getQuote();
|
76 |
+
$store = $quote->getStore();
|
77 |
+
|
78 |
+
if (!$quote->getId()) {
|
79 |
+
return $this;
|
80 |
+
}
|
81 |
+
|
82 |
+
$items = $address->getAllItems();
|
83 |
+
if (!count($items)) {
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* First, reset the fee amounts to 0 for this address and the quote.
|
89 |
+
*/
|
90 |
+
$address->setBuckarooFee(0)
|
91 |
+
->setBaseBuckarooFee(0);
|
92 |
+
|
93 |
+
$quote->setBuckarooFee(0)
|
94 |
+
->setBaseBuckarooFee(0);
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Check if the order was placed using Buckaroo
|
98 |
+
*/
|
99 |
+
$paymentMethod = $quote->getPayment()->getMethod();
|
100 |
+
|
101 |
+
if(strpos($paymentMethod,'buckaroo') === false){
|
102 |
+
return $this;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get the fee amount.
|
107 |
+
*/
|
108 |
+
$baseFee = $this->_getPaymentFee($quote,$paymentMethod);
|
109 |
+
if ($baseFee <= 0) {
|
110 |
+
return $this;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Convert the fee to the base fee amount.
|
115 |
+
*/
|
116 |
+
$fee = $store->convertPrice($baseFee);
|
117 |
+
/**
|
118 |
+
* Set the fee for the address and quote.
|
119 |
+
*/
|
120 |
+
$address->setBuckarooFee($fee)
|
121 |
+
->setBaseBuckarooFee($baseFee);
|
122 |
+
|
123 |
+
$quote->setBuckarooFee($fee)
|
124 |
+
->setBaseBuckarooFee($baseFee);
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Update the address' grand total amounts.
|
128 |
+
*/
|
129 |
+
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $baseFee);
|
130 |
+
$address->setGrandTotal($address->getGrandTotal() + $fee);
|
131 |
+
|
132 |
+
return $this;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Fetch the fee.
|
137 |
+
*
|
138 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
139 |
+
*
|
140 |
+
* @return $this
|
141 |
+
*/
|
142 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
143 |
+
{
|
144 |
+
$amount = $address->getBuckarooFee();
|
145 |
+
|
146 |
+
if ($amount <= 0) {
|
147 |
+
return $this;
|
148 |
+
}
|
149 |
+
|
150 |
+
$quote = $address->getQuote();
|
151 |
+
$storeId = $quote->getStoreId();
|
152 |
+
$paymentMethod = $quote->getPayment()->getMethod();
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Add the Buckaroo Payment fee tax for OSC if the 'display_tax_included' setting is turned on.
|
156 |
+
*/
|
157 |
+
if (Mage::app()->getRequest()->getModuleName() == self::ONESTEPCHECKOUT_MODULE_NAME
|
158 |
+
&& Mage::getStoreConfigFlag(self::XPATH_ONESTEPCHECKOUT_DISPLAY_TAX_INCLUDED, $storeId)
|
159 |
+
) {
|
160 |
+
$amount += $address->getBuckarooFeeTax();
|
161 |
+
}
|
162 |
+
|
163 |
+
$address->addTotal(
|
164 |
+
array(
|
165 |
+
'code' => $this->getCode(),
|
166 |
+
'title' => Mage::helper('buckaroo3extended')->getBuckarooFeeLabel($storeId,$paymentMethod,$amount),
|
167 |
+
'value' => $amount,
|
168 |
+
)
|
169 |
+
);
|
170 |
+
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* get payment fee before the paymentmethod is selected, based on tax settings
|
176 |
+
*
|
177 |
+
* @param Mage_Sales_Model_Quote $quote
|
178 |
+
* @param string $paymentMethod
|
179 |
+
* @return float|string
|
180 |
+
*/
|
181 |
+
public function getPaymentFeeBeforeSelect(Mage_Sales_Model_Quote $quote, $paymentMethod = '')
|
182 |
+
{
|
183 |
+
$store = $quote->getStore();
|
184 |
+
$storeId = $store->getId();
|
185 |
+
|
186 |
+
$configuredFee = Mage::getStoreConfig(
|
187 |
+
sprintf(self::XPATH_BUCKAROO_FEE, $quote->getPayment()->getMethod()),
|
188 |
+
$storeId
|
189 |
+
);
|
190 |
+
|
191 |
+
if (strpos($configuredFee, '%') !== false) {
|
192 |
+
return $configuredFee;
|
193 |
+
}
|
194 |
+
|
195 |
+
$baseFee = $this->_getPaymentFee($quote, $paymentMethod);
|
196 |
+
$fee = $store->convertPrice($baseFee);
|
197 |
+
$includeTax = false;
|
198 |
+
if(!$this->getFeeIsInclTax($storeId))
|
199 |
+
{
|
200 |
+
$includeTax = true;
|
201 |
+
}
|
202 |
+
|
203 |
+
$paymentFee = Mage::helper('tax')->getShippingPrice($fee, $includeTax, $quote->getShippingAddress());
|
204 |
+
|
205 |
+
return $paymentFee;
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Gets the configured Buckaroo Payment fee excl. tax for a given quote.
|
211 |
+
*
|
212 |
+
* @param Mage_Sales_Model_Quote $quote
|
213 |
+
* @param string $paymentMethod
|
214 |
+
*
|
215 |
+
* @return float|int
|
216 |
+
*/
|
217 |
+
protected function _getPaymentFee(Mage_Sales_Model_Quote $quote, $paymentMethod = '')
|
218 |
+
{
|
219 |
+
$storeId = $quote->getStoreId();
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Get the fee as configured by the merchant.
|
223 |
+
*/
|
224 |
+
if(empty($paymentMethod)){
|
225 |
+
$paymentMethod = $quote->getPayment()->getMethod();
|
226 |
+
}
|
227 |
+
|
228 |
+
if(!$paymentMethod){
|
229 |
+
return 0;
|
230 |
+
}
|
231 |
+
|
232 |
+
$fee = Mage::getStoreConfig(sprintf(self::XPATH_BUCKAROO_FEE, $paymentMethod), $storeId);
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Determine if the configured fee is a percentage or a flat amount.
|
236 |
+
*/
|
237 |
+
if (strpos($fee, '%') !== false) {
|
238 |
+
$this->_feeIsPercentage = true;
|
239 |
+
|
240 |
+
/**
|
241 |
+
* If the fee is a percentage, get the configured percentage value and determine over which part of the
|
242 |
+
* quote this percentage needs to be calculated.
|
243 |
+
*/
|
244 |
+
$percentage = floatval(trim($fee));
|
245 |
+
if (!$quote->isVirtual()) {
|
246 |
+
$address = $quote->getShippingAddress();
|
247 |
+
} else {
|
248 |
+
$address = $quote->getBillingAddress();
|
249 |
+
}
|
250 |
+
|
251 |
+
$calculationAmount = false;
|
252 |
+
$feePercentageMode = Mage::getStoreConfig(self::XPATH_BUCKAROO_FEE_PERCENTAGE_MODE, $storeId);
|
253 |
+
switch ($feePercentageMode) {
|
254 |
+
case 'subtotal':
|
255 |
+
$calculationAmount = $address->getBaseSubtotal()
|
256 |
+
- $address->getBaseDiscountAmount();
|
257 |
+
|
258 |
+
$this->_feeIsInclTax = false;
|
259 |
+
break;
|
260 |
+
case 'subtotal_incl_tax':
|
261 |
+
$calculationAmount = $address->getBaseSubtotalInclTax()
|
262 |
+
- $address->getBaseDiscountAmount();
|
263 |
+
|
264 |
+
$this->_feeIsInclTax = true;
|
265 |
+
break;
|
266 |
+
case 'grandtotal':
|
267 |
+
$calculationAmount = $address->getBaseSubtotalInclTax()
|
268 |
+
+ $address->getBaseShippingInclTax()
|
269 |
+
- $address->getBaseDiscountAmount();
|
270 |
+
|
271 |
+
$this->_feeIsInclTax = true;
|
272 |
+
break;
|
273 |
+
//no default
|
274 |
+
}
|
275 |
+
|
276 |
+
/**
|
277 |
+
* Calculate the flat fee.
|
278 |
+
*/
|
279 |
+
if ($calculationAmount !== false && $calculationAmount > 0) {
|
280 |
+
$fee = $calculationAmount * ($percentage / 100);
|
281 |
+
} else {
|
282 |
+
$fee = 0;
|
283 |
+
}
|
284 |
+
} else {
|
285 |
+
$fee = (float) $fee;
|
286 |
+
}
|
287 |
+
|
288 |
+
if ($fee <= 0) {
|
289 |
+
return 0;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* If the fee is entered without tax, return the fee amount. Otherwise, we need to calculate and remove the tax.
|
294 |
+
*/
|
295 |
+
$feeIsIncludingTax = $this->getFeeIsInclTax($storeId);
|
296 |
+
if (!$feeIsIncludingTax) {
|
297 |
+
return $fee;
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Build a tax request to calculate the fee tax.
|
302 |
+
*/
|
303 |
+
$taxRequest = $this->_getBuckarooFeeTaxRequest($quote);
|
304 |
+
|
305 |
+
if (!$taxRequest) {
|
306 |
+
return $fee;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Get the tax rate for the request.
|
311 |
+
*/
|
312 |
+
$taxRate = $this->_getBuckarooFeeTaxRate($taxRequest);
|
313 |
+
|
314 |
+
if (!$taxRate || $taxRate <= 0) {
|
315 |
+
return $fee;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Remove the tax from the fee.
|
320 |
+
*/
|
321 |
+
$feeTax = $this->_getBuckarooFeeTax($quote->getShippingAddress(), $taxRate, $fee, true);
|
322 |
+
$fee -= $feeTax;
|
323 |
+
|
324 |
+
return $fee;
|
325 |
+
}
|
326 |
+
}
|
@@ -0,0 +1,259 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
abstract class TIG_Buckaroo3Extended_Model_PaymentFee_Quote_Address_Total_Fee_Abstract extends Mage_Tax_Model_Sales_Total_Quote_Tax
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Xpath to the Buckaroo fee setting.
|
43 |
+
*/
|
44 |
+
const XPATH_BUCKAROO_FEE = 'buckaroo/%s/payment_fee';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Xpath to Buckaroo fee tax class.
|
48 |
+
*/
|
49 |
+
const XPATH_BUCKAROO_TAX_CLASS = 'tax/classes/buckaroo_fee';
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Xpath to the Buckaroo fee including tax setting.
|
53 |
+
*/
|
54 |
+
const XPATH_BUCKAROO_FEE_INCLUDING_TAX = 'tax/calculation/buckaroo_fee_including_tax';
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Xpath to the fee_percentage_mode setting.
|
58 |
+
*/
|
59 |
+
const XPATH_BUCKAROO_FEE_PERCENTAGE_MODE = 'buckaroo/buckaroo3extended_advanced/fee_percentage_mode';
|
60 |
+
|
61 |
+
/**
|
62 |
+
* @var string
|
63 |
+
*/
|
64 |
+
protected $_totalCode;
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @var boolean
|
68 |
+
*/
|
69 |
+
protected $_feeIsInclTax = null;
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Constructor method.
|
73 |
+
*
|
74 |
+
* Sets several class variables.
|
75 |
+
*/
|
76 |
+
public function __construct()
|
77 |
+
{
|
78 |
+
$this->setCode($this->_totalCode);
|
79 |
+
$this->setTaxCalculation(Mage::getSingleton('tax/calculation'));
|
80 |
+
|
81 |
+
$this->_helper = Mage::helper('tax');
|
82 |
+
$this->_config = Mage::getSingleton('tax/config');
|
83 |
+
$this->_weeeHelper = Mage::helper('weee');
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* @return Mage_Tax_Model_Calculation
|
88 |
+
*/
|
89 |
+
public function getTaxCalculation()
|
90 |
+
{
|
91 |
+
$taxCalculation = $this->_calculator;
|
92 |
+
if ($taxCalculation) {
|
93 |
+
return $taxCalculation;
|
94 |
+
}
|
95 |
+
|
96 |
+
$taxCalculation = Mage::getSingleton('tax/calculation');
|
97 |
+
|
98 |
+
$this->setTaxCalculation($taxCalculation);
|
99 |
+
return $taxCalculation;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @param Mage_Tax_Model_Calculation $taxCalculation
|
104 |
+
*
|
105 |
+
* @return $this
|
106 |
+
*/
|
107 |
+
public function setTaxCalculation(Mage_Tax_Model_Calculation $taxCalculation)
|
108 |
+
{
|
109 |
+
$this->_calculator = $taxCalculation;
|
110 |
+
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Get whether the Buckaroo fee is incl. tax.
|
116 |
+
*
|
117 |
+
* @param int|Mage_Core_Model_Store|null $store
|
118 |
+
*
|
119 |
+
* @return bool
|
120 |
+
*/
|
121 |
+
public function getFeeIsInclTax($store = null)
|
122 |
+
{
|
123 |
+
if (null !== $this->_feeIsInclTax) {
|
124 |
+
return $this->_feeIsInclTax;
|
125 |
+
}
|
126 |
+
|
127 |
+
if (is_null($store)) {
|
128 |
+
$storeId = Mage::app()->getStore()->getId();
|
129 |
+
} elseif ($store instanceof Mage_Core_Model_Store) {
|
130 |
+
$storeId = $store->getId();
|
131 |
+
} else {
|
132 |
+
$storeId = $store;
|
133 |
+
}
|
134 |
+
|
135 |
+
$feeIsInclTax = Mage::getStoreConfigFlag(self::XPATH_BUCKAROO_FEE_INCLUDING_TAX, $storeId);
|
136 |
+
|
137 |
+
$this->_feeIsInclTax = $feeIsInclTax;
|
138 |
+
return $feeIsInclTax;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get the tax request object for the current quote.
|
143 |
+
*
|
144 |
+
* @param Mage_Sales_Model_Quote $quote
|
145 |
+
*
|
146 |
+
* @return bool|Varien_Object
|
147 |
+
*/
|
148 |
+
protected function _getBuckarooFeeTaxRequest(Mage_Sales_Model_Quote $quote)
|
149 |
+
{
|
150 |
+
$store = $quote->getStore();
|
151 |
+
$codTaxClass = Mage::getStoreConfig(self::XPATH_BUCKAROO_TAX_CLASS, $store);
|
152 |
+
|
153 |
+
/**
|
154 |
+
* If no tax class is configured for the Buckaroo fee, there is no tax to be calculated.
|
155 |
+
*/
|
156 |
+
if (!$codTaxClass) {
|
157 |
+
return false;
|
158 |
+
}
|
159 |
+
|
160 |
+
$taxCalculation = $this->getTaxCalculation();
|
161 |
+
$customerTaxClass = $quote->getCustomerTaxClassId();
|
162 |
+
$shippingAddress = $quote->getShippingAddress();
|
163 |
+
$billingAddress = $quote->getBillingAddress();
|
164 |
+
|
165 |
+
$request = $taxCalculation->getRateRequest(
|
166 |
+
$shippingAddress,
|
167 |
+
$billingAddress,
|
168 |
+
$customerTaxClass,
|
169 |
+
$store
|
170 |
+
);
|
171 |
+
|
172 |
+
$request->setProductClassId($codTaxClass);
|
173 |
+
|
174 |
+
return $request;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Get the tax rate based on the previously created tax request.
|
179 |
+
*
|
180 |
+
* @param Varien_Object $request
|
181 |
+
*
|
182 |
+
* @return float
|
183 |
+
*/
|
184 |
+
protected function _getBuckarooFeeTaxRate($request)
|
185 |
+
{
|
186 |
+
$rate = $this->getTaxCalculation()->getRate($request);
|
187 |
+
|
188 |
+
return $rate;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Get the fee tax based on the shipping address and tax rate.
|
193 |
+
*
|
194 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
195 |
+
* @param float $taxRate
|
196 |
+
* @param float|null $fee
|
197 |
+
* @param boolean $isInclTax
|
198 |
+
*
|
199 |
+
* @return float
|
200 |
+
*/
|
201 |
+
protected function _getBuckarooFeeTax($address, $taxRate, $fee = null, $isInclTax = false)
|
202 |
+
{
|
203 |
+
if (is_null($fee)) {
|
204 |
+
$fee = (float) $address->getBuckarooFee();
|
205 |
+
}
|
206 |
+
|
207 |
+
$taxCalculation = $this->getTaxCalculation();
|
208 |
+
|
209 |
+
$feeTax = $taxCalculation->calcTaxAmount(
|
210 |
+
$fee,
|
211 |
+
$taxRate,
|
212 |
+
$isInclTax,
|
213 |
+
false
|
214 |
+
);
|
215 |
+
|
216 |
+
return $feeTax;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Get the base fee tax based on the shipping address and tax rate.
|
221 |
+
*
|
222 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
223 |
+
* @param float $taxRate
|
224 |
+
* @param float|null $fee
|
225 |
+
* @param boolean $isInclTax
|
226 |
+
*
|
227 |
+
* @return float
|
228 |
+
*/
|
229 |
+
protected function _getBaseBuckarooFeeTax($address, $taxRate, $fee = null, $isInclTax = false)
|
230 |
+
{
|
231 |
+
if (is_null($fee)) {
|
232 |
+
$fee = (float) $address->getBaseBuckarooFee();
|
233 |
+
}
|
234 |
+
|
235 |
+
$taxCalculation = $this->getTaxCalculation();
|
236 |
+
|
237 |
+
$baseFeeTax = $taxCalculation->calcTaxAmount(
|
238 |
+
$fee,
|
239 |
+
$taxRate,
|
240 |
+
$isInclTax,
|
241 |
+
false
|
242 |
+
);
|
243 |
+
|
244 |
+
return $baseFeeTax;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Process model configuration array.
|
249 |
+
* This method can be used for changing totals collect sort order
|
250 |
+
*
|
251 |
+
* @param array $config
|
252 |
+
* @param store $store
|
253 |
+
* @return array
|
254 |
+
*/
|
255 |
+
public function processConfigArray($config, $store)
|
256 |
+
{
|
257 |
+
return $config;
|
258 |
+
}
|
259 |
+
}
|
@@ -0,0 +1,160 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Quote_Address_Total_FeeTax
|
40 |
+
extends TIG_Buckaroo3Extended_Model_PaymentFee_Quote_Address_Total_Fee_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* The code of this 'total'.
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
protected $_totalCode = 'buckaroo_fee_tax';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Collect the Buckaroo Payment fee tax for the given address.
|
51 |
+
*
|
52 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
53 |
+
*
|
54 |
+
* @return $this
|
55 |
+
*/
|
56 |
+
public function collect(Mage_Sales_Model_Quote_Address $address)
|
57 |
+
{
|
58 |
+
/**
|
59 |
+
* We can only add the fee to the shipping address.
|
60 |
+
*/
|
61 |
+
if ($address->getAddressType() !='shipping') {
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
$quote = $address->getQuote();
|
66 |
+
$store = $quote->getStore();
|
67 |
+
|
68 |
+
if (!$quote->getId()) {
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* First, reset the fee amounts to 0 for this address and the quote.
|
74 |
+
*/
|
75 |
+
$address->setBuckarooFeeTax(0)
|
76 |
+
->setBaseBuckarooFeeTax(0);
|
77 |
+
|
78 |
+
$quote->setBuckarooFeeTax(0)
|
79 |
+
->setBaseBuckarooFeeTax(0);
|
80 |
+
|
81 |
+
$items = $address->getAllItems();
|
82 |
+
if (!count($items)) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
if (!$address->getBuckarooFee() || !$address->getBaseBuckarooFee()) {
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
$items = $address->getAllItems();
|
91 |
+
if (!count($items)) {
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Get the tax request and corresponding tax rate.
|
97 |
+
*/
|
98 |
+
$taxRequest = $this->_getBuckarooFeeTaxRequest($quote);
|
99 |
+
|
100 |
+
if (!$taxRequest) {
|
101 |
+
return $this;
|
102 |
+
}
|
103 |
+
|
104 |
+
$taxRate = $this->_getBuckarooFeeTaxRate($taxRequest);
|
105 |
+
|
106 |
+
if (!$taxRate || $taxRate <= 0) {
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Calculate the tax for the fee using the tax rate.
|
112 |
+
*/
|
113 |
+
$paymentMethod = $quote->getPayment()->getMethod();
|
114 |
+
|
115 |
+
$baseFee = $address->getBaseBuckarooFee();
|
116 |
+
|
117 |
+
$fee = $store->convertPrice($baseFee);
|
118 |
+
|
119 |
+
$feeTax = $this->_getBuckarooFeeTax($address, $taxRate, $fee, false);
|
120 |
+
$baseFeeTax = $this->_getBaseBuckarooFeeTax($address, $taxRate, $baseFee, false);
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Get all taxes that were applied for this tax request.
|
124 |
+
*/
|
125 |
+
$appliedRates = Mage::getSingleton('tax/calculation')
|
126 |
+
->getAppliedRates($taxRequest);
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Save the newly applied taxes.
|
130 |
+
*/
|
131 |
+
$this->_saveAppliedTaxes(
|
132 |
+
$address,
|
133 |
+
$appliedRates,
|
134 |
+
$feeTax,
|
135 |
+
$baseFeeTax,
|
136 |
+
$taxRate
|
137 |
+
);
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Update the total amounts.
|
141 |
+
*/
|
142 |
+
$address->setTaxAmount($address->getTaxAmount() + $feeTax)
|
143 |
+
->setBaseTaxAmount($address->getBaseTaxAmount() + $baseFeeTax)
|
144 |
+
->setBuckarooFeeTax($feeTax)
|
145 |
+
->setBaseBuckarooFeeTax($baseFeeTax);
|
146 |
+
|
147 |
+
$address->addTotalAmount('nominal_tax', $feeTax);
|
148 |
+
$address->addBaseTotalAmount('nominal_tax', $baseFeeTax);
|
149 |
+
|
150 |
+
$quote->setBuckarooFeeTax($feeTax)
|
151 |
+
->setBaseBuckarooFeeTax($baseFeeTax);
|
152 |
+
|
153 |
+
return $this;
|
154 |
+
}
|
155 |
+
|
156 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
157 |
+
{
|
158 |
+
return $this;
|
159 |
+
}
|
160 |
+
}
|
@@ -0,0 +1,252 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_Service
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Xpath to Buckaroo fee tax class.
|
43 |
+
*/
|
44 |
+
const XPATH_BUCKAROO_FEE_TAX_CLASS = 'tax/classes/buckaroo_fee';
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Add Buckaroo Payment fee tax info to the full tax info array.
|
48 |
+
*
|
49 |
+
* This is a really annoying hack to fix the problem where the full tax info does not include the custom Buckaroo
|
50 |
+
* Payment fee tax info. Magento only supports tax info from shipping tax or product tax by default
|
51 |
+
* (see Mage_Tax_Helper_Data::getCalculatedTaxes()). If anybody knows of a better way to fix this (that does not
|
52 |
+
* require a core rewrite) please let us know at servicedesk@tig.nl.
|
53 |
+
*
|
54 |
+
* @param array $fullInfo
|
55 |
+
* @param Mage_Sales_Model_Order|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
56 |
+
* @param Mage_Sales_Model_Order $order
|
57 |
+
*
|
58 |
+
* @return array
|
59 |
+
*
|
60 |
+
* @see Mage_Tax_Helper_Data::getCalculatedTaxes()
|
61 |
+
*/
|
62 |
+
public function addBuckarooFeeTaxInfo($fullInfo, $source, Mage_Sales_Model_Order $order)
|
63 |
+
{
|
64 |
+
$feeTax = (float) $order->getBuckarooFeeTax();
|
65 |
+
if ($feeTax <= 0) {
|
66 |
+
return $fullInfo;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* There are 3 possible ways to add the Payment fee tax info:
|
71 |
+
* - Go through all tax info records of an order and add the Payment fee info to the record with the same title and
|
72 |
+
* a discrepancy in the recorded and expected amount.
|
73 |
+
* - Add a missing tax info record.
|
74 |
+
* - Recalculate the tax info for the Payment fee and update the amount of the tax record with the same title.
|
75 |
+
*/
|
76 |
+
$orderClassName = Mage::getConfig()->getModelClassName('sales/order');
|
77 |
+
if ($source instanceof $orderClassName) {
|
78 |
+
$fullInfo = $this->_updateTaxAmountForTaxInfo($order, $fullInfo);
|
79 |
+
} else {
|
80 |
+
/**
|
81 |
+
* Try to find a tax record that does not have a corresponding tax item record.
|
82 |
+
*/
|
83 |
+
$taxItemCollection = Mage::getResourceModel('tax/sales_order_tax_item_collection');
|
84 |
+
$taxItemCollection->addFieldToSelect('tax_id');
|
85 |
+
$taxItemCollection->getSelect()->distinct();
|
86 |
+
|
87 |
+
$taxItemIds = $taxItemCollection->getColumnValues('tax_id');
|
88 |
+
|
89 |
+
$taxCollection = Mage::getResourceModel('sales/order_tax_collection')
|
90 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()))
|
91 |
+
->addFieldToFilter('tax_id', array('nin' => $taxItemIds));
|
92 |
+
|
93 |
+
/**
|
94 |
+
* If we have found a missing record, we need to add it with the COD fee tax info. Otherwise we need to
|
95 |
+
* recreate the entire tax request for the COD fee tax so we can match the title to an existing tax item
|
96 |
+
* record.
|
97 |
+
*/
|
98 |
+
if ($taxCollection->getSize()) {
|
99 |
+
$fullInfo = $this->_addBuckarooFeeTaxInfoFromCollection($taxCollection, $fullInfo, $source);
|
100 |
+
} else {
|
101 |
+
$fullInfo = $this->_addBuckarooFeeTaxInfoFromRequest($order, $fullInfo, $source);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
return $fullInfo;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Add Buckaroo Payment fee tax info by updating an incorrect tax record.
|
110 |
+
*
|
111 |
+
* @param Mage_Sales_Model_Order $order
|
112 |
+
* @param array $fullInfo
|
113 |
+
*
|
114 |
+
* @return array
|
115 |
+
*/
|
116 |
+
protected function _updateTaxAmountForTaxInfo($order, $fullInfo)
|
117 |
+
{
|
118 |
+
$taxCollection = Mage::getResourceModel('sales/order_tax_collection')
|
119 |
+
->addFieldToSelect('amount')
|
120 |
+
->addFieldToFilter('order_id', array('eq' => $order->getId()));
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Go through each tax record and update the tax info entry that has the same title, but a different amount.
|
124 |
+
*/
|
125 |
+
foreach ($taxCollection as $tax) {
|
126 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
127 |
+
if ($tax->getTitle() == $taxInfo['title'] && $tax->getAmount() != $taxInfo['tax_amount']) {
|
128 |
+
/**
|
129 |
+
* Update the amounts.
|
130 |
+
*/
|
131 |
+
$fullInfo[$key]['tax_amount'] = $tax->getAmount();
|
132 |
+
$fullInfo[$key]['base_tax_amount'] = $tax->getBaseAmount();
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
return $fullInfo;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Add Buckaroo Payment fee tax info by updating or adding a missing tax record.
|
142 |
+
*
|
143 |
+
* @param Mage_Sales_Model_Resource_Order_Tax_Collection $taxCollection
|
144 |
+
* @param array $fullInfo
|
145 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
146 |
+
*
|
147 |
+
* @return array
|
148 |
+
*/
|
149 |
+
protected function _addBuckarooFeeTaxInfoFromCollection($taxCollection, $fullInfo, $source)
|
150 |
+
{
|
151 |
+
/**
|
152 |
+
* Go through all tax records and add the Buckaroo Payment fee tax to the entry that has the right title. If no entry exists
|
153 |
+
* with that title, add it.
|
154 |
+
*/
|
155 |
+
foreach ($taxCollection as $tax) {
|
156 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
157 |
+
/**
|
158 |
+
* Update an existing entry.
|
159 |
+
*/
|
160 |
+
if ($taxInfo['title'] == $tax->getTitle()) {
|
161 |
+
$fullInfo[$key]['tax_amount'] += $source->getBuckarooFeeTax();
|
162 |
+
$fullInfo[$key]['base_tax_amount'] += $source->getBaseBuckarooFeeTax();
|
163 |
+
|
164 |
+
break(2);
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Add a missing entry.
|
170 |
+
*/
|
171 |
+
$fullInfo[] = array(
|
172 |
+
'tax_amount' => $source->getBuckarooFeeTax(),
|
173 |
+
'base_tax_amount' => $source->getBaseBuckarooFeeTax(),
|
174 |
+
'title' => $tax->getTitle(),
|
175 |
+
'percent' => $tax->getPercent(),
|
176 |
+
);
|
177 |
+
}
|
178 |
+
|
179 |
+
return $fullInfo;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* Add Buckaroo Payment fee tax info by recreating the tax request.
|
184 |
+
*
|
185 |
+
* @param Mage_Sales_Model_Order $order
|
186 |
+
* @param array $fullInfo
|
187 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $source
|
188 |
+
*
|
189 |
+
* @return array
|
190 |
+
*/
|
191 |
+
protected function _addBuckarooFeeTaxInfoFromRequest($order, $fullInfo, $source)
|
192 |
+
{
|
193 |
+
$store = $order->getStore();
|
194 |
+
$taxCalculation = Mage::getSingleton('tax/calculation');
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Recalculate the tax request.
|
198 |
+
*/
|
199 |
+
$customerTaxClass = $order->getCustomerTaxClassId();
|
200 |
+
$shippingAddress = $order->getShippingAddress();
|
201 |
+
$billingAddress = $order->getBillingAddress();
|
202 |
+
$codTaxClass = Mage::getStoreConfig(self::XPATH_BUCKAROO_FEE_TAX_CLASS, $store);
|
203 |
+
|
204 |
+
$taxRequest = $taxCalculation->getRateRequest(
|
205 |
+
$shippingAddress,
|
206 |
+
$billingAddress,
|
207 |
+
$customerTaxClass,
|
208 |
+
$store
|
209 |
+
);
|
210 |
+
|
211 |
+
$taxRequest->setProductClassId($codTaxClass);
|
212 |
+
|
213 |
+
/**
|
214 |
+
* If the tax request fails, there is nothing more we can do. This might occur, if the tax rules have been
|
215 |
+
* changed since this order was placed. Unfortunately there is nothing we can do about this.
|
216 |
+
*/
|
217 |
+
if (!$taxRequest) {
|
218 |
+
return $fullInfo;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Get the applied rates.
|
223 |
+
*/
|
224 |
+
$appliedRates = Mage::getSingleton('tax/calculation')
|
225 |
+
->getAppliedRates($taxRequest);
|
226 |
+
|
227 |
+
if (!isset($appliedRates[0]['rates'][0]['title'])) {
|
228 |
+
return $fullInfo;
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Get the tax title from the applied rates.
|
233 |
+
*/
|
234 |
+
$buckarooFeeTaxTitle = $appliedRates[0]['rates'][0]['title'];
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Fo through all tax info entries and try to match the title.
|
238 |
+
*/
|
239 |
+
foreach ($fullInfo as $key => $taxInfo) {
|
240 |
+
if ($taxInfo['title'] == $buckarooFeeTaxTitle) {
|
241 |
+
/**
|
242 |
+
* Update the tax info entry with the COD fee tax.
|
243 |
+
*/
|
244 |
+
$fullInfo[$key]['tax_amount'] += $source->getBuckarooFeeTax();
|
245 |
+
$fullInfo[$key]['base_tax_amount'] += $source->getBaseBuckarooFeeTax();
|
246 |
+
break;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
return $fullInfo;
|
251 |
+
}
|
252 |
+
}
|
@@ -0,0 +1,53 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_PaymentFee_System_Config_Source_FeeTaxClass
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* Get available tax classes for Buckaroo Payment Fee. Available tax classes are the same as those used for product tax
|
43 |
+
* classes.
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
public function toOptionArray()
|
48 |
+
{
|
49 |
+
$options = Mage::getModel('tax/class_source_product')->toOptionArray();
|
50 |
+
|
51 |
+
return $options;
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,481 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Afterpay_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_afterpay';
|
5 |
+
protected $_method = false;
|
6 |
+
/** @var TIG_Buckaroo3Extended_Helper_Data $_helper */
|
7 |
+
protected $_helper;
|
8 |
+
|
9 |
+
protected function _construct()
|
10 |
+
{
|
11 |
+
$this->_method = Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/paymethod', Mage::app()->getStore()->getStoreId());
|
12 |
+
$this->_helper = Mage::helper('buckaroo3extended');
|
13 |
+
}
|
14 |
+
|
15 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
16 |
+
{
|
17 |
+
if($this->_isChosenMethod($observer) === false) {
|
18 |
+
return $this;
|
19 |
+
}
|
20 |
+
|
21 |
+
$request = $observer->getRequest();
|
22 |
+
|
23 |
+
$vars = $request->getVars();
|
24 |
+
|
25 |
+
if($this->_method == false){
|
26 |
+
$this->_method = Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/paymethod', Mage::app()->getStore()->getStoreId());
|
27 |
+
}
|
28 |
+
|
29 |
+
$array = array(
|
30 |
+
$this->_method => array(
|
31 |
+
'action' => 'Pay',
|
32 |
+
'version' => '1',
|
33 |
+
),
|
34 |
+
);
|
35 |
+
|
36 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
37 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
38 |
+
} else {
|
39 |
+
$vars['services'] = $array;
|
40 |
+
}
|
41 |
+
|
42 |
+
$request->setVars($vars);
|
43 |
+
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
48 |
+
{
|
49 |
+
if($this->_isChosenMethod($observer) === false) {
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
$request = $observer->getRequest();
|
54 |
+
$this->_billingInfo = $request->getBillingInfo();
|
55 |
+
$this->_order = $request->getOrder();
|
56 |
+
|
57 |
+
$vars = $request->getVars();
|
58 |
+
|
59 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
60 |
+
$this->_addCustomerVariables($vars);
|
61 |
+
$this->_addCreditManagement($vars);
|
62 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
63 |
+
}
|
64 |
+
|
65 |
+
$this->_addAfterpayVariables($vars, $this->_method);
|
66 |
+
|
67 |
+
$request->setVars($vars);
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @param Varien_Event_Observer $observer
|
73 |
+
* @return $this
|
74 |
+
*/
|
75 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
76 |
+
{
|
77 |
+
if($this->_isChosenMethod($observer) === false) {
|
78 |
+
return $this;
|
79 |
+
}
|
80 |
+
|
81 |
+
$request = $observer->getRequest();
|
82 |
+
|
83 |
+
$codeBits = explode('_', $this->_code);
|
84 |
+
$code = end($codeBits);
|
85 |
+
$request->setMethod($code);
|
86 |
+
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
/** refund methods */
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @param Varien_Event_Observer $observer
|
94 |
+
* @return $this
|
95 |
+
*/
|
96 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
97 |
+
{
|
98 |
+
if($this->_isChosenMethod($observer) === false) {
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
|
102 |
+
$request = $observer->getRequest();
|
103 |
+
|
104 |
+
$codeBits = explode('_', $this->_code);
|
105 |
+
$code = end($codeBits);
|
106 |
+
$request->setMethod($code);
|
107 |
+
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @param Varien_Event_Observer $observer
|
113 |
+
* @return $this
|
114 |
+
*/
|
115 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
116 |
+
{
|
117 |
+
if($this->_isChosenMethod($observer) === false) {
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
$refundRequest = $observer->getRequest();
|
122 |
+
|
123 |
+
$vars = $refundRequest->getVars();
|
124 |
+
|
125 |
+
$array = array(
|
126 |
+
'action' => 'Refund',
|
127 |
+
'version' => 1,
|
128 |
+
|
129 |
+
);
|
130 |
+
|
131 |
+
if($this->_method == false){
|
132 |
+
$this->_method = Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/paymethod', Mage::app()->getStore()->getStoreId());
|
133 |
+
}
|
134 |
+
|
135 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
136 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
137 |
+
} else {
|
138 |
+
$vars['services'][$this->_method] = $array;
|
139 |
+
}
|
140 |
+
|
141 |
+
$refundRequest->setVars($vars);
|
142 |
+
|
143 |
+
return $this;
|
144 |
+
}
|
145 |
+
|
146 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
147 |
+
{
|
148 |
+
if($this->_isChosenMethod($observer) === false) {
|
149 |
+
return $this;
|
150 |
+
}
|
151 |
+
|
152 |
+
return $this;
|
153 |
+
}
|
154 |
+
|
155 |
+
/** INTERNAL METHODS **/
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Adds variables required for the SOAP XML for paymentguarantee to the variable array
|
159 |
+
* Will merge with old array if it exists
|
160 |
+
*
|
161 |
+
* @param array $vars
|
162 |
+
*/
|
163 |
+
protected function _addAfterpayVariables(&$vars)
|
164 |
+
{
|
165 |
+
$session = Mage::getSingleton('checkout/session');
|
166 |
+
$additionalFields = $session->getData('additionalFields');
|
167 |
+
|
168 |
+
$requestArray = array();
|
169 |
+
|
170 |
+
//add billing address
|
171 |
+
$billingAddress = $this->_order->getBillingAddress();
|
172 |
+
$streetFull = $this->_processAddress($billingAddress->getStreetFull());
|
173 |
+
$rawPhoneNumber = $billingAddress->getTelephone();
|
174 |
+
$rawPhoneNumber = (!empty($rawPhoneNumber))? $rawPhoneNumber : $additionalFields['BPE_PhoneNumber'];
|
175 |
+
$billingPhonenumber = $this->_processPhoneNumber($rawPhoneNumber);
|
176 |
+
|
177 |
+
$billingInfo = array(
|
178 |
+
'BillingTitle' => $billingAddress->getFirstname(),
|
179 |
+
'BillingGender' => $additionalFields['BPE_Customergender'],
|
180 |
+
'BillingInitials' => strtoupper(substr($billingAddress->getFirstname(),0,1)),
|
181 |
+
'BillingLastName' => $billingAddress->getLastname(),
|
182 |
+
'BillingBirthDate' => $additionalFields['BPE_customerbirthdate'],
|
183 |
+
'BillingStreet' => $streetFull['street'],
|
184 |
+
'BillingHouseNumber' => $streetFull['house_number'],
|
185 |
+
'BillingHouseNumberSuffix' => $streetFull['number_addition'],
|
186 |
+
'BillingPostalCode' => $billingAddress->getPostcode(),
|
187 |
+
'BillingCity' => $billingAddress->getCity(),
|
188 |
+
'BillingRegion' => $billingAddress->getRegion(),
|
189 |
+
'BillingCountry' => $billingAddress->getCountryId(),
|
190 |
+
'BillingEmail' => $billingAddress->getEmail(),
|
191 |
+
'BillingPhoneNumber' => $billingPhonenumber['clean'],
|
192 |
+
'BillingLanguage' => $billingAddress->getCountryId(),
|
193 |
+
);
|
194 |
+
$requestArray = array_merge($requestArray,$billingInfo);
|
195 |
+
|
196 |
+
//add shipping address (only when different from billing address)
|
197 |
+
if($this->isShippingDifferent()){
|
198 |
+
$shippingAddress = $this->_order->getShippingAddress();
|
199 |
+
$streetFull = $this->_processAddress($shippingAddress->getStreetFull());
|
200 |
+
$shippingPhonenumber = $this->_processPhoneNumber($shippingAddress->getTelephone());
|
201 |
+
|
202 |
+
$shippingInfo = array(
|
203 |
+
'AddressesDiffer' => 'true',
|
204 |
+
'ShippingTitle' => $shippingAddress->getFirstname(),
|
205 |
+
'ShippingGender' => $additionalFields['BPE_Customergender'],
|
206 |
+
'ShippingInitials' => strtoupper(substr($shippingAddress->getFirstname(),0,1)),
|
207 |
+
'ShippingLastName' => $shippingAddress->getLastname(),
|
208 |
+
'ShippingBirthDate' => $additionalFields['BPE_customerbirthdate'],
|
209 |
+
'ShippingStreet' => $streetFull['street'],
|
210 |
+
'ShippingHouseNumber' => $streetFull['house_number'],
|
211 |
+
'ShippingHouseNumberSuffix' => $streetFull['number_addition'],
|
212 |
+
'ShippingPostalCode' => $shippingAddress->getPostcode(),
|
213 |
+
'ShippingCity' => $shippingAddress->getCity(),
|
214 |
+
'ShippingRegion' => $shippingAddress->getRegion(),
|
215 |
+
'ShippingCountryCode' => $shippingAddress->getCountryId(),
|
216 |
+
'ShippingEmail' => $shippingAddress->getEmail(),
|
217 |
+
'ShippingPhoneNumber' => $shippingPhonenumber['clean'],
|
218 |
+
'ShippingLanguage' => $shippingAddress->getCountryId(),
|
219 |
+
);
|
220 |
+
$requestArray = array_merge($requestArray,$shippingInfo);
|
221 |
+
}
|
222 |
+
|
223 |
+
//customer info
|
224 |
+
$customerInfo = array(
|
225 |
+
'CustomerAccountNumber' => $additionalFields['BPE_AccountNumber'],
|
226 |
+
'CustomerIPAddress' => Mage::helper('core/http')->getRemoteAddr(),
|
227 |
+
'Accept' => $additionalFields['BPE_Accept'],
|
228 |
+
);
|
229 |
+
$shippingCosts = round($this->_order->getBaseShippingInclTax(), 2);
|
230 |
+
|
231 |
+
$discount = null;
|
232 |
+
|
233 |
+
if(Mage::helper('buckaroo3extended')->isEnterprise()){
|
234 |
+
if((double)$this->_order->getGiftCardsAmount() > 0){
|
235 |
+
$discount = (double)$this->_order->getGiftCardsAmount();
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
if(abs((double)$this->_order->getDiscountAmount()) > 0){
|
240 |
+
$discount += abs((double)$this->_order->getDiscountAmount());
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
//add order Info
|
245 |
+
$orderInfo = array(
|
246 |
+
'Discount' => $discount,
|
247 |
+
'ShippingCosts' => $shippingCosts,
|
248 |
+
);
|
249 |
+
|
250 |
+
$requestArray = array_merge($requestArray,$customerInfo);
|
251 |
+
$requestArray = array_merge($requestArray,$orderInfo);
|
252 |
+
//is B2B
|
253 |
+
if($additionalFields['BPE_B2B'] == 2){
|
254 |
+
$b2bInfo = array(
|
255 |
+
'B2B' => 'true',
|
256 |
+
'CompanyCOCRegistration' => $additionalFields['BPE_CompanyCOCRegistration'],
|
257 |
+
'CompanyName' => $additionalFields['BPE_CompanyName'],
|
258 |
+
'CostCentre' => $additionalFields['BPE_CostCentre'],
|
259 |
+
'VatNumber' => $additionalFields['BPE_VatNumber'],
|
260 |
+
);
|
261 |
+
$requestArray = array_merge($requestArray,$b2bInfo);
|
262 |
+
}
|
263 |
+
//add all products max 10
|
264 |
+
$products = $this->_order->getAllItems();
|
265 |
+
$max = 99;
|
266 |
+
$i = 1;
|
267 |
+
$group = array();
|
268 |
+
|
269 |
+
foreach($products as $item){
|
270 |
+
/** @var $item Mage_Sales_Model_Order_Item */
|
271 |
+
|
272 |
+
if (empty($item) || $item->hasParentItemId()) {
|
273 |
+
continue;
|
274 |
+
}
|
275 |
+
|
276 |
+
// Changed calculation from unitPrice to orderLinePrice due to impossible to recalculate unitprice,
|
277 |
+
// because of differences in outcome between TAX settings: Unit, OrderLine and Total.
|
278 |
+
// Quantity will always be 1 and quantity ordered will be in the article description.
|
279 |
+
$productPrice = ($item->getBasePrice() * $item->getQtyOrdered())
|
280 |
+
+ $item->getBaseTaxAmount()
|
281 |
+
+ $item->getBaseHiddenTaxAmount();
|
282 |
+
$productPrice = round($productPrice,2);
|
283 |
+
|
284 |
+
|
285 |
+
$article['ArticleDescription']['value'] = (int) $item->getQtyOrdered() . 'x ' . $item->getName();
|
286 |
+
$article['ArticleId']['value'] = $item->getId();
|
287 |
+
$article['ArticleQuantity']['value'] = 1;
|
288 |
+
$article['ArticleUnitPrice']['value'] = $productPrice;
|
289 |
+
$article['ArticleVatcategory']['value'] = $this->_getTaxCategory($this->_getTaxClassId($item));
|
290 |
+
|
291 |
+
$group[$i] = $article;
|
292 |
+
|
293 |
+
|
294 |
+
if($i <= $max){
|
295 |
+
$i++;
|
296 |
+
continue;
|
297 |
+
}
|
298 |
+
break;
|
299 |
+
}
|
300 |
+
|
301 |
+
end($group);// move the internal pointer to the end of the array
|
302 |
+
$key = (int)key($group);
|
303 |
+
$feeGroupId = $key+1;
|
304 |
+
$paymentFeeArray = $this->_getPaymentFeeLine();
|
305 |
+
if(false !== $paymentFeeArray && is_array($paymentFeeArray)){
|
306 |
+
$group[$feeGroupId] = $paymentFeeArray;
|
307 |
+
}
|
308 |
+
|
309 |
+
$requestArray = array_merge($requestArray, array('Articles' => $group));
|
310 |
+
|
311 |
+
if (array_key_exists('customVars', $vars) && is_array($vars['customVars'][$this->_method])) {
|
312 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $requestArray);
|
313 |
+
} else {
|
314 |
+
$vars['customVars'][$this->_method] = $requestArray;
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
protected function _getPaymentFeeLine()
|
319 |
+
{
|
320 |
+
$fee = (double) $this->_order->getBuckarooFee();
|
321 |
+
$feeTax = (double) $this->_order->getBuckarooFeeTax();
|
322 |
+
|
323 |
+
if($fee > 0){
|
324 |
+
$article['ArticleDescription']['value'] = 'Servicekosten';
|
325 |
+
$article['ArticleId']['value'] = 1;
|
326 |
+
$article['ArticleQuantity']['value'] = 1;
|
327 |
+
$article['ArticleUnitPrice']['value'] = round($fee+$feeTax,2);
|
328 |
+
$article['ArticleVatcategory']['value'] = $this->_getTaxCategory(Mage::getStoreConfig('tax/classes/buckaroo_fee', Mage::app()->getStore()->getId()));
|
329 |
+
return $article;
|
330 |
+
}
|
331 |
+
return false;
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* @param Mage_Sales_Model_Order_Item $item
|
336 |
+
* @return array|bool|string
|
337 |
+
*/
|
338 |
+
protected function _getTaxClassId(Mage_Sales_Model_Order_Item $item)
|
339 |
+
{
|
340 |
+
return Mage::getResourceModel('catalog/product')->getAttributeRawValue($item->getProductId(), 'tax_class_id', $item->getStoreId());
|
341 |
+
}
|
342 |
+
|
343 |
+
protected function _getTaxCategory($taxClassId)
|
344 |
+
{
|
345 |
+
if (!$taxClassId) {
|
346 |
+
return 4;
|
347 |
+
}
|
348 |
+
|
349 |
+
$highTaxClasses = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/high', Mage::app()->getStore()->getStoreId()));
|
350 |
+
$middleTaxClasses = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/middle', Mage::app()->getStore()->getStoreId()));
|
351 |
+
$lowTaxClasses = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/low', Mage::app()->getStore()->getStoreId()));
|
352 |
+
$zeroTaxClasses = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/zero', Mage::app()->getStore()->getStoreId()));
|
353 |
+
$noTaxClasses = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_afterpay/no', Mage::app()->getStore()->getStoreId()));
|
354 |
+
|
355 |
+
if (in_array($taxClassId, $highTaxClasses)) {
|
356 |
+
return 1;
|
357 |
+
}elseif (in_array($taxClassId, $middleTaxClasses)) {
|
358 |
+
return 5;
|
359 |
+
} elseif (in_array($taxClassId, $lowTaxClasses)) {
|
360 |
+
return 2;
|
361 |
+
} elseif (in_array($taxClassId, $zeroTaxClasses)) {
|
362 |
+
return 3;
|
363 |
+
} else {
|
364 |
+
return 4;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
|
368 |
+
protected function _processAddress($fullStreet)
|
369 |
+
{
|
370 |
+
//get address from billingInfo
|
371 |
+
$address = $fullStreet;
|
372 |
+
|
373 |
+
$ret = array();
|
374 |
+
$ret['house_number'] = '';
|
375 |
+
$ret['number_addition'] = '';
|
376 |
+
if (preg_match('#^(.*?)([0-9]+)(.*)#s', $address, $matches)) {
|
377 |
+
if ('' == $matches[1]) {
|
378 |
+
// Number at beginning
|
379 |
+
$ret['house_number'] = trim($matches[2]);
|
380 |
+
$ret['street'] = trim($matches[3]);
|
381 |
+
} else {
|
382 |
+
// Number at end
|
383 |
+
$ret['street'] = trim($matches[1]);
|
384 |
+
$ret['house_number'] = trim($matches[2]);
|
385 |
+
$ret['number_addition'] = trim($matches[3]);
|
386 |
+
}
|
387 |
+
} else {
|
388 |
+
// No number
|
389 |
+
$ret['street'] = $address;
|
390 |
+
}
|
391 |
+
|
392 |
+
return $ret;
|
393 |
+
}
|
394 |
+
|
395 |
+
/**
|
396 |
+
* @param $telephoneNumber
|
397 |
+
* @return array
|
398 |
+
*/
|
399 |
+
protected function _processPhoneNumber($telephoneNumber)
|
400 |
+
{
|
401 |
+
$number = $telephoneNumber;
|
402 |
+
|
403 |
+
//the final output must like this: 0031123456789 for mobile: 0031612345678
|
404 |
+
//so 13 characters max else number is not valid
|
405 |
+
//but for some error correction we try to find if there is some faulty notation
|
406 |
+
|
407 |
+
$return = array("orginal" => $number, "clean" => false, "mobile" => false, "valid" => false);
|
408 |
+
//first strip out the non-numeric characters:
|
409 |
+
$match = preg_replace('/[^0-9]/Uis', '', $number);
|
410 |
+
if ($match) {
|
411 |
+
$number = $match;
|
412 |
+
}
|
413 |
+
|
414 |
+
if (strlen((string)$number) == 13) {
|
415 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
416 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
417 |
+
//now we can almost say that the number is valid
|
418 |
+
$return['valid'] = true;
|
419 |
+
$return['clean'] = $number;
|
420 |
+
} elseif (strlen((string) $number) > 13) {
|
421 |
+
//if the number is bigger then 13, it means that there are probably a zero to much
|
422 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
423 |
+
$return['clean'] = $this->_isValidNotation($number);
|
424 |
+
if(strlen((string)$return['clean']) == 13) {
|
425 |
+
$return['valid'] = true;
|
426 |
+
}
|
427 |
+
|
428 |
+
} elseif (strlen((string)$number) == 12 or strlen((string)$number) == 11) {
|
429 |
+
//if the number is equal to 11 or 12, it means that they used a + in their number instead of 00
|
430 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
431 |
+
$return['clean'] = $this->_isValidNotation($number);
|
432 |
+
if(strlen((string)$return['clean']) == 13) {
|
433 |
+
$return['valid'] = true;
|
434 |
+
}
|
435 |
+
|
436 |
+
} elseif (strlen((string)$number) == 10) {
|
437 |
+
//this means that the user has no trailing "0031" and therfore only
|
438 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
439 |
+
$return['clean'] = '0031'.substr($number,1);
|
440 |
+
if (strlen((string) $return['clean']) == 13) {
|
441 |
+
$return['valid'] = true;
|
442 |
+
}
|
443 |
+
} else {
|
444 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
445 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
446 |
+
//now we can almost say that the number is valid
|
447 |
+
$return['valid'] = true;
|
448 |
+
$return['clean'] = $number;
|
449 |
+
}
|
450 |
+
|
451 |
+
return $return;
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Checks if shipping-address is different from billing-address
|
456 |
+
*
|
457 |
+
* @return bool
|
458 |
+
*/
|
459 |
+
protected function isShippingDifferent()
|
460 |
+
{
|
461 |
+
// exclude certain keys that are always different
|
462 |
+
$excludeKeys = array('entity_id', 'customer_address_id', 'quote_address_id', 'region_id', 'customer_id', 'address_type');
|
463 |
+
|
464 |
+
//get both the order-addresses
|
465 |
+
$oBillingAddress = $this->_order->getBillingAddress()->getData();
|
466 |
+
$oShippingAddress = $this->_order->getShippingAddress()->getData();
|
467 |
+
|
468 |
+
//remove the keys with corresponding values from both the addressess
|
469 |
+
$oBillingAddressFiltered = array_diff_key($oBillingAddress, array_flip($excludeKeys));
|
470 |
+
$oShippingAddressFiltered = array_diff_key($oShippingAddress, array_flip($excludeKeys));
|
471 |
+
|
472 |
+
//differentiate the addressess, when some data is different an array with changes will be returned
|
473 |
+
$addressDiff = array_diff($oBillingAddressFiltered, $oShippingAddressFiltered);
|
474 |
+
|
475 |
+
//if
|
476 |
+
if( !empty($addressDiff) ) { // billing and shipping addresses are different
|
477 |
+
return true;
|
478 |
+
}
|
479 |
+
return false;
|
480 |
+
}
|
481 |
+
}
|
@@ -0,0 +1,192 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Afterpay_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
24 |
+
{
|
25 |
+
public $allowedCurrencies = array(
|
26 |
+
'EUR',
|
27 |
+
);
|
28 |
+
|
29 |
+
protected $_code = 'buckaroo3extended_afterpay';
|
30 |
+
|
31 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_afterpay_checkout_form';
|
32 |
+
|
33 |
+
protected $_canRefund = true;
|
34 |
+
protected $_canRefundInvoicePartial = false;
|
35 |
+
|
36 |
+
public function getOrderPlaceRedirectUrl()
|
37 |
+
{
|
38 |
+
$session = Mage::getSingleton('checkout/session');
|
39 |
+
|
40 |
+
$post = Mage::app()->getRequest()->getPost();
|
41 |
+
|
42 |
+
$accountNumber = $post[$this->_code.'_bpe_customer_account_number'];
|
43 |
+
|
44 |
+
$customerBirthDate = date(
|
45 |
+
'Y-m-d', strtotime($post['payment'][$this->_code]['year']
|
46 |
+
. '-' . $post['payment'][$this->_code]['month']
|
47 |
+
. '-' . $post['payment'][$this->_code]['day'])
|
48 |
+
);
|
49 |
+
|
50 |
+
$array = array(
|
51 |
+
'BPE_Customergender' => $post[$this->_code.'_BPE_Customergender'],
|
52 |
+
'BPE_AccountNumber' => $this->filterAccount($accountNumber),
|
53 |
+
'BPE_PhoneNumber' => $post[$this->_code.'_bpe_customer_phone_number'],
|
54 |
+
'BPE_customerbirthdate' => $customerBirthDate,
|
55 |
+
'BPE_B2B' => (int)$post['buckaroo3extended_afterpay_BPE_BusinessSelect'],
|
56 |
+
'BPE_Accept' => 'true',
|
57 |
+
);
|
58 |
+
|
59 |
+
if((int)$array['BPE_B2B'] == 2){
|
60 |
+
$additionalArray = array(
|
61 |
+
'BPE_CompanyCOCRegistration' => $post['buckaroo3extended_afterpay_BPE_CompanyCOCRegistration'],
|
62 |
+
'BPE_CompanyName' => $post['buckaroo3extended_afterpay_BPE_CompanyName'],
|
63 |
+
'BPE_CostCentre' => $post['buckaroo3extended_afterpay_BPE_CostCentre'],
|
64 |
+
'BPE_VatNumber' => $post['buckaroo3extended_afterpay_BPE_VatNumber'],
|
65 |
+
);
|
66 |
+
|
67 |
+
$array = array_merge($array,$additionalArray);
|
68 |
+
}
|
69 |
+
|
70 |
+
$session->setData('additionalFields',$array);
|
71 |
+
|
72 |
+
return parent::getOrderPlaceRedirectUrl();
|
73 |
+
}
|
74 |
+
|
75 |
+
public function validate()
|
76 |
+
{
|
77 |
+
$postData = Mage::app()->getRequest()->getPost();
|
78 |
+
if (
|
79 |
+
!array_key_exists('buckaroo3extended_afterpay_bpe_accept', $postData)
|
80 |
+
|| $postData['buckaroo3extended_afterpay_bpe_accept'] != 'checked'
|
81 |
+
) {
|
82 |
+
Mage::throwException(
|
83 |
+
Mage::helper('buckaroo3extended')->__('Please accept the terms and conditions.')
|
84 |
+
);
|
85 |
+
}
|
86 |
+
|
87 |
+
$this->getInfoInstance()->setAdditionalInformation('checked_terms_and_conditions', true);
|
88 |
+
|
89 |
+
return parent::validate();
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @param null | Mage_Sales_Model_Quote $quote
|
94 |
+
* @return bool
|
95 |
+
*/
|
96 |
+
public function isAvailable($quote = null)
|
97 |
+
{
|
98 |
+
|
99 |
+
if(is_null($quote) && Mage::helper('buckaroo3extended')->isAdmin()){
|
100 |
+
// Uncomment this code to get all active Buckaroo payment methods in the backend. (3th party extensions)
|
101 |
+
/*if(Mage::getStoreConfigFlag('buckaroo/' . $this->_code . '/active', Mage::app()->getStore()->getId())){
|
102 |
+
return true;
|
103 |
+
}*/
|
104 |
+
|
105 |
+
return false;
|
106 |
+
}
|
107 |
+
|
108 |
+
$quoteItems = $quote->getAllVisibleItems();
|
109 |
+
if(count($quoteItems) > 99){
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
|
113 |
+
$session = Mage::getSingleton('checkout/session');
|
114 |
+
if($session->getData('buckarooAfterpayRejected') == true){
|
115 |
+
return false;
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
//check if the country specified in the billing address is allowed to use this payment method
|
120 |
+
if (Mage::getStoreConfig('buckaroo/' . $this->_code . '/allowspecific', $quote->getStoreId()) == 1
|
121 |
+
&& $quote->getBillingAddress()->getCountry())
|
122 |
+
{
|
123 |
+
$allowedCountries = explode(',',Mage::getStoreConfig('buckaroo/' . $this->_code . '/specificcountry', $quote->getStoreId()));
|
124 |
+
$country = $quote->getBillingAddress()->getCountry();
|
125 |
+
|
126 |
+
if (!in_array($country,$allowedCountries)) {
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
$areaAllowed = null;
|
132 |
+
if ($this->canUseInternal()) {
|
133 |
+
$areaAllowed = Mage::getStoreConfig('buckaroo/' . $this->_code . '/area', $quote->getStoreId());
|
134 |
+
}
|
135 |
+
|
136 |
+
//check if the paymentmethod is available in the current shop area (frontend or backend)
|
137 |
+
if ($areaAllowed == 'backend'
|
138 |
+
&& !Mage::helper('buckaroo3extended')->isAdmin()
|
139 |
+
) {
|
140 |
+
return false;
|
141 |
+
} elseif ($areaAllowed == 'frontend'
|
142 |
+
&& Mage::helper('buckaroo3extended')->isAdmin()
|
143 |
+
) {
|
144 |
+
return false;
|
145 |
+
}
|
146 |
+
|
147 |
+
// check if max amount for the issued PaymentMethod is set and if the quote basegrandtotal exceeds that
|
148 |
+
$maxAmount = Mage::getStoreConfig('buckaroo/' . $this->_code . '/max_amount', $quote->getStoreId());
|
149 |
+
if (!empty($maxAmount)
|
150 |
+
&& !empty($quote)
|
151 |
+
&& $quote->getBaseGrandTotal() > $maxAmount)
|
152 |
+
{
|
153 |
+
return false;
|
154 |
+
}
|
155 |
+
|
156 |
+
// check if min amount for the issued PaymentMethod is set and if the quote basegrandtotal is less than that
|
157 |
+
$minAmount = Mage::getStoreConfig('buckaroo/' . $this->_code . '/min_amount', $quote->getStoreId());
|
158 |
+
if (!empty($minAmount)
|
159 |
+
&& !empty($quote)
|
160 |
+
&& $quote->getBaseGrandTotal() < $minAmount)
|
161 |
+
{
|
162 |
+
return false;
|
163 |
+
}
|
164 |
+
|
165 |
+
//check if the module is set to enabled
|
166 |
+
if (!Mage::getStoreConfig('buckaroo/' . $this->_code . '/active', $quote->getStoreId())) {
|
167 |
+
return false;
|
168 |
+
}
|
169 |
+
|
170 |
+
//limit by ip
|
171 |
+
if (mage::getStoreConfig('dev/restrict/allow_ips') && Mage::getStoreConfig('buckaroo/' . $this->_code . '/limit_by_ip'))
|
172 |
+
{
|
173 |
+
$allowedIp = explode(',', mage::getStoreConfig('dev/restrict/allow_ips'));
|
174 |
+
if (!in_array(Mage::helper('core/http')->getRemoteAddr(), $allowedIp))
|
175 |
+
{
|
176 |
+
return false;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
// get current currency code
|
181 |
+
$currency = Mage::app()->getStore()->getBaseCurrencyCode();
|
182 |
+
|
183 |
+
|
184 |
+
// currency is not available for this module
|
185 |
+
if (!in_array($currency, $this->allowedCurrencies))
|
186 |
+
{
|
187 |
+
return false;
|
188 |
+
}
|
189 |
+
|
190 |
+
return TIG_Buckaroo3Extended_Model_Request_Availability::canUseBuckaroo($quote);
|
191 |
+
}
|
192 |
+
}
|
@@ -0,0 +1,290 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
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Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Amex_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_amex';
|
5 |
+
protected $_method = 'amex';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
if(Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/address_verification', Mage::app()->getStore()->getStoreId()))
|
61 |
+
{
|
62 |
+
$this->_addAavCredentials($vars);
|
63 |
+
}
|
64 |
+
|
65 |
+
$request->setVars($vars);
|
66 |
+
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
71 |
+
{
|
72 |
+
if($this->_isChosenMethod($observer) === false) {
|
73 |
+
return $this;
|
74 |
+
}
|
75 |
+
|
76 |
+
$request = $observer->getRequest();
|
77 |
+
|
78 |
+
$codeBits = explode('_', $this->_code);
|
79 |
+
$code = end($codeBits);
|
80 |
+
$request->setMethod($code);
|
81 |
+
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
86 |
+
{
|
87 |
+
if($this->_isChosenMethod($observer) === false) {
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
$request = $observer->getRequest();
|
92 |
+
|
93 |
+
$codeBits = explode('_', $this->_code);
|
94 |
+
$code = end($codeBits);
|
95 |
+
$request->setMethod($code);
|
96 |
+
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
101 |
+
{
|
102 |
+
if($this->_isChosenMethod($observer) === false) {
|
103 |
+
return $this;
|
104 |
+
}
|
105 |
+
|
106 |
+
$refundRequest = $observer->getRequest();
|
107 |
+
|
108 |
+
$vars = $refundRequest->getVars();
|
109 |
+
|
110 |
+
$array = array(
|
111 |
+
'action' => 'Refund',
|
112 |
+
'version' => 1,
|
113 |
+
);
|
114 |
+
|
115 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
116 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
117 |
+
} else {
|
118 |
+
$vars['services'][$this->_method] = $array;
|
119 |
+
}
|
120 |
+
|
121 |
+
$refundRequest->setVars($vars);
|
122 |
+
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
127 |
+
{
|
128 |
+
if($this->_isChosenMethod($observer) === false) {
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
return $this;
|
133 |
+
}
|
134 |
+
|
135 |
+
|
136 |
+
/**
|
137 |
+
* If AddressVerification is enabled in the config, this method will add the required variables so American Express
|
138 |
+
* can validate the address
|
139 |
+
* @param $vars
|
140 |
+
* @return mixed
|
141 |
+
*/
|
142 |
+
protected function _addAavCredentials(&$vars)
|
143 |
+
{
|
144 |
+
$billingAddress = $this->_billingInfo;
|
145 |
+
$shippingAddress = $this->_order->getShippingAddress();
|
146 |
+
|
147 |
+
$billingFirstname = $billingAddress['firstname'];
|
148 |
+
$billingLastname = $billingAddress['lastname'];
|
149 |
+
$billingStreetFull = $this->_processAddress($billingAddress['address']);
|
150 |
+
$billingHousenumber = $billingStreetFull['house_number'];
|
151 |
+
$billingHousenumberSuffix = $billingStreetFull['number_addition'];
|
152 |
+
$billingStreet = $billingStreetFull['street'];
|
153 |
+
$billingZipcode = $billingAddress['zip'];
|
154 |
+
$billingCountry = $billingAddress['countryCode'];
|
155 |
+
$billingPhonenumber = $this->_processPhoneNumber($billingAddress['telephone']);
|
156 |
+
|
157 |
+
|
158 |
+
$shippingFirstname = $shippingAddress->getFirstname();
|
159 |
+
$shippingLastname = $shippingAddress->getLastname();
|
160 |
+
$shippingStreetFull = $this->_processAddress($shippingAddress->getStreetFull());
|
161 |
+
$shippingHouseumber = $shippingStreetFull['house_number'];
|
162 |
+
$shippingHousenumberSuffix = $shippingStreetFull['number_addition'];
|
163 |
+
$shippingStreet = $shippingStreetFull['street'];
|
164 |
+
$shippingZipcode = $shippingAddress->getPostcode();
|
165 |
+
$shippingPhonenumber = $this->_processPhoneNumber($shippingAddress->getTelephone());
|
166 |
+
$shippingCountryCode = $shippingAddress->getCountry();
|
167 |
+
|
168 |
+
$customerEmail = $this->_order->getCustomerEmail();
|
169 |
+
|
170 |
+
|
171 |
+
$array = array(
|
172 |
+
'VerifyAddress' => 'true',
|
173 |
+
'ShippingFirstName' => $shippingFirstname,
|
174 |
+
'ShippingLastName' => $shippingLastname,
|
175 |
+
'ShippingStreet' => $shippingStreet,
|
176 |
+
'ShippingHouseNumber' => $shippingHouseumber,
|
177 |
+
'ShippingHouseNumberSuffix' => $shippingHousenumberSuffix,
|
178 |
+
'ShippingPostalCode' => $shippingZipcode,
|
179 |
+
'ShippingCountryCode' => $shippingCountryCode,
|
180 |
+
'ShippingPhoneNumber' => $shippingPhonenumber['clean'],
|
181 |
+
'BillingFirstName' => $billingFirstname,
|
182 |
+
'BillingLastName' => $billingLastname,
|
183 |
+
'BillingStreet' => $billingStreet,
|
184 |
+
'BillingHouseNumber' => $billingHousenumber,
|
185 |
+
'BillingHouseNumberSuffix' => $billingHousenumberSuffix,
|
186 |
+
'BillingPostalCode' => $billingZipcode,
|
187 |
+
'BillingPhoneNumber' => $billingPhonenumber['clean'],
|
188 |
+
'CustomerEmail' => $customerEmail,
|
189 |
+
);
|
190 |
+
|
191 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
192 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
193 |
+
} else {
|
194 |
+
$vars['customVars'][$this->_method] = $array;
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
return $vars;
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* @param $fullStreet
|
203 |
+
* @return array
|
204 |
+
*/
|
205 |
+
protected function _processAddress($fullStreet)
|
206 |
+
{
|
207 |
+
//get address from billingInfo
|
208 |
+
$address = $fullStreet;
|
209 |
+
|
210 |
+
$ret = array();
|
211 |
+
$ret['house_number'] = '';
|
212 |
+
$ret['number_addition'] = '';
|
213 |
+
if (preg_match('#^(.*?)([0-9]+)(.*)#s', $address, $matches)) {
|
214 |
+
if ('' == $matches[1]) {
|
215 |
+
// Number at beginning
|
216 |
+
$ret['house_number'] = trim($matches[2]);
|
217 |
+
$ret['street'] = trim($matches[3]);
|
218 |
+
} else {
|
219 |
+
// Number at end
|
220 |
+
$ret['street'] = trim($matches[1]);
|
221 |
+
$ret['house_number'] = trim($matches[2]);
|
222 |
+
$ret['number_addition'] = trim($matches[3]);
|
223 |
+
}
|
224 |
+
} else {
|
225 |
+
// No number
|
226 |
+
$ret['street'] = $address;
|
227 |
+
}
|
228 |
+
|
229 |
+
return $ret;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* @param $telephoneNumber
|
234 |
+
* @return array
|
235 |
+
*/
|
236 |
+
protected function _processPhoneNumber($telephoneNumber)
|
237 |
+
{
|
238 |
+
$number = $telephoneNumber;
|
239 |
+
|
240 |
+
//the final output must like this: 0031123456789 for mobile: 0031612345678
|
241 |
+
//so 13 characters max else number is not valid
|
242 |
+
//but for some error correction we try to find if there is some faulty notation
|
243 |
+
|
244 |
+
$return = array("orginal" => $number, "clean" => false, "mobile" => false, "valid" => false);
|
245 |
+
//first strip out the non-numeric characters:
|
246 |
+
$match = preg_replace('/[^0-9]/Uis', '', $number);
|
247 |
+
if ($match) {
|
248 |
+
$number = $match;
|
249 |
+
}
|
250 |
+
|
251 |
+
if (strlen((string)$number) == 13) {
|
252 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
253 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
254 |
+
//now we can almost say that the number is valid
|
255 |
+
$return['valid'] = true;
|
256 |
+
$return['clean'] = $number;
|
257 |
+
} elseif (strlen((string) $number) > 13) {
|
258 |
+
//if the number is bigger then 13, it means that there are probably a zero to much
|
259 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
260 |
+
$return['clean'] = $this->_isValidNotation($number);
|
261 |
+
if(strlen((string)$return['clean']) == 13) {
|
262 |
+
$return['valid'] = true;
|
263 |
+
}
|
264 |
+
|
265 |
+
} elseif (strlen((string)$number) == 12 or strlen((string)$number) == 11) {
|
266 |
+
//if the number is equal to 11 or 12, it means that they used a + in their number instead of 00
|
267 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
268 |
+
$return['clean'] = $this->_isValidNotation($number);
|
269 |
+
if(strlen((string)$return['clean']) == 13) {
|
270 |
+
$return['valid'] = true;
|
271 |
+
}
|
272 |
+
|
273 |
+
} elseif (strlen((string)$number) == 10) {
|
274 |
+
//this means that the user has no trailing "0031" and therfore only
|
275 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
276 |
+
$return['clean'] = '0031'.substr($number,1);
|
277 |
+
if (strlen((string) $return['clean']) == 13) {
|
278 |
+
$return['valid'] = true;
|
279 |
+
}
|
280 |
+
} else {
|
281 |
+
//if the length equal to 13 is, then we can check if its a mobile number or normal number
|
282 |
+
$return['mobile'] = $this->_isMobileNumber($number);
|
283 |
+
//now we can almost say that the number is valid
|
284 |
+
$return['valid'] = true;
|
285 |
+
$return['clean'] = $number;
|
286 |
+
}
|
287 |
+
|
288 |
+
return $return;
|
289 |
+
}
|
290 |
+
}
|
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Amex_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'DKK',
|
12 |
+
'EUR',
|
13 |
+
'GBP',
|
14 |
+
'HRK',
|
15 |
+
'LTL',
|
16 |
+
'LVL',
|
17 |
+
'MXN',
|
18 |
+
'NOK',
|
19 |
+
'PLN',
|
20 |
+
'SEK',
|
21 |
+
'TRY',
|
22 |
+
'USD',
|
23 |
+
);
|
24 |
+
|
25 |
+
protected $_code = 'buckaroo3extended_amex';
|
26 |
+
|
27 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_amex_checkout_form';
|
28 |
+
}
|
@@ -0,0 +1,199 @@
|
|
Â
|
|
Â
|
|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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Bancontactmrcash_Observer
|
3 |
+
extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
4 |
+
{
|
5 |
+
protected $_code = 'buckaroo3extended_bancontactmrcash';
|
6 |
+
protected $_method = 'bancontactmrcash';
|
7 |
+
|
8 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
9 |
+
{
|
10 |
+
if($this->_isChosenMethod($observer) === false) {
|
11 |
+
return $this;
|
12 |
+
}
|
13 |
+
|
14 |
+
$request = $observer->getRequest();
|
15 |
+
|
16 |
+
$vars = $request->getVars();
|
17 |
+
|
18 |
+
$array = array(
|
19 |
+
$this->_method => array(
|
20 |
+
'action' => 'Pay',
|
21 |
+
'version' => 1,
|
22 |
+
),
|
23 |
+
);
|
24 |
+
|
25 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
26 |
+
$array['creditmanagement'] = array(
|
27 |
+
'action' => 'Invoice',
|
28 |
+
'version' => 1,
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
33 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
34 |
+
} else {
|
35 |
+
$vars['services'] = $array;
|
36 |
+
}
|
37 |
+
|
38 |
+
$request->setVars($vars);
|
39 |
+
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
44 |
+
{
|
45 |
+
if($this->_isChosenMethod($observer) === false) {
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
$request = $observer->getRequest();
|
50 |
+
$this->_billingInfo = $request->getBillingInfo();
|
51 |
+
$this->_order = $request->getOrder();
|
52 |
+
|
53 |
+
$vars = $request->getVars();
|
54 |
+
|
55 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
56 |
+
$this->_addCustomerVariables($vars);
|
57 |
+
$this->_addCreditManagement($vars);
|
58 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
59 |
+
}
|
60 |
+
|
61 |
+
$array = array(
|
62 |
+
//'customercode' => $issuer,
|
63 |
+
);
|
64 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
65 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
66 |
+
} else {
|
67 |
+
$vars['customVars'][$this->_method] = $array;
|
68 |
+
}
|
69 |
+
|
70 |
+
$request->setVars($vars);
|
71 |
+
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
76 |
+
{
|
77 |
+
if($this->_isChosenMethod($observer) === false) {
|
78 |
+
return $this;
|
79 |
+
}
|
80 |
+
|
81 |
+
$request = $observer->getRequest();
|
82 |
+
|
83 |
+
$codeBits = explode('_', $this->_code);
|
84 |
+
$code = end($codeBits);
|
85 |
+
$request->setMethod($code);
|
86 |
+
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
protected function _isChosenMethod($observer)
|
91 |
+
{
|
92 |
+
$ret = false;
|
93 |
+
|
94 |
+
$chosenMethod = $observer->getOrder()->getPayment()->getMethod();
|
95 |
+
|
96 |
+
if ($chosenMethod === $this->_code) {
|
97 |
+
$ret = true;
|
98 |
+
}
|
99 |
+
return $ret;
|
100 |
+
}
|
101 |
+
|
102 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
103 |
+
{
|
104 |
+
if($this->_isChosenMethod($observer) === false) {
|
105 |
+
return $this;
|
106 |
+
}
|
107 |
+
|
108 |
+
$request = $observer->getRequest();
|
109 |
+
|
110 |
+
$codeBits = explode('_', $this->_code);
|
111 |
+
$code = end($codeBits);
|
112 |
+
$request->setMethod($code);
|
113 |
+
|
114 |
+
return $this;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
118 |
+
{
|
119 |
+
if($this->_isChosenMethod($observer) === false) {
|
120 |
+
return $this;
|
121 |
+
}
|
122 |
+
|
123 |
+
$refundRequest = $observer->getRequest();
|
124 |
+
|
125 |
+
$vars = $refundRequest->getVars();
|
126 |
+
|
127 |
+
$array = array(
|
128 |
+
'action' => 'Refund',
|
129 |
+
'version' => 1,
|
130 |
+
);
|
131 |
+
|
132 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
133 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
134 |
+
} else {
|
135 |
+
$vars['services'][$this->_method] = $array;
|
136 |
+
}
|
137 |
+
|
138 |
+
$refundRequest->setVars($vars);
|
139 |
+
|
140 |
+
return $this;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Add Mr. Cash specific refund variables.
|
145 |
+
*
|
146 |
+
* @param Varien_Event_Observer $observer
|
147 |
+
*
|
148 |
+
* @return $this
|
149 |
+
*/
|
150 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
151 |
+
{
|
152 |
+
if($this->_isChosenMethod($observer) === false) {
|
153 |
+
return $this;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Get the creditmemo parameters from the request object.
|
158 |
+
*/
|
159 |
+
$params = Mage::app()->getRequest()->getParam('creditmemo', array());
|
160 |
+
if (!isset($params['buckaroo3extended_refund_fields'])
|
161 |
+
|| !is_array($params['buckaroo3extended_refund_fields'])
|
162 |
+
) {
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Get the buckaroo-specific parameters.
|
168 |
+
*/
|
169 |
+
$buckarooParams = $params['buckaroo3extended_refund_fields'];
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Get the variables array from the refund request.
|
173 |
+
*
|
174 |
+
* @var TIG_Buckaroo3Extended_Model_Refund_Request_Abstract $refundRequest
|
175 |
+
*/
|
176 |
+
$refundRequest = $observer->getRequest();
|
177 |
+
$vars = $refundRequest->getVars();
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Add 3 Mr. Cash specific fields to the variables array if the fields are available.
|
181 |
+
*/
|
182 |
+
if (isset($buckarooParams['customer_iban'])) {
|
183 |
+
$vars['customVars'][$this->_method]['customeriban'] = $buckarooParams['customer_iban'];
|
184 |
+
}
|
185 |
+
if (isset($buckarooParams['customer_account_name'])) {
|
186 |
+
$vars['customVars'][$this->_method]['customeraccountname'] = $buckarooParams['customer_account_name'];
|
187 |
+
}
|
188 |
+
if (isset($buckarooParams['customer_bic'])) {
|
189 |
+
$vars['customVars'][$this->_method]['customerbic'] = $buckarooParams['customer_bic'];
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Update the refund request with the new variables.
|
194 |
+
*/
|
195 |
+
$refundRequest->setVars($vars);
|
196 |
+
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
}
|
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Bancontactmrcash_PaymentMethod
|
3 |
+
extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
4 |
+
{
|
5 |
+
public $allowedCurrencies = array(
|
6 |
+
'EUR',
|
7 |
+
);
|
8 |
+
|
9 |
+
protected $_code = 'buckaroo3extended_bancontactmrcash';
|
10 |
+
|
11 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_bancontactmrcash_checkout_form';
|
12 |
+
|
13 |
+
protected $_canRefundInvoicePartial = false;
|
14 |
+
}
|
@@ -0,0 +1,178 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Cartebancaire_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_cartebancaire';
|
5 |
+
protected $_method = 'cartebancaire';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function buckaroo3extended_return_custom_processing(Varien_Event_Observer $observer)
|
131 |
+
{
|
132 |
+
if($this->_isChosenMethod($observer) === false) {
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
$response = $observer->getPostArray();
|
137 |
+
$order = $observer->getOrder();
|
138 |
+
|
139 |
+
$enrolled = false;
|
140 |
+
$authenticated = false;
|
141 |
+
if (isset($response['brq_SERVICE_mastercard_Enrolled']) && isset($response['brq_SERVICE_mastercard_Authentication'])) {
|
142 |
+
$enrolled = $response['brq_SERVICE_mastercard_Enrolled'];
|
143 |
+
$enrolled = ($enrolled == 'Y') ? true : false;
|
144 |
+
|
145 |
+
$authenticated = $response['brq_SERVICE_mastercard_Authentication'];
|
146 |
+
$authenticated = ($authenticated == 'Y') ? true : false;
|
147 |
+
}
|
148 |
+
|
149 |
+
$order->setBuckarooSecureEnrolled($enrolled)
|
150 |
+
->setBuckarooSecureAuthenticated($authenticated)
|
151 |
+
->save();
|
152 |
+
|
153 |
+
if ($order->getTransactionKey()) {
|
154 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
155 |
+
}
|
156 |
+
|
157 |
+
return $this;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function buckaroo3extended_push_custom_processing_after(Varien_Event_Observer $observer)
|
161 |
+
{
|
162 |
+
if($this->_isChosenMethod($observer) === false) {
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
|
166 |
+
$order = $observer->getOrder();
|
167 |
+
$enrolled = $order->getBuckarooSecureEnrolled();
|
168 |
+
$authenticated = $order->getBuckarooSecureAuthenticated();
|
169 |
+
|
170 |
+
if (is_null($enrolled) || is_null($authenticated)) {
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
175 |
+
|
176 |
+
return $this;
|
177 |
+
}
|
178 |
+
}
|
@@ -0,0 +1,11 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Cartebancaire_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_cartebancaire';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_cartebancaire_checkout_form';
|
11 |
+
}
|
@@ -0,0 +1,178 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Cartebleue_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_cartebleue';
|
5 |
+
protected $_method = 'cartebleuevisa';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function buckaroo3extended_return_custom_processing(Varien_Event_Observer $observer)
|
131 |
+
{
|
132 |
+
if($this->_isChosenMethod($observer) === false) {
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
$response = $observer->getPostArray();
|
137 |
+
$order = $observer->getOrder();
|
138 |
+
|
139 |
+
$enrolled = false;
|
140 |
+
$authenticated = false;
|
141 |
+
if (isset($response['brq_SERVICE_mastercard_Enrolled']) && isset($response['brq_SERVICE_mastercard_Authentication'])) {
|
142 |
+
$enrolled = $response['brq_SERVICE_mastercard_Enrolled'];
|
143 |
+
$enrolled = ($enrolled == 'Y') ? true : false;
|
144 |
+
|
145 |
+
$authenticated = $response['brq_SERVICE_mastercard_Authentication'];
|
146 |
+
$authenticated = ($authenticated == 'Y') ? true : false;
|
147 |
+
}
|
148 |
+
|
149 |
+
$order->setBuckarooSecureEnrolled($enrolled)
|
150 |
+
->setBuckarooSecureAuthenticated($authenticated)
|
151 |
+
->save();
|
152 |
+
|
153 |
+
if ($order->getTransactionKey()) {
|
154 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
155 |
+
}
|
156 |
+
|
157 |
+
return $this;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function buckaroo3extended_push_custom_processing_after(Varien_Event_Observer $observer)
|
161 |
+
{
|
162 |
+
if($this->_isChosenMethod($observer) === false) {
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
|
166 |
+
$order = $observer->getOrder();
|
167 |
+
$enrolled = $order->getBuckarooSecureEnrolled();
|
168 |
+
$authenticated = $order->getBuckarooSecureAuthenticated();
|
169 |
+
|
170 |
+
if (is_null($enrolled) || is_null($authenticated)) {
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
175 |
+
|
176 |
+
return $this;
|
177 |
+
}
|
178 |
+
}
|
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Cartebleue_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'CZK',
|
12 |
+
'DKK',
|
13 |
+
'EUR',
|
14 |
+
'GBP',
|
15 |
+
'HRK',
|
16 |
+
'ISK',
|
17 |
+
'JPY',
|
18 |
+
'LTL',
|
19 |
+
'LVL',
|
20 |
+
'MXN',
|
21 |
+
'NOK',
|
22 |
+
'NZD',
|
23 |
+
'PLN',
|
24 |
+
'RUB',
|
25 |
+
'SEK',
|
26 |
+
'TRY',
|
27 |
+
'USD',
|
28 |
+
'ZAR',
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $_code = 'buckaroo3extended_cartebleue';
|
32 |
+
|
33 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_cartebleue_checkout_form';
|
34 |
+
}
|
@@ -0,0 +1,144 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Directdebit_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_directdebit';
|
5 |
+
protected $_method = 'sepadirectdebit';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
61 |
+
|
62 |
+
$array = array(
|
63 |
+
'customeriban' => $additionalFields['accountNumber'],
|
64 |
+
'customeraccountname' => $additionalFields['accountOwner'],
|
65 |
+
'CollectDate' => '',
|
66 |
+
'CustomerBIC' => $additionalFields['bankNumber'],
|
67 |
+
);
|
68 |
+
|
69 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
70 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
71 |
+
} else {
|
72 |
+
$vars['customVars'][$this->_method] = $array;
|
73 |
+
}
|
74 |
+
|
75 |
+
$request->setVars($vars);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$request = $observer->getRequest();
|
102 |
+
|
103 |
+
$codeBits = explode('_', $this->_code);
|
104 |
+
$code = end($codeBits);
|
105 |
+
$request->setMethod($code);
|
106 |
+
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
111 |
+
{
|
112 |
+
if($this->_isChosenMethod($observer) === false) {
|
113 |
+
return $this;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest = $observer->getRequest();
|
117 |
+
|
118 |
+
$vars = $refundRequest->getVars();
|
119 |
+
|
120 |
+
$array = array(
|
121 |
+
'action' => 'Refund',
|
122 |
+
'version' => 1,
|
123 |
+
);
|
124 |
+
|
125 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
126 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
127 |
+
} else {
|
128 |
+
$vars['services'][$this->_method] = $array;
|
129 |
+
}
|
130 |
+
|
131 |
+
$refundRequest->setVars($vars);
|
132 |
+
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
137 |
+
{
|
138 |
+
if($this->_isChosenMethod($observer) === false) {
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
return $this;
|
143 |
+
}
|
144 |
+
}
|
@@ -0,0 +1,59 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Directdebit_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_directdebit';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_directdebit_checkout_form';
|
11 |
+
protected $_infoBlockType = 'buckaroo3extended/paymentMethods_directdebit_info';
|
12 |
+
|
13 |
+
public function getOrderPlaceRedirectUrl()
|
14 |
+
{
|
15 |
+
$session = Mage::getSingleton('checkout/session');
|
16 |
+
|
17 |
+
if(isset($_POST['payment']))
|
18 |
+
{
|
19 |
+
$accountNumber = $_POST['payment']['account_number'];
|
20 |
+
$session->setData('additionalFields', array(
|
21 |
+
'accountOwner' => $_POST['payment']['account_owner'],
|
22 |
+
'accountNumber' => $this->filterAccount($accountNumber),
|
23 |
+
'bankNumber' => $_POST['payment']['bank_number'],
|
24 |
+
)
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
return parent::getOrderPlaceRedirectUrl();
|
29 |
+
}
|
30 |
+
|
31 |
+
public function saveAdditionalData($response)
|
32 |
+
{
|
33 |
+
$data = array();
|
34 |
+
try
|
35 |
+
{
|
36 |
+
foreach($response->Services->Service->ResponseParameter as $responseParameter)
|
37 |
+
{
|
38 |
+
if($responseParameter->Name == 'MandateReference')
|
39 |
+
{
|
40 |
+
$data['mandate_reference'] = $responseParameter->_;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
catch(Exception $e)
|
45 |
+
{
|
46 |
+
Mage::log('No response parameters found in response:');
|
47 |
+
Mage::log($response);
|
48 |
+
}
|
49 |
+
|
50 |
+
if(!empty($data))
|
51 |
+
{
|
52 |
+
$this->getInfoInstance()
|
53 |
+
->setAdditionalData(serialize($data))
|
54 |
+
->save();
|
55 |
+
}
|
56 |
+
|
57 |
+
return $this;
|
58 |
+
}
|
59 |
+
}
|
@@ -0,0 +1,269 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
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Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Empayment_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_empayment';
|
5 |
+
protected $_method = 'empayment';
|
6 |
+
protected $_service = 'Empaymentcollecting';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* disable this payment method
|
10 |
+
*
|
11 |
+
* @param null $quote
|
12 |
+
* @return bool
|
13 |
+
*/
|
14 |
+
public function isAvailable($quote = null)
|
15 |
+
{
|
16 |
+
return false;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
20 |
+
{
|
21 |
+
if($this->_isChosenMethod($observer) === false) {
|
22 |
+
return $this;
|
23 |
+
}
|
24 |
+
|
25 |
+
$request = $observer->getRequest();
|
26 |
+
|
27 |
+
$vars = $request->getVars();
|
28 |
+
|
29 |
+
$array = array(
|
30 |
+
$this->_service => array(
|
31 |
+
'action' => 'Pay',
|
32 |
+
'version' => 1,
|
33 |
+
),
|
34 |
+
);
|
35 |
+
|
36 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
37 |
+
$array['creditmanagement'] = array(
|
38 |
+
'action' => 'Invoice',
|
39 |
+
'version' => 1,
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
44 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
45 |
+
} else {
|
46 |
+
$vars['services'] = $array;
|
47 |
+
}
|
48 |
+
|
49 |
+
$request->setVars($vars);
|
50 |
+
|
51 |
+
return $this;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
55 |
+
{
|
56 |
+
if($this->_isChosenMethod($observer) === false) {
|
57 |
+
return $this;
|
58 |
+
}
|
59 |
+
|
60 |
+
$request = $observer->getRequest();
|
61 |
+
$this->_billingInfo = $request->getBillingInfo();
|
62 |
+
$this->_order = $request->getOrder();
|
63 |
+
|
64 |
+
$vars = $request->getVars();
|
65 |
+
|
66 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
67 |
+
$this->_addCustomerVariables($vars);
|
68 |
+
$this->_addCreditManagement($vars);
|
69 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
70 |
+
}
|
71 |
+
|
72 |
+
$this->_addEmpaymentVars($vars);
|
73 |
+
$this->_addPersonVars($vars);
|
74 |
+
$this->_addBillingAddressVars($vars);
|
75 |
+
$request->setVars($vars);
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
80 |
+
{
|
81 |
+
if($this->_isChosenMethod($observer) === false) {
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
$request = $observer->getRequest();
|
86 |
+
|
87 |
+
$codeBits = explode('_', $this->_code);
|
88 |
+
$code = end($codeBits);
|
89 |
+
$request->setMethod($code);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
protected function _addEmpaymentVars(&$vars)
|
95 |
+
{
|
96 |
+
$storeId = Mage::app()->getStore()->getId();
|
97 |
+
|
98 |
+
$array = array(
|
99 |
+
'processingtype' => 'Deferred',
|
100 |
+
'reference' => $this->_order->getIncrementId(),
|
101 |
+
'emailAddress' => $this->_billingInfo['email'],
|
102 |
+
);
|
103 |
+
|
104 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_service, $vars['customVars']) && is_array($vars['customVars'][$this->_service])) {
|
105 |
+
$vars['customVars'][$this->_service] = array_merge($vars['customVars'][$this->_service], $array);
|
106 |
+
} else {
|
107 |
+
$vars['customVars'][$this->_service] = $array;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
protected function _addPersonVars(&$vars)
|
112 |
+
{
|
113 |
+
$array = array(
|
114 |
+
'FirstName' => array(
|
115 |
+
'value' => $this->_billingInfo['firstname'],
|
116 |
+
'group' => 'person',
|
117 |
+
),
|
118 |
+
'Initials' => array(
|
119 |
+
'value' => $this->_getInitialsCM(),
|
120 |
+
'group' => 'person',
|
121 |
+
),
|
122 |
+
'LastName' => array(
|
123 |
+
'value' => $this->_billingInfo['lastname'],
|
124 |
+
'group' => 'person',
|
125 |
+
),
|
126 |
+
'browserAgent' => array(
|
127 |
+
'value' => $_SERVER['HTTP_USER_AGENT'],
|
128 |
+
'group' => 'clientInfo'
|
129 |
+
),
|
130 |
+
);
|
131 |
+
|
132 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_service, $vars['customVars']) && is_array($vars['customVars'][$this->_service])) {
|
133 |
+
$vars['customVars'][$this->_service] = array_merge($vars['customVars'][$this->_service], $array);
|
134 |
+
} else {
|
135 |
+
$vars['customVars'][$this->_service] = $array;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
protected function _addBillingAddressVars(&$vars)
|
140 |
+
{
|
141 |
+
$address = $this->_processAddressCM();
|
142 |
+
|
143 |
+
$array = array(
|
144 |
+
'Street' => array(
|
145 |
+
'value' => $address['street'],
|
146 |
+
'group' => 'address',
|
147 |
+
),
|
148 |
+
'AddressType' => array(
|
149 |
+
'value' => 'HOM',
|
150 |
+
'group' => 'address',
|
151 |
+
),
|
152 |
+
'Country' => array(
|
153 |
+
'value' => 528,
|
154 |
+
'group' => 'address',
|
155 |
+
),
|
156 |
+
'NumberExtension' => array(
|
157 |
+
'value' => $address['number_addition'],
|
158 |
+
'group' => 'address',
|
159 |
+
),
|
160 |
+
'City' => array(
|
161 |
+
'value' => $this->_billingInfo['city'],
|
162 |
+
'group' => 'address',
|
163 |
+
),
|
164 |
+
'Number' => array(
|
165 |
+
'value' => $address['house_number'],
|
166 |
+
'group' => 'address',
|
167 |
+
),
|
168 |
+
'ZipCode' => array(
|
169 |
+
'value' => $this->_billingInfo['zip'],
|
170 |
+
'group' => 'address',
|
171 |
+
),
|
172 |
+
);
|
173 |
+
|
174 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_service, $vars['customVars']) && is_array($vars['customVars'][$this->_service])) {
|
175 |
+
$vars['customVars'][$this->_service] = array_merge($vars['customVars'][$this->_service], $array);
|
176 |
+
} else {
|
177 |
+
$vars['customVars'][$this->_service] = $array;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
/* deprecated function from v4.7.0*/
|
182 |
+
protected function _addBankAccountVars(&$vars)
|
183 |
+
{
|
184 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
185 |
+
|
186 |
+
$array = array(
|
187 |
+
'Type' => array(
|
188 |
+
'value' => 'DOM',
|
189 |
+
'group' => 'bankaccount',
|
190 |
+
),
|
191 |
+
'DomesticAccountHolderName' => array(
|
192 |
+
'value' => $additionalFields['DOM']['accountHolder'],
|
193 |
+
'group' => 'bankaccount',
|
194 |
+
),
|
195 |
+
'DomesticCountry' => array(
|
196 |
+
'value' => 528,
|
197 |
+
'group' => 'bankaccount',
|
198 |
+
),
|
199 |
+
'DomesticBankIdentifier' => array(
|
200 |
+
'value' => $additionalFields['DOM']['bankId'],
|
201 |
+
'group' => 'bankaccount',
|
202 |
+
),
|
203 |
+
'DomesticAccountNumber' => array(
|
204 |
+
'value' => $additionalFields['DOM']['accountNumber'],
|
205 |
+
'group' => 'bankaccount',
|
206 |
+
),
|
207 |
+
'Collect' => array(
|
208 |
+
'value' => 1,
|
209 |
+
'group' => 'bankaccount',
|
210 |
+
),
|
211 |
+
);
|
212 |
+
|
213 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_service, $vars['customVars']) && is_array($vars['customVars'][$this->_service])) {
|
214 |
+
$vars['customVars'][$this->_service] = array_merge($vars['customVars'][$this->_service], $array);
|
215 |
+
} else {
|
216 |
+
$vars['customVars'][$this->_service] = $array;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
221 |
+
{
|
222 |
+
if($this->_isChosenMethod($observer) === false) {
|
223 |
+
return $this;
|
224 |
+
}
|
225 |
+
|
226 |
+
$request = $observer->getRequest();
|
227 |
+
|
228 |
+
$codeBits = explode('_', $this->_code);
|
229 |
+
$code = end($codeBits);
|
230 |
+
$request->setMethod($code);
|
231 |
+
|
232 |
+
return $this;
|
233 |
+
}
|
234 |
+
|
235 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
236 |
+
{
|
237 |
+
if($this->_isChosenMethod($observer) === false) {
|
238 |
+
return $this;
|
239 |
+
}
|
240 |
+
|
241 |
+
$refundRequest = $observer->getRequest();
|
242 |
+
|
243 |
+
$vars = $refundRequest->getVars();
|
244 |
+
|
245 |
+
$array = array(
|
246 |
+
'action' => 'Refund',
|
247 |
+
'version' => 1,
|
248 |
+
);
|
249 |
+
|
250 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
251 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
252 |
+
} else {
|
253 |
+
$vars['services'][$this->_method] = $array;
|
254 |
+
}
|
255 |
+
|
256 |
+
$refundRequest->setVars($vars);
|
257 |
+
|
258 |
+
return $this;
|
259 |
+
}
|
260 |
+
|
261 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
262 |
+
{
|
263 |
+
if($this->_isChosenMethod($observer) === false) {
|
264 |
+
return $this;
|
265 |
+
}
|
266 |
+
|
267 |
+
return $this;
|
268 |
+
}
|
269 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Empayment_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_empayment';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_empayment_checkout_form';
|
11 |
+
|
12 |
+
public function getOrderPlaceRedirectUrl()
|
13 |
+
{
|
14 |
+
return parent::getOrderPlaceRedirectUrl();
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Eps_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_eps';
|
5 |
+
protected $_method = 'eps';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
//not implemented yet
|
25 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
26 |
+
$array['creditmanagement'] = array(
|
27 |
+
'action' => 'Invoice',
|
28 |
+
'version' => 1,
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
33 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
34 |
+
} else {
|
35 |
+
$vars['services'] = $array;
|
36 |
+
}
|
37 |
+
|
38 |
+
$request->setVars($vars);
|
39 |
+
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
44 |
+
{
|
45 |
+
if($this->_isChosenMethod($observer) === false) {
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
$request = $observer->getRequest();
|
50 |
+
$this->_billingInfo = $request->getBillingInfo();
|
51 |
+
$this->_order = $request->getOrder();
|
52 |
+
|
53 |
+
$vars = $request->getVars();
|
54 |
+
|
55 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
56 |
+
$this->_addCustomerVariables($vars);
|
57 |
+
$this->_addCreditManagement($vars);
|
58 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
59 |
+
}
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
@@ -0,0 +1,11 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Eps_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Giftcards_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_giftcards';
|
5 |
+
protected $_method = 'giftcards';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array();
|
18 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
19 |
+
$array['creditmanagement'] = array(
|
20 |
+
'action' => 'Invoice',
|
21 |
+
'version' => 1,
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
26 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
27 |
+
} else {
|
28 |
+
$vars['services'] = $array;
|
29 |
+
}
|
30 |
+
|
31 |
+
$request->setVars($vars);
|
32 |
+
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
37 |
+
{
|
38 |
+
if($this->_isChosenMethod($observer) === false) {
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
$request = $observer->getRequest();
|
43 |
+
$vars = $request->getVars();
|
44 |
+
|
45 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
46 |
+
$this->_addCustomerVariables($vars);
|
47 |
+
$this->_addCreditManagement($vars);
|
48 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
49 |
+
}
|
50 |
+
|
51 |
+
$availableCards = Mage::getStoreConfig('buckaroo/buckaroo3extended_giftcards/cards_allowed', Mage::app()->getStore()->getId());
|
52 |
+
if (empty($availableCards)) {
|
53 |
+
Mage::throwException('no giftcards available');
|
54 |
+
}
|
55 |
+
$availableCards .= ',ideal';
|
56 |
+
|
57 |
+
$array = array(
|
58 |
+
'servicesSelectableByClient' => $availableCards,
|
59 |
+
'continueOnImcomplete' => 'RedirectToHTML',
|
60 |
+
);
|
61 |
+
|
62 |
+
if (array_key_exists('customVars', $vars)) {
|
63 |
+
$vars['customVars'] = array_merge($vars['customVars'], $array);
|
64 |
+
} else {
|
65 |
+
$vars['customVars'] = $array;
|
66 |
+
}
|
67 |
+
|
68 |
+
$request->setVars($vars);
|
69 |
+
|
70 |
+
return $this;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
74 |
+
{
|
75 |
+
if($this->_isChosenMethod($observer) === false) {
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
$request = $observer->getRequest();
|
80 |
+
|
81 |
+
$codeBits = explode('_', $this->_code);
|
82 |
+
$code = end($codeBits);
|
83 |
+
$request->setMethod($code);
|
84 |
+
|
85 |
+
return $this;
|
86 |
+
}
|
87 |
+
|
88 |
+
protected function _isChosenMethod($observer)
|
89 |
+
{
|
90 |
+
$ret = false;
|
91 |
+
|
92 |
+
$chosenMethod = $observer->getOrder()->getPayment()->getMethod();
|
93 |
+
|
94 |
+
if ($chosenMethod === $this->_code) {
|
95 |
+
$ret = true;
|
96 |
+
}
|
97 |
+
return $ret;
|
98 |
+
}
|
99 |
+
|
100 |
+
public function buckaroo3extended_push_custom_processing($observer)
|
101 |
+
{
|
102 |
+
if($this->_isChosenMethod($observer) === false) {
|
103 |
+
return $this;
|
104 |
+
}
|
105 |
+
|
106 |
+
$push = $observer->getPush();
|
107 |
+
$postData = $push->getPostArray();
|
108 |
+
if (!empty($postData['brq_relatedtransaction_partialpayment'])) {
|
109 |
+
$order = $observer->getOrder();
|
110 |
+
if ($postData['brq_amount'] < $order->getGrandTotal()) {
|
111 |
+
$order->setTransactionKey($postData['brq_relatedtransaction_partialpayment']);
|
112 |
+
|
113 |
+
$processingPaymentStatus = Mage::getStoreConfig('buckaroo/buckaroo3extended_giftcards/order_status_giftcard', Mage::app()->getStore()->getStoreId());
|
114 |
+
if (!empty($processingPaymentStatus)) {
|
115 |
+
$order->setStatus($processingPaymentStatus);
|
116 |
+
}
|
117 |
+
|
118 |
+
$order->save();
|
119 |
+
$push->setCustomResponseProcessing(true);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
public function buckaroo3extended_return_custom_processing($observer)
|
126 |
+
{
|
127 |
+
if($this->_isChosenMethod($observer) === false) {
|
128 |
+
return $this;
|
129 |
+
}
|
130 |
+
|
131 |
+
$return = $observer->getReturn();
|
132 |
+
$postData = $return->getPostArray();
|
133 |
+
$order = $observer->getOrder();
|
134 |
+
$code = $order->getPayment()->getMethodInstance()->getCode();
|
135 |
+
if ($code == 'buckaroo3extended_giftcards' && $postData['brq_statuscode'] == 190 && $postData['brq_amount'] < $order->getGrandTotal()){
|
136 |
+
$return->setCustomResponseProcessing(true);
|
137 |
+
$return->customSuccess();
|
138 |
+
}
|
139 |
+
|
140 |
+
if ($code == 'buckaroo3extended_giftcards' && $postData['brq_statuscode'] == 890 && $postData['brq_amount'] < $order->getGrandTotal()) {
|
141 |
+
$return->setCustomResponseProcessing(true);
|
142 |
+
$return->customFailed();
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
+
}
|
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Giftcards_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_giftcards';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_giftcards_checkout_form';
|
11 |
+
|
12 |
+
protected $_canRefund = false;
|
13 |
+
protected $_canRefundInvoicePartial = false;
|
14 |
+
}
|
@@ -0,0 +1,147 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Giropay_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_giropay';
|
5 |
+
protected $_method = 'giropay';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 2,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$bic = $this->_getBic();
|
61 |
+
$array = array(
|
62 |
+
'bic' => $bic,
|
63 |
+
);
|
64 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
65 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
66 |
+
} else {
|
67 |
+
$vars['customVars'][$this->_method] = $array;
|
68 |
+
}
|
69 |
+
|
70 |
+
$request->setVars($vars);
|
71 |
+
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
76 |
+
{
|
77 |
+
if($this->_isChosenMethod($observer) === false) {
|
78 |
+
return $this;
|
79 |
+
}
|
80 |
+
|
81 |
+
$request = $observer->getRequest();
|
82 |
+
|
83 |
+
$codeBits = explode('_', $this->_code);
|
84 |
+
$code = end($codeBits);
|
85 |
+
$request->setMethod($code);
|
86 |
+
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
protected function _getBic()
|
91 |
+
{
|
92 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
93 |
+
$bic = $additionalFields['bic'];
|
94 |
+
|
95 |
+
return $bic;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
99 |
+
{
|
100 |
+
if($this->_isChosenMethod($observer) === false) {
|
101 |
+
return $this;
|
102 |
+
}
|
103 |
+
|
104 |
+
$request = $observer->getRequest();
|
105 |
+
|
106 |
+
$codeBits = explode('_', $this->_code);
|
107 |
+
$code = end($codeBits);
|
108 |
+
$request->setMethod($code);
|
109 |
+
|
110 |
+
return $this;
|
111 |
+
}
|
112 |
+
|
113 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
114 |
+
{
|
115 |
+
if($this->_isChosenMethod($observer) === false) {
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
|
119 |
+
$refundRequest = $observer->getRequest();
|
120 |
+
|
121 |
+
$vars = $refundRequest->getVars();
|
122 |
+
|
123 |
+
$array = array(
|
124 |
+
'action' => 'Refund',
|
125 |
+
'version' => 1,
|
126 |
+
);
|
127 |
+
|
128 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
129 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
130 |
+
} else {
|
131 |
+
$vars['services'][$this->_method] = $array;
|
132 |
+
}
|
133 |
+
|
134 |
+
$refundRequest->setVars($vars);
|
135 |
+
|
136 |
+
return $this;
|
137 |
+
}
|
138 |
+
|
139 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
140 |
+
{
|
141 |
+
if($this->_isChosenMethod($observer) === false) {
|
142 |
+
return $this;
|
143 |
+
}
|
144 |
+
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
}
|
@@ -0,0 +1,25 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Giropay_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_giropay';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_giropay_checkout_form';
|
11 |
+
|
12 |
+
public function getOrderPlaceRedirectUrl()
|
13 |
+
{
|
14 |
+
$session = Mage::getSingleton('checkout/session');
|
15 |
+
|
16 |
+
if(isset($_POST[$this->_code.'_BPE_Bic']))
|
17 |
+
{
|
18 |
+
$session->setData('additionalFields', array(
|
19 |
+
'bic' => $_POST[$this->_code.'_BPE_Bic'],
|
20 |
+
));
|
21 |
+
}
|
22 |
+
|
23 |
+
return Mage::getUrl('buckaroo3extended/checkout/checkout', array('_secure' => true, 'method' => $this->_code));
|
24 |
+
}
|
25 |
+
}
|
@@ -0,0 +1,165 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
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o3extended_ideal';
|
5 |
+
protected $_method = 'ideal';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
$serviceVersion = $this->_getServiceVersion();
|
17 |
+
|
18 |
+
$array = array(
|
19 |
+
$this->_method => array(
|
20 |
+
'action' => 'Pay',
|
21 |
+
'version' => $serviceVersion,
|
22 |
+
),
|
23 |
+
);
|
24 |
+
|
25 |
+
$order = $request->getOrder();
|
26 |
+
$order->setBuckarooServiceVersionUsed($serviceVersion)
|
27 |
+
->save();
|
28 |
+
|
29 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
30 |
+
$array['creditmanagement'] = array(
|
31 |
+
'action' => 'Invoice',
|
32 |
+
'version' => 1,
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
37 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
38 |
+
} else {
|
39 |
+
$vars['services'] = $array;
|
40 |
+
}
|
41 |
+
|
42 |
+
$request->setVars($vars);
|
43 |
+
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
48 |
+
{
|
49 |
+
if($this->_isChosenMethod($observer) === false) {
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
$request = $observer->getRequest();
|
54 |
+
$this->_billingInfo = $request->getBillingInfo();
|
55 |
+
$this->_order = $request->getOrder();
|
56 |
+
|
57 |
+
$vars = $request->getVars();
|
58 |
+
|
59 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
60 |
+
$this->_addCustomerVariables($vars);
|
61 |
+
$this->_addCreditManagement($vars);
|
62 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
63 |
+
}
|
64 |
+
|
65 |
+
$issuer = $this->_getIssuer();
|
66 |
+
$array = array(
|
67 |
+
'issuer' => $issuer,
|
68 |
+
);
|
69 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
70 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
71 |
+
} else {
|
72 |
+
$vars['customVars'][$this->_method] = $array;
|
73 |
+
}
|
74 |
+
|
75 |
+
$request->setVars($vars);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
protected function _isChosenMethod($observer)
|
96 |
+
{
|
97 |
+
$ret = false;
|
98 |
+
|
99 |
+
$chosenMethod = $observer->getOrder()->getPayment()->getMethod();
|
100 |
+
|
101 |
+
if ($chosenMethod === $this->_code) {
|
102 |
+
$ret = true;
|
103 |
+
}
|
104 |
+
return $ret;
|
105 |
+
}
|
106 |
+
|
107 |
+
protected function _getIssuer()
|
108 |
+
{
|
109 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
110 |
+
$issuer = $additionalFields['Issuer'];
|
111 |
+
|
112 |
+
return $issuer;
|
113 |
+
}
|
114 |
+
|
115 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
116 |
+
{
|
117 |
+
if($this->_isChosenMethod($observer) === false) {
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
$request = $observer->getRequest();
|
122 |
+
|
123 |
+
$codeBits = explode('_', $this->_code);
|
124 |
+
$code = end($codeBits);
|
125 |
+
$request->setMethod($code);
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
131 |
+
{
|
132 |
+
if($this->_isChosenMethod($observer) === false) {
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
$refundRequest = $observer->getRequest();
|
137 |
+
|
138 |
+
$vars = $refundRequest->getVars();
|
139 |
+
$serviceVersion = $this->_getRefundServiceVersion($refundRequest->getOrder());
|
140 |
+
|
141 |
+
$array = array(
|
142 |
+
'action' => 'Refund',
|
143 |
+
'version' => $serviceVersion,
|
144 |
+
);
|
145 |
+
|
146 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
147 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
148 |
+
} else {
|
149 |
+
$vars['services'][$this->_method] = $array;
|
150 |
+
}
|
151 |
+
|
152 |
+
$refundRequest->setVars($vars);
|
153 |
+
|
154 |
+
return $this;
|
155 |
+
}
|
156 |
+
|
157 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
158 |
+
{
|
159 |
+
if($this->_isChosenMethod($observer) === false) {
|
160 |
+
return $this;
|
161 |
+
}
|
162 |
+
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
}
|
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Ideal_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_ideal';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_ideal_checkout_form';
|
11 |
+
|
12 |
+
public function getOrderPlaceRedirectUrl()
|
13 |
+
{
|
14 |
+
$session = Mage::getSingleton('checkout/session');
|
15 |
+
|
16 |
+
if(isset($_POST[$this->_code.'_BPE_Issuer']))
|
17 |
+
{
|
18 |
+
$session->setData('additionalFields', array('Issuer' => $_POST['buckaroo3extended_ideal_BPE_Issuer']));
|
19 |
+
}
|
20 |
+
|
21 |
+
return parent::getOrderPlaceRedirectUrl();
|
22 |
+
}
|
23 |
+
}
|
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Maestro_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_maestro';
|
5 |
+
protected $_method = 'maestro';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Maestro_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'CZK',
|
12 |
+
'DKK',
|
13 |
+
'EUR',
|
14 |
+
'GBP',
|
15 |
+
'HRK',
|
16 |
+
'ISK',
|
17 |
+
'JPY',
|
18 |
+
'LTL',
|
19 |
+
'LVL',
|
20 |
+
'MXN',
|
21 |
+
'NOK',
|
22 |
+
'NZD',
|
23 |
+
'PLN',
|
24 |
+
'RUB',
|
25 |
+
'SEK',
|
26 |
+
'TRY',
|
27 |
+
'USD',
|
28 |
+
'ZAR',
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $_code = 'buckaroo3extended_maestro';
|
32 |
+
|
33 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_maestro_checkout_form';
|
34 |
+
}
|
@@ -0,0 +1,178 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Mastercard_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_mastercard';
|
5 |
+
protected $_method = 'mastercard';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function buckaroo3extended_return_custom_processing(Varien_Event_Observer $observer)
|
131 |
+
{
|
132 |
+
if($this->_isChosenMethod($observer) === false) {
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
$response = $observer->getPostArray();
|
137 |
+
$order = $observer->getOrder();
|
138 |
+
|
139 |
+
$enrolled = false;
|
140 |
+
$authenticated = false;
|
141 |
+
if (isset($response['brq_SERVICE_mastercard_Enrolled']) && isset($response['brq_SERVICE_mastercard_Authentication'])) {
|
142 |
+
$enrolled = $response['brq_SERVICE_mastercard_Enrolled'];
|
143 |
+
$enrolled = ($enrolled == 'Y') ? true : false;
|
144 |
+
|
145 |
+
$authenticated = $response['brq_SERVICE_mastercard_Authentication'];
|
146 |
+
$authenticated = ($authenticated == 'Y') ? true : false;
|
147 |
+
}
|
148 |
+
|
149 |
+
$order->setBuckarooSecureEnrolled($enrolled)
|
150 |
+
->setBuckarooSecureAuthenticated($authenticated)
|
151 |
+
->save();
|
152 |
+
|
153 |
+
if ($order->getTransactionKey()) {
|
154 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
155 |
+
}
|
156 |
+
|
157 |
+
return $this;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function buckaroo3extended_push_custom_processing_after(Varien_Event_Observer $observer)
|
161 |
+
{
|
162 |
+
if($this->_isChosenMethod($observer) === false) {
|
163 |
+
return $this;
|
164 |
+
}
|
165 |
+
|
166 |
+
$order = $observer->getOrder();
|
167 |
+
$enrolled = $order->getBuckarooSecureEnrolled();
|
168 |
+
$authenticated = $order->getBuckarooSecureAuthenticated();
|
169 |
+
|
170 |
+
if (is_null($enrolled) || is_null($authenticated)) {
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
175 |
+
|
176 |
+
return $this;
|
177 |
+
}
|
178 |
+
}
|
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Mastercard_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'CZK',
|
12 |
+
'DKK',
|
13 |
+
'EUR',
|
14 |
+
'GBP',
|
15 |
+
'HRK',
|
16 |
+
'ISK',
|
17 |
+
'JPY',
|
18 |
+
'LTL',
|
19 |
+
'LVL',
|
20 |
+
'MXN',
|
21 |
+
'NOK',
|
22 |
+
'NZD',
|
23 |
+
'PLN',
|
24 |
+
'RUB',
|
25 |
+
'SEK',
|
26 |
+
'TRY',
|
27 |
+
'USD',
|
28 |
+
'ZAR',
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $_code = 'buckaroo3extended_mastercard';
|
32 |
+
|
33 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_mastercard_checkout_form';
|
34 |
+
}
|
@@ -0,0 +1,196 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Onlinegiro_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_onlinegiro';
|
5 |
+
protected $_method = 'onlinegiro';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'PaymentInvitation',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin()) {
|
61 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
62 |
+
} else {
|
63 |
+
$additionalFields = Mage::getSingleton('core/session')->getData('additionalFields');
|
64 |
+
}
|
65 |
+
|
66 |
+
if (is_array($additionalFields)
|
67 |
+
&& array_key_exists('gender', $additionalFields)
|
68 |
+
&& array_key_exists('mail', $additionalFields)
|
69 |
+
&& array_key_exists('firstname', $additionalFields)
|
70 |
+
&& array_key_exists('lastname', $additionalFields)
|
71 |
+
) {
|
72 |
+
$array = array(
|
73 |
+
'customergender' => $additionalFields['gender'],
|
74 |
+
'CustomerEmail' => $additionalFields['mail'],
|
75 |
+
'CustomerFirstName' => $additionalFields['firstname'],
|
76 |
+
'CustomerLastName' => $additionalFields['lastname'],
|
77 |
+
);
|
78 |
+
} else {
|
79 |
+
$array = array();
|
80 |
+
}
|
81 |
+
|
82 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
83 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
84 |
+
} else {
|
85 |
+
$vars['customVars'][$this->_method] = $array;
|
86 |
+
}
|
87 |
+
$request->setVars($vars);
|
88 |
+
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
93 |
+
{
|
94 |
+
if($this->_isChosenMethod($observer) === false) {
|
95 |
+
return $this;
|
96 |
+
}
|
97 |
+
|
98 |
+
$request = $observer->getRequest();
|
99 |
+
|
100 |
+
$codeBits = explode('_', $this->_code);
|
101 |
+
$code = end($codeBits);
|
102 |
+
$request->setMethod($code);
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* While onlinegiro is the paymentmethod for this transaction, the transation is actually completed using another paymentmethod.
|
109 |
+
* This observer stores that paymentmethod in the database. This is currently only used for online refunds.
|
110 |
+
*
|
111 |
+
* @param Varien_Event_Observer $observer
|
112 |
+
*/
|
113 |
+
public function buckaroo3extended_push_custom_processing(Varien_Event_Observer $observer)
|
114 |
+
{
|
115 |
+
if($this->_isChosenMethod($observer) === false) {
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
|
119 |
+
$push = $observer->getPush();
|
120 |
+
$order = $observer->getOrder();
|
121 |
+
$postArray = $push->getPostArray();
|
122 |
+
|
123 |
+
if (
|
124 |
+
isset($postArray['brq_payment_method'])
|
125 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
126 |
+
&& $postArray['brq_statuscode'] == '190'
|
127 |
+
)
|
128 |
+
{
|
129 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_payment_method']);
|
130 |
+
} elseif (
|
131 |
+
isset($postArray['brq_transaction_method'])
|
132 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
133 |
+
&& $postArray['brq_statuscode'] == '190'
|
134 |
+
)
|
135 |
+
{
|
136 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_transaction_method']);
|
137 |
+
}
|
138 |
+
$order->save();
|
139 |
+
|
140 |
+
//if set to true, the push processing will be stopped here. Needs to be set to false, to make
|
141 |
+
//sure the order is still updated.
|
142 |
+
$push->setCustomResponseProcessing(false);
|
143 |
+
|
144 |
+
return $this;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
148 |
+
{
|
149 |
+
if($this->_isChosenMethod($observer) === false) {
|
150 |
+
return $this;
|
151 |
+
}
|
152 |
+
|
153 |
+
$request = $observer->getRequest();
|
154 |
+
|
155 |
+
$codeBits = explode('_', $this->_code);
|
156 |
+
$code = end($codeBits);
|
157 |
+
$request->setMethod($code);
|
158 |
+
|
159 |
+
return $this;
|
160 |
+
}
|
161 |
+
|
162 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
163 |
+
{
|
164 |
+
if($this->_isChosenMethod($observer) === false) {
|
165 |
+
return $this;
|
166 |
+
}
|
167 |
+
|
168 |
+
$refundRequest = $observer->getRequest();
|
169 |
+
|
170 |
+
$vars = $refundRequest->getVars();
|
171 |
+
|
172 |
+
$array = array(
|
173 |
+
'action' => 'Refund',
|
174 |
+
'version' => 1,
|
175 |
+
);
|
176 |
+
|
177 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
178 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
179 |
+
} else {
|
180 |
+
$vars['services'][$this->_method] = $array;
|
181 |
+
}
|
182 |
+
|
183 |
+
$refundRequest->setVars($vars);
|
184 |
+
|
185 |
+
return $this;
|
186 |
+
}
|
187 |
+
|
188 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
189 |
+
{
|
190 |
+
if($this->_isChosenMethod($observer) === false) {
|
191 |
+
return $this;
|
192 |
+
}
|
193 |
+
|
194 |
+
return $this;
|
195 |
+
}
|
196 |
+
}
|
@@ -0,0 +1,31 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Onlinegiro_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_onlinegiro';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_onlinegiro_checkout_form';
|
11 |
+
|
12 |
+
protected $_canUseInternal = true;
|
13 |
+
|
14 |
+
public function assignData($data)
|
15 |
+
{
|
16 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin()) {
|
17 |
+
$session = Mage::getSingleton('checkout/session');
|
18 |
+
} else {
|
19 |
+
$session = Mage::getSingleton('core/session');
|
20 |
+
}
|
21 |
+
|
22 |
+
$session->setData('additionalFields', array(
|
23 |
+
'gender' => $_POST['buckaroo3extended_onlinegiro_BPE_Customergender'],
|
24 |
+
'firstname' => $_POST['buckaroo3extended_onlinegiro_BPE_Customerfirstname'],
|
25 |
+
'lastname' => $_POST['buckaroo3extended_onlinegiro_BPE_Customerlastname'],
|
26 |
+
'mail' => $_POST['buckaroo3extended_onlinegiro_BPE_Customermail'],
|
27 |
+
));
|
28 |
+
|
29 |
+
return parent::assignData($data);
|
30 |
+
}
|
31 |
+
}
|
@@ -0,0 +1,235 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod extends Mage_Payment_Model_Method_Abstract
|
24 |
+
{
|
25 |
+
public $allowedCurrencies = array();
|
26 |
+
|
27 |
+
protected $_isGateway = true;
|
28 |
+
protected $_canAuthorize = true;
|
29 |
+
protected $_canCapture = true;
|
30 |
+
protected $_canCapturePartial = true;
|
31 |
+
protected $_canRefund = true;
|
32 |
+
protected $_canRefundInvoicePartial = true;
|
33 |
+
protected $_canVoid = true;
|
34 |
+
protected $_canUseInternal = false;
|
35 |
+
protected $_canUseCheckout = true;
|
36 |
+
protected $_canUseForMultishipping = false;
|
37 |
+
protected $_canSaveCc = false;
|
38 |
+
|
39 |
+
protected $_payment;
|
40 |
+
|
41 |
+
public function setPayment($payment)
|
42 |
+
{
|
43 |
+
$this->_payment = $payment;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getPayment()
|
47 |
+
{
|
48 |
+
return $this->_payment;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getAllowedCurrencies()
|
52 |
+
{
|
53 |
+
return $this->allowedCurrencies;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function setAllowedCurrencies($allowedCurrencies)
|
57 |
+
{
|
58 |
+
$this->allowedCurrencies = $allowedCurrencies;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getOrderPlaceRedirectUrl()
|
62 |
+
{
|
63 |
+
return Mage::getUrl('buckaroo3extended/checkout/checkout', array('_secure' => true, 'method' => $this->_code));
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getTitle()
|
67 |
+
{
|
68 |
+
if(Mage::helper('buckaroo3extended')->getIsKlarnaEnabled()) {
|
69 |
+
return parent::getTitle();
|
70 |
+
}
|
71 |
+
|
72 |
+
if (!Mage::helper('buckaroo3extended')->isOneStepCheckout()) {
|
73 |
+
return parent::getTitle();
|
74 |
+
}
|
75 |
+
|
76 |
+
$block = Mage::app()
|
77 |
+
->getLayout()
|
78 |
+
->createBlock('buckaroo3extended/paymentMethods_ideal_checkout_form')
|
79 |
+
->setMethod($this);
|
80 |
+
|
81 |
+
$title = parent::getTitle() . ' ' . $block->getMethodLabelAfterHtml(false);
|
82 |
+
|
83 |
+
return $title;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function refund(Varien_Object $payment, $amount)
|
87 |
+
{
|
88 |
+
if (!$this->canRefund() || !$this->isRefundAvailable($payment)) {
|
89 |
+
Mage::throwException($this->_getHelper()->__('Refund action is not available.'));
|
90 |
+
}
|
91 |
+
|
92 |
+
$refundRequest = Mage::getModel(
|
93 |
+
'buckaroo3extended/refund_request_abstract',
|
94 |
+
array(
|
95 |
+
'payment' => $payment,
|
96 |
+
'amount' => $amount
|
97 |
+
)
|
98 |
+
);
|
99 |
+
|
100 |
+
try {
|
101 |
+
$refundRequest->sendRefundRequest();
|
102 |
+
$this->setPayment($refundRequest->getPayment());
|
103 |
+
} catch (Exception $e) {
|
104 |
+
Mage::helper('buckaroo3extended')->logException($e);
|
105 |
+
Mage::throwException($e->getMessage());
|
106 |
+
}
|
107 |
+
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function isRefundAvailable($payment)
|
112 |
+
{
|
113 |
+
if (!$payment->getOrder()->getTransactionKey()) {
|
114 |
+
Mage::getSingleton('adminhtml/session')
|
115 |
+
->addError(
|
116 |
+
Mage::helper('buckaroo3extended')->__(
|
117 |
+
'The order is missing a transaction key. Possibly this order was created using an older version of the Buckaroo module that did not yet support refunding.'
|
118 |
+
)
|
119 |
+
);
|
120 |
+
throw new Exception('The order is missing a transaction key. Possibly this order was created using an older version of the Buckaroo module that did not yet support refunding.');
|
121 |
+
return false;
|
122 |
+
}
|
123 |
+
|
124 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_refund/active', Mage::app()->getStore()->getStoreId())) {
|
125 |
+
Mage::getSingleton('adminhtml/session')
|
126 |
+
->addError(
|
127 |
+
Mage::helper('buckaroo3extended')->__(
|
128 |
+
'Buckaroo refunding is currently disabled in the configuration menu.'
|
129 |
+
)
|
130 |
+
);
|
131 |
+
throw new Exception('Buckaroo refunding is currently disabled in the configuration menu.');
|
132 |
+
return false;
|
133 |
+
}
|
134 |
+
|
135 |
+
return true;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function isAvailable($quote = null)
|
139 |
+
{
|
140 |
+
if(is_null($quote) || Mage::helper('buckaroo3extended')->isAdmin()){
|
141 |
+
// Uncomment this code to get all active Buckaroo payment methods in the backend. (3th party extensions)
|
142 |
+
if(Mage::getStoreConfigFlag('buckaroo/' . $this->_code . '/active', Mage::app()->getStore()->getId())){
|
143 |
+
return true;
|
144 |
+
}
|
145 |
+
return false;
|
146 |
+
}
|
147 |
+
|
148 |
+
//check if the country specified in the billing address is allowed to use this payment method
|
149 |
+
if (Mage::getStoreConfig('buckaroo/' . $this->_code . '/allowspecific', $quote->getStoreId()) == 1
|
150 |
+
&& $quote->getBillingAddress()->getCountry())
|
151 |
+
{
|
152 |
+
$allowedCountries = explode(',',Mage::getStoreConfig('buckaroo/' . $this->_code . '/specificcountry', $quote->getStoreId()));
|
153 |
+
$country = $quote->getBillingAddress()->getCountry();
|
154 |
+
|
155 |
+
if (!in_array($country,$allowedCountries)) {
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
$areaAllowed = null;
|
161 |
+
if ($this->canUseInternal()) {
|
162 |
+
$areaAllowed = Mage::getStoreConfig('buckaroo/' . $this->_code . '/area', $quote->getStoreId());
|
163 |
+
}
|
164 |
+
|
165 |
+
//check if the paymentmethod is available in the current shop area (frontend or backend)
|
166 |
+
if ($areaAllowed == 'backend'
|
167 |
+
&& !Mage::helper('buckaroo3extended')->isAdmin()
|
168 |
+
) {
|
169 |
+
return false;
|
170 |
+
} elseif ($areaAllowed == 'frontend'
|
171 |
+
&& Mage::helper('buckaroo3extended')->isAdmin()
|
172 |
+
) {
|
173 |
+
return false;
|
174 |
+
}
|
175 |
+
|
176 |
+
// check if max amount for the issued PaymentMethod is set and if the quote basegrandtotal exceeds that
|
177 |
+
$maxAmount = Mage::getStoreConfig('buckaroo/' . $this->_code . '/max_amount', $quote->getStoreId());
|
178 |
+
if (!empty($maxAmount)
|
179 |
+
&& !empty($quote)
|
180 |
+
&& $quote->getBaseGrandTotal() > $maxAmount)
|
181 |
+
{
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
// check if min amount for the issued PaymentMethod is set and if the quote basegrandtotal is less than that
|
186 |
+
$minAmount = Mage::getStoreConfig('buckaroo/' . $this->_code . '/min_amount', $quote->getStoreId());
|
187 |
+
if (!empty($minAmount)
|
188 |
+
&& !empty($quote)
|
189 |
+
&& $quote->getBaseGrandTotal() < $minAmount)
|
190 |
+
{
|
191 |
+
return false;
|
192 |
+
}
|
193 |
+
|
194 |
+
//check if the module is set to enabled
|
195 |
+
if (!Mage::getStoreConfig('buckaroo/' . $this->_code . '/active', $quote->getStoreId())) {
|
196 |
+
return false;
|
197 |
+
}
|
198 |
+
|
199 |
+
//limit by ip
|
200 |
+
if (mage::getStoreConfig('dev/restrict/allow_ips') && Mage::getStoreConfig('buckaroo/' . $this->_code . '/limit_by_ip'))
|
201 |
+
{
|
202 |
+
$allowedIp = explode(',', mage::getStoreConfig('dev/restrict/allow_ips'));
|
203 |
+
if (!in_array(Mage::helper('core/http')->getRemoteAddr(), $allowedIp))
|
204 |
+
{
|
205 |
+
return false;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
|
209 |
+
// get current currency code
|
210 |
+
$currency = Mage::app()->getStore()->getBaseCurrencyCode();
|
211 |
+
|
212 |
+
|
213 |
+
// currency is not available for this module
|
214 |
+
if (!in_array($currency, $this->allowedCurrencies))
|
215 |
+
{
|
216 |
+
return false;
|
217 |
+
}
|
218 |
+
|
219 |
+
return TIG_Buckaroo3Extended_Model_Request_Availability::canUseBuckaroo($quote);
|
220 |
+
}
|
221 |
+
|
222 |
+
public function filterAccount($accountNumber)
|
223 |
+
{
|
224 |
+
$filteredAccount = str_replace('.', '', $accountNumber);
|
225 |
+
|
226 |
+
return $filteredAccount;
|
227 |
+
}
|
228 |
+
|
229 |
+
public function saveAdditionalData($response)
|
230 |
+
{
|
231 |
+
// child modules will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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Paymentguarantee_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
24 |
+
{
|
25 |
+
protected $_code = 'buckaroo3extended_paymentguarantee';
|
26 |
+
protected $_method = 'paymentguarantee';
|
27 |
+
|
28 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
29 |
+
{
|
30 |
+
if($this->_isChosenMethod($observer) === false) {
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
$request = $observer->getRequest();
|
35 |
+
|
36 |
+
$vars = $request->getVars();
|
37 |
+
|
38 |
+
$array = array(
|
39 |
+
$this->_method => array(
|
40 |
+
'action' => 'PaymentInvitation',
|
41 |
+
'version' => 1,
|
42 |
+
),
|
43 |
+
);
|
44 |
+
|
45 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
46 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
47 |
+
} else {
|
48 |
+
$vars['services'] = $array;
|
49 |
+
}
|
50 |
+
|
51 |
+
$request->setVars($vars);
|
52 |
+
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
57 |
+
{
|
58 |
+
if($this->_isChosenMethod($observer) === false) {
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
|
62 |
+
$request = $observer->getRequest();
|
63 |
+
$this->_billingInfo = $request->getBillingInfo();
|
64 |
+
$this->_order = $request->getOrder();
|
65 |
+
|
66 |
+
$vars = $request->getVars();
|
67 |
+
|
68 |
+
$this->_addCustomerVariables($vars, $this->_method);
|
69 |
+
$this->_addCreditManagement($vars, $this->_method);
|
70 |
+
$this->_addPaymentGuaranteeVariables($vars);
|
71 |
+
|
72 |
+
$additionalInformation = $this->_order->getPayment()->getMethodInstance()->getInfoInstance()->getAdditionalInformation();
|
73 |
+
if (
|
74 |
+
array_key_exists('checked_terms_and_conditions', $additionalInformation)
|
75 |
+
&& $additionalInformation['checked_terms_and_conditions'] === true
|
76 |
+
) {
|
77 |
+
$message = Mage::helper('buckaroo3extended')->__('Customer accepted terms and conditions.');
|
78 |
+
} else {
|
79 |
+
$message = Mage::helper('buckaroo3extended')->__('Customer did NOT accept the terms and conditions.');
|
80 |
+
}
|
81 |
+
$this->_order->addStatusHistoryComment($message)->save();
|
82 |
+
|
83 |
+
$request->setVars($vars);
|
84 |
+
|
85 |
+
return $this;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
89 |
+
{
|
90 |
+
if($this->_isChosenMethod($observer) === false) {
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
$request = $observer->getRequest();
|
95 |
+
|
96 |
+
$codeBits = explode('_', $this->_code);
|
97 |
+
$code = end($codeBits);
|
98 |
+
$request->setMethod($code);
|
99 |
+
|
100 |
+
return $this;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Custom push processing for Paymentguarantee. Because paymentguarantee orders should have been invoiced as
|
105 |
+
* soon as Buckaroo said that the guarantor had approved the transaction only a note should be added to the
|
106 |
+
* order.
|
107 |
+
*
|
108 |
+
* @param Varien_Event_Observer $observer
|
109 |
+
* @return $this
|
110 |
+
*/
|
111 |
+
public function buckaroo3extended_push_custom_processing(Varien_Event_Observer $observer)
|
112 |
+
{
|
113 |
+
if($this->_isChosenMethod($observer) === false) {
|
114 |
+
return $this;
|
115 |
+
}
|
116 |
+
|
117 |
+
$push = $observer->getPush();
|
118 |
+
$response = $observer->getResponse();
|
119 |
+
$order = $observer->getOrder();
|
120 |
+
$postArray = $push->getPostArray();
|
121 |
+
|
122 |
+
$push->addNote($response['message'], $this->_method);
|
123 |
+
|
124 |
+
if (
|
125 |
+
isset($postArray['brq_payment_method'])
|
126 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
127 |
+
&& $postArray['brq_statuscode'] == '190'
|
128 |
+
)
|
129 |
+
{
|
130 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_payment_method']);
|
131 |
+
} elseif (
|
132 |
+
isset($postArray['brq_transaction_method'])
|
133 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
134 |
+
&& $postArray['brq_statuscode'] == '190'
|
135 |
+
)
|
136 |
+
{
|
137 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_transaction_method']);
|
138 |
+
}
|
139 |
+
$order->save();
|
140 |
+
|
141 |
+
$push->setCustomResponseProcessing(true);
|
142 |
+
|
143 |
+
return $this;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Custom response processing for Paymentguarantee. Because paymentguarantee orders should be invoiced as soon
|
148 |
+
* as Buckaroo says that the guarantor has approved the transaction
|
149 |
+
*
|
150 |
+
* @param Varien_Event_Observer $observer
|
151 |
+
* @return $this
|
152 |
+
*/
|
153 |
+
public function buckaroo3extended_response_custom_processing(Varien_Event_Observer $observer)
|
154 |
+
{
|
155 |
+
if($this->_isChosenMethod($observer) === false) {
|
156 |
+
return $this;
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
$responseModel = $observer->getModel();
|
161 |
+
$response = $observer->getResponse();
|
162 |
+
$responseObject = $observer->getResponseobject();
|
163 |
+
|
164 |
+
//because this is an response through SOAP and is not used with pushes, the transaction key will be saved at the
|
165 |
+
//invoice. Only to make it possible to create an online refund for paymentguarantee payments
|
166 |
+
$transactionKey = '';
|
167 |
+
if(isset($responseObject->Key) && !empty($responseObject->Key)){
|
168 |
+
$transactionKey = $responseObject->Key;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* @var $pushModel TIG_Buckaroo3Extended_Model_Response_Push
|
173 |
+
*/
|
174 |
+
$pushModel = Mage::getModel(
|
175 |
+
'buckaroo3extended/response_push',
|
176 |
+
array(
|
177 |
+
'order' => $observer->getOrder(),
|
178 |
+
'postArray' => array(
|
179 |
+
'brq_statuscode' => $response['code'],
|
180 |
+
'brq_transactions' => $transactionKey,
|
181 |
+
),
|
182 |
+
'debugEmail' => $responseModel->getDebugEmail(),
|
183 |
+
'method' => $this->_method,
|
184 |
+
)
|
185 |
+
);
|
186 |
+
|
187 |
+
$newStates = $pushModel->getNewStates($response['status']);
|
188 |
+
|
189 |
+
switch ($response['status'])
|
190 |
+
{
|
191 |
+
case self::BUCKAROO_ERROR:
|
192 |
+
case self::BUCKAROO_FAILED: $updatedFailed = $pushModel->processFailed($newStates, $response['message']);
|
193 |
+
break;
|
194 |
+
case self::BUCKAROO_SUCCESS: $updatedSuccess = $pushModel->processSuccess($newStates, $response['message']);
|
195 |
+
break;
|
196 |
+
case self::BUCKAROO_NEUTRAL: $responseModel->_addNote($response['message']);
|
197 |
+
break;
|
198 |
+
case self::BUCKAROO_PENDING_PAYMENT: $updatedPendingPayment = $responseModel->processPendingPayment($newStates, $response['message']);
|
199 |
+
break;
|
200 |
+
case self::BUCKAROO_INCORRECT_PAYMENT: $updatedIncorrectPayment = $pushModel->processIncorrectPayment($newStates);
|
201 |
+
break;
|
202 |
+
}
|
203 |
+
|
204 |
+
$responseModel->setCustomResponseProcessing(true);
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Adds variables required for the SOAP XML for paymentguarantee to the variable array
|
209 |
+
* Will merge with old array if it exists
|
210 |
+
*
|
211 |
+
* @param array $vars
|
212 |
+
*/
|
213 |
+
protected function _addPaymentGuaranteeVariables(&$vars)
|
214 |
+
{
|
215 |
+
$dueDays = Mage::getStoreConfig('buckaroo/buckaroo3extended_paymentguarantee/duedate', Mage::app()->getStore()->getStoreId());
|
216 |
+
$dueDateInvoice = date('Y-m-d', mktime(0, 0, 0, date("m") , (date("d") + $dueDays), date("Y")));
|
217 |
+
$dueDate = date('Y-m-d', mktime(0, 0, 0, date("m") , (date("d") + $dueDays + 14), date("Y")));
|
218 |
+
|
219 |
+
$VAT = 0;
|
220 |
+
foreach($this->_order->getFullTaxInfo() as $taxRecord)
|
221 |
+
{
|
222 |
+
$VAT += $taxRecord['amount'];
|
223 |
+
}
|
224 |
+
|
225 |
+
$session = Mage::getSingleton('checkout/session');
|
226 |
+
$additionalFields = $session->getData('additionalFields');
|
227 |
+
|
228 |
+
$gender = $additionalFields['BPE_Customergender'];
|
229 |
+
$dob = $additionalFields['BPE_customerbirthdate'];
|
230 |
+
$accountNumber = $additionalFields['BPE_AccountNumber'];
|
231 |
+
|
232 |
+
$array = array(
|
233 |
+
'InvoiceDate' => $dueDateInvoice,
|
234 |
+
'DateDue' => $dueDate,
|
235 |
+
'AmountVat' => $VAT,
|
236 |
+
'CustomerGender' => $gender,
|
237 |
+
'CustomerBirthDate' => $dob,
|
238 |
+
'CustomerEmail' => $this->_billingInfo['email'],
|
239 |
+
'customeriban' => $accountNumber,
|
240 |
+
'PaymentMethodsAllowed' => $this->_getPaymentMethodsAllowed(),
|
241 |
+
'SendMail' => Mage::getStoreConfig('buckaroo/buckaroo3extended_'.$this->_method.'/sendmail', Mage::app()->getStore()->getId()) ? 'TRUE' : 'FALSE',
|
242 |
+
);
|
243 |
+
|
244 |
+
if (array_key_exists('customVars', $vars) && is_array($vars['customVars'][$this->_method])) {
|
245 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
246 |
+
} else {
|
247 |
+
$vars['customVars'][$this->_method] = $array;
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
252 |
+
{
|
253 |
+
if($this->_isChosenMethod($observer) === false) {
|
254 |
+
return $this;
|
255 |
+
}
|
256 |
+
|
257 |
+
$canRefund = Mage::getStoreConfig('buckaroo/buckaroo3extended_'.$this->_method.'/creditnote', Mage::app()->getStore()->getId());
|
258 |
+
|
259 |
+
if(!$canRefund){
|
260 |
+
Mage::getSingleton('core/session')->addNotice(
|
261 |
+
Mage::helper('buckaroo3extended')->__( "Currently the option to create a creditnote with a Paymentguarantee transaction is disabled." )
|
262 |
+
);
|
263 |
+
return $this;
|
264 |
+
}
|
265 |
+
$request = $observer->getRequest();
|
266 |
+
|
267 |
+
$codeBits = explode('_', $this->_code);
|
268 |
+
$code = end($codeBits);
|
269 |
+
$request->setMethod($code);
|
270 |
+
|
271 |
+
return $this;
|
272 |
+
}
|
273 |
+
|
274 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
275 |
+
{
|
276 |
+
if($this->_isChosenMethod($observer) === false) {
|
277 |
+
return $this;
|
278 |
+
}
|
279 |
+
|
280 |
+
$refundRequest = $observer->getRequest();
|
281 |
+
|
282 |
+
$vars = $refundRequest->getVars();
|
283 |
+
|
284 |
+
$array = array(
|
285 |
+
'action' => 'creditnote',
|
286 |
+
'version' => 1,
|
287 |
+
|
288 |
+
);
|
289 |
+
|
290 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
291 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
292 |
+
} else {
|
293 |
+
$vars['services'][$this->_method] = $array;
|
294 |
+
}
|
295 |
+
|
296 |
+
$refundRequest->setVars($vars);
|
297 |
+
|
298 |
+
return $this;
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* @param Varien_Event_Observer $observer
|
303 |
+
* @return $this
|
304 |
+
* @var $order Mage_Sales_Model_Order
|
305 |
+
*/
|
306 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
307 |
+
{
|
308 |
+
if($this->_isChosenMethod($observer) === false) {
|
309 |
+
return $this;
|
310 |
+
}
|
311 |
+
|
312 |
+
$refundRequest = $observer->getRequest();
|
313 |
+
$order = $observer->getOrder();
|
314 |
+
|
315 |
+
$vars = $refundRequest->getVars();
|
316 |
+
|
317 |
+
$tax = 0;
|
318 |
+
foreach($order->getFullTaxInfo() as $taxRecord)
|
319 |
+
{
|
320 |
+
$tax += $taxRecord['amount'];
|
321 |
+
}
|
322 |
+
$tax = round($tax ,2);
|
323 |
+
|
324 |
+
$array = array(
|
325 |
+
'OriginalInvoiceNumber' => $vars['orderId'],
|
326 |
+
'AmountVat' => $tax,
|
327 |
+
);
|
328 |
+
|
329 |
+
if (array_key_exists('customVars', $vars) && is_array($vars['customVars'][$this->_method])) {
|
330 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
331 |
+
} else {
|
332 |
+
$vars['customVars'][$this->_method] = $array;
|
333 |
+
}
|
334 |
+
|
335 |
+
$refundRequest->setVars($vars);
|
336 |
+
|
337 |
+
return $this;
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* @param Varien_Event_Observer $observer
|
342 |
+
* @return $this
|
343 |
+
*/
|
344 |
+
public function buckaroo3extended_refund_response_custom_processing(Varien_Event_Observer $observer)
|
345 |
+
{
|
346 |
+
if($this->_isChosenMethod($observer) === false) {
|
347 |
+
return $this;
|
348 |
+
}
|
349 |
+
|
350 |
+
$response = $observer->getResponse();
|
351 |
+
|
352 |
+
if($response['status'] == self::BUCKAROO_SUCCESS){
|
353 |
+
Mage::getSingleton('core/session')->addNotice(
|
354 |
+
Mage::helper('buckaroo3extended')->__( "Note: By creating a credit-note for this order does not mean this order will actually be refunded.\n To refund this order please go to the Payment Plaza and do it manually." )
|
355 |
+
);
|
356 |
+
}
|
357 |
+
|
358 |
+
return $this;
|
359 |
+
}
|
360 |
+
|
361 |
+
}
|
@@ -0,0 +1,58 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Paymentguarantee_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_paymentguarantee';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_paymentguarantee_checkout_form';
|
11 |
+
|
12 |
+
protected $_canRefund = true;
|
13 |
+
protected $_canRefundInvoicePartial = true;
|
14 |
+
|
15 |
+
public function getOrderPlaceRedirectUrl()
|
16 |
+
{
|
17 |
+
$session = Mage::getSingleton('checkout/session');
|
18 |
+
|
19 |
+
$post = Mage::app()->getRequest()->getPost();
|
20 |
+
|
21 |
+
$accountNumber = $post[$this->_code.'_bpe_customer_account_number'];
|
22 |
+
|
23 |
+
$customerBirthDate = date(
|
24 |
+
'Y-m-d', strtotime($post['payment'][$this->_code]['year']
|
25 |
+
. '-' . $post['payment'][$this->_code]['month']
|
26 |
+
. '-' . $post['payment'][$this->_code]['day'])
|
27 |
+
);
|
28 |
+
|
29 |
+
$session->setData(
|
30 |
+
'additionalFields',
|
31 |
+
array(
|
32 |
+
'BPE_Customergender' => $post[$this->_code.'_BPE_Customergender'],
|
33 |
+
'BPE_AccountNumber' => $this->filterAccount($accountNumber),
|
34 |
+
'BPE_PhoneNumber' => $post[$this->_code.'_bpe_customer_phone_number'],
|
35 |
+
'BPE_customerbirthdate' => $customerBirthDate,
|
36 |
+
)
|
37 |
+
);
|
38 |
+
|
39 |
+
return parent::getOrderPlaceRedirectUrl();
|
40 |
+
}
|
41 |
+
|
42 |
+
public function validate()
|
43 |
+
{
|
44 |
+
$postData = Mage::app()->getRequest()->getPost();
|
45 |
+
if (
|
46 |
+
!array_key_exists('buckaroo3extended_paymentguarantee_bpe_terms_and_conditions', $postData)
|
47 |
+
|| $postData['buckaroo3extended_paymentguarantee_bpe_terms_and_conditions'] != 'checked'
|
48 |
+
) {
|
49 |
+
Mage::throwException(
|
50 |
+
Mage::helper('buckaroo3extended')->__('Please accept the terms and conditions.')
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
$this->getInfoInstance()->setAdditionalInformation('checked_terms_and_conditions', true);
|
55 |
+
|
56 |
+
return parent::validate();
|
57 |
+
}
|
58 |
+
}
|
@@ -0,0 +1,238 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Paypal_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_paypal';
|
5 |
+
protected $_method = 'paypal';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
$order = $request->getOrder();
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'name' => 'paypal',
|
20 |
+
'action' => 'pay',
|
21 |
+
'version' => 1,
|
22 |
+
),
|
23 |
+
);
|
24 |
+
|
25 |
+
$checkForSellerProtection = Mage::helper('buckaroo3extended')->checkSellersProtection($order);
|
26 |
+
|
27 |
+
$this->_addCommentHistoryForVirtual($order);
|
28 |
+
|
29 |
+
if ($checkForSellerProtection){
|
30 |
+
$array['sellersprotection'] = array(
|
31 |
+
'name' => 'paypal',
|
32 |
+
'action' => 'extraInfo',
|
33 |
+
'version' => 1,
|
34 |
+
);
|
35 |
+
}
|
36 |
+
|
37 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
38 |
+
$array['creditmanagement'] = array(
|
39 |
+
'action' => 'Invoice',
|
40 |
+
'version' => 1,
|
41 |
+
);
|
42 |
+
}
|
43 |
+
|
44 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
45 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
46 |
+
} else {
|
47 |
+
$vars['services'] = $array;
|
48 |
+
}
|
49 |
+
|
50 |
+
$request->setVars($vars);
|
51 |
+
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
56 |
+
{
|
57 |
+
if($this->_isChosenMethod($observer) === false) {
|
58 |
+
return $this;
|
59 |
+
}
|
60 |
+
|
61 |
+
$request = $observer->getRequest();
|
62 |
+
$this->_order = $request->getOrder();
|
63 |
+
$shippingAddress = $this->_order->getShippingAddress();
|
64 |
+
|
65 |
+
$arrayCustom = $this->_getSellerProtectionVars($this->_order, $shippingAddress);
|
66 |
+
$vars = $request->getVars();
|
67 |
+
|
68 |
+
if ($arrayCustom) {
|
69 |
+
if (array_key_exists('customVars', $vars) && array_key_exists('sellersprotection', $vars['customVars']) && is_array($vars['customVars']['sellersprotection'])) {
|
70 |
+
$vars['customVars']['sellersprotection'] = array_merge($vars['customVars']['sellersprotection'], $arrayCustom);
|
71 |
+
} else {
|
72 |
+
$vars['customVars']['sellersprotection'] = $arrayCustom;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
77 |
+
$this->_addCustomerVariables($vars);
|
78 |
+
$this->_addCreditManagement($vars);
|
79 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
80 |
+
}
|
81 |
+
|
82 |
+
$request->setVars($vars);
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
87 |
+
{
|
88 |
+
if($this->_isChosenMethod($observer) === false) {
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
|
92 |
+
$request = $observer->getRequest();
|
93 |
+
|
94 |
+
$codeBits = explode('_', $this->_code);
|
95 |
+
$code = end($codeBits);
|
96 |
+
$request->setMethod($code);
|
97 |
+
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
102 |
+
{
|
103 |
+
if($this->_isChosenMethod($observer) === false) {
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
$request = $observer->getRequest();
|
108 |
+
|
109 |
+
$codeBits = explode('_', $this->_code);
|
110 |
+
$code = end($codeBits);
|
111 |
+
$request->setMethod($code);
|
112 |
+
|
113 |
+
return $this;
|
114 |
+
}
|
115 |
+
|
116 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
117 |
+
{
|
118 |
+
if($this->_isChosenMethod($observer) === false) {
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
+
|
122 |
+
$refundRequest = $observer->getRequest();
|
123 |
+
|
124 |
+
$vars = $refundRequest->getVars();
|
125 |
+
|
126 |
+
$array = array(
|
127 |
+
'action' => 'Refund',
|
128 |
+
'version' => 1,
|
129 |
+
);
|
130 |
+
|
131 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
132 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
133 |
+
} else {
|
134 |
+
$vars['services'][$this->_method] = $array;
|
135 |
+
}
|
136 |
+
|
137 |
+
$refundRequest->setVars($vars);
|
138 |
+
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
143 |
+
{
|
144 |
+
if($this->_isChosenMethod($observer) === false) {
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
return $this;
|
148 |
+
}
|
149 |
+
|
150 |
+
public function buckaroo3extended_push_custom_processing_after(Varien_Event_Observer $observer)
|
151 |
+
{
|
152 |
+
if($this->_isChosenMethod($observer) === false) {
|
153 |
+
return $this;
|
154 |
+
}
|
155 |
+
|
156 |
+
$order = $observer->getOrder();
|
157 |
+
$push = $observer->getPush()->getPostArray();
|
158 |
+
$response = $observer->getResponse();
|
159 |
+
|
160 |
+
if($response['status'] !== self::BUCKAROO_SUCCESS) {
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
if(!isset($push['brq_SERVICE_paypal_ProtectionEligibility']) &&
|
165 |
+
!isset($push['brq_service_paypal_ProtectionEligibility'])) {
|
166 |
+
return $this;
|
167 |
+
}
|
168 |
+
|
169 |
+
if(!isset($push['brq_SERVICE_paypal_ProtectionEligibility'])){
|
170 |
+
$eligibility = $push['brq_service_paypal_ProtectionEligibility'];
|
171 |
+
} else {
|
172 |
+
$eligibility = $push['brq_SERVICE_paypal_ProtectionEligibility'];
|
173 |
+
}
|
174 |
+
|
175 |
+
if(!isset($push['brq_SERVICE_paypal_ProtectionEligibilityType'])){
|
176 |
+
$eligibilityType = $push['brq_service_paypal_ProtectionEligibilityType'];
|
177 |
+
} else {
|
178 |
+
$eligibilityType = $push['brq_SERVICE_paypal_ProtectionEligibilityType'];
|
179 |
+
}
|
180 |
+
|
181 |
+
if ($eligibility == 'Ineligible') {
|
182 |
+
$eligibilityType = 'None';
|
183 |
+
}
|
184 |
+
|
185 |
+
$commentEligible = Mage::helper('buckaroo3extended')->__(
|
186 |
+
'Merchant is protected by PayPals Seller Protection Policy for both Unauthorized Payment and Item Not Received'
|
187 |
+
);
|
188 |
+
$commentItemNotReceivedEligible = Mage::helper('buckaroo3extended')->__(
|
189 |
+
'Merchant is protected by Paypals Seller Protection Policy for Item Not Received'
|
190 |
+
);
|
191 |
+
$commentUnauthorizedPaymentEligible = Mage::helper('buckaroo3extended')->__(
|
192 |
+
'Merchant is protected by Paypals Seller Protection Policy for Unauthorized Payment'
|
193 |
+
);
|
194 |
+
$commentIneligible = Mage::helper('buckaroo3extended')->__(
|
195 |
+
'Merchant is not protected under the Seller Protection Policy'
|
196 |
+
);
|
197 |
+
|
198 |
+
switch ($eligibilityType) {
|
199 |
+
|
200 |
+
case 'Eligible':
|
201 |
+
$eligibilityStatus = Mage::getStoreConfig(
|
202 |
+
'buckaroo/buckaroo3extended_paypal/sellers_protection_eligible',
|
203 |
+
$order->getStoreId()
|
204 |
+
);
|
205 |
+
$order->addStatusHistoryComment($commentEligible, $eligibilityStatus)
|
206 |
+
->save();
|
207 |
+
break;
|
208 |
+
|
209 |
+
case 'ItemNotReceivedEligible':
|
210 |
+
$eligibilityStatus = Mage::getStoreConfig(
|
211 |
+
'buckaroo/buckaroo3extended_paypal/sellers_protection_itemnotreceived_eligible',
|
212 |
+
$order->getStoreId()
|
213 |
+
);
|
214 |
+
$order->addStatusHistoryComment($commentItemNotReceivedEligible, $eligibilityStatus)
|
215 |
+
->save();
|
216 |
+
break;
|
217 |
+
|
218 |
+
case 'UnauthorizedPaymentEligible':
|
219 |
+
$eligibilityStatus = Mage::getStoreConfig(
|
220 |
+
'buckaroo/buckaroo3extended_paypal/sellers_protection_unauthorizedpayment_eligible',
|
221 |
+
$order->getStoreId()
|
222 |
+
);
|
223 |
+
$order->addStatusHistoryComment($commentUnauthorizedPaymentEligible, $eligibilityStatus)
|
224 |
+
->save();
|
225 |
+
break;
|
226 |
+
|
227 |
+
case 'None':
|
228 |
+
$eligibilityStatus = Mage::getStoreConfig(
|
229 |
+
'buckaroo/buckaroo3extended_paypal/sellers_protection_ineligible',
|
230 |
+
$order->getStoreId()
|
231 |
+
);
|
232 |
+
$order->addStatusHistoryComment($commentIneligible, $eligibilityStatus)
|
233 |
+
->save();
|
234 |
+
break;
|
235 |
+
}
|
236 |
+
return $this;
|
237 |
+
}
|
238 |
+
}
|
@@ -0,0 +1,32 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Paypal_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'AUD',
|
6 |
+
'BRL',
|
7 |
+
'CAD',
|
8 |
+
'CHF',
|
9 |
+
'DKK',
|
10 |
+
'EUR',
|
11 |
+
'GBP',
|
12 |
+
'HKD',
|
13 |
+
'HUF',
|
14 |
+
'ILS',
|
15 |
+
'JPY',
|
16 |
+
'MYR',
|
17 |
+
'NOK',
|
18 |
+
'NZD',
|
19 |
+
'PHP',
|
20 |
+
'PLN',
|
21 |
+
'SEK',
|
22 |
+
'SGD',
|
23 |
+
'THB',
|
24 |
+
'TRY',
|
25 |
+
'TWD',
|
26 |
+
'USD',
|
27 |
+
);
|
28 |
+
|
29 |
+
protected $_code = 'buckaroo3extended_paypal';
|
30 |
+
|
31 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_paypal_checkout_form';
|
32 |
+
}
|
@@ -0,0 +1,317 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Payperemail_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_payperemail';
|
5 |
+
protected $_method = 'payperemail';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @param Varien_Event_Observer $observer
|
9 |
+
* @return $this
|
10 |
+
*/
|
11 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
12 |
+
{
|
13 |
+
if($this->_isChosenMethod($observer) === false) {
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
$request = $observer->getRequest();
|
18 |
+
|
19 |
+
$vars = $request->getVars();
|
20 |
+
|
21 |
+
$array = array(
|
22 |
+
$this->_method => array(
|
23 |
+
'action' => 'PaymentInvitation',
|
24 |
+
'version' => 1,
|
25 |
+
),
|
26 |
+
);
|
27 |
+
|
28 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
29 |
+
$array['creditmanagement'] = array(
|
30 |
+
'action' => 'Invoice',
|
31 |
+
'version' => 1,
|
32 |
+
);
|
33 |
+
}
|
34 |
+
|
35 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
36 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
37 |
+
} else {
|
38 |
+
$vars['services'] = $array;
|
39 |
+
}
|
40 |
+
|
41 |
+
$request->setVars($vars);
|
42 |
+
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @param Varien_Event_Observer $observer
|
48 |
+
* @return $this
|
49 |
+
*/
|
50 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
51 |
+
{
|
52 |
+
if($this->_isChosenMethod($observer) === false) {
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
$request = $observer->getRequest();
|
57 |
+
$this->_billingInfo = $request->getBillingInfo();
|
58 |
+
$this->_order = $request->getOrder();
|
59 |
+
|
60 |
+
$vars = $request->getVars();
|
61 |
+
|
62 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
63 |
+
$this->_addCustomerVariables($vars);
|
64 |
+
$this->_addCreditManagement($vars);
|
65 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
66 |
+
}
|
67 |
+
|
68 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin()) {
|
69 |
+
$additionalFields = Mage::getSingleton('checkout/session')->getData('additionalFields');
|
70 |
+
} else {
|
71 |
+
$additionalFields = Mage::getSingleton('core/session')->getData('additionalFields');
|
72 |
+
}
|
73 |
+
|
74 |
+
if (is_array($additionalFields)
|
75 |
+
&& array_key_exists('gender', $additionalFields)
|
76 |
+
&& array_key_exists('mail', $additionalFields)
|
77 |
+
&& array_key_exists('firstname', $additionalFields)
|
78 |
+
&& array_key_exists('lastname', $additionalFields)
|
79 |
+
) {
|
80 |
+
$array = array(
|
81 |
+
'customergender' => $additionalFields['gender'],
|
82 |
+
'CustomerEmail' => $additionalFields['mail'],
|
83 |
+
'CustomerFirstName' => $additionalFields['firstname'],
|
84 |
+
'CustomerLastName' => $additionalFields['lastname'],
|
85 |
+
);
|
86 |
+
} else {
|
87 |
+
$array = array();
|
88 |
+
}
|
89 |
+
$array['MerchantSendsEmail'] = Mage::getStoreConfig('buckaroo/buckaroo3extended_payperemail/send_mail'
|
90 |
+
, Mage::app()->getStore()->getStoreId()) ? 'false' : 'true';
|
91 |
+
$array['PaymentMethodsAllowed'] = $this->_getPaymentMethodsAllowed();
|
92 |
+
|
93 |
+
if (array_key_exists('customVars', $vars) && array_key_exists($this->_method, $vars['customVars']) && is_array($vars['customVars'][$this->_method])) {
|
94 |
+
$vars['customVars'][$this->_method] = array_merge($vars['customVars'][$this->_method], $array);
|
95 |
+
} else {
|
96 |
+
$vars['customVars'][$this->_method] = $array;
|
97 |
+
}
|
98 |
+
$request->setVars($vars);
|
99 |
+
|
100 |
+
return $this;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* While PayPerEmail is the payment method for this transaction, the transaction is actually completed using another
|
105 |
+
* payment method. This observer stores that payment method in the database. This is currently only used for online
|
106 |
+
* refunds.
|
107 |
+
*
|
108 |
+
* This method also prevents secondary transactions from cancelling the order prematurely.
|
109 |
+
*
|
110 |
+
* @param Varien_Event_Observer $observer
|
111 |
+
*
|
112 |
+
* @return $this
|
113 |
+
*/
|
114 |
+
public function buckaroo3extended_push_custom_processing(Varien_Event_Observer $observer)
|
115 |
+
{
|
116 |
+
if($this->_isChosenMethod($observer) === false) {
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @var TIG_Buckaroo3Extended_Model_Response_Push $push
|
122 |
+
* @var Mage_Sales_Model_Order $order
|
123 |
+
* @var array $postArray
|
124 |
+
* @var array $response
|
125 |
+
*/
|
126 |
+
$push = $observer->getPush();
|
127 |
+
$order = $observer->getOrder();
|
128 |
+
$postArray = $push->getPostArray();
|
129 |
+
$response = $observer->getResponse();
|
130 |
+
|
131 |
+
/**
|
132 |
+
* If this push is for a secondary transaction for a PPE order, we may only process 'successful' updates.
|
133 |
+
*/
|
134 |
+
if ($postArray['brq_transaction_method'] != $this->_code
|
135 |
+
&& $response['status'] != self::BUCKAROO_SUCCESS
|
136 |
+
){
|
137 |
+
/**
|
138 |
+
* This flag will prevent further processing of the push.
|
139 |
+
*/
|
140 |
+
$push->setCustomResponseProcessing(true);
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* If this push is made by a secondary transaction and if the push indicates a successful payment, update the
|
146 |
+
* order's payment method to reflect the chosen payment method.
|
147 |
+
*/
|
148 |
+
if (isset($postArray['brq_payment_method'])
|
149 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
150 |
+
&& $response['status'] == self::BUCKAROO_SUCCESS
|
151 |
+
) {
|
152 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_payment_method']);
|
153 |
+
} elseif (isset($postArray['brq_transaction_method'])
|
154 |
+
&& !$order->getPaymentMethodUsedForTransaction()
|
155 |
+
&& $response['status'] == self::BUCKAROO_SUCCESS
|
156 |
+
) {
|
157 |
+
$order->setPaymentMethodUsedForTransaction($postArray['brq_transaction_method']);
|
158 |
+
}
|
159 |
+
$order->save();
|
160 |
+
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* @param Varien_Event_Observer $observer
|
166 |
+
* @return $this
|
167 |
+
*/
|
168 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
169 |
+
{
|
170 |
+
if($this->_isChosenMethod($observer) === false) {
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
$request = $observer->getRequest();
|
175 |
+
|
176 |
+
$codeBits = explode('_', $this->_code);
|
177 |
+
$code = end($codeBits);
|
178 |
+
$request->setMethod($code);
|
179 |
+
|
180 |
+
return $this;
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @param Varien_Event_Observer $observer
|
185 |
+
* @return $this
|
186 |
+
*/
|
187 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
188 |
+
{
|
189 |
+
if($this->_isChosenMethod($observer) === false) {
|
190 |
+
return $this;
|
191 |
+
}
|
192 |
+
|
193 |
+
$request = $observer->getRequest();
|
194 |
+
|
195 |
+
$codeBits = explode('_', $this->_code);
|
196 |
+
$code = end($codeBits);
|
197 |
+
$request->setMethod($code);
|
198 |
+
|
199 |
+
return $this;
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* @param Varien_Event_Observer $observer
|
204 |
+
* @return $this
|
205 |
+
*/
|
206 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
207 |
+
{
|
208 |
+
if($this->_isChosenMethod($observer) === false) {
|
209 |
+
return $this;
|
210 |
+
}
|
211 |
+
|
212 |
+
$refundRequest = $observer->getRequest();
|
213 |
+
|
214 |
+
$vars = $refundRequest->getVars();
|
215 |
+
|
216 |
+
$array = array(
|
217 |
+
'action' => 'Refund',
|
218 |
+
'version' => 1,
|
219 |
+
);
|
220 |
+
|
221 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
222 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
223 |
+
} else {
|
224 |
+
$vars['services'][$this->_method] = $array;
|
225 |
+
}
|
226 |
+
|
227 |
+
$refundRequest->setVars($vars);
|
228 |
+
|
229 |
+
return $this;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* @param Varien_Event_Observer $observer
|
234 |
+
* @return $this
|
235 |
+
*/
|
236 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
237 |
+
{
|
238 |
+
if($this->_isChosenMethod($observer) === false) {
|
239 |
+
return $this;
|
240 |
+
}
|
241 |
+
|
242 |
+
return $this;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Alternative return processing for PPE orders. In the case of a PPE order, customers may choose to pay using
|
247 |
+
* another payment method, such as iDEAL. This will create a second transaction in payment plaza, linked to the PPE
|
248 |
+
* transaction. If the customer cancels this second transaction, the shop will be updated with a cancel request for
|
249 |
+
* the entire order. The customer may however choose another payment method and pay using that. In this case the
|
250 |
+
* third, successful transaction will be ignored by Magento as the order has already been cancelled by the second,
|
251 |
+
* unsuccessful transaction. To prevent this, cancellation requests may only be processed for PPE orders if they are
|
252 |
+
* sent by the initial PPE transaction and not by a secondary transaction.
|
253 |
+
*
|
254 |
+
* @param Varien_Event_Observer $observer
|
255 |
+
*
|
256 |
+
* @return $this
|
257 |
+
*
|
258 |
+
* @event buckaroo3extended_return_custom_processing
|
259 |
+
*
|
260 |
+
* @observer buckaroo3extended_paymentmethod_observer_payperemail_return
|
261 |
+
*/
|
262 |
+
public function buckaroo3extended_return_custom_processing(Varien_Event_Observer $observer)
|
263 |
+
{
|
264 |
+
/**
|
265 |
+
* Make sure the order was placed using PPE.
|
266 |
+
*
|
267 |
+
* @var Mage_Sales_Model_Order $order
|
268 |
+
*/
|
269 |
+
$order = $observer->getOrder();
|
270 |
+
if ($order->getPayment()->getMethod() !== $this->_code) {
|
271 |
+
return $this;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Get the source data, including the 'return' model.
|
276 |
+
*
|
277 |
+
* @var array $pushData
|
278 |
+
* @var TIG_Buckaroo3Extended_Model_Response_Return $return
|
279 |
+
*/
|
280 |
+
$pushData = $observer->getPostArray();
|
281 |
+
$return = $observer->getReturn();
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Check the status code sent by Buckaroo.
|
285 |
+
*/
|
286 |
+
$statusCodes = $return->responseCodes;
|
287 |
+
$statusCode = $pushData['brq_statuscode'];
|
288 |
+
if (!array_key_exists($statusCode, $statusCodes)) {
|
289 |
+
return $this;
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Parse the status code.
|
294 |
+
*/
|
295 |
+
$status = $statusCodes[$statusCode];
|
296 |
+
|
297 |
+
/**
|
298 |
+
* If the payment method of the current transaction is not PPE, we may only process 'successful' status codes.
|
299 |
+
*/
|
300 |
+
if ($pushData['brq_payment_method'] !== $this->_method
|
301 |
+
&& $status['status'] != $return::BUCKAROO_SUCCESS
|
302 |
+
) {
|
303 |
+
/**
|
304 |
+
* Add a note to the order to indicate this request was not processed.
|
305 |
+
*/
|
306 |
+
$order->addStatusHistoryComment(
|
307 |
+
Mage::helper('buckaroo3extended')->__(
|
308 |
+
'The customer attempted to pay this order using %s, but cancelled the payment.',
|
309 |
+
$pushData['brq_payment_method']
|
310 |
+
)
|
311 |
+
)->save();
|
312 |
+
$return->setCustomResponseProcessing(true);
|
313 |
+
}
|
314 |
+
|
315 |
+
return $this;
|
316 |
+
}
|
317 |
+
}
|
@@ -0,0 +1,47 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Payperemail_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'DKK',
|
12 |
+
'EUR',
|
13 |
+
'GBP',
|
14 |
+
'HRK',
|
15 |
+
'LTL',
|
16 |
+
'LVL',
|
17 |
+
'MXN',
|
18 |
+
'NOK',
|
19 |
+
'PLN',
|
20 |
+
'SEK',
|
21 |
+
'TRY',
|
22 |
+
'USD',
|
23 |
+
);
|
24 |
+
|
25 |
+
protected $_code = 'buckaroo3extended_payperemail';
|
26 |
+
|
27 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_payperemail_checkout_form';
|
28 |
+
|
29 |
+
protected $_canUseInternal = true;
|
30 |
+
|
31 |
+
public function assignData($data)
|
32 |
+
{
|
33 |
+
if (!Mage::helper('buckaroo3extended')->isAdmin()) {
|
34 |
+
$session = Mage::getSingleton('checkout/session');
|
35 |
+
} else {
|
36 |
+
$session = Mage::getSingleton('core/session');
|
37 |
+
}
|
38 |
+
|
39 |
+
$session->setData('additionalFields', array(
|
40 |
+
'gender' => $_POST['buckaroo3extended_payperemail_BPE_Customergender'],
|
41 |
+
'firstname' => $_POST['buckaroo3extended_payperemail_BPE_Customerfirstname'],
|
42 |
+
'lastname' => $_POST['buckaroo3extended_payperemail_BPE_Customerlastname'],
|
43 |
+
'mail' => $_POST['buckaroo3extended_payperemail_BPE_Customermail'],
|
44 |
+
));
|
45 |
+
return parent::assignData($data);
|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
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_paysafecard';
|
5 |
+
protected $_method = 'paysafecard';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
$request->setVars($vars);
|
60 |
+
|
61 |
+
return $this;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
65 |
+
{
|
66 |
+
if($this->_isChosenMethod($observer) === false) {
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
$request = $observer->getRequest();
|
71 |
+
|
72 |
+
$codeBits = explode('_', $this->_code);
|
73 |
+
$code = end($codeBits);
|
74 |
+
$request->setMethod($code);
|
75 |
+
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
80 |
+
{
|
81 |
+
if($this->_isChosenMethod($observer) === false) {
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
$request = $observer->getRequest();
|
86 |
+
|
87 |
+
$codeBits = explode('_', $this->_code);
|
88 |
+
$code = end($codeBits);
|
89 |
+
$request->setMethod($code);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
95 |
+
{
|
96 |
+
if($this->_isChosenMethod($observer) === false) {
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
$refundRequest = $observer->getRequest();
|
101 |
+
|
102 |
+
$vars = $refundRequest->getVars();
|
103 |
+
|
104 |
+
$array = array(
|
105 |
+
'action' => 'Refund',
|
106 |
+
'version' => 1,
|
107 |
+
);
|
108 |
+
|
109 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
110 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
111 |
+
} else {
|
112 |
+
$vars['services'][$this->_method] = $array;
|
113 |
+
}
|
114 |
+
|
115 |
+
$refundRequest->setVars($vars);
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
121 |
+
{
|
122 |
+
if($this->_isChosenMethod($observer) === false) {
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
return $this;
|
127 |
+
}
|
128 |
+
}
|
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Paysafecard_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
);
|
7 |
+
|
8 |
+
protected $_code = 'buckaroo3extended_paysafecard';
|
9 |
+
|
10 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_paysafecard_checkout_form';
|
11 |
+
|
12 |
+
protected $_canRefund = false;
|
13 |
+
protected $_canRefundInvoicePartial = false;
|
14 |
+
}
|
@@ -0,0 +1,128 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Sofortueberweisung_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_sofortueberweisung';
|
5 |
+
protected $_method = 'sofortueberweisung';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
$request->setVars($vars);
|
60 |
+
|
61 |
+
return $this;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
65 |
+
{
|
66 |
+
if($this->_isChosenMethod($observer) === false) {
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
$request = $observer->getRequest();
|
71 |
+
|
72 |
+
$codeBits = explode('_', $this->_code);
|
73 |
+
$code = end($codeBits);
|
74 |
+
$request->setMethod($code);
|
75 |
+
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
80 |
+
{
|
81 |
+
if($this->_isChosenMethod($observer) === false) {
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
$request = $observer->getRequest();
|
86 |
+
|
87 |
+
$codeBits = explode('_', $this->_code);
|
88 |
+
$code = end($codeBits);
|
89 |
+
$request->setMethod($code);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
95 |
+
{
|
96 |
+
if($this->_isChosenMethod($observer) === false) {
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
$refundRequest = $observer->getRequest();
|
101 |
+
|
102 |
+
$vars = $refundRequest->getVars();
|
103 |
+
|
104 |
+
$array = array(
|
105 |
+
'action' => 'Refund',
|
106 |
+
'version' => 1,
|
107 |
+
);
|
108 |
+
|
109 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
110 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
111 |
+
} else {
|
112 |
+
$vars['services'][$this->_method] = $array;
|
113 |
+
}
|
114 |
+
|
115 |
+
$refundRequest->setVars($vars);
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
121 |
+
{
|
122 |
+
if($this->_isChosenMethod($observer) === false) {
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
return $this;
|
127 |
+
}
|
128 |
+
}
|
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Sofortueberweisung_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
'PLN',
|
7 |
+
);
|
8 |
+
|
9 |
+
prot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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Transfer_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_transfer';
|
5 |
+
protected $_method = 'transfer';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
$this->_addTransfer($vars);
|
55 |
+
|
56 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
57 |
+
$this->_addCreditManagement($vars);
|
58 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
59 |
+
$this->_addCustomerVariables($vars, 'creditmanagement');
|
60 |
+
|
61 |
+
if (!isset($vars['customVars']['creditmanagement']['PhoneNumber'])) {
|
62 |
+
$vars['customVars']['creditmanagement']['PhoneNumber'] = $vars['customVars']['creditmanagement']['MobilePhoneNumber'];
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
$request->setVars($vars);
|
67 |
+
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function _addTransfer(&$vars)
|
72 |
+
{
|
73 |
+
$dueDays = Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/due_date', Mage::app()->getStore()->getStoreId());
|
74 |
+
$dueDate = date('Y-m-d', mktime(0, 0, 0, date("m") , (date("d") + $dueDays), date("Y")));
|
75 |
+
|
76 |
+
$array = array(
|
77 |
+
'SendMail' => Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/send_mail', Mage::app()->getStore()->getStoreId()) ? 'true' : 'false',
|
78 |
+
'customeremail' => $this->_billingInfo['email'],
|
79 |
+
'customercountry' => $this->_billingInfo['countryCode'],
|
80 |
+
'customergender' => '0',
|
81 |
+
'customerFirstName' => $this->_billingInfo['firstname'],
|
82 |
+
'customerLastName' => $this->_billingInfo['lastname'],
|
83 |
+
'DateDue' => $dueDate,
|
84 |
+
);
|
85 |
+
if (array_key_exists('customVars', $vars) && array_key_exists('transfer', $vars['customVars']) && is_array($vars['customVars']['transfer'])) {
|
86 |
+
$vars['customVars']['transfer'] = array_merge($vars['customVars']['transfer'], $array);
|
87 |
+
} else {
|
88 |
+
$vars['customVars']['transfer'] = $array;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
93 |
+
{
|
94 |
+
if($this->_isChosenMethod($observer) === false) {
|
95 |
+
return $this;
|
96 |
+
}
|
97 |
+
|
98 |
+
$request = $observer->getRequest();
|
99 |
+
|
100 |
+
$codeBits = explode('_', $this->_code);
|
101 |
+
$code = end($codeBits);
|
102 |
+
$request->setMethod($code);
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
108 |
+
{
|
109 |
+
if($this->_isChosenMethod($observer) === false) {
|
110 |
+
return $this;
|
111 |
+
}
|
112 |
+
|
113 |
+
$request = $observer->getRequest();
|
114 |
+
|
115 |
+
$codeBits = explode('_', $this->_code);
|
116 |
+
$code = end($codeBits);
|
117 |
+
$request->setMethod($code);
|
118 |
+
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
+
|
122 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
123 |
+
{
|
124 |
+
if($this->_isChosenMethod($observer) === false) {
|
125 |
+
return $this;
|
126 |
+
}
|
127 |
+
|
128 |
+
$refundRequest = $observer->getRequest();
|
129 |
+
|
130 |
+
$vars = $refundRequest->getVars();
|
131 |
+
|
132 |
+
$array = array(
|
133 |
+
'action' => 'Refund',
|
134 |
+
'version' => 1,
|
135 |
+
);
|
136 |
+
|
137 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
138 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
139 |
+
} else {
|
140 |
+
$vars['services'][$this->_method] = $array;
|
141 |
+
}
|
142 |
+
|
143 |
+
$refundRequest->setVars($vars);
|
144 |
+
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
|
148 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
149 |
+
{
|
150 |
+
if($this->_isChosenMethod($observer) === false) {
|
151 |
+
return $this;
|
152 |
+
}
|
153 |
+
|
154 |
+
return $this;
|
155 |
+
}
|
156 |
+
}
|
@@ -0,0 +1,46 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Transfer_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'CHF',
|
6 |
+
'CNY',
|
7 |
+
'DKK',
|
8 |
+
'EUR',
|
9 |
+
'GBP',
|
10 |
+
'JPY',
|
11 |
+
'NOK',
|
12 |
+
'PLN',
|
13 |
+
'SEK',
|
14 |
+
'USD',
|
15 |
+
);
|
16 |
+
|
17 |
+
protected $_code = 'buckaroo3extended_transfer';
|
18 |
+
|
19 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_transfer_checkout_form';
|
20 |
+
|
21 |
+
protected $_canRefund = false;
|
22 |
+
protected $_canRefundInvoicePartial = false;
|
23 |
+
|
24 |
+
public function getOrderPlaceRedirectUrl()
|
25 |
+
{
|
26 |
+
$session = Mage::getSingleton('checkout/session');
|
27 |
+
|
28 |
+
$post = Mage::app()->getRequest()->getPost();
|
29 |
+
|
30 |
+
$customerBirthDate = date(
|
31 |
+
'Y-m-d', strtotime($post['payment'][$this->_code]['year']
|
32 |
+
. '-' . $post['payment'][$this->_code]['month']
|
33 |
+
. '-' . $post['payment'][$this->_code]['day'])
|
34 |
+
);
|
35 |
+
|
36 |
+
if (isset($_POST[$this->_code.'_BPE_Customergender'])) {
|
37 |
+
$session->setData('additionalFields',array(
|
38 |
+
'BPE_Customergender' => $_POST[$this->_code.'_BPE_Customergender'],
|
39 |
+
'BPE_Customermail' => $_POST[$this->_code.'_BPE_Customermail'],
|
40 |
+
'BPE_customerbirthdate' => $customerBirthDate
|
41 |
+
));
|
42 |
+
}
|
43 |
+
|
44 |
+
return parent::getOrderPlaceRedirectUrl();
|
45 |
+
}
|
46 |
+
}
|
@@ -0,0 +1,177 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Visa_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_visa';
|
5 |
+
protected $_method = 'visa';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
$request->setVars($vars);
|
60 |
+
|
61 |
+
return $this;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
65 |
+
{
|
66 |
+
if($this->_isChosenMethod($observer) === false) {
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
$request = $observer->getRequest();
|
71 |
+
|
72 |
+
$codeBits = explode('_', $this->_code);
|
73 |
+
$code = end($codeBits);
|
74 |
+
$request->setMethod($code);
|
75 |
+
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
80 |
+
{
|
81 |
+
if($this->_isChosenMethod($observer) === false) {
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
$request = $observer->getRequest();
|
86 |
+
|
87 |
+
$codeBits = explode('_', $this->_code);
|
88 |
+
$code = end($codeBits);
|
89 |
+
$request->setMethod($code);
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
95 |
+
{
|
96 |
+
if($this->_isChosenMethod($observer) === false) {
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
$refundRequest = $observer->getRequest();
|
101 |
+
|
102 |
+
$vars = $refundRequest->getVars();
|
103 |
+
|
104 |
+
$array = array(
|
105 |
+
'action' => 'Refund',
|
106 |
+
'version' => 1,
|
107 |
+
);
|
108 |
+
|
109 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
110 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
111 |
+
} else {
|
112 |
+
$vars['services'][$this->_method] = $array;
|
113 |
+
}
|
114 |
+
|
115 |
+
$refundRequest->setVars($vars);
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
121 |
+
{
|
122 |
+
if($this->_isChosenMethod($observer) === false) {
|
123 |
+
return $this;
|
124 |
+
}
|
125 |
+
|
126 |
+
return $this;
|
127 |
+
}
|
128 |
+
|
129 |
+
public function buckaroo3extended_return_custom_processing(Varien_Event_Observer $observer)
|
130 |
+
{
|
131 |
+
if($this->_isChosenMethod($observer) === false) {
|
132 |
+
return $this;
|
133 |
+
}
|
134 |
+
|
135 |
+
$response = $observer->getPostArray();
|
136 |
+
$order = $observer->getOrder();
|
137 |
+
|
138 |
+
$enrolled = false;
|
139 |
+
$authenticated = false;
|
140 |
+
if (isset($response['brq_SERVICE_visa_Enrolled']) && isset($response['brq_SERVICE_visa_Authentication'])) {
|
141 |
+
$enrolled = $response['brq_SERVICE_visa_Enrolled'];
|
142 |
+
$enrolled = ($enrolled == 'Y') ? true : false;
|
143 |
+
|
144 |
+
$authenticated = $response['brq_SERVICE_visa_Authentication'];
|
145 |
+
$authenticated = ($authenticated == 'Y') ? true : false;
|
146 |
+
}
|
147 |
+
|
148 |
+
$order->setBuckarooSecureEnrolled($enrolled)
|
149 |
+
->setBuckarooSecureAuthenticated($authenticated)
|
150 |
+
->save();
|
151 |
+
|
152 |
+
if ($order->getTransactionKey()) {
|
153 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
154 |
+
}
|
155 |
+
|
156 |
+
return $this;
|
157 |
+
}
|
158 |
+
|
159 |
+
public function buckaroo3extended_push_custom_processing_after(Varien_Event_Observer $observer)
|
160 |
+
{
|
161 |
+
if($this->_isChosenMethod($observer) === false) {
|
162 |
+
return $this;
|
163 |
+
}
|
164 |
+
|
165 |
+
$order = $observer->getOrder();
|
166 |
+
$enrolled = $order->getBuckarooSecureEnrolled();
|
167 |
+
$authenticated = $order->getBuckarooSecureAuthenticated();
|
168 |
+
|
169 |
+
if (is_null($enrolled) || is_null($authenticated)) {
|
170 |
+
return $this;
|
171 |
+
}
|
172 |
+
|
173 |
+
$this->_updateSecureStatus($enrolled, $authenticated, $order);
|
174 |
+
|
175 |
+
return $this;
|
176 |
+
}
|
177 |
+
}
|
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Visa_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'CZK',
|
12 |
+
'DKK',
|
13 |
+
'EUR',
|
14 |
+
'GBP',
|
15 |
+
'HRK',
|
16 |
+
'ISK',
|
17 |
+
'JPY',
|
18 |
+
'LTL',
|
19 |
+
'LVL',
|
20 |
+
'MXN',
|
21 |
+
'NOK',
|
22 |
+
'NZD',
|
23 |
+
'PLN',
|
24 |
+
'RUB',
|
25 |
+
'SEK',
|
26 |
+
'TRY',
|
27 |
+
'USD',
|
28 |
+
'ZAR',
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $_code = 'buckaroo3extended_visa';
|
32 |
+
|
33 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_visa_checkout_form';
|
34 |
+
}
|
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Visaelectron_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_visaelectron';
|
5 |
+
protected $_method = 'visaelectron';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Visaelectron_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'CZK',
|
12 |
+
'DKK',
|
13 |
+
'EUR',
|
14 |
+
'GBP',
|
15 |
+
'HRK',
|
16 |
+
'ISK',
|
17 |
+
'JPY',
|
18 |
+
'LTL',
|
19 |
+
'LVL',
|
20 |
+
'MXN',
|
21 |
+
'NOK',
|
22 |
+
'NZD',
|
23 |
+
'PLN',
|
24 |
+
'RUB',
|
25 |
+
'SEK',
|
26 |
+
'TRY',
|
27 |
+
'USD',
|
28 |
+
'ZAR',
|
29 |
+
);
|
30 |
+
|
31 |
+
protected $_code = 'buckaroo3extended_visaelectron';
|
32 |
+
|
33 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_visaelectron_checkout_form';
|
34 |
+
}
|
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Vpay_Observer extends TIG_Buckaroo3Extended_Model_Observer_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'buckaroo3extended_vpay';
|
5 |
+
protected $_method = 'vpay';
|
6 |
+
|
7 |
+
public function buckaroo3extended_request_addservices(Varien_Event_Observer $observer)
|
8 |
+
{
|
9 |
+
if($this->_isChosenMethod($observer) === false) {
|
10 |
+
return $this;
|
11 |
+
}
|
12 |
+
|
13 |
+
$request = $observer->getRequest();
|
14 |
+
|
15 |
+
$vars = $request->getVars();
|
16 |
+
|
17 |
+
$array = array(
|
18 |
+
$this->_method => array(
|
19 |
+
'action' => 'Pay',
|
20 |
+
'version' => 1,
|
21 |
+
),
|
22 |
+
);
|
23 |
+
|
24 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
25 |
+
$array['creditmanagement'] = array(
|
26 |
+
'action' => 'Invoice',
|
27 |
+
'version' => 1,
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'])) {
|
32 |
+
$vars['services'] = array_merge($vars['services'], $array);
|
33 |
+
} else {
|
34 |
+
$vars['services'] = $array;
|
35 |
+
}
|
36 |
+
|
37 |
+
$request->setVars($vars);
|
38 |
+
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function buckaroo3extended_request_addcustomvars(Varien_Event_Observer $observer)
|
43 |
+
{
|
44 |
+
if($this->_isChosenMethod($observer) === false) {
|
45 |
+
return $this;
|
46 |
+
}
|
47 |
+
|
48 |
+
$request = $observer->getRequest();
|
49 |
+
$this->_billingInfo = $request->getBillingInfo();
|
50 |
+
$this->_order = $request->getOrder();
|
51 |
+
|
52 |
+
$vars = $request->getVars();
|
53 |
+
|
54 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/use_creditmanagement', Mage::app()->getStore()->getStoreId())) {
|
55 |
+
$this->_addCustomerVariables($vars);
|
56 |
+
$this->_addCreditManagement($vars);
|
57 |
+
$this->_addAdditionalCreditManagementVariables($vars);
|
58 |
+
}
|
59 |
+
|
60 |
+
$request->setVars($vars);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function buckaroo3extended_request_setmethod(Varien_Event_Observer $observer)
|
66 |
+
{
|
67 |
+
if($this->_isChosenMethod($observer) === false) {
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
+
|
71 |
+
$request = $observer->getRequest();
|
72 |
+
|
73 |
+
$codeBits = explode('_', $this->_code);
|
74 |
+
$code = end($codeBits);
|
75 |
+
$request->setMethod($code);
|
76 |
+
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function buckaroo3extended_refund_request_setmethod(Varien_Event_Observer $observer)
|
81 |
+
{
|
82 |
+
if($this->_isChosenMethod($observer) === false) {
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
$request = $observer->getRequest();
|
87 |
+
|
88 |
+
$codeBits = explode('_', $this->_code);
|
89 |
+
$code = end($codeBits);
|
90 |
+
$request->setMethod($code);
|
91 |
+
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function buckaroo3extended_refund_request_addservices(Varien_Event_Observer $observer)
|
96 |
+
{
|
97 |
+
if($this->_isChosenMethod($observer) === false) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
$refundRequest = $observer->getRequest();
|
102 |
+
|
103 |
+
$vars = $refundRequest->getVars();
|
104 |
+
|
105 |
+
$array = array(
|
106 |
+
'action' => 'Refund',
|
107 |
+
'version' => 1,
|
108 |
+
);
|
109 |
+
|
110 |
+
if (array_key_exists('services', $vars) && is_array($vars['services'][$this->_method])) {
|
111 |
+
$vars['services'][$this->_method] = array_merge($vars['services'][$this->_method], $array);
|
112 |
+
} else {
|
113 |
+
$vars['services'][$this->_method] = $array;
|
114 |
+
}
|
115 |
+
|
116 |
+
$refundRequest->setVars($vars);
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
public function buckaroo3extended_refund_request_addcustomvars(Varien_Event_Observer $observer)
|
122 |
+
{
|
123 |
+
if($this->_isChosenMethod($observer) === false) {
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
}
|
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_PaymentMethods_Vpay_PaymentMethod extends TIG_Buckaroo3Extended_Model_PaymentMethods_PaymentMethod
|
3 |
+
{
|
4 |
+
public $allowedCurrencies = array(
|
5 |
+
'ARS',
|
6 |
+
'AUD',
|
7 |
+
'BRL',
|
8 |
+
'CAD',
|
9 |
+
'CHF',
|
10 |
+
'CNY',
|
11 |
+
'DKK',
|
12 |
+
'EUR',
|
13 |
+
'GBP',
|
14 |
+
'HRK',
|
15 |
+
'LTL',
|
16 |
+
'LVL',
|
17 |
+
'MXN',
|
18 |
+
'NOK',
|
19 |
+
'PLN',
|
20 |
+
'SEK',
|
21 |
+
'TRY',
|
22 |
+
'USD',
|
23 |
+
);
|
24 |
+
|
25 |
+
protected $_code = 'buckaroo3extended_vpay';
|
26 |
+
|
27 |
+
protected $_formBlockType = 'buckaroo3extended/paymentMethods_vpay_checkout_form';
|
28 |
+
}
|
@@ -0,0 +1,168 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/** ____________ _ _ _ ________ ___ _ _ _______ ___ ___ _ _ _ ___
|
3 |
+
* \_ _/ \_ _/ \| | |_| \ \_ _/ \| _ || \ |/ \_ _/ / __\| _ |/ \| | | _ \
|
4 |
+
* | | | | | ' | |_ | | || | '_/| /| | '_/| | | |_ \| / | | | | __/
|
5 |
+
* |_|\_/|_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
class TIG_Buckaroo3Extended_Model_Process extends Mage_Index_Model_Process
|
24 |
+
{
|
25 |
+
protected $_isLocked = null;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get lock file resource
|
29 |
+
*
|
30 |
+
* @return resource | TIG_Buckaroo3Extended_Model_Process
|
31 |
+
*/
|
32 |
+
protected function _getLockFile()
|
33 |
+
{
|
34 |
+
if ($this->_lockFile !== null) {
|
35 |
+
return $this->_lockFile;
|
36 |
+
}
|
37 |
+
|
38 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
39 |
+
$file = $varDir . DS . 'buckaroo_process_' . $this->getId() . '.lock';
|
40 |
+
|
41 |
+
if (is_file($file)) {
|
42 |
+
if($this->_lockIsExpired()){
|
43 |
+
unlink($file);//remove file
|
44 |
+
$this->_lockFile = fopen($file, 'x');//create new lock file
|
45 |
+
}else{
|
46 |
+
$this->_lockFile = fopen($file, 'w');
|
47 |
+
}
|
48 |
+
} else {
|
49 |
+
$this->_lockFile = fopen($file, 'x');
|
50 |
+
}
|
51 |
+
|
52 |
+
fwrite($this->_lockFile, date('r'));
|
53 |
+
|
54 |
+
return $this->_lockFile;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Lock process without blocking.
|
59 |
+
* This method allow protect multiple process running and fast lock validation.
|
60 |
+
*
|
61 |
+
* @return TIG_Buckaroo3Extended_Model_Process
|
62 |
+
*/
|
63 |
+
public function lock()
|
64 |
+
{
|
65 |
+
$this->_isLocked = true;
|
66 |
+
|
67 |
+
flock($this->_getLockFile(), LOCK_EX | LOCK_NB);
|
68 |
+
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Lock and block process
|
74 |
+
*
|
75 |
+
* @return TIG_Buckaroo3Extended_Model_Process
|
76 |
+
*/
|
77 |
+
public function lockAndBlock()
|
78 |
+
{
|
79 |
+
$this->_isLocked = true;
|
80 |
+
$file = $this->_getLockFile();
|
81 |
+
|
82 |
+
flock($this->_getLockFile(), LOCK_EX);
|
83 |
+
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Unlock process
|
89 |
+
*
|
90 |
+
* @return TIG_Buckaroo3Extended_Model_Process
|
91 |
+
*/
|
92 |
+
public function unlock()
|
93 |
+
{
|
94 |
+
$this->_isLocked = false;
|
95 |
+
$file = $this->_getLockFile();
|
96 |
+
|
97 |
+
flock($file, LOCK_UN);
|
98 |
+
|
99 |
+
//remove lockfile
|
100 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
101 |
+
$lockFile = $varDir . DS . 'buckaroo_process_' . $this->getId() . '.lock';
|
102 |
+
unlink($lockFile);
|
103 |
+
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Check if process is locked
|
109 |
+
*
|
110 |
+
* @return bool
|
111 |
+
*/
|
112 |
+
public function isLocked()
|
113 |
+
{
|
114 |
+
if ($this->_isLocked !== null) {
|
115 |
+
return $this->_isLocked;
|
116 |
+
}
|
117 |
+
|
118 |
+
$fp = $this->_getLockFile();
|
119 |
+
if (flock($fp, LOCK_EX | LOCK_NB)) {
|
120 |
+
flock($fp, LOCK_UN);
|
121 |
+
return false;
|
122 |
+
}
|
123 |
+
|
124 |
+
//if the lock exists and exists for longer then 5minutes then remove lock & return false
|
125 |
+
if($this->_lockIsExpired()){
|
126 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
127 |
+
$lockFile = $varDir . DS . 'buckaroo_process_' . $this->getId() . '.lock';
|
128 |
+
unlink($lockFile);
|
129 |
+
|
130 |
+
$this->_getLockFile();//create new lock file
|
131 |
+
return false;
|
132 |
+
}
|
133 |
+
|
134 |
+
return true;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Checks if the lock has expired
|
139 |
+
*
|
140 |
+
* @return bool
|
141 |
+
*/
|
142 |
+
protected function _lockIsExpired(){
|
143 |
+
$varDir = Mage::getConfig()->getVarDir('locks');
|
144 |
+
$file = $varDir . DS . 'buckaroo_process_'.$this->getId().'.lock';
|
145 |
+
|
146 |
+
if(!is_file($file)){
|
147 |
+
$fp = fopen($file, 'x');
|
148 |
+
fwrite($fp, date('r'));
|
149 |
+
fclose($fp);
|
150 |
+
return false;
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
$fiveMinAgo = time() - 300;//300
|
155 |
+
$contents = file_get_contents($file);
|
156 |
+
$time = strtotime($contents);
|
157 |
+
$debug = 'current contents: '.$contents . "\n"
|
158 |
+
. 'contents in timestamp: '.$time . "\n"
|
159 |
+
. '5 minutes ago in timestamp: '.$fiveMinAgo;
|
160 |
+
|
161 |
+
if($time <= $fiveMinAgo){
|
162 |
+
$fp = fopen($file,'w');
|
163 |
+
flock($fp, LOCK_UN);
|
164 |
+
return true;
|
165 |
+
}
|
166 |
+
return false;
|
167 |
+
}
|
168 |
+
}
|
@@ -0,0 +1,317 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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when a refund is made in Buckaroo Payment Plaza.
|
8 |
+
* This Function will result in a creditmemo being created for the order in question.
|
9 |
+
*/
|
10 |
+
public function processBuckarooRefundPush()
|
11 |
+
{
|
12 |
+
//check if the push is valid and if the order can be updated
|
13 |
+
list($valid, $canProcess) = $this->_canProcessRefundPush();
|
14 |
+
|
15 |
+
$this->_debugEmail .= "Is the PUSH valid? " . $valid . "\nCan the creditmemo be created? " . $canProcess . "\n";
|
16 |
+
|
17 |
+
if (!$valid || !$canProcess) {
|
18 |
+
return false;
|
19 |
+
}
|
20 |
+
|
21 |
+
$success = $this->_createCreditmemo();
|
22 |
+
|
23 |
+
if ($success === false) { //if $success === true, the observer will update the status instead
|
24 |
+
$this->_updateRefundedOrderStatus($success);
|
25 |
+
}
|
26 |
+
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function _createCreditmemo()
|
31 |
+
{
|
32 |
+
$data = $this->_getCreditmemoData();
|
33 |
+
|
34 |
+
try {
|
35 |
+
$creditmemo = $this->_initCreditmemo($data);
|
36 |
+
if ($creditmemo) {
|
37 |
+
if (($creditmemo->getGrandTotal() <= 0) && (!$creditmemo->getAllowZeroGrandTotal())) {
|
38 |
+
Mage::throwException(
|
39 |
+
Mage::helper('buckaroo3extended')->__('Credit memo\'s total must be positive.')
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
$comment = '';
|
44 |
+
if (!empty($data['comment_text'])) {
|
45 |
+
$creditmemo->addComment(
|
46 |
+
$data['comment_text'],
|
47 |
+
isset($data['comment_customer_notify']),
|
48 |
+
isset($data['is_visible_on_front'])
|
49 |
+
);
|
50 |
+
if (isset($data['comment_customer_notify'])) {
|
51 |
+
$comment = $data['comment_text'];
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
if (isset($data['do_refund'])) {
|
56 |
+
$creditmemo->setRefundRequested(true);
|
57 |
+
}
|
58 |
+
if (isset($data['do_offline'])) {
|
59 |
+
$creditmemo->setOfflineRequested((bool)(int)$data['do_offline']);
|
60 |
+
}
|
61 |
+
|
62 |
+
$creditmemo->setTransactionKey($this->_postArray['brq_transactions']);
|
63 |
+
|
64 |
+
$creditmemo->register();
|
65 |
+
if (!empty($data['send_email'])) {
|
66 |
+
$creditmemo->setEmailSent(true);
|
67 |
+
}
|
68 |
+
|
69 |
+
$creditmemo->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
|
70 |
+
$this->_saveCreditmemo($creditmemo);
|
71 |
+
$creditmemo->sendEmail(!empty($data['send_email']), $comment);
|
72 |
+
|
73 |
+
Mage::getSingleton('adminhtml/session')->getCommentText(true);
|
74 |
+
|
75 |
+
return true;
|
76 |
+
} else {
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
} catch (Mage_Core_Exception $e) {
|
80 |
+
$this->logException($e->getMessage());
|
81 |
+
return false;
|
82 |
+
} catch (Exception $e) {
|
83 |
+
$this->logException($e->getMessage());
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
|
89 |
+
protected function _initCreditmemo($data, $update = false)
|
90 |
+
{
|
91 |
+
$request = $this->getRequest();
|
92 |
+
$request->setParam('creditmemo', $data);
|
93 |
+
|
94 |
+
|
95 |
+
$creditmemo = false;
|
96 |
+
|
97 |
+
$order = $this->_order;
|
98 |
+
|
99 |
+
$service = Mage::getModel('sales/service_order', $order);
|
100 |
+
|
101 |
+
$savedData = $this->_getItemData($data);
|
102 |
+
|
103 |
+
$qtys = array();
|
104 |
+
foreach ($savedData as $orderItemId =>$itemData) {
|
105 |
+
if (isset($itemData['qty'])) {
|
106 |
+
$qtys[$orderItemId] = $itemData['qty'];
|
107 |
+
}
|
108 |
+
}
|
109 |
+
$data['qtys'] = $qtys;
|
110 |
+
$creditmemo = $service->prepareCreditmemo($data);
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Process back to stock flags
|
114 |
+
*/
|
115 |
+
foreach ($creditmemo->getAllItems() as $creditmemoItem) {
|
116 |
+
$creditmemoItem->setBackToStock(false);
|
117 |
+
}
|
118 |
+
|
119 |
+
$args = array('creditmemo' => $creditmemo, 'request' => $request);
|
120 |
+
Mage::dispatchEvent('adminhtml_sales_order_creditmemo_register_before', $args);
|
121 |
+
|
122 |
+
Mage::register('current_creditmemo', $creditmemo);
|
123 |
+
return $creditmemo;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Save creditmemo and related order, invoice in one transaction
|
128 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
129 |
+
*/
|
130 |
+
protected function _saveCreditmemo($creditmemo)
|
131 |
+
{
|
132 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
133 |
+
->addObject($creditmemo)
|
134 |
+
->addObject($creditmemo->getOrder());
|
135 |
+
if ($creditmemo->getInvoice()) {
|
136 |
+
$transactionSave->addObject($creditmemo->getInvoice());
|
137 |
+
}
|
138 |
+
$transactionSave->save();
|
139 |
+
|
140 |
+
return $this;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Get requested items qtys and return to stock flags
|
145 |
+
*/
|
146 |
+
protected function _getItemData($data = false)
|
147 |
+
{
|
148 |
+
if (isset($data['items'])) {
|
149 |
+
$qtys = $data['items'];
|
150 |
+
} else {
|
151 |
+
$qtys = array();
|
152 |
+
}
|
153 |
+
return $qtys;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Most of the code used to create a creditmemo is copied and modified from the default magento code.
|
158 |
+
* However, that code expects an array with values. This method creates that array.
|
159 |
+
*
|
160 |
+
* @return array $data
|
161 |
+
*/
|
162 |
+
protected function _getCreditmemoData()
|
163 |
+
{
|
164 |
+
$totalAmount = $this->_calculateTotalAmount();
|
165 |
+
|
166 |
+
$data = array(
|
167 |
+
'do_offline' => '0',
|
168 |
+
'do_refund' => '0',
|
169 |
+
'comment_text' => '',
|
170 |
+
);
|
171 |
+
|
172 |
+
$totalToRefund = $totalAmount + $this->_order->getBaseTotalRefunded();
|
173 |
+
if ($totalToRefund == $this->_order->getBaseGrandTotal()) {
|
174 |
+
|
175 |
+
//calculates the total adjustments made by previous creditmemos
|
176 |
+
$creditmemos = $this->_order->getCreditmemosCollection();
|
177 |
+
$totalAdjustment = 0;
|
178 |
+
foreach($creditmemos as $creditmemo) {
|
179 |
+
$adjustment = $creditmemo->getBaseAdjustmentPositive() - $creditmemo->getBaseAdjustmentNegative();
|
180 |
+
$totalAdjustment += $adjustment;
|
181 |
+
}
|
182 |
+
|
183 |
+
//if the amount to be refunded + the amount that has already been refunded equals the order's base grandtotal
|
184 |
+
//all products from that order will be refunded as well
|
185 |
+
$data['shipping_amount'] = $this->_order->getBaseShippingAmount() - $this->_order->getBaseShippingRefunded();
|
186 |
+
$data['adjustment_negative'] = $totalAdjustment;
|
187 |
+
|
188 |
+
$remainder = $this->_calculateRemainder();
|
189 |
+
|
190 |
+
$data['adjustment_positive'] = $remainder;
|
191 |
+
} else {
|
192 |
+
//if the above is not the case; no products will be refunded and this refund will be considered an
|
193 |
+
//adjustment refund
|
194 |
+
$data['shipping_amount'] = '0';
|
195 |
+
$data['adjustment_negative'] = '0';
|
196 |
+
$data['adjustment_positive'] = $totalAmount;
|
197 |
+
}
|
198 |
+
|
199 |
+
$items = $this->_getCreditmemoDataItems();
|
200 |
+
|
201 |
+
$data['items'] = $items;
|
202 |
+
|
203 |
+
return $data;
|
204 |
+
}
|
205 |
+
|
206 |
+
protected function _calculateTotalAmount()
|
207 |
+
{
|
208 |
+
$amountPushed = $this->_postArray['brq_amount_credit'];
|
209 |
+
|
210 |
+
$baseCurrency = $this->_order->getBaseCurrency()->getCode();
|
211 |
+
$currency = $this->_postArray['brq_currency'];
|
212 |
+
|
213 |
+
if ($baseCurrency == $currency) {
|
214 |
+
return $amountPushed;
|
215 |
+
} else {
|
216 |
+
$amount = round($amountPushed * $this->_order->getBaseToOrderRate(), 2);
|
217 |
+
return $amount;
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Calculates the amount left over after discounts, shipping, taxes, adjustments and the subtotal have been
|
223 |
+
* taken into account. This remainder is probably caused by some module such as a paymentfee.
|
224 |
+
*
|
225 |
+
* This method will return 0 in most cases.
|
226 |
+
*/
|
227 |
+
protected function _calculateRemainder()
|
228 |
+
{
|
229 |
+
$baseTotalToBeRefunded = (
|
230 |
+
$this->_order->getBaseShippingAmount()
|
231 |
+
- $this->_order->getBaseShippingRefunded()
|
232 |
+
) + (
|
233 |
+
$this->_order->getBaseSubtotal()
|
234 |
+
- $this->_order->getBaseSubtotalRefunded()
|
235 |
+
) + (
|
236 |
+
$this->_order->getBaseAdjustmentNegative()
|
237 |
+
- $this->_order->getBaseAdjustmentPositive()
|
238 |
+
) + (
|
239 |
+
$this->_order->getBaseTaxAmount()
|
240 |
+
- $this->_order->getBaseTaxRefunded()
|
241 |
+
) + (
|
242 |
+
$this->_order->getBaseDiscountAmount()
|
243 |
+
- $this->_order->getBaseDiscountRefunded()
|
244 |
+
);
|
245 |
+
|
246 |
+
$remainderToBeRefunded = $this->_order->getBaseGrandTotal()
|
247 |
+
- $baseTotalToBeRefunded
|
248 |
+
- $this->_order->getBaseTotalRefunded();
|
249 |
+
|
250 |
+
return $remainderToBeRefunded;
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Determines which items need to be refunded. If the amount to be refunded equals the order base grandtotal
|
255 |
+
* then all items are refunded, otherwise none are
|
256 |
+
*/
|
257 |
+
protected function _getCreditmemoDataItems()
|
258 |
+
{
|
259 |
+
$items = array();
|
260 |
+
foreach ($this->_order->getAllItems() as $orderItem)
|
261 |
+
{
|
262 |
+
if (!in_array($orderItem->getId(), array_flip($items))) {
|
263 |
+
if (($this->_postArray['brq_amount_credit'] + $this->_order->getBaseTotalRefunded()) == $this->_order->getBaseGrandTotal()) {
|
264 |
+
$qty = $orderItem->getQtyInvoiced() - $orderItem->getQtyRefunded();
|
265 |
+
} else {
|
266 |
+
$qty = 0;
|
267 |
+
}
|
268 |
+
$items[$orderItem->getId()] = array(
|
269 |
+
'qty' => $qty,
|
270 |
+
);
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
return $items;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Checks if the post recieved is valid by checking its signature field.
|
279 |
+
* This field is unique for every payment and every store.
|
280 |
+
* Also calls a method that checks if the order is able to have a creditmemo
|
281 |
+
*
|
282 |
+
* @return array $return
|
283 |
+
*/
|
284 |
+
protected function _canProcessRefundPush()
|
285 |
+
{
|
286 |
+
$correctSignature = false;
|
287 |
+
$canProcess = false;
|
288 |
+
$signature = $this->_calculateSignature();
|
289 |
+
if ($signature === $this->_postArray['brq_signature']) {
|
290 |
+
$correctSignature = true;
|
291 |
+
}
|
292 |
+
|
293 |
+
//check if the order can recieve a new creditmemo
|
294 |
+
if ($correctSignature === true) {
|
295 |
+
$canProcess = $this->_canProcessCreditmemo();
|
296 |
+
}
|
297 |
+
|
298 |
+
$return = array(
|
299 |
+
(bool) $correctSignature,
|
300 |
+
(bool) $canProcess,
|
301 |
+
);
|
302 |
+
return $return;
|
303 |
+
}
|
304 |
+
|
305 |
+
protected function _canProcessCreditmemo()
|
306 |
+
{
|
307 |
+
if (!$this->_order->canCreditmemo()) {
|
308 |
+
return false;
|
309 |
+
}
|
310 |
+
|
311 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_refund/allow_push')) {
|
312 |
+
return false;
|
313 |
+
}
|
314 |
+
|
315 |
+
return true;
|
316 |
+
}
|
317 |
+
}
|
@@ -0,0 +1,51 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Observer extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function sales_order_payment_refund(Varien_Event_Observer $observer)
|
5 |
+
{
|
6 |
+
$payment = $observer->getPayment();
|
7 |
+
$creditmemo = $observer->getCreditmemo();
|
8 |
+
|
9 |
+
if (!$creditmemo->getTransactionKey()) {
|
10 |
+
$creditmemo->setTransactionKey($payment->getTransactionKey())->save();
|
11 |
+
$payment->setTransactionKey(null)->save(); //the transaction key needs to be reset after every refund
|
12 |
+
}
|
13 |
+
|
14 |
+
$order = $creditmemo->getOrder();
|
15 |
+
$this->_updateRefundedOrderStatus($creditmemo, $order, true);
|
16 |
+
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _updateRefundedOrderStatus($creditmemo, $order, $success)
|
21 |
+
{
|
22 |
+
if (!$creditmemo->getTransactionKey()) {
|
23 |
+
return false;
|
24 |
+
}
|
25 |
+
|
26 |
+
$successString = $success ? 'success' : 'failed';
|
27 |
+
$state = $order->getState();
|
28 |
+
|
29 |
+
if ($success) {
|
30 |
+
$comment = 'Buckaroo refund request was successfully processed.';
|
31 |
+
} else {
|
32 |
+
$comment = 'Unfortunately the Buckaroo refund request could not be processed succesfully.';
|
33 |
+
}
|
34 |
+
|
35 |
+
if ($order->getBaseGrandTotal() != $order->getBaseTotalRefunded()) {
|
36 |
+
$configField = "buckaroo/buckaroo3extended_refund/order_status_partial_{$state}_{$successString}";
|
37 |
+
$status = Mage::getStoreConfig($configField);
|
38 |
+
} else {
|
39 |
+
$status = null;
|
40 |
+
}
|
41 |
+
|
42 |
+
if (!empty($status) && $order->getStatus() != $status) {
|
43 |
+
$order->setStatus($status)->save();
|
44 |
+
$order->addStatusHistoryComment($comment, $status)
|
45 |
+
->save();
|
46 |
+
} else {
|
47 |
+
$order->addStatusHistoryComment($comment)
|
48 |
+
->save();
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
@@ -0,0 +1,204 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Request_Abstract extends TIG_Buckaroo3Extended_Model_Request_Abstract
|
3 |
+
{
|
4 |
+
protected $_payment;
|
5 |
+
protected $_invoice;
|
6 |
+
protected $_amount;
|
7 |
+
|
8 |
+
public function setPayment($payment)
|
9 |
+
{
|
10 |
+
$this->_payment = $payment;
|
11 |
+
}
|
12 |
+
|
13 |
+
public function getPayment()
|
14 |
+
{
|
15 |
+
return $this->_payment;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function setInvoice($invoice)
|
19 |
+
{
|
20 |
+
$this->_invoice = $invoice;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getInvoice()
|
24 |
+
{
|
25 |
+
return $this->_invoice;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function setAmount($amount)
|
29 |
+
{
|
30 |
+
$this->_amount = $amount;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function getAmount()
|
34 |
+
{
|
35 |
+
return $this->_amount;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function loadInvoiceByTransactionId($transactionId)
|
39 |
+
{
|
40 |
+
foreach ($this->getOrder()->getInvoiceCollection() as $invoice) {
|
41 |
+
if ($invoice->getTransactionId() == $transactionId) {
|
42 |
+
$invoice->load($invoice->getId()); // to make sure all data will properly load (maybe not required)
|
43 |
+
return $invoice;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function __construct($data) {
|
50 |
+
if (strpos(__DIR__, '/Model') !== false) {
|
51 |
+
$dir = str_replace('/Model/Refund/Request', '/certificate', __DIR__);
|
52 |
+
} else {
|
53 |
+
$dir = str_replace('/includes/src', '/app/code/community/TIG/Buckaroo3Extended/certificate', __DIR__);
|
54 |
+
}
|
55 |
+
define('CERTIFICATE_DIR', $dir);
|
56 |
+
|
57 |
+
$this->setAmount($data['amount']);
|
58 |
+
$this->setPayment($data['payment']);
|
59 |
+
$this->setOrder($data['payment']->getOrder());
|
60 |
+
$this->setSession(Mage::getSingleton('core/session'));
|
61 |
+
|
62 |
+
$invoice = $this->loadInvoiceByTransactionId($this->_order->getTransactionKey());
|
63 |
+
|
64 |
+
if ($invoice === false) {
|
65 |
+
Mage::throwException($this->_getHelper()->__('Refund action is not available.'));
|
66 |
+
}
|
67 |
+
$this->setInvoice($invoice->getId());
|
68 |
+
|
69 |
+
$this->_setOrderBillingInfo();
|
70 |
+
$this->setDebugEmail('');
|
71 |
+
|
72 |
+
$this->_checkExpired();
|
73 |
+
|
74 |
+
Mage::dispatchEvent('buckaroo3extended_refund_request_setmethod', array('request' => $this, 'order' => $this->_order));
|
75 |
+
|
76 |
+
$this->setVars(array());
|
77 |
+
}
|
78 |
+
|
79 |
+
public function sendRefundRequest()
|
80 |
+
{
|
81 |
+
try {
|
82 |
+
return $this->_sendRefundRequest();
|
83 |
+
} catch (Exception $e) {
|
84 |
+
Mage::helper('buckaroo3extended')->logException($e);
|
85 |
+
Mage::throwException($e->getMessage());
|
86 |
+
}
|
87 |
+
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
|
91 |
+
protected function _sendRefundRequest()
|
92 |
+
{
|
93 |
+
$this->_debugEmail .= 'Chosen payment method: ' . $this->_method . "\n";
|
94 |
+
|
95 |
+
//if no method has been set (no payment method could identify the chosen method) process the order as if it had failed
|
96 |
+
if (empty($this->_method)) {
|
97 |
+
$this->_debugEmail .= "No method was set! :( \n";
|
98 |
+
Mage::getModel('buckaroo3extended/refund_response_abstract', array('response' => false, 'XML' => false))->processResponse();
|
99 |
+
}
|
100 |
+
|
101 |
+
$this->_debugEmail .= "\n";
|
102 |
+
//forms an array with all payment-independant variables (such as merchantkey, order id etc.) which are required for the transaction request
|
103 |
+
$this->_addBaseVariables();
|
104 |
+
$this->_addOrderVariables();
|
105 |
+
$this->_addShopVariables();
|
106 |
+
$this->_addRefundVariables();
|
107 |
+
$this->_addCustomParameters();
|
108 |
+
$this->_addSoftwareVariables();
|
109 |
+
|
110 |
+
$this->_debugEmail .= "Firing request events. \n";
|
111 |
+
//event that allows individual payment methods to add additional variables such as bankaccount number
|
112 |
+
Mage::dispatchEvent('buckaroo3extended_refund_request_addservices', array('request' => $this, 'order' => $this->_order));
|
113 |
+
Mage::dispatchEvent('buckaroo3extended_refund_request_addcustomvars', array('request' => $this, 'order' => $this->_order));
|
114 |
+
|
115 |
+
$this->_debugEmail .= "Events fired! \n";
|
116 |
+
|
117 |
+
//clean the array for a soap request
|
118 |
+
$this->setVars($this->_cleanArrayForSoap($this->getVars()));
|
119 |
+
|
120 |
+
$this->_debugEmail .= "Variable array:" . var_export($this->_vars, true) . "\n\n";
|
121 |
+
$this->_debugEmail .= "Building SOAP request... \n";
|
122 |
+
|
123 |
+
//send the transaction request using SOAP
|
124 |
+
|
125 |
+
/** @var $soap TIG_Buckaroo3Extended_Model_Soap */
|
126 |
+
$soap = Mage::getModel('buckaroo3extended/soap', array('vars' => $this->getVars(), 'method' => $this->getMethod()));
|
127 |
+
list($response, $responseXML, $requestXML) = $soap->transactionRequest();
|
128 |
+
|
129 |
+
$this->_debugEmail .= "The SOAP request has been sent. \n";
|
130 |
+
if (is_object($requestXML) && is_object($responseXML)) {
|
131 |
+
$this->_debugEmail .= "Request: " . var_export($requestXML->saveXML(), true) . "\n";
|
132 |
+
$this->_debugEmail .= "Response: " . var_export($response, true) . "\n";
|
133 |
+
$this->_debugEmail .= "Response XML:" . var_export($responseXML->saveXML(), true) . "\n\n";
|
134 |
+
}
|
135 |
+
|
136 |
+
$this->_debugEmail .= "Response recieved. \n";
|
137 |
+
//process the response
|
138 |
+
|
139 |
+
$processedResponse = Mage::getModel(
|
140 |
+
'buckaroo3extended/refund_response_abstract',
|
141 |
+
array(
|
142 |
+
'response' => $response,
|
143 |
+
'XML' => $responseXML,
|
144 |
+
'debugEmail' => $this->_debugEmail,
|
145 |
+
'payment' => $this->_payment,
|
146 |
+
'order' => $this->_order,
|
147 |
+
)
|
148 |
+
)->processResponse();
|
149 |
+
|
150 |
+
$this->setPayment($processedResponse->getPayment());
|
151 |
+
|
152 |
+
return $this;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Only difference with parent is that here the totalAmount is 'Credit', rather than 'Debit'
|
157 |
+
*
|
158 |
+
* @see TIG_Buckaroo3Extended_Model_Request_Abstract::_addOrderVariables()
|
159 |
+
*/
|
160 |
+
protected function _addOrderVariables()
|
161 |
+
{
|
162 |
+
list($currency, $totalAmount) = $this->_determinRefundAmountAndCurrency();
|
163 |
+
|
164 |
+
$tax = 0;
|
165 |
+
foreach($this->_order->getFullTaxInfo() as $taxRecord)
|
166 |
+
{
|
167 |
+
$tax += $taxRecord['amount'];
|
168 |
+
}
|
169 |
+
$tax = round($tax,2);
|
170 |
+
|
171 |
+
$this->_vars['currency'] = $currency;
|
172 |
+
$this->_vars['amountCredit'] = $totalAmount;
|
173 |
+
$this->_vars['amountDebit'] = 0;
|
174 |
+
$this->_vars['orderId'] = $this->_order->getIncrementId();
|
175 |
+
|
176 |
+
$this->_debugEmail .= 'Order variables added! \n';
|
177 |
+
}
|
178 |
+
|
179 |
+
protected function _determinRefundAmountAndCurrency()
|
180 |
+
{
|
181 |
+
$baseCurrency = $this->_order->getBaseCurrency()->getCode();
|
182 |
+
$currency = $this->_order->getCurrencyCodeUsedForTransaction();
|
183 |
+
|
184 |
+
if ($baseCurrency == $currency) {
|
185 |
+
return array($currency, $this->_amount);
|
186 |
+
} else {
|
187 |
+
$amount = round($this->_amount * $this->_order->getBaseToOrderRate(), 2);
|
188 |
+
return array($currency, $amount);
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
protected function _addCustomParameters()
|
193 |
+
{
|
194 |
+
$array = array(
|
195 |
+
'refund_initiated_in_magento' => 1,
|
196 |
+
);
|
197 |
+
|
198 |
+
if (isset($this->_vars['customParaeters'])) {
|
199 |
+
$this->_vars['customParameters'] = array_merge($this->_vars['customParameters'], $array);
|
200 |
+
} else {
|
201 |
+
$this->_vars['customParameters'] = $array;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
@@ -0,0 +1,118 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Response_Abstract extends TIG_Buckaroo3Extended_Model_Response_Abstract
|
3 |
+
{
|
4 |
+
protected $_payment;
|
5 |
+
|
6 |
+
public function setPayment($payment)
|
7 |
+
{
|
8 |
+
$this->_payment = $payment;
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getPayment()
|
12 |
+
{
|
13 |
+
return $this->_payment;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function __construct($data)
|
17 |
+
{
|
18 |
+
$this->setOrder($data['order']);
|
19 |
+
$this->setPayment($data['payment']);
|
20 |
+
parent::__construct($data);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function processResponse()
|
24 |
+
{
|
25 |
+
if ($this->_response === false) {
|
26 |
+
$this->_debugEmail .= "An error occurred.";
|
27 |
+
$this->_error();
|
28 |
+
}
|
29 |
+
|
30 |
+
$this->_debugEmail .= "Verifying authenticity of the response...";
|
31 |
+
$verified = $this->_verifyResponse();
|
32 |
+
|
33 |
+
if ($verified !== true) {
|
34 |
+
$this->_debugEmail .= "Authenticity could NOT be verified!";
|
35 |
+
$this->_verifyError();
|
36 |
+
}
|
37 |
+
$this->_debugEmail .= "Verified as authentic! \n\n";
|
38 |
+
|
39 |
+
$this->_payment->setTransactionKey($this->_response->Key)->save();
|
40 |
+
|
41 |
+
$parsedResponse = $this->_parseResponse();
|
42 |
+
$this->_debugEmail .= "Parsed response: " . var_export($parsedResponse, true) . "\n";
|
43 |
+
|
44 |
+
$this->_debugEmail .= "Dispatching custom order processing event... \n";
|
45 |
+
|
46 |
+
Mage::dispatchEvent(
|
47 |
+
'buckaroo3extended_refund_response_custom_processing',
|
48 |
+
array(
|
49 |
+
'model' => $this,
|
50 |
+
'order' => $this->getOrder(),
|
51 |
+
'response' => $parsedResponse,
|
52 |
+
)
|
53 |
+
);
|
54 |
+
|
55 |
+
$this->_requiredAction($parsedResponse);
|
56 |
+
return $this;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
protected function _success()
|
61 |
+
{
|
62 |
+
$this->_debugEmail .= 'The refund request has been accepted \n';
|
63 |
+
|
64 |
+
$this->sendDebugEmail();
|
65 |
+
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
protected function _failed()
|
70 |
+
{
|
71 |
+
$this->_debugEmail .= 'The transaction request has failed. \n';
|
72 |
+
|
73 |
+
$this->_updateRefundedOrderStatus(false);
|
74 |
+
|
75 |
+
$this->sendDebugEmail();
|
76 |
+
|
77 |
+
Mage::throwException(Mage::helper('buckaroo3extended')->__($this->_response->Status->Code->_));
|
78 |
+
}
|
79 |
+
|
80 |
+
protected function _error()
|
81 |
+
{
|
82 |
+
$this->_debugEmail .= 'The transaction request produced an error. \n';
|
83 |
+
|
84 |
+
if ($this->getOrder()) {
|
85 |
+
$this->_updateRefundedOrderStatus(false);
|
86 |
+
}
|
87 |
+
|
88 |
+
$this->sendDebugEmail();
|
89 |
+
|
90 |
+
if (isset($this->_response) && isset($this->_response->Status->Code->_)) {
|
91 |
+
Mage::throwException(Mage::helper('buckaroo3extended')->__('Buckaroo returned the following error: %s', $this->_response->Status->Code->_));
|
92 |
+
} else {
|
93 |
+
Mage::throwException('An unknown error occurred.');
|
94 |
+
}
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
protected function _neutral()
|
99 |
+
{
|
100 |
+
$this->_failed();
|
101 |
+
}
|
102 |
+
|
103 |
+
protected function _verifyError()
|
104 |
+
{
|
105 |
+
$this->_failed();
|
106 |
+
}
|
107 |
+
|
108 |
+
protected function _pendingPayment()
|
109 |
+
{
|
110 |
+
$this->_debugEmail .= 'This refund request has been put on hold. \n';
|
111 |
+
|
112 |
+
$this->_updateRefundedOrderStatus(false);
|
113 |
+
|
114 |
+
$this->sendDebugEmail();
|
115 |
+
|
116 |
+
Mage::throwException(Mage::helper('buckaroo3extended')->__("This refund request has been put on hold by Buckaroo. You can find out details regarding the action and complete the refund in Buckaroo Payment Plaza."));
|
117 |
+
}
|
118 |
+
}
|
@@ -0,0 +1,366 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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aroo3Extended_Model_Refund_Response_Abstract
|
3 |
+
{
|
4 |
+
const PAYMENTCODE = 'buckaroo3extended';
|
5 |
+
|
6 |
+
protected $_order = '';
|
7 |
+
protected $_creditmemo = '';
|
8 |
+
protected $_postArray = '';
|
9 |
+
protected $_debugEmail = '';
|
10 |
+
protected $_method = '';
|
11 |
+
protected $_storeId = '';
|
12 |
+
|
13 |
+
public function setCurrentOrder($order)
|
14 |
+
{
|
15 |
+
$this->_order = $order;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getCurrentOrder()
|
19 |
+
{
|
20 |
+
return $this->_order;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setCreditmemo($creditmemo)
|
24 |
+
{
|
25 |
+
$this->_creditmemo = $creditmemo;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getCreditmemo()
|
29 |
+
{
|
30 |
+
return $this->_creditmemo;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function setPostArray($array)
|
34 |
+
{
|
35 |
+
$this->_postArray = $array;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getPostArray()
|
39 |
+
{
|
40 |
+
return $this->_postArray;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function setDebugEmail($debugEmail)
|
44 |
+
{
|
45 |
+
$this->_debugEmail = $debugEmail;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getDebugEmail()
|
49 |
+
{
|
50 |
+
return $this->_debugEmail;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function setStoreId($storeId)
|
54 |
+
{
|
55 |
+
$this->_storeId = $storeId;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getStoreId()
|
59 |
+
{
|
60 |
+
return $this->_storeId;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function __construct($data = array())
|
64 |
+
{
|
65 |
+
$this->setCurrentOrder($data['order']);
|
66 |
+
$this->setPostArray($data['postArray']);
|
67 |
+
$this->setDebugEmail($data['debugEmail']);
|
68 |
+
$this->setStoreId($this->getOrder()->getStoreId());
|
69 |
+
|
70 |
+
foreach ($data['order']->getCreditmemosCollection() as $creditmemo)
|
71 |
+
{
|
72 |
+
if ($creditmemo->getTransactionKey() == $data['postArray']['brq_transactions']) {
|
73 |
+
$this->setCreditmemo($creditmemo);
|
74 |
+
break;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
if (empty($creditmemo)) {
|
79 |
+
$this->_debugEmail .= "Could not locate a creditmemo with the supplied transaction key. \n";
|
80 |
+
}
|
81 |
+
}
|
82 |
+
/**
|
83 |
+
* Processes 'pushes' recieves from Buckaroo with the purpose of updating an existing creditmemo or create a new one.
|
84 |
+
*
|
85 |
+
* @return boolean
|
86 |
+
*/
|
87 |
+
public function processPush()
|
88 |
+
{
|
89 |
+
//check if the push is valid and if the order can be updated
|
90 |
+
$canProcessPush = $this->_canProcessRefundPush();
|
91 |
+
list($canProcess, $canUpdate) = $canProcessPush;
|
92 |
+
|
93 |
+
$this->_debugEmail .= "can the creditmemo be processed? " . $canProcess . "\ncan the creditmemo be updated? " . $canUpdate . "\n";
|
94 |
+
|
95 |
+
if (!$canProcess || !$canUpdate) {
|
96 |
+
return false;
|
97 |
+
}
|
98 |
+
|
99 |
+
$response = $this->_parseRefundPostResponse($this->_postArray['brq_statuscode']);
|
100 |
+
|
101 |
+
$this->_debugEmail .= "Response recieved: " . var_export($response, true) . "\n\n";
|
102 |
+
|
103 |
+
Mage::dispatchEvent('buckaroo3extended_refund_push_custom_processing', array('push' => $this, 'order' => $this->getCurrentOrder(), 'response' => $response));
|
104 |
+
|
105 |
+
if ($this->getCustomResponseProcessing()) {
|
106 |
+
return true;
|
107 |
+
}
|
108 |
+
|
109 |
+
return true;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Checks if the post recieved is valid by checking its signature field.
|
114 |
+
* This field is unique for every payment and every store.
|
115 |
+
* Also calls method that checks if an order is able to be updated further.
|
116 |
+
* Canceled, completed, holded etc. orders are not able to be updated
|
117 |
+
*
|
118 |
+
* @return array $return
|
119 |
+
*/
|
120 |
+
protected function _canProcessRefundPush()
|
121 |
+
{
|
122 |
+
$correctSignature = false;
|
123 |
+
$canUpdate = false;
|
124 |
+
$signature = $this->_calculateSignature();
|
125 |
+
if ($signature === $this->_postArray['brq_signature']) {
|
126 |
+
$correctSignature = true;
|
127 |
+
}
|
128 |
+
|
129 |
+
//check if the order can recieve further status updates
|
130 |
+
if ($correctSignature === true) {
|
131 |
+
if ($this->_order->canRefund() && $this->_postArray['brq_statuscode'] == '190') {
|
132 |
+
$canUpdate = true;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
$return = array(
|
137 |
+
(bool) $correctSignature,
|
138 |
+
(bool) $canUpdate,
|
139 |
+
);
|
140 |
+
return $return;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Process a succesful order. Sets its new state and status, sends an order confirmation email
|
145 |
+
* and creates an invoice if set in config.
|
146 |
+
*
|
147 |
+
* @TODO $trx will be used for Buckaroo2012Refund, to be added in 3.0.0
|
148 |
+
*
|
149 |
+
* @param array $response | int $response
|
150 |
+
* @param string $description
|
151 |
+
*
|
152 |
+
* @return boolean
|
153 |
+
*/
|
154 |
+
protected function _processSuccess($newStates, $description = false)
|
155 |
+
{
|
156 |
+
$this->_autoInvoice();
|
157 |
+
|
158 |
+
$description = Mage::helper('buckaroo3extended')->__($description);
|
159 |
+
|
160 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
161 |
+
|
162 |
+
//sets the transaction key if its defined ($trx)
|
163 |
+
//will retrieve it from the response array, if response actually is an array
|
164 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
165 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
166 |
+
$this->_order->save();
|
167 |
+
}
|
168 |
+
|
169 |
+
$this->_order->setState($newStates[0], $newStates[1], $description)
|
170 |
+
->save();
|
171 |
+
|
172 |
+
//send new order email if it hasnt already been sent
|
173 |
+
if(!$this->_order->getEmailSent())
|
174 |
+
{
|
175 |
+
$this->_order->sendNewOrderEmail();
|
176 |
+
}
|
177 |
+
|
178 |
+
return true;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Process a failed order. Sets its new state and status and cencels the order
|
183 |
+
* if set in config.
|
184 |
+
*
|
185 |
+
* @param array $newStates
|
186 |
+
* @param string $description
|
187 |
+
*
|
188 |
+
* @return boolean
|
189 |
+
*/
|
190 |
+
protected function _processFailed($newStates, $description = false)
|
191 |
+
{
|
192 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
193 |
+
|
194 |
+
//sets the transaction key if its defined ($trx)
|
195 |
+
//will retrieve it from the response array, if response actually is an array
|
196 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
197 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
198 |
+
}
|
199 |
+
|
200 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/cancel_on_failed', $this->getStoreId())) {
|
201 |
+
$this->_order->cancel()
|
202 |
+
->save();
|
203 |
+
if ($description) {
|
204 |
+
$this->_order->addStatusHistoryComment(Mage::helper('buckaroo3extended')->__($description))
|
205 |
+
->save();
|
206 |
+
}
|
207 |
+
} else {
|
208 |
+
$this->_order->setState($newStates[0], $newStates[1], Mage::helper('buckaroo3extended')->__($description))
|
209 |
+
->save();
|
210 |
+
}
|
211 |
+
return true;
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Processes an order for which an incorrect amount has been paid (can only happen with Overschrijving)
|
216 |
+
*
|
217 |
+
* @return boolean
|
218 |
+
*/
|
219 |
+
protected function _processIncorrectPayment($newStates)
|
220 |
+
{
|
221 |
+
//determine whether too much or not enough has been paid and determine the status history copmment accordingly
|
222 |
+
$amount = round($this->_order->getBaseGrandTotal()*100, 0);
|
223 |
+
$currency = $this->_order->getBaseCurrencyCode();
|
224 |
+
|
225 |
+
if ($amount > $this->_postArray['brq_amount']) {
|
226 |
+
$setState = $newStates[0];
|
227 |
+
$setStatus = $newStates[1];
|
228 |
+
$description = Mage::helper('buckaroo3extended')->__('te weinig betaald: ')
|
229 |
+
. round(($this->_postArray['brq_amount'] / 100), 2)
|
230 |
+
. ' '
|
231 |
+
. $currency
|
232 |
+
. Mage::helper('buckaroo3extended')->__(' is overgemaakt. Order bedrag was: ')
|
233 |
+
. round($this->_order->getGrandTotal(), 2)
|
234 |
+
. ' '
|
235 |
+
. $currency;
|
236 |
+
} elseif ($amount < $this->_postArray['bpe_amount']) {
|
237 |
+
$setState = $newStates[0];
|
238 |
+
$setStatus = $newStates[1];
|
239 |
+
$description = Mage::helper('buckaroo3extended')->__('te veel betaald: ')
|
240 |
+
. round(($this->_postArray['brq_amount'] / 100), 2)
|
241 |
+
. ' '
|
242 |
+
. $currency
|
243 |
+
. Mage::helper('buckaroo3extended')->__(' is overgemaakt. Order bedrag was: ')
|
244 |
+
. round($this->_order->getGrandTotal(), 2)
|
245 |
+
. ' '
|
246 |
+
. $currency;
|
247 |
+
} else {
|
248 |
+
//the correct amount was actually paid, so return false
|
249 |
+
return false;
|
250 |
+
}
|
251 |
+
|
252 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_transfer/on_hold_email')) {
|
253 |
+
$this->_sendOverschrijvingOnHoldEmail();
|
254 |
+
}
|
255 |
+
|
256 |
+
//hold the order
|
257 |
+
$this->_order->hold()
|
258 |
+
->save();
|
259 |
+
$this->_order->setState($setState, $setStatus, Mage::helper('buckaroo3extended')->__($description))
|
260 |
+
->save();
|
261 |
+
|
262 |
+
return true;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* processes an order awaiting payment. Sets its new state and status.
|
267 |
+
*
|
268 |
+
* @param array $newStates
|
269 |
+
* @param string $description
|
270 |
+
*
|
271 |
+
* @return boolean
|
272 |
+
*/
|
273 |
+
protected function _processPendingPayment($newStates, $description = false)
|
274 |
+
{
|
275 |
+
$description = Mage::helper('buckaroo3extended')->__($description);
|
276 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
277 |
+
|
278 |
+
//sets the transaction key if its defined ($trx)
|
279 |
+
//will retrieve it from the response array, if response actually is an array
|
280 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
281 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
282 |
+
}
|
283 |
+
|
284 |
+
$this->_order->setState($newStates[0], $newStates[1], $description)
|
285 |
+
->save();
|
286 |
+
|
287 |
+
return true;
|
288 |
+
}
|
289 |
+
|
290 |
+
public function getNewStates($code)
|
291 |
+
{
|
292 |
+
return $this->_getNewStates($code);
|
293 |
+
}
|
294 |
+
|
295 |
+
public function processPendingPayment($newStates, $description = false) {
|
296 |
+
return $this->_processPendingPayment($newStates, $description);
|
297 |
+
}
|
298 |
+
|
299 |
+
public function processSuccess($newStates, $description = false) {
|
300 |
+
return $this->_processPendingPayment($newStates, $description);
|
301 |
+
}
|
302 |
+
|
303 |
+
public function processFailed($newStates, $description = false) {
|
304 |
+
return $this->_processPendingPayment($newStates, $description);
|
305 |
+
}
|
306 |
+
|
307 |
+
public function processIncorrectPayment($newStates) {
|
308 |
+
return $this->_processPendingPayment($newStates);
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* Determines the signature using array sorting and the SHA1 hash algorithm
|
313 |
+
*
|
314 |
+
* @param array $origArray
|
315 |
+
*
|
316 |
+
* @return string $signature
|
317 |
+
*/
|
318 |
+
protected function _calculateSignature()
|
319 |
+
{
|
320 |
+
if (isset($this->_postArray['isOldPost']) && $this->_postArray['isOldPost'])
|
321 |
+
{
|
322 |
+
return $this->_calculateOldSignature();
|
323 |
+
}
|
324 |
+
|
325 |
+
$origArray = $this->_postArray;
|
326 |
+
unset($origArray['brq_signature']);
|
327 |
+
|
328 |
+
//sort the array
|
329 |
+
$sortableArray = $this->buckarooSort($origArray);
|
330 |
+
|
331 |
+
//turn into string and add the secret key to the end
|
332 |
+
$signatureString = '';
|
333 |
+
foreach($sortableArray as $key => $value) {
|
334 |
+
$value = urldecode($value);
|
335 |
+
$signatureString .= $key . '=' . $value;
|
336 |
+
}
|
337 |
+
$signatureString .= Mage::getStoreConfig('buckaroo/buckaroo3extended/digital_signature', $this->getStoreId());
|
338 |
+
|
339 |
+
$this->_debugEmail .= "\nSignaturestring: {$signatureString}\n";
|
340 |
+
|
341 |
+
//return the SHA1 encoded string for comparison
|
342 |
+
$signature = SHA1($signatureString);
|
343 |
+
|
344 |
+
$this->_debugEmail .= "\nSignature: {$signature}\n";
|
345 |
+
|
346 |
+
return $signature;
|
347 |
+
}
|
348 |
+
|
349 |
+
protected function _calculateOldSignature()
|
350 |
+
{
|
351 |
+
$signature2 = md5(
|
352 |
+
$this->_postArray['oldPost']["bpe_trx"]
|
353 |
+
. $this->_postArray['oldPost']["bpe_timestamp"]
|
354 |
+
. Mage::getStoreConfig('buckaroo/buckaroo3extended/key', $this->getStoreId())
|
355 |
+
. $this->_postArray['oldPost']["bpe_invoice"]
|
356 |
+
. $this->_postArray['oldPost']["bpe_reference"]
|
357 |
+
. $this->_postArray['oldPost']["bpe_currency"]
|
358 |
+
. $this->_postArray['oldPost']["bpe_amount"]
|
359 |
+
. $this->_postArray['oldPost']["bpe_result"]
|
360 |
+
. $this->_postArray['oldPost']["bpe_mode"]
|
361 |
+
. Mage::getStoreConfig('buckaroo/buckaroo3extended/digital_signature', $this->getStoreId())
|
362 |
+
);
|
363 |
+
|
364 |
+
return $signature2;
|
365 |
+
}
|
366 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesClosedFailed extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'closed';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesClosedSuccess extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'closed';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesCompleteFailed extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'complete';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesCompleteSuccess extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'complete';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesProcessingFailed extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'processing';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Refund_Sources_StatusesProcessingSuccess extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state = 'processing';
|
7 |
+
|
8 |
+
$statuses = Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options = array();
|
11 |
+
$options[] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value => $label)
|
13 |
+
{
|
14 |
+
$options[] = array('value' => $value, 'label' => $label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
Binary file
|
@@ -0,0 +1,256 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Request_Abstract extends TIG_Buckaroo3Extended_Model_Abstract
|
3 |
+
{
|
4 |
+
protected $_vars;
|
5 |
+
protected $_method;
|
6 |
+
|
7 |
+
public function getVars()
|
8 |
+
{
|
9 |
+
return $this->_vars;
|
10 |
+
}
|
11 |
+
|
12 |
+
public function setVars($vars = array())
|
13 |
+
{
|
14 |
+
$this->_vars = $vars;
|
15 |
+
|
16 |
+
return $this;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getMethod()
|
20 |
+
{
|
21 |
+
return $this->_method;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function setMethod($method = '')
|
25 |
+
{
|
26 |
+
$this->_method = $method;
|
27 |
+
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function __construct() {
|
32 |
+
parent::__construct();
|
33 |
+
|
34 |
+
$this->setVars(array());
|
35 |
+
}
|
36 |
+
|
37 |
+
public function sendRequest()
|
38 |
+
{
|
39 |
+
try {
|
40 |
+
$this->_sendRequest();
|
41 |
+
} catch (Exception $e) {
|
42 |
+
|
43 |
+
$responseModelClass = Mage::helper('buckaroo3extended')->isAdmin() ? 'buckaroo3extended/response_backendOrder' : 'buckaroo3extended/response_abstract';
|
44 |
+
|
45 |
+
Mage::helper('buckaroo3extended')->logException($e);
|
46 |
+
$responseModel = Mage::getModel(
|
47 |
+
$responseModelClass,
|
48 |
+
array(
|
49 |
+
'response' => false,
|
50 |
+
'XML' => false,
|
51 |
+
'debugEmail' => $this->_debugEmail
|
52 |
+
)
|
53 |
+
);
|
54 |
+
$responseModel->setOrder($this->_order)
|
55 |
+
->processResponse();
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function _sendRequest()
|
60 |
+
{
|
61 |
+
$responseModelClass = Mage::helper('buckaroo3extended')->isAdmin() ? 'buckaroo3extended/response_backendOrder' : 'buckaroo3extended/response_abstract';
|
62 |
+
|
63 |
+
if (empty($this->_order)) {
|
64 |
+
$this->_debugEmail .= "No order was set! :( \n";
|
65 |
+
Mage::getModel($responseModelClass, array('response' => false, 'XML' => false, 'debugEmail' => $this->_debugEmail))->processResponse();
|
66 |
+
}
|
67 |
+
|
68 |
+
if($this->_order->hasTransactionKey()){
|
69 |
+
$message = 'Order '.$this->_order->getIncrementId().' has a new transaction key requested, the current key will be unset.'."\n";
|
70 |
+
$message.= 'current key: '.$this->_order->getTransactionKey();
|
71 |
+
|
72 |
+
$this->_debugEmail .= $message."\n";
|
73 |
+
|
74 |
+
$this->_order->addStatusHistoryComment(
|
75 |
+
Mage::helper('buckaroo3extended')->__('New transaction key requested, the current key is unset.')
|
76 |
+
);
|
77 |
+
|
78 |
+
$this->_order->setTransactionKey(false);
|
79 |
+
$this->_order->save();
|
80 |
+
}
|
81 |
+
|
82 |
+
Mage::dispatchEvent('buckaroo3extended_request_setmethod', array('request' => $this, 'order' => $this->_order));
|
83 |
+
|
84 |
+
$this->_debugEmail .= 'Chosen payment method: ' . $this->_method . "\n";
|
85 |
+
|
86 |
+
//if no method has been set (no payment method could identify the chosen method) process the order as if it had failed
|
87 |
+
if (empty($this->_method)) {
|
88 |
+
$this->_debugEmail .= "No method was set! :( \n";
|
89 |
+
$responseModel = Mage::getModel(
|
90 |
+
$responseModelClass,
|
91 |
+
array(
|
92 |
+
'response' => false,
|
93 |
+
'XML' => false,
|
94 |
+
'debugEmail' => $this->_debugEmail
|
95 |
+
)
|
96 |
+
);
|
97 |
+
if (!$responseModel->getOrder()) {
|
98 |
+
$responseModel->setOrder($this->_order);
|
99 |
+
}
|
100 |
+
|
101 |
+
$responseModel->processResponse();
|
102 |
+
}
|
103 |
+
|
104 |
+
//hack to prevent SQL errors when using onestepcheckout
|
105 |
+
if(!Mage::helper('buckaroo3extended')->isAdmin()) {
|
106 |
+
Mage::getSingleton('checkout/session')->getQuote()->setReservedOrderId(null)->save();
|
107 |
+
}else {
|
108 |
+
Mage::getSingleton('adminhtml/session_quote')->getQuote()->setReservedOrderId(null)->save();
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
$this->_debugEmail .= "\n";
|
113 |
+
//forms an array with all payment-independant variables (such as merchantkey, order id etc.) which are required for the transaction request
|
114 |
+
$this->_addBaseVariables();
|
115 |
+
$this->_addOrderVariables();
|
116 |
+
$this->_addShopVariables();
|
117 |
+
$this->_addSoftwareVariables();
|
118 |
+
|
119 |
+
$this->_debugEmail .= "Firing request events. \n";
|
120 |
+
//event that allows individual payment methods to add additional variables such as bankaccount number
|
121 |
+
Mage::dispatchEvent('buckaroo3extended_request_addservices', array('request' => $this, 'order' => $this->_order));
|
122 |
+
Mage::dispatchEvent('buckaroo3extended_request_addcustomvars', array('request' => $this, 'order' => $this->_order));
|
123 |
+
Mage::dispatchEvent('buckaroo3extended_request_addcustomparameters', array('request' => $this, 'order' => $this->_order));
|
124 |
+
|
125 |
+
$this->_debugEmail .= "Events fired! \n";
|
126 |
+
|
127 |
+
//clean the array for a soap request
|
128 |
+
$this->setVars($this->_cleanArrayForSoap($this->getVars()));
|
129 |
+
|
130 |
+
$this->_debugEmail .= "Variable array:" . var_export($this->_vars, true) . "\n\n";
|
131 |
+
$this->_debugEmail .= "Building SOAP request... \n";
|
132 |
+
|
133 |
+
//send the transaction request using SOAP
|
134 |
+
$soap = Mage::getModel('buckaroo3extended/soap', array('vars' => $this->getVars(), 'method' => $this->getMethod()));
|
135 |
+
list($response, $responseXML, $requestXML) = $soap->transactionRequest();
|
136 |
+
|
137 |
+
|
138 |
+
$this->_debugEmail .= "The SOAP request has been sent. \n";
|
139 |
+
|
140 |
+
if (!is_object($requestXML) || !is_object($responseXML)) {
|
141 |
+
$this->_debugEmail .= "Request or response was not an object \n";
|
142 |
+
} else {
|
143 |
+
$this->_debugEmail .= "Request: " . var_export($requestXML->saveXML(), true) . "\n";
|
144 |
+
$this->_debugEmail .= "Response: " . var_export($response, true) . "\n";
|
145 |
+
$this->_debugEmail .= "Response XML:" . var_export($responseXML->saveXML(), true) . "\n\n";
|
146 |
+
}
|
147 |
+
|
148 |
+
$this->_debugEmail .= "Processing response... \n";
|
149 |
+
|
150 |
+
//process the response
|
151 |
+
$responseModel = Mage::getModel(
|
152 |
+
$responseModelClass,
|
153 |
+
array(
|
154 |
+
'response' => $response,
|
155 |
+
'XML' => $responseXML,
|
156 |
+
'debugEmail' => $this->_debugEmail,
|
157 |
+
)
|
158 |
+
);
|
159 |
+
|
160 |
+
if (!$responseModel->getOrder()) {
|
161 |
+
$responseModel->setOrder($this->_order);
|
162 |
+
}
|
163 |
+
$responseModel->processResponse();
|
164 |
+
}
|
165 |
+
|
166 |
+
protected function _addServices()
|
167 |
+
{
|
168 |
+
$this->_vars['services'][$this->_method] = array(
|
169 |
+
'action' => 'Pay',
|
170 |
+
'version' => 1,
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
protected function _addBaseVariables()
|
175 |
+
{
|
176 |
+
list($country, $locale, $lang) = $this->_getLocale();
|
177 |
+
|
178 |
+
//test mode can be set in the general config options, but also in the config options for the individual payment options.
|
179 |
+
//The latter overwrites the first if set to true
|
180 |
+
$test = Mage::getStoreConfig('buckaroo/buckaroo3extended/mode', Mage::app()->getStore()->getStoreId());
|
181 |
+
|
182 |
+
if (!$test && Mage::getStoreConfig('buckaroo/buckaroo3extended' . $this->_code . '/mode', Mage::app()->getStore()->getStoreId())) {
|
183 |
+
$test = '1';
|
184 |
+
}
|
185 |
+
|
186 |
+
$this->_vars['country'] = $country;
|
187 |
+
$this->_vars['locale'] = $locale;
|
188 |
+
$this->_vars['lang'] = $lang;
|
189 |
+
$this->_vars['test'] = $test;
|
190 |
+
|
191 |
+
$this->_debugEmail .= "Base variables added! \n";
|
192 |
+
}
|
193 |
+
|
194 |
+
protected function _addShopVariables()
|
195 |
+
{
|
196 |
+
$returnUrl = Mage::getUrl('buckaroo3extended/notify/return', array('_secure' => true));
|
197 |
+
|
198 |
+
$merchantKey = Mage::getStoreConfig('buckaroo/buckaroo3extended/key', $this->_order->getStoreId());
|
199 |
+
$description = Mage::getStoreConfig('buckaroo/buckaroo3extended/payment_description', $this->_order->getStoreId());
|
200 |
+
$thumbprint = Mage::getStoreConfig('buckaroo/buckaroo3extended/thumbprint', $this->_order->getStoreId());
|
201 |
+
|
202 |
+
$this->_vars['returnUrl'] = $returnUrl;
|
203 |
+
$this->_vars['merchantKey'] = $merchantKey;
|
204 |
+
$this->_vars['description'] = $description;
|
205 |
+
$this->_vars['thumbprint'] = $thumbprint;
|
206 |
+
|
207 |
+
$this->_debugEmail .= "Shop variables added! \n";
|
208 |
+
}
|
209 |
+
|
210 |
+
protected function _addSoftwareVariables()
|
211 |
+
{
|
212 |
+
$platformName = 'Magento';
|
213 |
+
|
214 |
+
if (method_exists('Mage', 'getEdition')) {
|
215 |
+
$platformName .= ' ' . Mage::getEdition();
|
216 |
+
}
|
217 |
+
|
218 |
+
$platformVersion = Mage::getVersion();
|
219 |
+
$moduleSupplier = 'Total Internet Group';
|
220 |
+
$moduleName = 'Buckaroo3Extended';
|
221 |
+
$moduleVersion = (string) Mage::getConfig()->getModuleConfig("TIG_Buckaroo3Extended")->version;
|
222 |
+
|
223 |
+
$array = array(
|
224 |
+
'PlatformName' => $platformName,
|
225 |
+
'PlatformVersion' => $platformVersion,
|
226 |
+
'ModuleSupplier' => $moduleSupplier,
|
227 |
+
'ModuleName' => $moduleName,
|
228 |
+
'ModuleVersion' => $moduleVersion,
|
229 |
+
);
|
230 |
+
|
231 |
+
$this->_vars['Software'] = $array;
|
232 |
+
|
233 |
+
$this->_debugEmail .= "Software variables added! \n";
|
234 |
+
}
|
235 |
+
|
236 |
+
protected function _addOrderVariables()
|
237 |
+
{
|
238 |
+
list($currency, $totalAmount) = $this->_determineAmountAndCurrency();
|
239 |
+
|
240 |
+
$this->_vars['currency'] = $currency;
|
241 |
+
$this->_vars['amountCredit'] = 0;
|
242 |
+
$this->_vars['amountDebit'] = $totalAmount;
|
243 |
+
$this->_vars['orderId'] = $this->_order->getIncrementId();
|
244 |
+
|
245 |
+
$this->_debugEmail .= "Order variables added! \n";
|
246 |
+
}
|
247 |
+
|
248 |
+
protected function _addRefundVariables()
|
249 |
+
{
|
250 |
+
$invoice = Mage::getModel('sales/order_invoice')->load($this->_invoice);
|
251 |
+
$this->_vars['OriginalTransactionKey'] = $invoice->getTransactionId();
|
252 |
+
$this->_vars['invoiceId'] = 'CM'.$invoice->getIncrementId();
|
253 |
+
|
254 |
+
$this->_debugEmail .= "Refund variables added! \n";
|
255 |
+
}
|
256 |
+
}
|
@@ -0,0 +1,163 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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ended_Model_Request_Availability extends TIG_Buckaroo3Extended_Model_Abstract
|
3 |
+
{
|
4 |
+
public static $allowedCurrencies = array(
|
5 |
+
'EUR',
|
6 |
+
'GBP',
|
7 |
+
'USD',
|
8 |
+
'CAD',
|
9 |
+
'SHR',
|
10 |
+
'NOK',
|
11 |
+
'SEK',
|
12 |
+
'DKK',
|
13 |
+
'ARS',
|
14 |
+
'BRL',
|
15 |
+
'HRK',
|
16 |
+
'LTL',
|
17 |
+
'TRY',
|
18 |
+
'TRL',
|
19 |
+
'AUD',
|
20 |
+
'CNY',
|
21 |
+
'LVL',
|
22 |
+
'MXN',
|
23 |
+
'MXP',
|
24 |
+
'PLN',
|
25 |
+
'CHF',
|
26 |
+
'CZK',
|
27 |
+
);
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Various checks to determine if Buckaroo payment options should be available to customers
|
31 |
+
*
|
32 |
+
* @param null $quote
|
33 |
+
* @return bool
|
34 |
+
*/
|
35 |
+
public static function canUseBuckaroo($quote = null)
|
36 |
+
{
|
37 |
+
$return = false;
|
38 |
+
|
39 |
+
$configValues = self::_checkConfigValues();
|
40 |
+
|
41 |
+
$currencyAllowed = self::_checkCurrencyAllowed();
|
42 |
+
|
43 |
+
$ipAllowed = self::_checkIpAllowed();
|
44 |
+
|
45 |
+
$isZeroPayment = self::_checkGrandTotalNotZero($quote);
|
46 |
+
|
47 |
+
$isEnterprise = @mage::getModel('Enterprise_Reward_Model_Reward');
|
48 |
+
|
49 |
+
if (
|
50 |
+
$configValues === true
|
51 |
+
&& $currencyAllowed === true
|
52 |
+
&& $ipAllowed === true
|
53 |
+
&& (
|
54 |
+
$isZeroPayment === false || $isEnterprise
|
55 |
+
)
|
56 |
+
)
|
57 |
+
{
|
58 |
+
$return = true;
|
59 |
+
}
|
60 |
+
return $return;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Checks if all required configuration options are set
|
65 |
+
* NOTE: does not check if entered values are valid, only that they're not empty
|
66 |
+
*
|
67 |
+
* @return bool
|
68 |
+
*/
|
69 |
+
private static function _checkConfigValues()
|
70 |
+
{
|
71 |
+
$configValues = false;
|
72 |
+
|
73 |
+
//config values that need to be entered
|
74 |
+
$configEnabled = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended/active', Mage::app()->getStore()->getStoreId());
|
75 |
+
$merchantKeyEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended/key', Mage::app()->getStore()->getStoreId());
|
76 |
+
$thumbprintEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended/thumbprint', Mage::app()->getStore()->getStoreId());
|
77 |
+
$orderStatusSuccessEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status_success', Mage::app()->getStore()->getStoreId());
|
78 |
+
$orderStatusFailedEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status_failed', Mage::app()->getStore()->getStoreId());
|
79 |
+
|
80 |
+
//advanced config values that need to be entered
|
81 |
+
$newOrderStatusEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status', Mage::app()->getStore()->getStoreId());
|
82 |
+
$orderStateSuccessEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_success', Mage::app()->getStore()->getStoreId());
|
83 |
+
$orderStateFailedEntered = (bool) Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_failed', Mage::app()->getStore()->getStoreId());
|
84 |
+
|
85 |
+
if ($configEnabled
|
86 |
+
&& $merchantKeyEntered
|
87 |
+
&& $thumbprintEntered
|
88 |
+
&& $orderStatusSuccessEntered
|
89 |
+
&& $orderStatusFailedEntered
|
90 |
+
&& $newOrderStatusEntered
|
91 |
+
&& $orderStateSuccessEntered
|
92 |
+
&& $orderStateFailedEntered
|
93 |
+
)
|
94 |
+
{
|
95 |
+
$configValues = true;
|
96 |
+
}
|
97 |
+
return $configValues;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Checks if the store's base currency is allowed by Buckaroo
|
102 |
+
*
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
private static function _checkCurrencyAllowed()
|
106 |
+
{
|
107 |
+
$allowed = false;
|
108 |
+
|
109 |
+
$baseCurrency = Mage::app()->getStore()->getBaseCurrency()->getCode();
|
110 |
+
|
111 |
+
if (in_array($baseCurrency, self::$allowedCurrencies)) {
|
112 |
+
$allowed = true;
|
113 |
+
}
|
114 |
+
|
115 |
+
return $allowed;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* If the 'limit by IP' options is set in the backend, check if the user's IP ids allowed
|
120 |
+
* NOTE: this is only the general limit by ip option. Individual module's limit by IP options are not checked here
|
121 |
+
*
|
122 |
+
* @return bool
|
123 |
+
*/
|
124 |
+
private static function _checkIpAllowed()
|
125 |
+
{
|
126 |
+
$ipAllowed = false;
|
127 |
+
|
128 |
+
if (Mage::getStoreConfig('dev/restrict/allow_ips') && Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/limit_by_ip'))
|
129 |
+
{
|
130 |
+
$allowedIp = explode(',', mage::getStoreConfig('dev/restrict/allow_ips'));
|
131 |
+
if (in_array(Mage::helper('core/http')->getRemoteAddr(), $allowedIp))
|
132 |
+
{
|
133 |
+
$ipAllowed = true;
|
134 |
+
}
|
135 |
+
} else {
|
136 |
+
$ipAllowed = true;
|
137 |
+
}
|
138 |
+
|
139 |
+
return $ipAllowed;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Checks if the order base grandtotal is zero.
|
144 |
+
* NOTE: this check is currently not used. Will be implemented later when I know for certain which payment methods can and cannot handle
|
145 |
+
* zero-grandtotal payments.
|
146 |
+
*
|
147 |
+
* @param $quote
|
148 |
+
* @return bool
|
149 |
+
*/
|
150 |
+
private static function _checkGrandTotalNotZero($quote)
|
151 |
+
{
|
152 |
+
if (empty($quote)) {
|
153 |
+
return true;
|
154 |
+
}
|
155 |
+
$isZero = false;
|
156 |
+
|
157 |
+
if ($quote->getBaseGrandTotal() < 0.01) {
|
158 |
+
$isZero = true;
|
159 |
+
}
|
160 |
+
|
161 |
+
return $isZero;
|
162 |
+
}
|
163 |
+
}
|
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Resource_Certificate extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('buckaroo3extended/certificate', 'certificate_id');
|
7 |
+
}
|
8 |
+
}
|
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Resource_Certificate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('buckaroo3extended/certificate');
|
8 |
+
}
|
9 |
+
}
|
@@ -0,0 +1,45 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_Resource_Giftcard extends Mage_Core_Model_Mysql4_Abstract
|
40 |
+
{
|
41 |
+
public function _construct()
|
42 |
+
{
|
43 |
+
$this->_init('buckaroo3extended/giftcard', 'entity_id');
|
44 |
+
}
|
45 |
+
}
|
@@ -0,0 +1,46 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_Resource_Giftcard_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
40 |
+
{
|
41 |
+
public function _construct()
|
42 |
+
{
|
43 |
+
parent::_construct();
|
44 |
+
$this->_init('buckaroo3extended/giftcard');
|
45 |
+
}
|
46 |
+
}
|
@@ -0,0 +1,383 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* callAfterApplyAllUpdates flag. Causes applyAFterUpdates() to be called.
|
6 |
+
*
|
7 |
+
* @var boolean
|
8 |
+
*/
|
9 |
+
protected $_callAfterApplyAllUpdates = true;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Module version as stored in the db at the time of the update
|
13 |
+
*
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
protected $_dbVer;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Module version as specified in the module's configuration at the time of the update
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
protected $_configVer;
|
24 |
+
|
25 |
+
protected $_giftcardArray = array(
|
26 |
+
array(
|
27 |
+
'value' => 'babygiftcard',
|
28 |
+
'label' => 'babygiftcard'
|
29 |
+
),
|
30 |
+
array(
|
31 |
+
'value' => 'babyparkgiftcard',
|
32 |
+
'label' => 'Babypark Giftcard'
|
33 |
+
),
|
34 |
+
array(
|
35 |
+
'value' => 'beautywellness',
|
36 |
+
'label' => 'Beauty Wellness'
|
37 |
+
),
|
38 |
+
array(
|
39 |
+
'value' => 'boekenbon',
|
40 |
+
'label' => 'Boekenbon'
|
41 |
+
),
|
42 |
+
array(
|
43 |
+
'value' => 'boekenvoordeel',
|
44 |
+
'label' => 'Boekenvoordeel'
|
45 |
+
),
|
46 |
+
array(
|
47 |
+
'value' => 'designshopsgiftcard',
|
48 |
+
'label' => 'Designshops Giftcard'
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'value' => 'fijncadeau',
|
52 |
+
'label' => 'Fijn Cadeau'
|
53 |
+
),
|
54 |
+
array(
|
55 |
+
'value' => 'koffiecadeau',
|
56 |
+
'label' => 'Koffie Cadeau'
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'value' => 'kokenzo',
|
60 |
+
'label' => 'Koken En Zo'
|
61 |
+
),
|
62 |
+
array(
|
63 |
+
'value' => 'kookcadeau',
|
64 |
+
'label' => 'kook-cadeau'
|
65 |
+
),
|
66 |
+
array(
|
67 |
+
'value' => 'nationaleentertainmentcard',
|
68 |
+
'label' => 'Nationale EntertainmentCard'
|
69 |
+
),
|
70 |
+
array(
|
71 |
+
'value' => 'naturesgift',
|
72 |
+
'label' => 'Natures Gift'
|
73 |
+
),
|
74 |
+
array(
|
75 |
+
'value' => 'podiumcadeaukaart',
|
76 |
+
'label' => 'PODIUM Cadeaukaart'
|
77 |
+
),
|
78 |
+
array(
|
79 |
+
'value' => 'shoesaccessories',
|
80 |
+
'label' => 'Shoes Accessories'
|
81 |
+
),
|
82 |
+
array(
|
83 |
+
'value' => 'webshopgiftcard',
|
84 |
+
'label' => 'Webshop Giftcard'
|
85 |
+
),
|
86 |
+
array(
|
87 |
+
'value' => 'wijncadeau',
|
88 |
+
'label' => 'Wijn Cadeau'
|
89 |
+
),
|
90 |
+
array(
|
91 |
+
'value' => 'wonenzo',
|
92 |
+
'label' => 'Wonen En Zo'
|
93 |
+
),
|
94 |
+
array(
|
95 |
+
'value' => 'yourgift',
|
96 |
+
'label' => 'YourGift Card'
|
97 |
+
),
|
98 |
+
array(
|
99 |
+
'value' => 'fashioncheque',
|
100 |
+
'label' => 'fashioncheque'
|
101 |
+
),
|
102 |
+
array(
|
103 |
+
'value' => 'sieradenhorlogescadeaukaart',
|
104 |
+
'label' => 'sieradenhorlogescadeaukaart'
|
105 |
+
),
|
106 |
+
array(
|
107 |
+
'value' => 'jewellerygiftcard',
|
108 |
+
'label' => 'JewelleryGiftcard'
|
109 |
+
),
|
110 |
+
array(
|
111 |
+
'value' => 'ebon',
|
112 |
+
'label' => 'e-bon'
|
113 |
+
),
|
114 |
+
array(
|
115 |
+
'value' => 'voetbalshopcadeau',
|
116 |
+
'label' => 'Voetbalshop cadeaucard'
|
117 |
+
)
|
118 |
+
);
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Set the stored DB version to the specified value
|
122 |
+
*
|
123 |
+
* @param string $dbVer
|
124 |
+
*
|
125 |
+
* @return TIG_Buckaroo3Extended_Model_Resource_Setup
|
126 |
+
*/
|
127 |
+
public function setDbVer($dbVer)
|
128 |
+
{
|
129 |
+
$this->_dbVer = $dbVer;
|
130 |
+
|
131 |
+
return $this;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Set the stored config version to the specified value
|
136 |
+
*
|
137 |
+
* @param string $configVer
|
138 |
+
*
|
139 |
+
* @return TIG_Buckaroo3Extended_Model_Resource_Setup
|
140 |
+
*/
|
141 |
+
public function setConfigVer($configVer)
|
142 |
+
{
|
143 |
+
$this->_configVer = $configVer;
|
144 |
+
|
145 |
+
return $this;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get the stored DB version
|
150 |
+
*
|
151 |
+
* @return string
|
152 |
+
*/
|
153 |
+
public function getDbVer()
|
154 |
+
{
|
155 |
+
return $this->_dbVer;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* get the stored config version
|
160 |
+
*
|
161 |
+
* @return string
|
162 |
+
*/
|
163 |
+
public function getConfigVer()
|
164 |
+
{
|
165 |
+
return $this->_configVer;
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Store the applied update versions
|
170 |
+
*
|
171 |
+
* @return parent::applyUpdates()
|
172 |
+
*/
|
173 |
+
public function applyUpdates()
|
174 |
+
{
|
175 |
+
$dbVer = $this->_getResource()->getDbVersion($this->_resourceName);
|
176 |
+
$configVer = (string)$this->_moduleConfig->version;
|
177 |
+
|
178 |
+
$this->setDbVer($dbVer);
|
179 |
+
$this->setConfigVer($configVer);
|
180 |
+
|
181 |
+
return parent::applyUpdates();
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Check if there are modules installed that can conflict with the buckaroo module
|
186 |
+
*
|
187 |
+
* @return TIG_Buckaroo3Extended_Model_Resource_Setup
|
188 |
+
* @deprecated v4.10.1
|
189 |
+
*
|
190 |
+
*/
|
191 |
+
public function afterApplyAllUpdates()
|
192 |
+
{
|
193 |
+
/**
|
194 |
+
* as of version v4.10.0 the rewrites were removed due to the rewritten PaymentFee implementation
|
195 |
+
* so the conflict-detection can be disabled
|
196 |
+
*/
|
197 |
+
return $this;
|
198 |
+
}
|
199 |
+
|
200 |
+
public function getGiftcardArray()
|
201 |
+
{
|
202 |
+
return $this->_giftcardArray;
|
203 |
+
}
|
204 |
+
|
205 |
+
public function getTermsAndConditions()
|
206 |
+
{
|
207 |
+
$termsAndConditions = <<<TERMS_AND_CONDITIONS
|
208 |
+
<p><strong>Toelichting</strong></p>
|
209 |
+
<p>Bij "achteraf betalen", kunt u eerst uw bestelling ontvangen en dan de factuur betalen.
|
210 |
+
Indien u kiest voor de betaalmethode "achteraf betalen", gaat u akkoord met de daarbij behorende
|
211 |
+
algemene voorwaarden. Voor de beoordeling van uw aanvraag worden de door u ingevulde gegevens
|
212 |
+
conform de bepalingen in de algemene voorwaarden doorgezonden naar Intrum Justitia.</p>
|
213 |
+
<p>De afhandeling van de betaling van de Klanten wordt uitbesteed aan Buckaroo. Op de factuur
|
214 |
+
staat hoe u (na ontvangst van goederen en/of diensten) de factuur dient te betalen. De
|
215 |
+
factuur dient binnen 14 (veertien) dagen na factuurdatum betaald te worden.</p>
|
216 |
+
<p>U dient dit vakje aan te klikken om aan te geven dat u akkoord gaat met de algemene voorwaarden.
|
217 |
+
Voor deze algemene voorwaarden klikt u <a href="">hier</a>.</p>
|
218 |
+
TERMS_AND_CONDITIONS;
|
219 |
+
|
220 |
+
return $termsAndConditions;
|
221 |
+
}
|
222 |
+
|
223 |
+
public function setTermsAndConditions($termsAndConditions)
|
224 |
+
{
|
225 |
+
$this->_termsAndConditions = $termsAndConditions;
|
226 |
+
return $this;
|
227 |
+
}
|
228 |
+
|
229 |
+
public function getInformationRequirement()
|
230 |
+
{
|
231 |
+
$informationRequirement = <<<INFORMATION_REQUIREMENT
|
232 |
+
<p>Voorwaarden gebruik "achteraf betalen":<br/>
|
233 |
+
1. De producten en/of diensten van <naam Merchant invullen> zijn afgenomen met een factuur-
|
234 |
+
en afleveradres (geen postbus) in Nederland;<br/>
|
235 |
+
2. Om de financiële risico's van de betaaloptie "achteraf betalen" te beperken, wordt de
|
236 |
+
bestelling via Buckaroo door Intrum Justitia getoetst. Op grond van deze toetsing wordt
|
237 |
+
bepaald of de aanvraag voor de achteraf betaling geaccepteerd wordt. Als gevolg van de
|
238 |
+
acceptatie dient u te betalen op de manier zoals nader in deze voorwaarden beschreven.
|
239 |
+
<naam Merchant invullen> wijst Intrum Justitia aan als degene aan wie moet worden betaald.<br/>
|
240 |
+
3. Indien betaaloptie "achteraf betalen" niet wordt geaccepteerd, dient u de bestelling via een
|
241 |
+
andere betaaloptie vooraf te voldoen;<br/>
|
242 |
+
4. U verklaart dat alle (aanvullende) gegevens benodigd voor de aanvraag van uw verzoek om
|
243 |
+
achteraf betaling, correct en volledig zijn opgegeven en geeft toestemming uw gegevens
|
244 |
+
te verwerken en online uw gegevens te toetsen bij Intrum Justitia, zodat u direct weet of de
|
245 |
+
aanvraag geaccepteerd wordt;<br/>
|
246 |
+
5. U bent verplicht <naam Merchant invullen> op de hoogte te stellen van iedere adres- en/
|
247 |
+
of e-mailwijziging. Zolang wij geen adreswijziging van u hebben ontvangen, wordt u geacht
|
248 |
+
woonachtig te zijn op het laatst bij ons bekende adres. Ongeacht het wel of niet doorgeven
|
249 |
+
van een adres- en/of e-mailwijziging blijft u gehouden het openstaande saldo te voldoen.
|
250 |
+
Adres- en/of e-mailwijzigingen kunnen via de website van <naam Merchant invullen> per e-
|
251 |
+
mail of schriftelijk aan de Klantenservice van <naam Merchant invullen> worden doorgegeven;<br/>
|
252 |
+
6. U verklaart dat u geen surseance van betaling heeft aangevraagd of verkeert in
|
253 |
+
schuldsanering/ bemiddeling, niet failliet bent verklaard of onder curatele gesteld en er ook
|
254 |
+
geen procedure of aanvraag loopt, welke zou kunnen resulteren in een faillissement, een
|
255 |
+
surseance van betaling, een onder curatelestelling of enig traject van schuldsanering in welke
|
256 |
+
vorm dan ook</p>
|
257 |
+
<p>De wijze van betalen<br/>
|
258 |
+
1. Intrum Justitia heeft de afhandeling van uw betaling uitbesteed aan Buckaroo B.V.
|
259 |
+
(www.buckaroo.nl). Indien uw aanvraag is geaccepteerd, ontvangt u naast de (digitale)
|
260 |
+
factuur, kort daarna ook een e-mail met betaalkoppeling van Buckaroo. Op zowel de factuur
|
261 |
+
als in de e-mail met betaalkoppeling staat aangegeven hoe u (na ontvangst van de goederen
|
262 |
+
en/of diensten) de factuur dient te betalen. Zorg ervoor dat u op tijd betaalt conform de
|
263 |
+
instructies vermeld op de factuur of via de e-mail met betaalkoppeling. U voorkomt dat
|
264 |
+
incassokosten aan u in rekening gebracht worden bij overschrijding van de betalingstermijn
|
265 |
+
van 14 (veertien) dagen.<br/>
|
266 |
+
2. Voor het ontvangen van de e-mail dient u een geldig en correct e-mailadres op te geven.
|
267 |
+
Indien u geen geldig en correct e-mailadres opgeeft, dan ontvangt u geen betaalinformatie
|
268 |
+
via de e-mail met betaalkoppeling. U bent verplicht het e-mailadres dat u opgeeft op juistheid
|
269 |
+
te controleren, alsmede de ontvangst van de e-mail met betaalkoppeling van Buckaroo te
|
270 |
+
controleren.<br/>
|
271 |
+
3. U erkent dat Buckaroo diensten aanbiedt ten behoeve van het verwerken van online
|
272 |
+
betalingen door u aan en dat Buckaroo in dat verband kennisgevingen en mededelingen
|
273 |
+
weergeeft en/of zal weergeven en handelingen verricht danwel zal verrichten namens
|
274 |
+
<naam Merchant invullen> respectievelijk Intrum Justitia, hetgeen ook als zodanig door u
|
275 |
+
als een geldige en juiste kennisgeving, mededeling en/of handeling van danwel namens
|
276 |
+
<naam Merchant invullen> respectievelijk Intrum Justitia wordt erkend.</p>
|
277 |
+
<p>Betalingsvoorwaarden en betaaltermijn:<br/>
|
278 |
+
1. Het voor uw aankopen verschuldigde bedrag dient binnen een termijn van 14 (veertien) dagen
|
279 |
+
na factuurdatum in zijn geheel, zonder enige aftrek of verrekening door Buckaroo ontvangen
|
280 |
+
te zijn.<br/>
|
281 |
+
2. Indien u niet binnen 14 (veertien) dagen na datum factuur het gehele factuurbedrag heeft
|
282 |
+
betaald, bent u zonder nadere ingebrekestelling in verzuim.<br/>
|
283 |
+
3. Bij overschrijding van de betalingstermijn heeft Intrum Justitia al dan niet namens <naam
|
284 |
+
Merchant invullen> het recht buitengerechtelijke incassokosten alsmede rente in rekening te
|
285 |
+
brengen.<br/>
|
286 |
+
4. Voor het toezenden van de betalingsherinnering en het in rekening brengen van de
|
287 |
+
incassokosten alsmede de rente bij overschrijding van de betalingstermijn wordt gebruik
|
288 |
+
gemaakt van het door u opgegeven en het door u op juistheid gecontroleerde e-mail adres.
|
289 |
+
U ontvangt hiervoor een e-mail met betaalkoppeling. Het niet (kunnen) ontvangen van
|
290 |
+
een e-mail laat onverlet dat u verantwoordelijk bent voor het op tijd betalen van het gehele
|
291 |
+
factuurbedrag alsmede de in rekening gebrachte incassokosten en rente.<br/>
|
292 |
+
5. Indien u ondanks sommatie en/of herinneringen niet het gehele bedrag (factuurbedrag
|
293 |
+
alsmede de incassokosten en rente) betaalt, dan draagt <naam Merchant invullen>
|
294 |
+
overeenkomstig deze algemene voorwaarden, 35 (vijfendertig) dagen na factuurdatum, de
|
295 |
+
gehele Vordering jegens u ook juridisch over aan Intrum Justitia.<br/>
|
296 |
+
6. U bent verplicht Intrum Justitia op de hoogte te stellen van iedere adres- en/of e-mailwijziging
|
297 |
+
gedurende de periode dat u verplicht bent het verschuldigde bedrag te betalen. Zolang Intrum
|
298 |
+
Justitia geen adreswijziging van u heeft ontvangen, wordt u geacht woonachtig te zijn op
|
299 |
+
het laatst bij ons bekende adres en blijft u gehouden om het alsdan verschuldigde bedrag te
|
300 |
+
voldoen.<br/>
|
301 |
+
7. Het doorgeven van adres- en/of e-mailwijzigingen aan Intrum Justitia kan schriftelijk. De
|
302 |
+
adresgegevens vindt u terug op de website www.intrum.nl onder Contact.<br/>
|
303 |
+
8. Indien u niet, niet volledig of niet tijdig het gehele bedrag (factuurbedrag alsmede de
|
304 |
+
incassokosten) betaalt, kan dit gevolgen hebben voor eventuele goedkeuring door Intrum
|
305 |
+
Justitia van iedere volgende aanvraag van u voor de betaaloptie "achteraf betalen".</p>
|
306 |
+
INFORMATION_REQUIREMENT;
|
307 |
+
|
308 |
+
return $informationRequirement;
|
309 |
+
}
|
310 |
+
|
311 |
+
public function setInformationRequirement($informationRequirement)
|
312 |
+
{
|
313 |
+
$this->_informationRequirement = $informationRequirement;
|
314 |
+
return $this;
|
315 |
+
}
|
316 |
+
|
317 |
+
public function installTermsAndConditions()
|
318 |
+
{
|
319 |
+
$currentStore = Mage::app()->getStore()->getId();
|
320 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
321 |
+
|
322 |
+
$staticBlock = Mage::getModel('cms/block');
|
323 |
+
$intrumTermsAndConditions = $staticBlock->load('buckaroo_intrum_terms_and_conditions');
|
324 |
+
if ($intrumTermsAndConditions->getId()) {
|
325 |
+
return $this;
|
326 |
+
}
|
327 |
+
|
328 |
+
$parameters = array(
|
329 |
+
'title' => 'Buckaroo Algemene Voorwaarden',
|
330 |
+
'identifier' => 'buckaroo_intrum_terms_and_conditions',
|
331 |
+
'content' => $this->getTermsAndConditions(),
|
332 |
+
'is_active' => 1,
|
333 |
+
'stores' => array(0),
|
334 |
+
);
|
335 |
+
|
336 |
+
$intrumTermsAndConditions->setData($parameters)->save();
|
337 |
+
Mage::app()->setCurrentStore($currentStore);
|
338 |
+
return $this;
|
339 |
+
}
|
340 |
+
|
341 |
+
public function installInformationRequirement()
|
342 |
+
{
|
343 |
+
$currentStore = Mage::app()->getStore()->getId();
|
344 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
345 |
+
|
346 |
+
$staticBlock = Mage::getModel('cms/block');
|
347 |
+
$informationRequirement = $staticBlock->load('buckaroo_information_requirement');
|
348 |
+
if ($informationRequirement->getId()) {
|
349 |
+
return $this;
|
350 |
+
}
|
351 |
+
|
352 |
+
$parameters = array(
|
353 |
+
'title' => 'Buckaroo Informatieplicht',
|
354 |
+
'identifier' => 'buckaroo_information_requirement',
|
355 |
+
'content' => $this->getInformationRequirement(),
|
356 |
+
'is_active' => 1,
|
357 |
+
'stores' => array(0),
|
358 |
+
);
|
359 |
+
|
360 |
+
$informationRequirement->setData($parameters)->save();
|
361 |
+
Mage::app()->setCurrentStore($currentStore);
|
362 |
+
return $this;
|
363 |
+
}
|
364 |
+
|
365 |
+
public function installBaseGiftcards()
|
366 |
+
{
|
367 |
+
$giftcards = $this->getGiftcardArray();
|
368 |
+
foreach ($giftcards as $giftcard) {
|
369 |
+
$giftcardModel = Mage::getModel('buckaroo3extended/giftcard');
|
370 |
+
$giftcardModel->load($giftcard['value'], 'servicecode');
|
371 |
+
|
372 |
+
if ($giftcardModel->getId()) {
|
373 |
+
continue;
|
374 |
+
}
|
375 |
+
|
376 |
+
$giftcardModel->setServicecode($giftcard['value'])
|
377 |
+
->setLabel($giftcard['label'])
|
378 |
+
->save();
|
379 |
+
}
|
380 |
+
|
381 |
+
return $this;
|
382 |
+
}
|
383 |
+
}
|
@@ -0,0 +1,558 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Response_Abstract extends TIG_Buckaroo3Extended_Model_Abstract
|
3 |
+
{
|
4 |
+
protected $_debugEmail = '';
|
5 |
+
protected $_responseXML = '';
|
6 |
+
protected $_response = '';
|
7 |
+
|
8 |
+
protected $_customResponseProcessing = false;
|
9 |
+
|
10 |
+
public function setCurrentOrder($order)
|
11 |
+
{
|
12 |
+
$this->_order = $order;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getCurrentOrder()
|
16 |
+
{
|
17 |
+
return $this->_order;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function setDebugEmail($debugEmail)
|
21 |
+
{
|
22 |
+
$this->_debugEmail = $debugEmail;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function getDebugEmail()
|
26 |
+
{
|
27 |
+
return $this->_debugEmail;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function setResponseXML($xml)
|
31 |
+
{
|
32 |
+
$this->_responseXML = $xml;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getResponseXML()
|
36 |
+
{
|
37 |
+
return $this->_responseXML;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function setResponse($response)
|
41 |
+
{
|
42 |
+
$this->_response = $response;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function getResponse()
|
46 |
+
{
|
47 |
+
return $this->_response;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function setCustomResponseProcessing($boolean)
|
51 |
+
{
|
52 |
+
$this->_customResponseProcessing = (bool) $boolean;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function getCustomResponseProcessing()
|
56 |
+
{
|
57 |
+
return $this->_customResponseProcessing;
|
58 |
+
}
|
59 |
+
|
60 |
+
public function __construct($data)
|
61 |
+
{
|
62 |
+
parent::__construct($data['debugEmail']);
|
63 |
+
$this->setResponse($data['response']);
|
64 |
+
$this->setResponseXML($data['XML']);
|
65 |
+
}
|
66 |
+
|
67 |
+
public function processResponse()
|
68 |
+
{
|
69 |
+
if ($this->_response === false) {
|
70 |
+
$this->_debugEmail .= "An error occurred in building or sending the SOAP request.. \n";
|
71 |
+
$this->_error();
|
72 |
+
}
|
73 |
+
|
74 |
+
$this->_debugEmail .= "verifiying authenticity of the response... \n";
|
75 |
+
$verified = $this->_verifyResponse();
|
76 |
+
|
77 |
+
if ($verified !== true) {
|
78 |
+
$this->_debugEmail .= "The authenticity of the responw could NOT be verified. \n";
|
79 |
+
$this->_verifyError();
|
80 |
+
}
|
81 |
+
$this->_debugEmail .= "Verified as authentic! \n\n";
|
82 |
+
|
83 |
+
if (!$this->_order->getTransactionKey()
|
84 |
+
&& is_object($this->_response)
|
85 |
+
&& isset($this->_response->Key))
|
86 |
+
{
|
87 |
+
$this->_order->setTransactionKey($this->_response->Key);
|
88 |
+
$this->_order->save();
|
89 |
+
$this->_debugEmail .= 'Transaction key saved: ' . $this->_response->Key . "\n";
|
90 |
+
}
|
91 |
+
|
92 |
+
//sets the currency used by Buckaroo
|
93 |
+
if (!$this->_order->getCurrencyCodeUsedForTransaction()
|
94 |
+
&& is_object($this->_response)
|
95 |
+
&& isset($this->_response->Currency))
|
96 |
+
{
|
97 |
+
$this->_order->setCurrencyCodeUsedForTransaction($this->_response->Currency);
|
98 |
+
$this->_order->save();
|
99 |
+
}
|
100 |
+
|
101 |
+
if (is_object($this->_response) && isset($this->_response->RequiredAction)) {
|
102 |
+
$requiredAction = $this->_response->RequiredAction->Type;
|
103 |
+
} else {
|
104 |
+
$requiredAction = false;
|
105 |
+
}
|
106 |
+
|
107 |
+
$parsedResponse = $this->_parseResponse();
|
108 |
+
$this->_addSubCodeComment($parsedResponse);
|
109 |
+
|
110 |
+
if (!is_null($requiredAction)
|
111 |
+
&& $requiredAction !== false
|
112 |
+
&& $requiredAction == 'Redirect')
|
113 |
+
{
|
114 |
+
$this->_debugEmail .= "Redirecting customer... \n";
|
115 |
+
$this->_redirectUser();
|
116 |
+
}
|
117 |
+
|
118 |
+
$this->_debugEmail .= "Parsed response: " . var_export($parsedResponse, true) . "\n";
|
119 |
+
|
120 |
+
$this->_debugEmail .= "Dispatching custom order processing event... \n";
|
121 |
+
Mage::dispatchEvent(
|
122 |
+
'buckaroo3extended_response_custom_processing',
|
123 |
+
array(
|
124 |
+
'model' => $this,
|
125 |
+
'order' => $this->getOrder(),
|
126 |
+
'response' => $parsedResponse,
|
127 |
+
'responseobject' => $this->_response,
|
128 |
+
)
|
129 |
+
);
|
130 |
+
|
131 |
+
$this->_requiredAction($parsedResponse);
|
132 |
+
}
|
133 |
+
|
134 |
+
protected function _requiredAction($response)
|
135 |
+
{
|
136 |
+
switch ($response['status']) {
|
137 |
+
case self::BUCKAROO_SUCCESS: $this->_success();
|
138 |
+
break;
|
139 |
+
case self::BUCKAROO_FAILED: $this->_failed();
|
140 |
+
break;
|
141 |
+
case self::BUCKAROO_ERROR: $this->_error();
|
142 |
+
break;
|
143 |
+
case self::BUCKAROO_NEUTRAL: $this->_neutral();
|
144 |
+
break;
|
145 |
+
case self::BUCKAROO_PENDING_PAYMENT: $this->_pendingPayment();
|
146 |
+
break;
|
147 |
+
case self::BUCKAROO_INCORRECT_PAYMENT: $this->_incorrectPayment();
|
148 |
+
break;
|
149 |
+
case self::BUCKAROO_REJECTED: $this->_rejected();
|
150 |
+
break;
|
151 |
+
default: $this->_neutral();
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
protected function _addSubCodeComment($parsedResponse)
|
156 |
+
{
|
157 |
+
if (!isset($parsedResponse['subCode'])) {
|
158 |
+
return $this;
|
159 |
+
}
|
160 |
+
|
161 |
+
$subCode = $parsedResponse['subCode'];
|
162 |
+
|
163 |
+
$this->_order->addStatusHistoryComment(
|
164 |
+
Mage::helper('buckaroo3extended')->__(
|
165 |
+
'Buckaroo has sent the following response: %s',
|
166 |
+
$subCode['message']
|
167 |
+
)
|
168 |
+
);
|
169 |
+
|
170 |
+
$this->_order->save();
|
171 |
+
return $this;
|
172 |
+
}
|
173 |
+
|
174 |
+
protected function _redirectUser()
|
175 |
+
{
|
176 |
+
$redirectUrl = $this->_response->RequiredAction->RedirectURL;
|
177 |
+
|
178 |
+
$this->_order->addStatusHistoryComment(
|
179 |
+
Mage::helper('buckaroo3extended')->__(
|
180 |
+
'Customer is being redirected to Buckaroo. Url: %s',
|
181 |
+
$redirectUrl
|
182 |
+
)
|
183 |
+
);
|
184 |
+
$this->_order->save();
|
185 |
+
|
186 |
+
$this->_debugEmail .= "Redirecting user to…" . $redirectUrl . "\n";
|
187 |
+
|
188 |
+
$this->sendDebugEmail();
|
189 |
+
|
190 |
+
header('Location:' . $redirectUrl);
|
191 |
+
exit;
|
192 |
+
}
|
193 |
+
|
194 |
+
protected function _success()
|
195 |
+
{
|
196 |
+
$this->_debugEmail .= "The response indicates a successful request. \n";
|
197 |
+
|
198 |
+
$this->_order->addStatusHistoryComment(
|
199 |
+
Mage::helper('buckaroo3extended')->__(
|
200 |
+
'The payment request has been successfully recieved by Buckaroo.'
|
201 |
+
)
|
202 |
+
);
|
203 |
+
$this->_order->save();
|
204 |
+
|
205 |
+
/**
|
206 |
+
* @var Mage_Sales_Model_Order_Payment $payment
|
207 |
+
*/
|
208 |
+
$payment = $this->_order->getPayment();
|
209 |
+
$payment->registerAuthorizationNotification($this->_order->getBaseGrandTotal());
|
210 |
+
$payment->getMethodInstance()->saveAdditionalData($this->_response);
|
211 |
+
|
212 |
+
$shouldSend = Mage::getStoreConfig('buckaroo/' . $payment->getMethod() . '/order_email', $this->_order->getStoreId());
|
213 |
+
if(!$this->_order->getEmailSent() && $shouldSend)
|
214 |
+
{
|
215 |
+
$this->sendNewOrderEmail();
|
216 |
+
}
|
217 |
+
|
218 |
+
$this->emptyCart();
|
219 |
+
|
220 |
+
Mage::getSingleton('core/session')->addSuccess(
|
221 |
+
Mage::helper('buckaroo3extended')->__('Your order has been placed succesfully.')
|
222 |
+
);
|
223 |
+
|
224 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/success_redirect', $this->_order->getStoreId());
|
225 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
226 |
+
|
227 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . "\n";
|
228 |
+
|
229 |
+
$this->sendDebugEmail();
|
230 |
+
|
231 |
+
header('Location:' . $returnUrl);
|
232 |
+
exit;
|
233 |
+
}
|
234 |
+
|
235 |
+
protected function _failed()
|
236 |
+
{
|
237 |
+
$this->_debugEmail .= 'The transaction was unsuccessful. \n';
|
238 |
+
|
239 |
+
$this->_order->addStatusHistoryComment(
|
240 |
+
Mage::helper('buckaroo3extended')->__(
|
241 |
+
'The payment request has been denied by Buckaroo.'
|
242 |
+
)
|
243 |
+
);
|
244 |
+
$this->_order->save();
|
245 |
+
|
246 |
+
$this->restoreQuote();
|
247 |
+
|
248 |
+
Mage::getSingleton('core/session')->addError(
|
249 |
+
Mage::helper('buckaroo3extended')->__('Your payment was unsuccesful. Please try again or choose another payment method.')
|
250 |
+
);
|
251 |
+
|
252 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/cancel_on_failed', $this->_order->getStoreId())) {
|
253 |
+
$this->_returnGiftcards($this->_order);
|
254 |
+
$this->_order->cancel()->save();
|
255 |
+
}
|
256 |
+
|
257 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/failure_redirect', $this->_order->getStoreId());
|
258 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
259 |
+
|
260 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . "\n";
|
261 |
+
|
262 |
+
$this->sendDebugEmail();
|
263 |
+
header('Location:' . $returnUrl);
|
264 |
+
exit;
|
265 |
+
}
|
266 |
+
|
267 |
+
protected function _error()
|
268 |
+
{
|
269 |
+
$this->_debugEmail .= "The transaction generated an error. \n";
|
270 |
+
|
271 |
+
Mage::getSingleton('core/session')->addError(
|
272 |
+
Mage::helper('buckaroo3extended')->__('A technical error has occurred. Please try again. If this problem persists, please contact the shop owner.')
|
273 |
+
);
|
274 |
+
|
275 |
+
$this->_order->addStatusHistoryComment(
|
276 |
+
Mage::helper('buckaroo3extended')->__(
|
277 |
+
'A technical error has occurred.'
|
278 |
+
)
|
279 |
+
);
|
280 |
+
|
281 |
+
$this->_returnGiftcards($this->_order);
|
282 |
+
|
283 |
+
$this->_order->cancel()->save();
|
284 |
+
$this->_returnGiftcards($this->_order);
|
285 |
+
|
286 |
+
$this->_debugEmail .= "The order has been cancelled. \n";
|
287 |
+
$this->restoreQuote();
|
288 |
+
$this->_debugEmail .= "The quote has been restored. \n";
|
289 |
+
|
290 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/failure_redirect', $this->_order->getStoreId());
|
291 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
292 |
+
|
293 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . "\n";
|
294 |
+
|
295 |
+
$this->sendDebugEmail();
|
296 |
+
header('Location:' . $returnUrl);
|
297 |
+
}
|
298 |
+
|
299 |
+
protected function _rejected()
|
300 |
+
{
|
301 |
+
|
302 |
+
$this->_debugEmail .= "The transaction generated an error. \n";
|
303 |
+
|
304 |
+
$paymentMethod = $this->_order->getPayment()->getMethod();
|
305 |
+
switch($paymentMethod){
|
306 |
+
case 'buckaroo3extended_afterpay':
|
307 |
+
Mage::getSingleton('checkout/session')->setData('buckarooAfterpayRejected',true);
|
308 |
+
$message = Mage::helper('buckaroo3extended')->__(
|
309 |
+
'We are sorry to inform you that the request to pay afterwards with AfterPay is not possible at' .
|
310 |
+
' this time. This can be due to various (temporary) reasons.<br/><br/> For questions about your' .
|
311 |
+
' rejection you can contact the customer service of AfterPay. Or you can visit the website of' .
|
312 |
+
' AfterPay and click ""Frequently asked questions"" through this link <a' .
|
313 |
+
' href=""http://www.afterpay.nl/page/consument-faq"">http://www.afterpay.nl/page/consument-faq<' .
|
314 |
+
'/a> in the section ""Datacontrol"".<br/><br/> We advice you to choose a different payment method' .
|
315 |
+
' to complete your order.'
|
316 |
+
);
|
317 |
+
break;
|
318 |
+
default:
|
319 |
+
$message = Mage::helper('buckaroo3extended')->__(
|
320 |
+
'The payment has been rejected, please try again or select a different paymentmethod.'
|
321 |
+
);
|
322 |
+
}
|
323 |
+
|
324 |
+
Mage::getSingleton('core/session')->addError($message);
|
325 |
+
|
326 |
+
$this->_order->cancel()->save();
|
327 |
+
$this->_debugEmail .= "The order has been cancelled. \n";
|
328 |
+
$this->restoreQuote();
|
329 |
+
$this->_debugEmail .= "The quote has been restored. \n";
|
330 |
+
|
331 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/failure_redirect', $this->_order->getStoreId());
|
332 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
333 |
+
|
334 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . "\n";
|
335 |
+
|
336 |
+
$this->sendDebugEmail();
|
337 |
+
header('Location:' . $returnUrl);
|
338 |
+
exit;
|
339 |
+
}
|
340 |
+
|
341 |
+
protected function _neutral()
|
342 |
+
{
|
343 |
+
$this->_debugEmail .= "The response is neutral (not successful, not unsuccessful). \n";
|
344 |
+
|
345 |
+
$this->_order->addStatusHistoryComment(
|
346 |
+
Mage::helper('buckaroo3extended')->__(
|
347 |
+
'The payment request has been recieved by Buckaroo.'
|
348 |
+
)
|
349 |
+
);
|
350 |
+
$this->_order->save();
|
351 |
+
|
352 |
+
Mage::getSingleton('core/session')->addSuccess(
|
353 |
+
Mage::helper('buckaroo3extended')->__(
|
354 |
+
'Your order has been placed succesfully. You will recieve an e-mail containing further payment instructions shortly.'
|
355 |
+
)
|
356 |
+
);
|
357 |
+
|
358 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/success_redirect', $this->_order->getStoreId());
|
359 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
360 |
+
|
361 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . '\n';
|
362 |
+
|
363 |
+
$this->sendDebugEmail();
|
364 |
+
header('Location:' . $returnUrl);
|
365 |
+
exit;
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* return the giftcard amount, if there is one
|
370 |
+
* @param $order Mage_Sales_Model_Order
|
371 |
+
*/
|
372 |
+
protected function _returnGiftcards($order)
|
373 |
+
{
|
374 |
+
if((float)$order->getGiftCardsAmount() > 0){
|
375 |
+
$this->_revertGiftCardsForOrder($order);
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Revert authorized amounts for all order's gift cards
|
381 |
+
*
|
382 |
+
* @param Mage_Sales_Model_Order $order
|
383 |
+
* @return Enterprise_GiftCardAccount_Model_Observer
|
384 |
+
*/
|
385 |
+
protected function _revertGiftCardsForOrder(Mage_Sales_Model_Order $order)
|
386 |
+
{
|
387 |
+
$cards = Mage::helper('enterprise_giftcardaccount')->getCards($order);
|
388 |
+
if (is_array($cards)) {
|
389 |
+
foreach ($cards as $card) {
|
390 |
+
if (isset($card['authorized'])) {
|
391 |
+
$this->_revertById($card['i'], $card['authorized']);
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
return $this;
|
397 |
+
}
|
398 |
+
|
399 |
+
/**
|
400 |
+
* Revert amount to gift card
|
401 |
+
*
|
402 |
+
* @param int $id
|
403 |
+
* @param int|float $amount
|
404 |
+
* @return Enterprise_GiftCardAccount_Model_Observer
|
405 |
+
*/
|
406 |
+
protected function _revertById($id, $amount = 0)
|
407 |
+
{
|
408 |
+
$giftCard = Mage::getModel('enterprise_giftcardaccount/giftcardaccount')->load($id);
|
409 |
+
|
410 |
+
if ($giftCard) {
|
411 |
+
$giftCard->revert($amount)
|
412 |
+
->unsOrder()
|
413 |
+
->save();
|
414 |
+
}
|
415 |
+
|
416 |
+
return $this;
|
417 |
+
}
|
418 |
+
|
419 |
+
protected function _pendingPayment()
|
420 |
+
{
|
421 |
+
$this->_success();
|
422 |
+
}
|
423 |
+
|
424 |
+
protected function _incorrectPayment()
|
425 |
+
{
|
426 |
+
$this->_error();
|
427 |
+
}
|
428 |
+
|
429 |
+
protected function _verifyError()
|
430 |
+
{
|
431 |
+
$this->_debugEmail .= "The transaction's authenticity was not verified. \n";
|
432 |
+
Mage::getSingleton('core/session')->addNotice(
|
433 |
+
Mage::helper('buckaroo3extended')->__('We are currently unable to retrieve the status of your transaction. If you do not recieve an e-mail regarding your order within 30 minutes, please contact the shop owner.')
|
434 |
+
);
|
435 |
+
|
436 |
+
$returnLocation = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/failure_redirect', $this->_order->getStoreId());
|
437 |
+
$returnUrl = Mage::getUrl($returnLocation, array('_secure' => true));
|
438 |
+
|
439 |
+
$this->_debugEmail .= 'Redirecting user to...' . $returnUrl . "\n";
|
440 |
+
|
441 |
+
$this->sendDebugEmail();
|
442 |
+
header('Location:' . $returnUrl);
|
443 |
+
exit;
|
444 |
+
}
|
445 |
+
|
446 |
+
protected function _verifyResponse()
|
447 |
+
{
|
448 |
+
$verified = false;
|
449 |
+
|
450 |
+
$verifiedSignature = $this->_verifySignature();
|
451 |
+
$verifiedDigest = $this->_verifyDigest();
|
452 |
+
|
453 |
+
if ($verifiedSignature === true && $verifiedDigest === true) {
|
454 |
+
$verified = true;
|
455 |
+
}
|
456 |
+
|
457 |
+
return $verified;
|
458 |
+
}
|
459 |
+
|
460 |
+
protected function _verifySignature()
|
461 |
+
{
|
462 |
+
$verified = false;
|
463 |
+
|
464 |
+
//save response XML to string
|
465 |
+
$responseDomDoc = $this->_responseXML;
|
466 |
+
$responseString = $responseDomDoc->saveXML();
|
467 |
+
|
468 |
+
//retrieve the signature value
|
469 |
+
$sigatureRegex = "#<SignatureValue>(.*)</SignatureValue>#ims";
|
470 |
+
$signatureArray = array();
|
471 |
+
preg_match_all($sigatureRegex, $responseString, $signatureArray);
|
472 |
+
|
473 |
+
//decode the signature
|
474 |
+
$signature = $signatureArray[1][0];
|
475 |
+
$sigDecoded = base64_decode($signature);
|
476 |
+
|
477 |
+
$xPath = new DOMXPath($responseDomDoc);
|
478 |
+
|
479 |
+
//register namespaces to use in xpath query's
|
480 |
+
$xPath->registerNamespace('wsse','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
|
481 |
+
$xPath->registerNamespace('sig','http://www.w3.org/2000/09/xmldsig#');
|
482 |
+
$xPath->registerNamespace('soap','http://schemas.xmlsoap.org/soap/envelope/');
|
483 |
+
|
484 |
+
//Get the SignedInfo nodeset
|
485 |
+
$SignedInfoQuery = '//wsse:Security/sig:Signature/sig:SignedInfo';
|
486 |
+
$SignedInfoQueryNodeSet = $xPath->query($SignedInfoQuery);
|
487 |
+
$SignedInfoNodeSet = $SignedInfoQueryNodeSet->item(0);
|
488 |
+
|
489 |
+
//Canonicalize nodeset
|
490 |
+
$signedInfo = $SignedInfoNodeSet->C14N(true, false);
|
491 |
+
|
492 |
+
//get the public key
|
493 |
+
$pubKey = openssl_get_publickey(openssl_x509_read(file_get_contents(CERTIFICATE_DIR . DS .'Checkout.pem')));
|
494 |
+
|
495 |
+
//verify the signature
|
496 |
+
$sigVerify = openssl_verify($signedInfo, $sigDecoded, $pubKey);
|
497 |
+
|
498 |
+
if ($sigVerify === 1) {
|
499 |
+
$verified = true;
|
500 |
+
}
|
501 |
+
|
502 |
+
return $verified;
|
503 |
+
}
|
504 |
+
|
505 |
+
protected function _verifyDigest()
|
506 |
+
{
|
507 |
+
$verified = false;
|
508 |
+
|
509 |
+
//save response XML to string
|
510 |
+
$responseDomDoc = $this->_responseXML;
|
511 |
+
$responseString = $responseDomDoc->saveXML();
|
512 |
+
|
513 |
+
//retrieve the signature value
|
514 |
+
$digestRegex = "#<DigestValue>(.*?)</DigestValue>#ims";
|
515 |
+
$digestArray = array();
|
516 |
+
preg_match_all($digestRegex, $responseString, $digestArray);
|
517 |
+
|
518 |
+
$digestValues = array();
|
519 |
+
foreach($digestArray[1] as $digest) {
|
520 |
+
$digestValues[] = $digest;
|
521 |
+
}
|
522 |
+
|
523 |
+
$xPath = new DOMXPath($responseDomDoc);
|
524 |
+
|
525 |
+
//register namespaces to use in xpath query's
|
526 |
+
$xPath->registerNamespace('wsse','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
|
527 |
+
$xPath->registerNamespace('sig','http://www.w3.org/2000/09/xmldsig#');
|
528 |
+
$xPath->registerNamespace('soap','http://schemas.xmlsoap.org/soap/envelope/');
|
529 |
+
|
530 |
+
$controlHashReference = $xPath->query('//*[@Id="_control"]')->item(0);
|
531 |
+
$controlHashCanonical = $controlHashReference->C14N(true, false);
|
532 |
+
$controlHash = base64_encode(pack('H*',sha1($controlHashCanonical)));
|
533 |
+
|
534 |
+
$bodyHashReference = $xPath->query('//*[@Id="_body"]')->item(0);
|
535 |
+
$bodyHashCanonical = $bodyHashReference->C14N(true, false);
|
536 |
+
$bodyHash = base64_encode(pack('H*',sha1($bodyHashCanonical)));
|
537 |
+
|
538 |
+
if (in_array($controlHash, $digestValues) === true && in_array($bodyHash, $digestValues) === true) {
|
539 |
+
$verified = true;
|
540 |
+
}
|
541 |
+
|
542 |
+
return $verified;
|
543 |
+
}
|
544 |
+
|
545 |
+
public function sendNewOrderEmail()
|
546 |
+
{
|
547 |
+
$currentStore = Mage::app()->getStore()->getId();
|
548 |
+
$orderStore = $this->_order->getStoreId();
|
549 |
+
|
550 |
+
Mage::app()->setCurrentStore($orderStore);
|
551 |
+
|
552 |
+
$this->_order->sendNewOrderEmail();
|
553 |
+
|
554 |
+
Mage::app()->setCurrentStore($currentStore);
|
555 |
+
|
556 |
+
return $this;
|
557 |
+
}
|
558 |
+
}
|
@@ -0,0 +1,79 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Response_BackendOrder extends TIG_Buckaroo3Extended_Model_Response_Abstract
|
3 |
+
{
|
4 |
+
protected function _success()
|
5 |
+
{
|
6 |
+
$this->_debugEmail .= "The request was successful \n";
|
7 |
+
if(!$this->_order->getEmailSent())
|
8 |
+
{
|
9 |
+
$this->_order->sendNewOrderEmail();
|
10 |
+
}
|
11 |
+
|
12 |
+
Mage::getSingleton('core/session')->addSuccess(
|
13 |
+
Mage::helper('buckaroo3extended')->__('Your order has been placed succesfully.')
|
14 |
+
);
|
15 |
+
$this->sendDebugEmail();
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function _failed()
|
19 |
+
{
|
20 |
+
$this->_debugEmail .= 'The request failed \n';
|
21 |
+
$this->restoreQuote();
|
22 |
+
|
23 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/cancel_on_failed', $this->_order->getStoreId())) {
|
24 |
+
$this->_order->cancel()->save();
|
25 |
+
}
|
26 |
+
|
27 |
+
$this->sendDebugEmail();
|
28 |
+
Mage::throwException('An error occurred while processing the payment request, check the Buckaroo debug e-mail for details.');
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _error()
|
32 |
+
{
|
33 |
+
$this->_debugEmail .= "The request generated an error \n";
|
34 |
+
|
35 |
+
$this->_order->cancel()->save();
|
36 |
+
|
37 |
+
$this->_debugEmail .= "I have cancelled the order! \n";
|
38 |
+
|
39 |
+
$this->sendDebugEmail();
|
40 |
+
Mage::throwException('An error occurred while processing the payment request, check the Buckaroo debug e-mail for details.');
|
41 |
+
}
|
42 |
+
|
43 |
+
protected function _neutral()
|
44 |
+
{
|
45 |
+
$this->_debugEmail .= "The request was neutral \n";
|
46 |
+
|
47 |
+
Mage::getSingleton('core/session')->addSuccess(
|
48 |
+
Mage::helper('buckaroo3extended')->__(
|
49 |
+
'Your order has been placed succesfully. You will recieve an e-mail containing further payment instructions shortly.'
|
50 |
+
)
|
51 |
+
);
|
52 |
+
|
53 |
+
$this->sendDebugEmail();
|
54 |
+
}
|
55 |
+
|
56 |
+
protected function _pendingPayment()
|
57 |
+
{
|
58 |
+
$this->_success();
|
59 |
+
}
|
60 |
+
|
61 |
+
protected function _incorrectPayment()
|
62 |
+
{
|
63 |
+
$this->_error();
|
64 |
+
}
|
65 |
+
|
66 |
+
protected function _verifyError()
|
67 |
+
{
|
68 |
+
$this->_debugEmail .= "The response could not be verified \n";
|
69 |
+
Mage::getSingleton('core/session')->addNotice(
|
70 |
+
Mage::helper('buckaroo3extended')->__('We are currently unable to retrieve the status of your transaction. If you do not recieve an e-mail regarding your order within 30 minutes, please contact the shop owner.')
|
71 |
+
);
|
72 |
+
|
73 |
+
$this->_order->cancel()->save();
|
74 |
+
$this->_debugEmail .= "I have cancelled the order! \n";
|
75 |
+
|
76 |
+
$this->sendDebugEmail();
|
77 |
+
Mage::throwException('An error occurred while processing the request');
|
78 |
+
}
|
79 |
+
}
|
@@ -0,0 +1,705 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Response_Push extends TIG_Buckaroo3Extended_Model_Response_Abstract
|
3 |
+
{
|
4 |
+
const PAYMENTCODE = 'buckaroo3extended';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @var Mage_Sales_Model_Order
|
8 |
+
*/
|
9 |
+
protected $_order = '';
|
10 |
+
|
11 |
+
protected $_postArray = '';
|
12 |
+
protected $_debugEmail = '';
|
13 |
+
protected $_method = '';
|
14 |
+
|
15 |
+
public function setCurrentOrder($order)
|
16 |
+
{
|
17 |
+
$this->_order = $order;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getCurrentOrder()
|
21 |
+
{
|
22 |
+
return $this->_order;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function setPostArray($array)
|
26 |
+
{
|
27 |
+
$this->_postArray = $array;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getPostArray()
|
31 |
+
{
|
32 |
+
return $this->_postArray;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setMethod($method)
|
36 |
+
{
|
37 |
+
$this->_method = $method;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getMethod()
|
41 |
+
{
|
42 |
+
return $this->_method;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function setDebugEmail($debugEmail)
|
46 |
+
{
|
47 |
+
$this->_debugEmail = $debugEmail;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getDebugEmail()
|
51 |
+
{
|
52 |
+
return $this->_debugEmail;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function __construct($data = array())
|
56 |
+
{
|
57 |
+
$this->setCurrentOrder($data['order']);
|
58 |
+
$this->setPostArray($data['postArray']);
|
59 |
+
$this->setDebugEmail($data['debugEmail']);
|
60 |
+
$this->setMethod($data['method']);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Processes 'pushes' receives from Buckaroo with the purpose of updating an order or payment.
|
65 |
+
*
|
66 |
+
* @return bool
|
67 |
+
*/
|
68 |
+
public function processPush()
|
69 |
+
{
|
70 |
+
$response = $this->_parsePostResponse($this->_postArray['brq_statuscode']);
|
71 |
+
|
72 |
+
//check if the push is valid and if the order can be updated
|
73 |
+
list($canProcess, $canUpdate) = $this->_canProcessPush(false,$response);
|
74 |
+
|
75 |
+
$this->_debugEmail .= "Can the order be processed? " . $canProcess . "\n"."Can the order be updated? " . $canUpdate . "\n";
|
76 |
+
|
77 |
+
if (!$canProcess) {
|
78 |
+
return false;
|
79 |
+
} elseif ($canProcess && !$canUpdate) {
|
80 |
+
//if the order cant be updated, try to add a notification to the status history instead
|
81 |
+
$response = $this->_parsePostResponse($this->_postArray['brq_statuscode']);
|
82 |
+
$this->_addNote($response['message'], $this->_method);
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
|
86 |
+
$paymentMethod = $this->_order->getPayment()->getMethod();
|
87 |
+
|
88 |
+
if ($paymentMethod == 'buckaroo3extended_giftcards') {
|
89 |
+
Mage::dispatchEvent('buckaroo3extended_push_custom_processing', array('push' => $this, 'order' => $this->getCurrentOrder()));
|
90 |
+
|
91 |
+
if ($this->getCustomResponseProcessing()) {
|
92 |
+
return true;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
$newStates = $this->_getNewStates($response['status']);
|
97 |
+
|
98 |
+
$this->_debugEmail .= "Response recieved: " . var_export($response, true) . "\n\n";
|
99 |
+
$this->_debugEmail .= "Current state: " . $this->_order->getState() . "\nCurrent status: " . $this->_order->getStatus() . "\n";
|
100 |
+
$this->_debugEmail .= "New state: " . $newStates[0] . "\nNew status: " . $newStates[1] . "\n\n";
|
101 |
+
|
102 |
+
Mage::dispatchEvent('buckaroo3extended_push_custom_processing', array('push' => $this, 'order' => $this->getCurrentOrder(), 'response' => $response));
|
103 |
+
|
104 |
+
if ($this->getCustomResponseProcessing()) {
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
|
108 |
+
switch ($response['status'])
|
109 |
+
{
|
110 |
+
case self::BUCKAROO_ERROR:
|
111 |
+
case self::BUCKAROO_FAILED: $updatedFailed = $this->_processFailed($newStates, $response['message']);
|
112 |
+
break;
|
113 |
+
case self::BUCKAROO_SUCCESS: $updatedSuccess = $this->_processSuccess($newStates, $response['message']);
|
114 |
+
break;
|
115 |
+
case self::BUCKAROO_NEUTRAL: $this->_addNote($response['message']);
|
116 |
+
break;
|
117 |
+
case self::BUCKAROO_PENDING_PAYMENT: $updatedPendingPayment = $this->_processPendingPayment($newStates, $response['message']);
|
118 |
+
break;
|
119 |
+
case self::BUCKAROO_INCORRECT_PAYMENT: $updatedIncorrectPayment = $this->_processIncorrectPayment($newStates);
|
120 |
+
break;
|
121 |
+
}
|
122 |
+
|
123 |
+
//revert the original status in order complete the whole process like it should.
|
124 |
+
if (isset($originalResponseStatus)) {
|
125 |
+
if($response['status'] == self::BUCKAROO_NEUTRAL){
|
126 |
+
$response['status'] = $originalResponseStatus;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
Mage::dispatchEvent(
|
131 |
+
'buckaroo3extended_push_custom_processing_after',
|
132 |
+
array(
|
133 |
+
'push' => $this,
|
134 |
+
'order' => $this->getCurrentOrder(),
|
135 |
+
'response' => $response
|
136 |
+
)
|
137 |
+
);
|
138 |
+
|
139 |
+
if (isset($updatedFailed) && $updatedFailed) {
|
140 |
+
$this->_debugEmail .= "Succesfully updated 'failed' state and status \n";
|
141 |
+
} elseif (isset($updatedSuccess) && $updatedSuccess) {
|
142 |
+
$this->_debugEmail .= "Succesfully updated 'success' state and status \n";
|
143 |
+
} elseif (isset($updatedPendingPayment) && $updatedPendingPayment) {
|
144 |
+
$this->_debugEmail .= "Succesfully updated pending payment \n";
|
145 |
+
} elseif (isset($updatedIncorrectPayment) && $updatedIncorrectPayment) {
|
146 |
+
$this->_debugEmail .= "Succesfully updated incorrect payment \n";
|
147 |
+
} else {
|
148 |
+
$this->_debugEmail .= "Order was not updated \n";
|
149 |
+
}
|
150 |
+
|
151 |
+
return true;
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Checks if the post received is valid by checking its signature field.
|
157 |
+
* This field is unique for every payment and every store.
|
158 |
+
* Also calls method that checks if an order is able to be updated further.
|
159 |
+
* Canceled, completed, holded etc. orders are not able to be updated
|
160 |
+
*
|
161 |
+
* @param bool $isReturn
|
162 |
+
* @param array $response
|
163 |
+
* @return array
|
164 |
+
*/
|
165 |
+
protected function _canProcessPush($isReturn = false, $response = array())
|
166 |
+
{
|
167 |
+
$correctSignature = false;
|
168 |
+
$canUpdate = false;
|
169 |
+
$signature = $this->_calculateSignature();
|
170 |
+
if ($signature === $this->_postArray['brq_signature']) {
|
171 |
+
$correctSignature = true;
|
172 |
+
}
|
173 |
+
|
174 |
+
//check if the order can recieve further status updates
|
175 |
+
if ($correctSignature === true) {
|
176 |
+
$canUpdate = $this->_canUpdate($response);
|
177 |
+
}
|
178 |
+
|
179 |
+
$return = array(
|
180 |
+
(bool) $correctSignature,
|
181 |
+
(bool) $canUpdate,
|
182 |
+
);
|
183 |
+
return $return;
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Checks if the order can be updated by checking if its state and status is not
|
188 |
+
* complete, closed, cancelled or holded and the order can be invoiced
|
189 |
+
*
|
190 |
+
* @param array $response
|
191 |
+
*
|
192 |
+
* @return boolean
|
193 |
+
*/
|
194 |
+
protected function _canUpdate($response = array())
|
195 |
+
{
|
196 |
+
|
197 |
+
// Get successful state and status
|
198 |
+
$completedStateAndStatus = array('complete', 'complete');
|
199 |
+
$cancelledStateAndStatus = array('canceled', 'canceled');
|
200 |
+
$holdedStateAndStatus = array('holded', 'holded');
|
201 |
+
$closedStateAndStatus = array ('closed','closed');
|
202 |
+
|
203 |
+
$currentStateAndStatus = array($this->_order->getState(), $this->_order->getStatus());
|
204 |
+
|
205 |
+
//prevent completed orders from recieving further updates
|
206 |
+
if( $completedStateAndStatus != $currentStateAndStatus
|
207 |
+
&& $cancelledStateAndStatus != $currentStateAndStatus
|
208 |
+
&& $holdedStateAndStatus != $currentStateAndStatus
|
209 |
+
&& $closedStateAndStatus != $currentStateAndStatus
|
210 |
+
&& $this->_order->canInvoice()
|
211 |
+
){
|
212 |
+
return true;
|
213 |
+
}
|
214 |
+
|
215 |
+
//when payperemail is used and the order has the status other then success, and current pushed status is success; send email to shopowner
|
216 |
+
if( !empty($response)
|
217 |
+
&& $response['status'] == self::BUCKAROO_SUCCESS
|
218 |
+
&& $this->_order->getPayment()->getMethod() == 'buckaroo3extended_payperemail'
|
219 |
+
&& (
|
220 |
+
$currentStateAndStatus == $completedStateAndStatus
|
221 |
+
|| $currentStateAndStatus == $cancelledStateAndStatus
|
222 |
+
|| $currentStateAndStatus == $holdedStateAndStatus
|
223 |
+
|| $currentStateAndStatus == $closedStateAndStatus
|
224 |
+
)
|
225 |
+
){
|
226 |
+
$this->_sendDoubleTransactionEmail();
|
227 |
+
}
|
228 |
+
|
229 |
+
$this->_debugEmail .= "order already has succes, complete, closed, or holded state or can't be invoiced \n\n";
|
230 |
+
|
231 |
+
|
232 |
+
return false;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Send the shop owner and subscribers to the debug-email an email with the message that there is a double transaction
|
237 |
+
*/
|
238 |
+
protected function _sendDoubleTransactionEmail(){
|
239 |
+
|
240 |
+
$helper = Mage::helper('buckaroo3extended');
|
241 |
+
$orderId = $this->_order->getIncrementId();
|
242 |
+
$currentOrderStatus = $this->_order->getStatus();
|
243 |
+
|
244 |
+
$recipients = explode(',', Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->getStoreId()));
|
245 |
+
$recipients[] = Mage::getStoreConfig('trans_email/ident_general/email');
|
246 |
+
|
247 |
+
$mail = $helper->__('Status Success received for order %s while the order currently the status %s has.',$orderId,$currentOrderStatus);
|
248 |
+
|
249 |
+
foreach($recipients as $recipient) {
|
250 |
+
mail(
|
251 |
+
trim($recipient),
|
252 |
+
'Dubbele transactie voor dezelfde order',
|
253 |
+
$mail
|
254 |
+
);
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Uses setState to add a comment to the order status history without changing the state nor status. Purpose of the comment
|
260 |
+
* is to inform the user of an attempted status upsate after the order has already recieved complete, canceled, closed or holded states
|
261 |
+
* or the order can't be invoiced. Returns false if the config has disabled this feature.
|
262 |
+
*
|
263 |
+
* @param string $description
|
264 |
+
*/
|
265 |
+
protected function _addNote($description)
|
266 |
+
{
|
267 |
+
$helper = Mage::helper('buckaroo3extended');
|
268 |
+
|
269 |
+
$note = $helper->__('Buckaroo attempted to update this order after it already had ')
|
270 |
+
. '<b>'
|
271 |
+
. strtoupper($this->_order->getState())
|
272 |
+
. '</b>'
|
273 |
+
. $helper->__(' state, by sending the following: ')
|
274 |
+
. '<br/>--------------------------------------------------------------------------------------------------------------------------------<br/>'
|
275 |
+
. $description
|
276 |
+
. ' ('
|
277 |
+
. $this->_postArray['brq_statuscode']
|
278 |
+
. ')';
|
279 |
+
$this->_order->addStatusHistoryComment($note)
|
280 |
+
->save();
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* @param $description
|
285 |
+
*/
|
286 |
+
public function addNote($description)
|
287 |
+
{
|
288 |
+
$this->_addNote($description);
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Determines which state and status an order will recieve based on its response code
|
293 |
+
* and the configuration. Will use configuration for the payment method used or, if
|
294 |
+
* that's not set, use the default
|
295 |
+
*
|
296 |
+
* @param string $code
|
297 |
+
*
|
298 |
+
* @return array $newStates
|
299 |
+
*
|
300 |
+
* @note currently the states are only used by _processpendingPayment(). May be removed completely in the future
|
301 |
+
*/
|
302 |
+
protected function _getNewStates($code)
|
303 |
+
{
|
304 |
+
$order = $this->getorder();
|
305 |
+
$storeId = $order->getStoreId();
|
306 |
+
|
307 |
+
$useStatus = Mage::getStoreConfig('buckaroo/' . $this->_method . '/active_status', $storeId);
|
308 |
+
|
309 |
+
//get the possible new states for the order
|
310 |
+
$stateSuccess = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_success', $storeId);
|
311 |
+
$stateFailure = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_failed', $storeId);
|
312 |
+
$statePendingpayment = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_pendingpayment', $storeId);
|
313 |
+
|
314 |
+
//get the possible new status for the order based on the payment method's individual config options
|
315 |
+
//these are optional
|
316 |
+
$customSuccessStatus = Mage::getStoreConfig('buckaroo/' . $this->_method . '/order_status_success', $storeId);
|
317 |
+
$customFailureStatus = Mage::getStoreConfig('buckaroo/' . $this->_method . '/order_status_failed', $storeId);
|
318 |
+
$customPendingPaymentStatus = Mage::getStoreConfig('buckaroo/' . $this->_method . '/order_status_pendingpayment', $storeId);
|
319 |
+
|
320 |
+
//get the possible default new status for the order based on the general config options
|
321 |
+
//these should always be set
|
322 |
+
$defaultSuccessStatus = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status_success', $storeId);
|
323 |
+
$defaultFailureStatus = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status_failed', $storeId);
|
324 |
+
$defaultPendingPaymentStatus = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_status_pendingpayment', $storeId);
|
325 |
+
|
326 |
+
//determine whether to use the default or custom status
|
327 |
+
if ($useStatus && $customSuccessStatus && !empty($customSuccessStatus)) {
|
328 |
+
$statusSuccess = $customSuccessStatus;
|
329 |
+
} else {
|
330 |
+
$statusSuccess = $defaultSuccessStatus;
|
331 |
+
}
|
332 |
+
|
333 |
+
if ($useStatus && $customFailureStatus && !empty($customFailureStatus)) {
|
334 |
+
$statusFailure = $customFailureStatus;
|
335 |
+
} else {
|
336 |
+
$statusFailure = $defaultFailureStatus;
|
337 |
+
}
|
338 |
+
|
339 |
+
if ($useStatus && $customPendingPaymentStatus && !empty($customPendingPaymentStatus)) {
|
340 |
+
$statusPendingpayment = $customPendingPaymentStatus;
|
341 |
+
} else {
|
342 |
+
$statusPendingpayment = $defaultPendingPaymentStatus;
|
343 |
+
}
|
344 |
+
|
345 |
+
$stateIncorrectPayment = 'holded';
|
346 |
+
$statusIncorrectPayment = 'buckaroo_incorrect_payment';
|
347 |
+
|
348 |
+
//magento 1.4 compatibility
|
349 |
+
$version15 = '1.5.0.0';
|
350 |
+
$version14 = '1.4.0.0';
|
351 |
+
if (version_compare(Mage::getVersion(), $version15, '<')
|
352 |
+
&& version_compare(Mage::getVersion(), $version14, '>')
|
353 |
+
&& $statusIncorrectPayment == 'buckaroo_incorrect_payment'
|
354 |
+
)
|
355 |
+
{
|
356 |
+
$statusIncorrectPayment = 'payment_review';
|
357 |
+
}
|
358 |
+
|
359 |
+
switch($code)
|
360 |
+
{
|
361 |
+
case self::BUCKAROO_SUCCESS: $newStates = array($stateSuccess, $statusSuccess);
|
362 |
+
break;
|
363 |
+
case self::BUCKAROO_ERROR:
|
364 |
+
case self::BUCKAROO_FAILED: $newStates = array($stateFailure, $statusFailure);
|
365 |
+
break;
|
366 |
+
case self::BUCKAROO_NEUTRAL: $newStates = array(null, null);
|
367 |
+
break;
|
368 |
+
case self::BUCKAROO_PENDING_PAYMENT: $newStates = array($statePendingpayment, $statusPendingpayment);
|
369 |
+
break;
|
370 |
+
case self::BUCKAROO_INCORRECT_PAYMENT: $newStates = array($stateIncorrectPayment, $statusIncorrectPayment);
|
371 |
+
break;
|
372 |
+
default: $newStates = array(null, null);
|
373 |
+
}
|
374 |
+
|
375 |
+
return $newStates;
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Process a succesful order. Sets its new state and status, sends an order confirmation email
|
380 |
+
* and creates an invoice if set in config.
|
381 |
+
*
|
382 |
+
* @param $newStates
|
383 |
+
* @param bool $description
|
384 |
+
* @return bool
|
385 |
+
*/
|
386 |
+
protected function _processSuccess($newStates, $description = false)
|
387 |
+
{
|
388 |
+
//send new order email if it hasnt already been sent
|
389 |
+
if(!$this->_order->getEmailSent())
|
390 |
+
{
|
391 |
+
$this->sendNewOrderEmail();
|
392 |
+
}
|
393 |
+
|
394 |
+
$this->_autoInvoice();
|
395 |
+
|
396 |
+
$description = Mage::helper('buckaroo3extended')->__($description);
|
397 |
+
|
398 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
399 |
+
|
400 |
+
//sets the transaction key if its defined ($trx)
|
401 |
+
//will retrieve it from the response array, if response actually is an array
|
402 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
403 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
404 |
+
$this->_order->save();
|
405 |
+
}
|
406 |
+
|
407 |
+
if ($this->_order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING) {
|
408 |
+
$this->_order->addStatusHistoryComment($description, $newStates[1])
|
409 |
+
->save();
|
410 |
+
|
411 |
+
$this->_order->setStatus($newStates[1])->save();
|
412 |
+
} else {
|
413 |
+
$this->_order->addStatusHistoryComment($description)
|
414 |
+
->save();
|
415 |
+
}
|
416 |
+
|
417 |
+
|
418 |
+
return true;
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* Process a failed order. Sets its new state and status and cancels the order
|
423 |
+
* if set in config.
|
424 |
+
*
|
425 |
+
* @param $newStates
|
426 |
+
* @param bool $description
|
427 |
+
* @return bool
|
428 |
+
*/
|
429 |
+
protected function _processFailed($newStates, $description = false)
|
430 |
+
{
|
431 |
+
$description = Mage::helper('buckaroo3extended')->__($description);
|
432 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
433 |
+
|
434 |
+
//sets the transaction key if its defined ('brq_transactions')
|
435 |
+
//will retrieve it from the response array, if response actually is an array
|
436 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
437 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
438 |
+
}
|
439 |
+
|
440 |
+
if (
|
441 |
+
Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/cancel_on_failed', $this->_order->getStoreId())
|
442 |
+
&& $this->_order->canCancel()
|
443 |
+
) {
|
444 |
+
$this->_order->cancel()
|
445 |
+
->save();
|
446 |
+
}
|
447 |
+
|
448 |
+
if ($this->_order->getState() == Mage_Sales_Model_Order::STATE_CANCELED) {
|
449 |
+
$this->_order->addStatusHistoryComment($description, $newStates[1])
|
450 |
+
->save();
|
451 |
+
|
452 |
+
$this->_order->setStatus($newStates[1])->save();
|
453 |
+
} else {
|
454 |
+
$this->_order->addStatusHistoryComment($description)
|
455 |
+
->save();
|
456 |
+
}
|
457 |
+
|
458 |
+
return true;
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* Processes an order for which an incorrect amount has been paid (can only happen with Transfer)
|
463 |
+
*
|
464 |
+
* @param $newStates
|
465 |
+
* @return bool
|
466 |
+
*/
|
467 |
+
protected function _processIncorrectPayment($newStates)
|
468 |
+
{
|
469 |
+
//determine whether too much or not enough has been paid and determine the status history copmment accordingly
|
470 |
+
$amount = round($this->_order->getBaseGrandTotal()*100, 0);
|
471 |
+
|
472 |
+
$setStatus = $newStates[1];
|
473 |
+
|
474 |
+
if ($this->_postArray['brq_currency'] == $this->_order->getBaseCurrencyCode()) {
|
475 |
+
$currencyCode = $this->_order->getBaseCurrencyCode();
|
476 |
+
$orderAmount = $this->_order->getBaseGrandTotal();
|
477 |
+
} else {
|
478 |
+
$currencyCode = $this->_order->getOrderCurrencyCode();
|
479 |
+
$orderAmount = $this->_order->getGrandTotal();
|
480 |
+
}
|
481 |
+
|
482 |
+
if ($amount > $this->_postArray['brq_amount']) {
|
483 |
+
$description = Mage::helper('buckaroo3extended')->__(
|
484 |
+
'Not enough paid: %s has been transfered. Order grand total was: %s.',
|
485 |
+
Mage::app()->getLocale()->currency($currencyCode)->toCurrency($this->_postArray['brq_amount']),
|
486 |
+
Mage::app()->getLocale()->currency($currencyCode)->toCurrency($orderAmount)
|
487 |
+
);
|
488 |
+
} elseif ($amount < $this->_postArray['brq_amount']) {
|
489 |
+
$description = Mage::helper('buckaroo3extended')->__(
|
490 |
+
'Too much paid: %s has been transfered. Order grand total was: %s.',
|
491 |
+
Mage::app()->getLocale()->currency($currencyCode)->toCurrency($this->_postArray['brq_amount']),
|
492 |
+
Mage::app()->getLocale()->currency($currencyCode)->toCurrency($orderAmount)
|
493 |
+
);
|
494 |
+
} else {
|
495 |
+
//the correct amount was actually paid, so return false
|
496 |
+
return false;
|
497 |
+
}
|
498 |
+
|
499 |
+
//hold the order
|
500 |
+
$this->_order->hold()
|
501 |
+
->save()
|
502 |
+
->setStatus($setStatus)
|
503 |
+
->save()
|
504 |
+
->addStatusHistoryComment(Mage::helper('buckaroo3extended')->__($description), $setStatus)
|
505 |
+
->save();
|
506 |
+
|
507 |
+
return true;
|
508 |
+
}
|
509 |
+
|
510 |
+
/**
|
511 |
+
* processes an order awaiting payment. Sets its new state and status.
|
512 |
+
*
|
513 |
+
* @param $newStates
|
514 |
+
* @param bool $description
|
515 |
+
* @return bool
|
516 |
+
*/
|
517 |
+
protected function _processPendingPayment($newStates, $description = false)
|
518 |
+
{
|
519 |
+
$description = Mage::helper('buckaroo3extended')->__($description);
|
520 |
+
$description .= " (#{$this->_postArray['brq_statuscode']})";
|
521 |
+
|
522 |
+
//sets the transaction key if its defined ($trx)
|
523 |
+
//will retrieve it from the response array, if response actually is an array
|
524 |
+
if (!$this->_order->getTransactionKey() && array_key_exists('brq_transactions', $this->_postArray)) {
|
525 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions']);
|
526 |
+
}
|
527 |
+
|
528 |
+
|
529 |
+
if ($this->_order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
|
530 |
+
$this->_order->addStatusHistoryComment($description, $newStates[1])
|
531 |
+
->save();
|
532 |
+
|
533 |
+
$this->_order->setStatus($newStates[1])->save();
|
534 |
+
} else {
|
535 |
+
$this->_order->addStatusHistoryComment($description)
|
536 |
+
->save();
|
537 |
+
}
|
538 |
+
|
539 |
+
return true;
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* @param $code
|
544 |
+
* @return array
|
545 |
+
*/
|
546 |
+
public function getNewStates($code)
|
547 |
+
{
|
548 |
+
return $this->_getNewStates($code);
|
549 |
+
}
|
550 |
+
|
551 |
+
/**
|
552 |
+
* @param $newStates
|
553 |
+
* @param bool $description
|
554 |
+
* @return bool
|
555 |
+
*/
|
556 |
+
public function processPendingPayment($newStates, $description = false) {
|
557 |
+
return $this->_processPendingPayment($newStates, $description);
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* @param $newStates
|
562 |
+
* @param bool $description
|
563 |
+
* @return bool
|
564 |
+
*/
|
565 |
+
public function processSuccess($newStates, $description = false) {
|
566 |
+
return $this->_processSuccess($newStates, $description);
|
567 |
+
}
|
568 |
+
|
569 |
+
/**
|
570 |
+
* @param $newStates
|
571 |
+
* @param bool $description
|
572 |
+
* @return bool
|
573 |
+
*/
|
574 |
+
public function processFailed($newStates, $description = false) {
|
575 |
+
return $this->_processFailed($newStates, $description);
|
576 |
+
}
|
577 |
+
|
578 |
+
/**
|
579 |
+
* @param $newStates
|
580 |
+
* @return bool
|
581 |
+
*/
|
582 |
+
public function processIncorrectPayment($newStates) {
|
583 |
+
return $this->_processIncorrectPayment($newStates);
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Creates an invoice for the order if the module is configured to do so.
|
588 |
+
*
|
589 |
+
* @return bool
|
590 |
+
*/
|
591 |
+
protected function _autoInvoice()
|
592 |
+
{
|
593 |
+
//check if the module is configured to create invoice on success
|
594 |
+
if (!Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/auto_invoice', $this->_order->getStoreId()))
|
595 |
+
{
|
596 |
+
return false;
|
597 |
+
}
|
598 |
+
|
599 |
+
//returns true if invoice has been made, else false
|
600 |
+
$invoiceSaved = $this->_saveInvoice();
|
601 |
+
|
602 |
+
if($invoiceSaved && Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/invoice_mail', $this->_order->getStoreId()))
|
603 |
+
{
|
604 |
+
//loop through every invoice
|
605 |
+
foreach($this->_order->getInvoiceCollection() as $invoice)
|
606 |
+
{
|
607 |
+
//when there is no invoice send to the customer, send it!
|
608 |
+
if(!$invoice->getEmailSent())
|
609 |
+
{
|
610 |
+
$invoice->sendEmail()
|
611 |
+
->setEmailSent(true)
|
612 |
+
->save();
|
613 |
+
}
|
614 |
+
}
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
/**
|
619 |
+
* Saves an invoice and sets total-paid for the order
|
620 |
+
*
|
621 |
+
* @return bool
|
622 |
+
*/
|
623 |
+
protected function _saveInvoice()
|
624 |
+
{
|
625 |
+
if ($this->_order->canInvoice() && !$this->_order->hasInvoices()) {
|
626 |
+
$payment = $this->_order->getPayment();
|
627 |
+
$payment->registerCaptureNotification($this->_order->getBaseGrandTotal());
|
628 |
+
|
629 |
+
$this->_order->save();
|
630 |
+
$this->_debugEmail .= 'Invoice created and saved. \n';
|
631 |
+
|
632 |
+
//sets the invoice's transaction ID as the Buckaroo TRX. This is to allow the order to be refunded using Buckaroo later on.
|
633 |
+
foreach($this->_order->getInvoiceCollection() as $invoice)
|
634 |
+
{
|
635 |
+
if (!isset($this->_postArray['brq_transactions'])) {
|
636 |
+
continue;
|
637 |
+
}
|
638 |
+
$invoice->setTransactionId($this->_postArray['brq_transactions'])
|
639 |
+
->save();
|
640 |
+
}
|
641 |
+
return true;
|
642 |
+
}
|
643 |
+
|
644 |
+
return false;
|
645 |
+
}
|
646 |
+
|
647 |
+
/**
|
648 |
+
* Determines the signature using array sorting and the SHA1 hash algorithm
|
649 |
+
*
|
650 |
+
* @return string $signature
|
651 |
+
*/
|
652 |
+
protected function _calculateSignature()
|
653 |
+
{
|
654 |
+
if (isset($this->_postArray['isOldPost']) && $this->_postArray['isOldPost'])
|
655 |
+
{
|
656 |
+
return $this->_calculateOldSignature();
|
657 |
+
}
|
658 |
+
|
659 |
+
$origArray = $this->_postArray;
|
660 |
+
unset($origArray['brq_signature']);
|
661 |
+
|
662 |
+
//sort the array
|
663 |
+
$sortableArray = $this->buckarooSort($origArray);
|
664 |
+
|
665 |
+
//turn into string and add the secret key to the end
|
666 |
+
$signatureString = '';
|
667 |
+
foreach($sortableArray as $key => $value) {
|
668 |
+
$value = urldecode($value);
|
669 |
+
$signatureString .= $key . '=' . $value;
|
670 |
+
}
|
671 |
+
$signatureString .= Mage::getStoreConfig('buckaroo/buckaroo3extended/digital_signature', $this->_order->getStoreId());
|
672 |
+
|
673 |
+
$this->_debugEmail .= "\nSignaturestring: {$signatureString}\n";
|
674 |
+
|
675 |
+
//return the SHA1 encoded string for comparison
|
676 |
+
$signature = SHA1($signatureString);
|
677 |
+
|
678 |
+
$this->_debugEmail .= "\nSignature: {$signature}\n";
|
679 |
+
|
680 |
+
return $signature;
|
681 |
+
}
|
682 |
+
|
683 |
+
/**
|
684 |
+
* Compatibility for BPE 2.0 pushes
|
685 |
+
*
|
686 |
+
* @return string
|
687 |
+
*/
|
688 |
+
protected function _calculateOldSignature()
|
689 |
+
{
|
690 |
+
$signature2 = md5(
|
691 |
+
$this->_postArray['oldPost']["bpe_trx"]
|
692 |
+
. $this->_postArray['oldPost']["bpe_timestamp"]
|
693 |
+
. Mage::getStoreConfig('buckaroo/buckaroo3extended/key', $this->_order->getStoreId())
|
694 |
+
. $this->_postArray['oldPost']["bpe_invoice"]
|
695 |
+
. $this->_postArray['oldPost']["bpe_reference"]
|
696 |
+
. $this->_postArray['oldPost']["bpe_currency"]
|
697 |
+
. $this->_postArray['oldPost']["bpe_amount"]
|
698 |
+
. $this->_postArray['oldPost']["bpe_result"]
|
699 |
+
. $this->_postArray['oldPost']["bpe_mode"]
|
700 |
+
. Mage::getStoreConfig('buckaroo/buckaroo3extended/digital_signature', $this->_order->getStoreId())
|
701 |
+
);
|
702 |
+
|
703 |
+
return $signature2;
|
704 |
+
}
|
705 |
+
}
|
@@ -0,0 +1,39 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Response_Return extends TIG_Buckaroo3Extended_Model_Response_Push
|
3 |
+
{
|
4 |
+
public function processReturn()
|
5 |
+
{
|
6 |
+
//check if the push is valid and if the order can be updated
|
7 |
+
list($canProcess, $canUpdate) = $this->_canProcessPush(true);
|
8 |
+
|
9 |
+
$this->_debugEmail .= "can the order be processed? " . $canProcess . "\ncan the order be updated? " . $canUpdate . "\n";
|
10 |
+
|
11 |
+
if (!$canProcess) {
|
12 |
+
$this->_verifyError();
|
13 |
+
}
|
14 |
+
|
15 |
+
Mage::dispatchEvent('buckaroo3extended_return_custom_processing', array('return' => $this, 'order' => $this->getCurrentOrder(), 'post_array' => $this->_postArray));
|
16 |
+
|
17 |
+
if ($this->getCustomResponseProcessing()) {
|
18 |
+
return true;
|
19 |
+
}
|
20 |
+
|
21 |
+
$parsedResponse = $this->_parsePostResponse($this->_postArray['brq_statuscode']);
|
22 |
+
|
23 |
+
$this->_requiredAction($parsedResponse);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function customSuccess()
|
27 |
+
{
|
28 |
+
if ($this->getCustomResponseProcessing()) {
|
29 |
+
$this->_success();
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
public function customFailed()
|
34 |
+
{
|
35 |
+
if ($this->getCustomResponseProcessing()) {
|
36 |
+
$this->_failed();
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
@@ -0,0 +1,666 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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_|_|_|___| |_|_\_||_|\__/|_\_\|_\_|\__/|_| \___/|_\_\\_/|___|_|
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Creative Commons License.
|
10 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
11 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
12 |
+
*
|
13 |
+
* DISCLAIMER
|
14 |
+
*
|
15 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
16 |
+
* versions in the future. If you wish to customize this module for your
|
17 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
18 |
+
*
|
19 |
+
* @copyright 2014 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
20 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
21 |
+
*/
|
22 |
+
|
23 |
+
final class TIG_Buckaroo3Extended_Model_Soap extends TIG_Buckaroo3Extended_Model_Abstract
|
24 |
+
{
|
25 |
+
const WSDL_URL = 'https://checkout.buckaroo.nl/soap/soap.svc?wsdl';
|
26 |
+
|
27 |
+
private $_vars;
|
28 |
+
private $_method;
|
29 |
+
|
30 |
+
protected $_debugEmail;
|
31 |
+
|
32 |
+
public function setVars($vars = array())
|
33 |
+
{
|
34 |
+
$this->_vars = $vars;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getVars()
|
38 |
+
{
|
39 |
+
return $this->_vars;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function __construct($data = array())
|
43 |
+
{
|
44 |
+
define(
|
45 |
+
'LIB_DIR',
|
46 |
+
Mage::getBaseDir()
|
47 |
+
. DS
|
48 |
+
. 'app'
|
49 |
+
. DS
|
50 |
+
. 'code'
|
51 |
+
. DS
|
52 |
+
. 'community'
|
53 |
+
. DS
|
54 |
+
. 'TIG'
|
55 |
+
. DS
|
56 |
+
. 'Buckaroo3Extended'
|
57 |
+
. DS
|
58 |
+
. 'lib'
|
59 |
+
. DS
|
60 |
+
);
|
61 |
+
|
62 |
+
$this->setVars($data['vars']);
|
63 |
+
$this->setMethod($data['method']);
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getMethod()
|
67 |
+
{
|
68 |
+
return $this->_method;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function setMethod($method = '')
|
72 |
+
{
|
73 |
+
$this->_method = $method;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function transactionRequest()
|
77 |
+
{
|
78 |
+
try
|
79 |
+
{
|
80 |
+
//first attempt: use the cached WSDL
|
81 |
+
$client = new SoapClientWSSEC(
|
82 |
+
self::WSDL_URL,
|
83 |
+
array(
|
84 |
+
'trace' => 1,
|
85 |
+
'cache_wsdl' => WSDL_CACHE_DISK,
|
86 |
+
));
|
87 |
+
} catch (SoapFault $e) {
|
88 |
+
try {
|
89 |
+
//second attempt: use an uncached WSDL
|
90 |
+
ini_set('soap.wsdl_cache_ttl', 1);
|
91 |
+
$client = new SoapClientWSSEC(
|
92 |
+
self::WSDL_URL,
|
93 |
+
array(
|
94 |
+
'trace' => 1,
|
95 |
+
'cache_wsdl' => WSDL_CACHE_NONE,
|
96 |
+
));
|
97 |
+
} catch (SoapFault $e) {
|
98 |
+
try {
|
99 |
+
//third and final attempt: use the supplied wsdl found in the lib folder
|
100 |
+
$client = new SoapClientWSSEC(
|
101 |
+
LIB_DIR . 'Buckaroo.wsdl',
|
102 |
+
array(
|
103 |
+
'trace' => 1,
|
104 |
+
'cache_wsdl' => WSDL_CACHE_NONE,
|
105 |
+
));
|
106 |
+
} catch (SoapFault $e) {
|
107 |
+
return $this->_error();
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
/*when request is a refund; use 'CallCenter' else use channel 'Web' (case sensitive)*/
|
113 |
+
$requestChannel = 'Web';
|
114 |
+
$invoiceNumber = $this->_vars['orderId'];
|
115 |
+
if(round($this->_vars['amountDebit'], 2) == 0
|
116 |
+
&& round($this->_vars['amountCredit'], 2) > 0){
|
117 |
+
$requestChannel = 'CallCenter';
|
118 |
+
|
119 |
+
$invoiceNumber = $this->_vars['invoiceId'];
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
$client->thumbprint = $this->_vars['thumbprint'];
|
124 |
+
|
125 |
+
$TransactionRequest = new Body();
|
126 |
+
$TransactionRequest->Currency = $this->_vars['currency'];
|
127 |
+
$TransactionRequest->AmountDebit = round($this->_vars['amountDebit'], 2);
|
128 |
+
$TransactionRequest->AmountCredit = round($this->_vars['amountCredit'], 2);
|
129 |
+
$TransactionRequest->Invoice = $invoiceNumber;
|
130 |
+
$TransactionRequest->Order = $this->_vars['orderId'];
|
131 |
+
$TransactionRequest->Description = $this->_vars['description'];
|
132 |
+
$TransactionRequest->ReturnURL = $this->_vars['returnUrl'];
|
133 |
+
$TransactionRequest->StartRecurrent = FALSE;
|
134 |
+
|
135 |
+
if (isset($this->_vars['customVars']['servicesSelectableByClient']) && isset($this->_vars['customVars']['continueOnImcomplete'])) {
|
136 |
+
$TransactionRequest->ServicesSelectableByClient = $this->_vars['customVars']['servicesSelectableByClient'];
|
137 |
+
$TransactionRequest->ContinueOnIncomplete = $this->_vars['customVars']['continueOnImcomplete'];
|
138 |
+
}
|
139 |
+
|
140 |
+
if (array_key_exists('OriginalTransactionKey', $this->_vars)) {
|
141 |
+
$TransactionRequest->OriginalTransactionKey = $this->_vars['OriginalTransactionKey'];
|
142 |
+
}
|
143 |
+
|
144 |
+
if (isset($this->_vars['customParameters'])) {
|
145 |
+
$TransactionRequest = $this->_addCustomParameters($TransactionRequest);
|
146 |
+
}
|
147 |
+
|
148 |
+
$TransactionRequest->Services = new Services();
|
149 |
+
|
150 |
+
$this->_addServices($TransactionRequest);
|
151 |
+
|
152 |
+
$TransactionRequest->ClientIP = new IPAddress();
|
153 |
+
$TransactionRequest->ClientIP->Type = 'IPv4';
|
154 |
+
$TransactionRequest->ClientIP->_ = Mage::helper('core/http')->getRemoteAddr();
|
155 |
+
|
156 |
+
$Software = new Software();
|
157 |
+
$Software->PlatformName = $this->_vars['Software']['PlatformName'];
|
158 |
+
$Software->PlatformVersion = $this->_vars['Software']['PlatformVersion'];
|
159 |
+
$Software->ModuleSupplier = $this->_vars['Software']['ModuleSupplier'];
|
160 |
+
$Software->ModuleName = $this->_vars['Software']['ModuleName'];
|
161 |
+
$Software->ModuleVersion = $this->_vars['Software']['ModuleVersion'];
|
162 |
+
|
163 |
+
$Header = new Header();
|
164 |
+
$Header->MessageControlBlock = new MessageControlBlock();
|
165 |
+
$Header->MessageControlBlock->Id = '_control';
|
166 |
+
$Header->MessageControlBlock->WebsiteKey = $this->_vars['merchantKey'];
|
167 |
+
$Header->MessageControlBlock->Culture = $this->_vars['locale'];
|
168 |
+
$Header->MessageControlBlock->TimeStamp = time();
|
169 |
+
$Header->MessageControlBlock->Channel = $requestChannel;
|
170 |
+
$Header->MessageControlBlock->Software = $Software;
|
171 |
+
$Header->Security = new SecurityType();
|
172 |
+
$Header->Security->Signature = new SignatureType();
|
173 |
+
|
174 |
+
$Header->Security->Signature->SignedInfo = new SignedInfoType();
|
175 |
+
$Header->Security->Signature->SignedInfo->CanonicalizationMethod = new CanonicalizationMethodType();
|
176 |
+
$Header->Security->Signature->SignedInfo->CanonicalizationMethod->Algorithm = 'http://www.w3.org/2001/10/xml-exc-c14n#';
|
177 |
+
$Header->Security->Signature->SignedInfo->SignatureMethod = new SignatureMethodType();
|
178 |
+
$Header->Security->Signature->SignedInfo->SignatureMethod->Algorithm = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1';
|
179 |
+
|
180 |
+
$Reference = new ReferenceType();
|
181 |
+
$Reference->URI = '#_body';
|
182 |
+
$Transform = new TransformType();
|
183 |
+
$Transform->Algorithm = 'http://www.w3.org/2001/10/xml-exc-c14n#';
|
184 |
+
$Reference->Transforms=array($Transform);
|
185 |
+
|
186 |
+
$Reference->DigestMethod = new DigestMethodType();
|
187 |
+
$Reference->DigestMethod->Algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1';
|
188 |
+
$Reference->DigestValue = '';
|
189 |
+
|
190 |
+
$Transform2 = new TransformType();
|
191 |
+
$Transform2->Algorithm = 'http://www.w3.org/2001/10/xml-exc-c14n#';
|
192 |
+
$ReferenceControl = new ReferenceType();
|
193 |
+
$ReferenceControl->URI = '#_control';
|
194 |
+
$ReferenceControl->DigestMethod = new DigestMethodType();
|
195 |
+
$ReferenceControl->DigestMethod->Algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1';
|
196 |
+
$ReferenceControl->DigestValue = '';
|
197 |
+
$ReferenceControl->Transforms=array($Transform2);
|
198 |
+
|
199 |
+
$Header->Security->Signature->SignedInfo->Reference = array($Reference,$ReferenceControl);
|
200 |
+
$Header->Security->Signature->SignatureValue = '';
|
201 |
+
|
202 |
+
$soapHeaders = array();
|
203 |
+
$soapHeaders[] = new SOAPHeader('https://checkout.buckaroo.nl/PaymentEngine/', 'MessageControlBlock', $Header->MessageControlBlock);
|
204 |
+
$soapHeaders[] = new SOAPHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $Header->Security);
|
205 |
+
$client->__setSoapHeaders($soapHeaders);
|
206 |
+
|
207 |
+
//if the module is set to testmode, use the test gateway. Otherwise, use the default gateway
|
208 |
+
if (Mage::getStoreConfig('buckaroo/buckaroo3extended/mode', Mage::app()->getStore()->getStoreId())
|
209 |
+
|| Mage::getStoreConfig('buckaroo/buckaroo3extended_' . $this->_method . '/mode', Mage::app()->getStore()->getStoreId())
|
210 |
+
) {
|
211 |
+
$location = 'https://testcheckout.buckaroo.nl/soap/';
|
212 |
+
} else {
|
213 |
+
$location = 'https://checkout.buckaroo.nl/soap/';
|
214 |
+
}
|
215 |
+
|
216 |
+
$client->__SetLocation($location);
|
217 |
+
|
218 |
+
try
|
219 |
+
{
|
220 |
+
$response = $client->TransactionRequest($TransactionRequest);
|
221 |
+
} catch (SoapFault $e) {
|
222 |
+
$this->logException($e->getMessage());
|
223 |
+
return $this->_error($client);
|
224 |
+
} catch (Exception $e) {
|
225 |
+
$this->logException($e->getMessage());
|
226 |
+
return $this->_error($client);
|
227 |
+
}
|
228 |
+
|
229 |
+
if (is_null($response)) {
|
230 |
+
$response = false;
|
231 |
+
}
|
232 |
+
|
233 |
+
$responseXML = $client->__getLastResponse();
|
234 |
+
$requestXML = $client->__getLastRequest();
|
235 |
+
|
236 |
+
$responseDomDOC = new DOMDocument();
|
237 |
+
$responseDomDOC->loadXML($responseXML);
|
238 |
+
$responseDomDOC->preserveWhiteSpace = FALSE;
|
239 |
+
$responseDomDOC->formatOutput = TRUE;
|
240 |
+
|
241 |
+
$requestDomDOC = new DOMDocument();
|
242 |
+
$requestDomDOC->loadXML($requestXML);
|
243 |
+
$requestDomDOC->preserveWhiteSpace = FALSE;
|
244 |
+
$requestDomDOC->formatOutput = TRUE;
|
245 |
+
|
246 |
+
return array($response, $responseDomDOC, $requestDomDOC);
|
247 |
+
}
|
248 |
+
|
249 |
+
protected function _error($client = false)
|
250 |
+
{
|
251 |
+
$response = false;
|
252 |
+
|
253 |
+
$responseDomDOC = new DOMDocument();
|
254 |
+
$requestDomDOC = new DOMDocument();
|
255 |
+
if ($client) {
|
256 |
+
$responseXML = $client->__getLastResponse();
|
257 |
+
$requestXML = $client->__getLastRequest();
|
258 |
+
|
259 |
+
if (!empty($responseXML)) {
|
260 |
+
$responseDomDOC->loadXML($responseXML);
|
261 |
+
$responseDomDOC->preserveWhiteSpace = FALSE;
|
262 |
+
$responseDomDOC->formatOutput = TRUE;
|
263 |
+
}
|
264 |
+
|
265 |
+
if (!empty($requestXML)) {
|
266 |
+
$requestDomDOC->loadXML($requestXML);
|
267 |
+
$requestDomDOC->preserveWhiteSpace = FALSE;
|
268 |
+
$requestDomDOC->formatOutput = TRUE;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
return array($response, $responseDomDOC, $requestDomDOC);
|
273 |
+
}
|
274 |
+
|
275 |
+
protected function _addServices(&$TransactionRequest)
|
276 |
+
{
|
277 |
+
$services = array();
|
278 |
+
foreach($this->_vars['services'] as $fieldName => $value) {
|
279 |
+
if (empty($value)) {
|
280 |
+
continue;
|
281 |
+
}
|
282 |
+
|
283 |
+
$service = new Service();
|
284 |
+
|
285 |
+
if(isset($value['name'])){
|
286 |
+
$name = $value['name'];
|
287 |
+
} else {
|
288 |
+
$name = $fieldName;
|
289 |
+
}
|
290 |
+
|
291 |
+
$service->Name = $name;
|
292 |
+
$service->Action = $value['action'];
|
293 |
+
$service->Version = $value['version'];
|
294 |
+
|
295 |
+
$this->_addCustomFields($service, $fieldName);
|
296 |
+
|
297 |
+
$services[] = $service;
|
298 |
+
}
|
299 |
+
$TransactionRequest->Services->Service = $services;
|
300 |
+
}
|
301 |
+
|
302 |
+
protected function _addCustomFields(&$service, $name)
|
303 |
+
{
|
304 |
+
if (
|
305 |
+
!isset($this->_vars['customVars'])
|
306 |
+
|| !isset($this->_vars['customVars'][$name])
|
307 |
+
|| empty($this->_vars['customVars'][$name])
|
308 |
+
) {
|
309 |
+
unset($service->RequestParameter);
|
310 |
+
return;
|
311 |
+
}
|
312 |
+
|
313 |
+
$requestParameters = array();
|
314 |
+
|
315 |
+
foreach($this->_vars['customVars'][$name] as $fieldName => $value) {
|
316 |
+
|
317 |
+
if($fieldName == 'Articles'){
|
318 |
+
if(is_array($value) && !empty($value)){
|
319 |
+
foreach($value as $groupId => $articleArray){
|
320 |
+
if(is_array($articleArray) && !empty($articleArray)){
|
321 |
+
foreach($articleArray as $articleName => $articleValue){
|
322 |
+
$requestParameter = new RequestParameter();
|
323 |
+
$requestParameter->Name = $articleName;
|
324 |
+
$requestParameter->GroupID = $groupId;
|
325 |
+
$requestParameter->_ = $articleValue['value'];
|
326 |
+
$requestParameters[] = $requestParameter;
|
327 |
+
}
|
328 |
+
}
|
329 |
+
}
|
330 |
+
continue;
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
if (
|
335 |
+
(is_null($value) || $value === '')
|
336 |
+
|| (
|
337 |
+
is_array($value)
|
338 |
+
&& (is_null($value['value']) || $value['value'] === '')
|
339 |
+
)
|
340 |
+
) {
|
341 |
+
continue;
|
342 |
+
}
|
343 |
+
|
344 |
+
$requestParameter = new RequestParameter();
|
345 |
+
$requestParameter->Name = $fieldName;
|
346 |
+
if (is_array($value)) {
|
347 |
+
$requestParameter->Group = $value['group'];
|
348 |
+
$requestParameter->_ = $value['value'];
|
349 |
+
} else {
|
350 |
+
$requestParameter->_ = $value;
|
351 |
+
}
|
352 |
+
|
353 |
+
$requestParameters[] = $requestParameter;
|
354 |
+
}
|
355 |
+
|
356 |
+
if (empty($requestParameters)) {
|
357 |
+
unset($service->RequestParameter);
|
358 |
+
return;
|
359 |
+
} else {
|
360 |
+
$service->RequestParameter = $requestParameters;
|
361 |
+
}
|
362 |
+
}
|
363 |
+
|
364 |
+
protected function _addCustomParameters(&$TransactionRequest)
|
365 |
+
{
|
366 |
+
$requestParameters = array();
|
367 |
+
foreach($this->_vars['customParameters'] as $fieldName => $value) {
|
368 |
+
if (
|
369 |
+
(is_null($value) || $value === '')
|
370 |
+
|| (
|
371 |
+
is_array($value)
|
372 |
+
&& (is_null($value['value']) || $value['value'] === '')
|
373 |
+
)
|
374 |
+
) {
|
375 |
+
continue;
|
376 |
+
}
|
377 |
+
|
378 |
+
$requestParameter = new RequestParameter();
|
379 |
+
$requestParameter->Name = $fieldName;
|
380 |
+
if (is_array($value)) {
|
381 |
+
$requestParameter->Group = $value['group'];
|
382 |
+
$requestParameter->_ = $value['value'];
|
383 |
+
} else {
|
384 |
+
$requestParameter->_ = $value;
|
385 |
+
}
|
386 |
+
|
387 |
+
$requestParameters[] = $requestParameter;
|
388 |
+
}
|
389 |
+
|
390 |
+
if (empty($requestParameters)) {
|
391 |
+
unset($TransactionRequest->AdditionalParameters);
|
392 |
+
return;
|
393 |
+
} else {
|
394 |
+
$TransactionRequest->AdditionalParameters = $requestParameters;
|
395 |
+
}
|
396 |
+
|
397 |
+
return $TransactionRequest;
|
398 |
+
}
|
399 |
+
}
|
400 |
+
|
401 |
+
|
402 |
+
class SoapClientWSSEC extends SoapClient
|
403 |
+
{
|
404 |
+
/**
|
405 |
+
* Contains the request XML
|
406 |
+
* @var DOMDocument
|
407 |
+
*/
|
408 |
+
private $document;
|
409 |
+
|
410 |
+
/**
|
411 |
+
* Path to the privateKey file
|
412 |
+
* @var string
|
413 |
+
*/
|
414 |
+
public $privateKey = '';
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Password for the privatekey
|
418 |
+
* @var string
|
419 |
+
*/
|
420 |
+
public $privateKeyPassword = '';
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Thumbprint from Payment Plaza
|
424 |
+
* @var type
|
425 |
+
*/
|
426 |
+
public $thumbprint = '';
|
427 |
+
|
428 |
+
public function __doRequest ($request , $location , $action , $version , $one_way = 0 )
|
429 |
+
{
|
430 |
+
// Add code to inspect/dissect/debug/adjust the XML given in $request here
|
431 |
+
$domDOC = new DOMDocument();
|
432 |
+
$domDOC->preserveWhiteSpace = FALSE;
|
433 |
+
$domDOC->formatOutput = TRUE;
|
434 |
+
$domDOC->loadXML($request);
|
435 |
+
|
436 |
+
//Sign the document
|
437 |
+
$domDOC = $this->SignDomDocument($domDOC);
|
438 |
+
|
439 |
+
// Uncomment the following line, if you actually want to do the request
|
440 |
+
return parent::__doRequest($domDOC->saveXML($domDOC->documentElement), $location, $action, $version, $one_way);
|
441 |
+
}
|
442 |
+
|
443 |
+
//Get nodeset based on xpath and ID
|
444 |
+
private function getReference($ID, $xPath)
|
445 |
+
{
|
446 |
+
$query = '//*[@Id="'.$ID.'"]';
|
447 |
+
$nodeset = $xPath->query($query);
|
448 |
+
return $nodeset->item(0);
|
449 |
+
}
|
450 |
+
|
451 |
+
//Canonicalize nodeset
|
452 |
+
private function getCanonical($Object)
|
453 |
+
{
|
454 |
+
return $Object->C14N(true, false);
|
455 |
+
}
|
456 |
+
|
457 |
+
//Calculate digest value (sha1 hash)
|
458 |
+
private function calculateDigestValue($input)
|
459 |
+
{
|
460 |
+
return base64_encode(pack('H*',sha1($input)));
|
461 |
+
}
|
462 |
+
|
463 |
+
private function signDomDocument($domDocument)
|
464 |
+
{
|
465 |
+
//create xPath
|
466 |
+
$xPath = new DOMXPath($domDocument);
|
467 |
+
|
468 |
+
//register namespaces to use in xpath query's
|
469 |
+
$xPath->registerNamespace('wsse','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd');
|
470 |
+
$xPath->registerNamespace('sig','http://www.w3.org/2000/09/xmldsig#');
|
471 |
+
$xPath->registerNamespace('soap','http://schemas.xmlsoap.org/soap/envelope/');
|
472 |
+
|
473 |
+
//Set id on soap body to easily extract the body later.
|
474 |
+
$bodyNodeList = $xPath->query('/soap:Envelope/soap:Body');
|
475 |
+
$bodyNode = $bodyNodeList->item(0);
|
476 |
+
$bodyNode->setAttribute('Id','_body');
|
477 |
+
|
478 |
+
//Get the digest values
|
479 |
+
$controlHash = $this->CalculateDigestValue($this->GetCanonical($this->GetReference('_control', $xPath)));
|
480 |
+
$bodyHash = $this->CalculateDigestValue($this->GetCanonical($this->GetReference('_body', $xPath)));
|
481 |
+
|
482 |
+
//Set the digest value for the control reference
|
483 |
+
$Control = '#_control';
|
484 |
+
$controlHashQuery = $query = '//*[@URI="'.$Control.'"]/sig:DigestValue';
|
485 |
+
$controlHashQueryNodeset = $xPath->query($controlHashQuery);
|
486 |
+
$controlHashNode = $controlHashQueryNodeset->item(0);
|
487 |
+
$controlHashNode->nodeValue = $controlHash;
|
488 |
+
|
489 |
+
//Set the digest value for the body reference
|
490 |
+
$Body = '#_body';
|
491 |
+
$bodyHashQuery = $query = '//*[@URI="'.$Body.'"]/sig:DigestValue';
|
492 |
+
$bodyHashQueryNodeset = $xPath->query($bodyHashQuery);
|
493 |
+
$bodyHashNode = $bodyHashQueryNodeset->item(0);
|
494 |
+
$bodyHashNode->nodeValue = $bodyHash;
|
495 |
+
|
496 |
+
//Get the SignedInfo nodeset
|
497 |
+
$SignedInfoQuery = '//wsse:Security/sig:Signature/sig:SignedInfo';
|
498 |
+
$SignedInfoQueryNodeSet = $xPath->query($SignedInfoQuery);
|
499 |
+
$SignedInfoNodeSet = $SignedInfoQueryNodeSet->item(0);
|
500 |
+
|
501 |
+
//Canonicalize nodeset
|
502 |
+
$signedINFO = $this->GetCanonical($SignedInfoNodeSet);
|
503 |
+
|
504 |
+
$certificateId = Mage::getStoreConfig('buckaroo/buckaroo3extended/certificate_selection', Mage::app()->getStore()->getId());
|
505 |
+
$certificate = Mage::getModel('buckaroo3extended/certificate')->load($certificateId)->getCertificate();
|
506 |
+
|
507 |
+
$priv_key = substr($certificate, 0, 8192);
|
508 |
+
|
509 |
+
if ($priv_key === false) {
|
510 |
+
throw new Exception('Unable to read certificate.');
|
511 |
+
}
|
512 |
+
|
513 |
+
$pkeyid = openssl_get_privatekey($priv_key, '');
|
514 |
+
if ($pkeyid === false) {
|
515 |
+
throw new Exception('Unable to retrieve private key from certificate.');
|
516 |
+
}
|
517 |
+
|
518 |
+
//Sign signedinfo with privatekey
|
519 |
+
$signature2 = null;
|
520 |
+
$signatureCreate = openssl_sign($signedINFO, $signature2, $pkeyid);
|
521 |
+
|
522 |
+
//Add signature value to xml document
|
523 |
+
$sigValQuery = '//wsse:Security/sig:Signature/sig:SignatureValue';
|
524 |
+
$sigValQueryNodeset = $xPath->query($sigValQuery);
|
525 |
+
$sigValNodeSet = $sigValQueryNodeset->item(0);
|
526 |
+
$sigValNodeSet->nodeValue = base64_encode($signature2);
|
527 |
+
|
528 |
+
//Get signature node
|
529 |
+
$sigQuery = '//wsse:Security/sig:Signature';
|
530 |
+
$sigQueryNodeset = $xPath->query($sigQuery);
|
531 |
+
$sigNodeSet = $sigQueryNodeset->item(0);
|
532 |
+
|
533 |
+
//Create keyinfo element and Add public key to KeyIdentifier element
|
534 |
+
$KeyTypeNode = $domDocument->createElementNS("http://www.w3.org/2000/09/xmldsig#","KeyInfo");
|
535 |
+
$SecurityTokenReference = $domDocument->createElementNS('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','SecurityTokenReference');
|
536 |
+
$KeyIdentifier = $domDocument->createElement("KeyIdentifier");
|
537 |
+
$KeyIdentifier->nodeValue = $this->thumbprint;
|
538 |
+
$KeyIdentifier->setAttribute('ValueType','http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbPrintSHA1');
|
539 |
+
$SecurityTokenReference->appendChild($KeyIdentifier);
|
540 |
+
$KeyTypeNode->appendChild($SecurityTokenReference);
|
541 |
+
$sigNodeSet->appendChild($KeyTypeNode);
|
542 |
+
|
543 |
+
|
544 |
+
|
545 |
+
return $domDocument;
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
class Header
|
550 |
+
{
|
551 |
+
public $MessageControlBlock;
|
552 |
+
}
|
553 |
+
|
554 |
+
class SecurityType
|
555 |
+
{
|
556 |
+
public $Signature;
|
557 |
+
}
|
558 |
+
|
559 |
+
class SignatureType
|
560 |
+
{
|
561 |
+
public $SignedInfo;
|
562 |
+
public $SignatureValue;
|
563 |
+
public $KeyInfo;
|
564 |
+
}
|
565 |
+
|
566 |
+
class SignedInfoType
|
567 |
+
{
|
568 |
+
public $CanonicalizationMethod;
|
569 |
+
public $SignatureMethod;
|
570 |
+
public $Reference;
|
571 |
+
}
|
572 |
+
|
573 |
+
class ReferenceType
|
574 |
+
{
|
575 |
+
public $Transforms;
|
576 |
+
public $DigestMethod;
|
577 |
+
public $DigestValue;
|
578 |
+
public $URI;
|
579 |
+
public $Id;
|
580 |
+
}
|
581 |
+
|
582 |
+
|
583 |
+
class TransformType
|
584 |
+
{
|
585 |
+
public $Algorithm;
|
586 |
+
}
|
587 |
+
|
588 |
+
class DigestMethodType
|
589 |
+
{
|
590 |
+
public $Algorithm;
|
591 |
+
}
|
592 |
+
|
593 |
+
|
594 |
+
class SignatureMethodType
|
595 |
+
{
|
596 |
+
public $Algorithm;
|
597 |
+
}
|
598 |
+
|
599 |
+
class CanonicalizationMethodType
|
600 |
+
{
|
601 |
+
public $Algorithm;
|
602 |
+
}
|
603 |
+
|
604 |
+
class MessageControlBlock
|
605 |
+
{
|
606 |
+
public $Id;
|
607 |
+
public $WebsiteKey;
|
608 |
+
public $Culture;
|
609 |
+
public $TimeStamp;
|
610 |
+
public $Channel;
|
611 |
+
public $Software;
|
612 |
+
}
|
613 |
+
|
614 |
+
class Body
|
615 |
+
{
|
616 |
+
public $Currency;
|
617 |
+
public $AmountDebit;
|
618 |
+
public $AmountCredit;
|
619 |
+
public $Invoice;
|
620 |
+
public $Order;
|
621 |
+
public $Description;
|
622 |
+
public $ClientIP;
|
623 |
+
public $ReturnURL;
|
624 |
+
public $ReturnURLCancel;
|
625 |
+
public $ReturnURLError;
|
626 |
+
public $ReturnURLReject;
|
627 |
+
public $OriginalTransactionKey;
|
628 |
+
public $StartRecurrent;
|
629 |
+
public $Services;
|
630 |
+
}
|
631 |
+
|
632 |
+
class Services
|
633 |
+
{
|
634 |
+
public $Global;
|
635 |
+
public $Service;
|
636 |
+
}
|
637 |
+
|
638 |
+
class Service
|
639 |
+
{
|
640 |
+
public $RequestParameter;
|
641 |
+
public $Name;
|
642 |
+
public $Action;
|
643 |
+
public $Version;
|
644 |
+
}
|
645 |
+
|
646 |
+
class RequestParameter
|
647 |
+
{
|
648 |
+
public $_;
|
649 |
+
public $Name;
|
650 |
+
public $Group;
|
651 |
+
}
|
652 |
+
|
653 |
+
class IPAddress
|
654 |
+
{
|
655 |
+
public $_;
|
656 |
+
public $Type;
|
657 |
+
}
|
658 |
+
|
659 |
+
class Software
|
660 |
+
{
|
661 |
+
public $PlatformName;
|
662 |
+
public $PlatformVersion;
|
663 |
+
public $ModuleSupplier;
|
664 |
+
public $ModuleName;
|
665 |
+
public $ModuleVersion;
|
666 |
+
}
|
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_AcceptgiroDirectdebit
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => 'afterpayacceptgiro', 'label' => Mage::helper('buckaroo3extended')->__('Acceptgiro')),
|
8 |
+
array('value' => 'afterpaydigiaccept', 'label' => Mage::helper('buckaroo3extended')->__('Digiaccept')),
|
9 |
+
);
|
10 |
+
return $array;
|
11 |
+
}
|
12 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Afterpay_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_afterpay_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,11 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Allspecificcountries
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value'=>0, 'label'=>Mage::helper('buckaroo3extended')->__('All Allowed Countries')),
|
8 |
+
array('value'=>1, 'label'=>Mage::helper('buckaroo3extended')->__('Specific Countries')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Amex_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_amex_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Availablemethods
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => 'all', 'label' => Mage::helper('buckaroo3extended')->__('all')),
|
8 |
+
array('value' => 'amex', 'label' => Mage::helper('buckaroo3extended')->__('American Express')),
|
9 |
+
array('value' => 'directdebit', 'label' => Mage::helper('buckaroo3extended')->__('Eenmalige Machtiging')),
|
10 |
+
array('value' => 'giropay', 'label' => Mage::helper('buckaroo3extended')->__('Giropay')),
|
11 |
+
array('value' => 'ideal', 'label' => Mage::helper('buckaroo3extended')->__('iDeal')),
|
12 |
+
array('value' => 'mastercard', 'label' => Mage::helper('buckaroo3extended')->__('Mastercard')),
|
13 |
+
array('value' => 'onlinegiro', 'label' => Mage::helper('buckaroo3extended')->__('Online Giro')),
|
14 |
+
array('value' => 'paypal', 'label' => Mage::helper('buckaroo3extended')->__('PayPal')),
|
15 |
+
array('value' => 'paysafecard', 'label' => Mage::helper('buckaroo3extended')->__('Paysafecard')),
|
16 |
+
array('value' => 'sofortueberweisung', 'label' => Mage::helper('buckaroo3extended')->__('Sofort Banking')),
|
17 |
+
array('value' => 'transfer', 'label' => Mage::helper('buckaroo3extended')->__('Overboeking')),
|
18 |
+
array('value' => 'visa', 'label' => Mage::helper('buckaroo3extended')->__('Visa')),
|
19 |
+
array('value' => 'maestro', 'label' => Mage::helper('buckaroo3extended')->__('eMaestro')),
|
20 |
+
array('value' => 'visaelectron', 'label' => Mage::helper('buckaroo3extended')->__('Visa Electron')),
|
21 |
+
array('value' => 'vpay', 'label' => Mage::helper('buckaroo3extended')->__('V PAY')),
|
22 |
+
array('value' => 'bancontactmrcash', 'label' => Mage::helper('buckaroo3extended')->__('Bancontact / Mr. Cash')),
|
23 |
+
);
|
24 |
+
return $array;
|
25 |
+
}
|
26 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Bancontactmrcash_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_bancontactmrcash_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TIG_Buckaroo3Extended_Model_Sources_BusinessToBusiness
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$array = array(
|
8 |
+
array('value' => '1', 'label' => Mage::helper('buckaroo3extended')->__('B2C')),
|
9 |
+
array('value' => '2', 'label' => Mage::helper('buckaroo3extended')->__('B2B')),
|
10 |
+
array('value' => '3', 'label' => Mage::helper('buckaroo3extended')->__('Both')),
|
11 |
+
);
|
12 |
+
return $array;
|
13 |
+
}
|
14 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Cartebancaire_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_cartebancaire_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Cartebleue_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_cartebleue_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,35 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Certificates
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$collection = Mage::getResourceModel('buckaroo3extended/certificate_collection');
|
7 |
+
|
8 |
+
if ($collection->count() < 1) {
|
9 |
+
$array = array(
|
10 |
+
array(
|
11 |
+
'label' => Mage::helper('buckaroo3extended')->__('You have not yet uploaded any certificate files.'),
|
12 |
+
'value' => '',
|
13 |
+
),
|
14 |
+
);
|
15 |
+
|
16 |
+
return $array;
|
17 |
+
}
|
18 |
+
|
19 |
+
$array = array(
|
20 |
+
array(
|
21 |
+
'label' => Mage::helper('buckaroo3extended')->__('No certificate selected.'),
|
22 |
+
'value' => '',
|
23 |
+
),
|
24 |
+
);
|
25 |
+
|
26 |
+
foreach($collection->getItems() as $certificate) {
|
27 |
+
$array[] = array(
|
28 |
+
'value' => $certificate->getCertificateId(),
|
29 |
+
'label' => $certificate->getCertificateName() . ' (' . $certificate->getUploadDate() . ')',
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
return $array;
|
34 |
+
}
|
35 |
+
}
|
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_CultureType
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => 'billing', 'label' => Mage::helper('buckaroo3extended')->__('Billing Address')),
|
8 |
+
array('value' => 'store', 'label' => Mage::helper('buckaroo3extended')->__('Store Settings')),
|
9 |
+
);
|
10 |
+
return $array;
|
11 |
+
}
|
12 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Directdebit_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_directdebit_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Empayment_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_empayment_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Eps_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_eps_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,63 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2014 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Model_Sources_FeePercentageMode
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
public function toOptionArray()
|
45 |
+
{
|
46 |
+
$helper = Mage::helper('buckaroo3extended');
|
47 |
+
$array = array(
|
48 |
+
array(
|
49 |
+
'value' => 'subtotal',
|
50 |
+
'label' => $helper->__('Subtotal')
|
51 |
+
),
|
52 |
+
array(
|
53 |
+
'value' => 'subtotal_incl_tax',
|
54 |
+
'label' => $helper->__('Subtotal incl. tax')
|
55 |
+
),
|
56 |
+
array(
|
57 |
+
'value' => 'grandtotal',
|
58 |
+
'label' => $helper->__('Grand total')
|
59 |
+
),
|
60 |
+
);
|
61 |
+
return $array;
|
62 |
+
}
|
63 |
+
}
|
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Giftcards_Availablecards
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$helper = Mage::helper('buckaroo3extended');
|
7 |
+
$giftcardCollection = Mage::getResourceModel('buckaroo3extended/giftcard_collection');
|
8 |
+
$giftcardCollection->addFieldToSelect('servicecode')
|
9 |
+
->addFieldToSelect('label');
|
10 |
+
|
11 |
+
$options = array();
|
12 |
+
foreach ($giftcardCollection as $giftcard) {
|
13 |
+
$options[] = array(
|
14 |
+
'value' => $giftcard->getServicecode(),
|
15 |
+
'label' => $giftcard->getlabel(),
|
16 |
+
);
|
17 |
+
}
|
18 |
+
|
19 |
+
return $options;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Giftcards_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_giftcards_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Giropay_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_giropay_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Ideal_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_ideal_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Ideal_ServiceVersion
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$helper = Mage::helper('buckaroo3extended');
|
7 |
+
|
8 |
+
$array = array(
|
9 |
+
array(
|
10 |
+
'label' => $helper->__('1'),
|
11 |
+
'value' => 1,
|
12 |
+
),
|
13 |
+
array(
|
14 |
+
'label' => $helper->__('2 (SEPA)'),
|
15 |
+
'value' => 2,
|
16 |
+
),
|
17 |
+
);
|
18 |
+
|
19 |
+
return $array;
|
20 |
+
}
|
21 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Maestro_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_maestro_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Mastercard_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_mastercard_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Onlinegiro_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_onlinegiro_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,13 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_PaymentMethodArea
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => 'frontend', 'label' => Mage::helper('buckaroo3extended')->__('Frontend')),
|
8 |
+
array('value' => 'backend', 'label' => Mage::helper('buckaroo3extended')->__('Backend')),
|
9 |
+
array('value' => 'both', 'label' => Mage::helper('buckaroo3extended')->__('Frontend and Backend')),
|
10 |
+
);
|
11 |
+
return $array;
|
12 |
+
}
|
13 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Paymentguarantee_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_paymentguarantee_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Paypal_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_paypal_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Payperemail_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_payperemail_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Paysafecard_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_paysafecard_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_ReminderLevel
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => '4', 'label' => Mage::helper('buckaroo3extended')->__('4')),
|
8 |
+
array('value' => '3', 'label' => Mage::helper('buckaroo3extended')->__('3')),
|
9 |
+
array('value' => '2', 'label' => Mage::helper('buckaroo3extended')->__('2')),
|
10 |
+
array('value' => '1', 'label' => Mage::helper('buckaroo3extended')->__('1')),
|
11 |
+
);
|
12 |
+
return $array;
|
13 |
+
}
|
14 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Sofortueberweisung_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_sofortueberweisung_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_States extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$states=Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates();
|
7 |
+
|
8 |
+
$options=array();
|
9 |
+
$options['']=Mage::helper('buckaroo3extended')->__('-- Please Select --');
|
10 |
+
|
11 |
+
foreach($states as $value=>$label)
|
12 |
+
{
|
13 |
+
$options[]=array('value'=>$label, 'label'=>$label);
|
14 |
+
}
|
15 |
+
|
16 |
+
return $options;
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_StatusesFailed extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state=Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_failed', Mage::app()->getStore()->getStoreId());
|
7 |
+
|
8 |
+
$statuses=Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
9 |
+
|
10 |
+
$options=array();
|
11 |
+
$options[]=array('value'=>'', 'label'=>Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
12 |
+
foreach($statuses as $value=>$label)
|
13 |
+
{
|
14 |
+
$options[]=array('value'=>$value, 'label'=>$label);
|
15 |
+
}
|
16 |
+
|
17 |
+
return $options;
|
18 |
+
}
|
19 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_StatusesPending extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state='new';
|
7 |
+
$statuses=Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
8 |
+
|
9 |
+
$options=array();
|
10 |
+
$options[]=array('value'=>'', 'label'=>Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
11 |
+
foreach($statuses as $value=>$label)
|
12 |
+
{
|
13 |
+
$options[]=array('value'=>$value, 'label'=>$label);
|
14 |
+
}
|
15 |
+
|
16 |
+
return $options;
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_StatusesPendingPayment extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state=Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_pendingpayment', Mage::app()->getStore()->getStoreId());
|
7 |
+
$statuses=Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
8 |
+
|
9 |
+
$options=array();
|
10 |
+
$options[]=array('value'=>'', 'label'=>Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
11 |
+
foreach($statuses as $value=>$label)
|
12 |
+
{
|
13 |
+
$options[]=array('value'=>$value, 'label'=>$label);
|
14 |
+
}
|
15 |
+
|
16 |
+
return $options;
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_StatusesSuccess extends Varien_Object
|
3 |
+
{
|
4 |
+
static public function toOptionArray()
|
5 |
+
{
|
6 |
+
$state=Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/order_state_success', Mage::app()->getStore()->getStoreId());
|
7 |
+
$statuses=Mage::getSingleton('sales/order_config')->getStateStatuses($state);
|
8 |
+
|
9 |
+
$options=array();
|
10 |
+
$options[]=array('value'=>'', 'label'=>Mage::helper('buckaroo3extended')->__('-- Please Select --'));
|
11 |
+
foreach($statuses as $value=>$label)
|
12 |
+
{
|
13 |
+
$options[]=array('value'=>$value, 'label'=>$label);
|
14 |
+
}
|
15 |
+
|
16 |
+
return $options;
|
17 |
+
}
|
18 |
+
}
|
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_TaxClasses
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$collection = Mage::getModel('tax/class')->getCollection()
|
7 |
+
->distinct(true)
|
8 |
+
->addFieldToFilter(
|
9 |
+
'class_type',
|
10 |
+
array(
|
11 |
+
'like' => 'PRODUCT'
|
12 |
+
)
|
13 |
+
)
|
14 |
+
->load();
|
15 |
+
|
16 |
+
$classes = $collection->getColumnValues('class_id');
|
17 |
+
|
18 |
+
$optionArray = array();
|
19 |
+
$optionArray[''] = array('value' => '', 'label' => Mage::helper('buckaroo3extended')->__('None'));
|
20 |
+
foreach ($classes as $class) {
|
21 |
+
if (empty($class)) {
|
22 |
+
continue;
|
23 |
+
}
|
24 |
+
$optionArray[$class] = array('value' => $class, 'label' => Mage::getModel('tax/class')->load($class)->getClassName());
|
25 |
+
}
|
26 |
+
|
27 |
+
return $optionArray;
|
28 |
+
}
|
29 |
+
}
|
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_TestLive
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$array = array(
|
7 |
+
array('value' => '1', 'label' => Mage::helper('buckaroo3extended')->__('Test')),
|
8 |
+
array('value' => '0', 'label' => Mage::helper('buckaroo3extended')->__('Live')),
|
9 |
+
);
|
10 |
+
return $array;
|
11 |
+
}
|
12 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Transfer_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_transfer_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Visa_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_visa_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Visaelectron_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_visaelectron_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Vpay_AvailableCurrencies
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
$paymentModel = Mage::getModel('buckaroo3extended/paymentMethods_vpay_paymentMethod');
|
7 |
+
$allowedCurrencies = $paymentModel->getAllowedCurrencies();
|
8 |
+
|
9 |
+
$array = array();
|
10 |
+
foreach ($allowedCurrencies as $allowedCurrency) {
|
11 |
+
$array[] = array('value' => $allowedCurrency, 'label' => $allowedCurrency);
|
12 |
+
}
|
13 |
+
|
14 |
+
return $array;
|
15 |
+
}
|
16 |
+
}
|
@@ -0,0 +1,11 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_Model_Sources_Yesno
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value' => 1, 'label'=>Mage::helper('buckaroo3extended')->__('Yes')),
|
8 |
+
array('value' => 0, 'label'=>Mage::helper('buckaroo3extended')->__('No')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
}
|
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
-----BEGIN CERTIFICATE-----
|
2 |
+
MIICeDCCAeGgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBwjEUMBIGA1UEBhMLTmV0
|
3 |
+
aGVybGFuZHMxEDAOBgNVBAgTB1V0cmVjaHQxEDAOBgNVBAcTB1V0cmVjaHQxFjAU
|
4 |
+
BgNVBAoTDUJ1Y2thcm9vIEIuVi4xGjAYBgNVBAsTEVRlY2huaWNhbCBTdXBwb3J0
|
5 |
+
MS4wLAYDVQQDEyVCdWNrYXJvbyBPbmxpbmUgUGF5bWVudCBTZXJ2aWNlcyBCLlYu
|
6 |
+
MSIwIAYJKoZIhvcNAQkBFhNzdXBwb3J0QGJ1Y2thcm9vLm5sMB4XDTEyMDIwNzEx
|
7 |
+
MTQ1NVoXDTIyMDIwNzExMTQ1NVowQTEPMA0GA1UEBxMGQkVJTEVOMRYwFAYDVQQK
|
8 |
+
Ew1CdWNrYXJvbyBCLlYuMRYwFAYDVQQDEw1CdWNrYXJvbyBCLlYuMIGfMA0GCSqG
|
9 |
+
SIb3DQEBAQUAA4GNADCBiQKBgQD4u6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Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2013 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_Buckaroo3Extended_Adminhtml_GiftcardController extends Mage_Adminhtml_Controller_Action
|
40 |
+
{
|
41 |
+
protected function _construct()
|
42 |
+
{
|
43 |
+
$this->setUsedModuleName('TIG_Buckaroo3Extended');
|
44 |
+
}
|
45 |
+
|
46 |
+
protected function _initAction()
|
47 |
+
{
|
48 |
+
$this->_title($this->__('System'))
|
49 |
+
->_title($this->__('Buckaroo Giftcards'));
|
50 |
+
|
51 |
+
$this->loadLayout()
|
52 |
+
->_setActiveMenu('system/buckaroo_giftcards')
|
53 |
+
->_addBreadcrumb(
|
54 |
+
Mage::helper('adminhtml')->__('System'),
|
55 |
+
Mage::helper('adminhtml')->__('System')
|
56 |
+
)
|
57 |
+
->_addBreadcrumb(
|
58 |
+
Mage::helper('buckaroo3extended')->__('Giftcards'),
|
59 |
+
Mage::helper('buckaroo3extended')->__('Giftcards')
|
60 |
+
);
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function indexAction()
|
66 |
+
{
|
67 |
+
$this->_initAction()->renderLayout();
|
68 |
+
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function newAction()
|
73 |
+
{
|
74 |
+
$this->_redirect('*/*/edit');
|
75 |
+
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function editAction()
|
80 |
+
{
|
81 |
+
$giftcard = Mage::getModel('buckaroo3extended/giftcard');
|
82 |
+
$id = $this->getRequest()->getParam('entity_id');
|
83 |
+
|
84 |
+
if ($id) {
|
85 |
+
$giftcard->load($id);
|
86 |
+
}
|
87 |
+
|
88 |
+
Mage::register('current_giftcard', $giftcard);
|
89 |
+
$this->_initAction()->renderLayout();
|
90 |
+
|
91 |
+
return $this;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function gridAction()
|
95 |
+
{
|
96 |
+
$this->loadLayout()->renderLayout();
|
97 |
+
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function saveAction()
|
102 |
+
{
|
103 |
+
$id = $this->getRequest()->getParam('entity_id');
|
104 |
+
|
105 |
+
$giftcard = Mage::getModel('buckaroo3extended/giftcard');
|
106 |
+
if ($id) {
|
107 |
+
$giftcard->load($id);
|
108 |
+
}
|
109 |
+
|
110 |
+
$data = $this->getRequest()->getParam('giftcard');
|
111 |
+
if (!is_array($data)){
|
112 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
113 |
+
$this->__('There was an error saving your giftcard. please check all fields and try again.')
|
114 |
+
);
|
115 |
+
$this->_redirect('*/*/edit', array('entity_id' => $id));
|
116 |
+
|
117 |
+
return $this;
|
118 |
+
}
|
119 |
+
|
120 |
+
foreach ($data as $field => $value) {
|
121 |
+
$giftcard->setDataUsingMethod($field, $value);
|
122 |
+
}
|
123 |
+
|
124 |
+
try {
|
125 |
+
$giftcard->save();
|
126 |
+
} catch (Exception $e) {
|
127 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
128 |
+
$this->_redirect('*/*/edit', array('entity_id' => $id));
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
134 |
+
$this->__('Product was saved successfully.')
|
135 |
+
);
|
136 |
+
|
137 |
+
$this->_redirect('*/*/index');
|
138 |
+
return $this;
|
139 |
+
}
|
140 |
+
}
|
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_CheckoutController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function checkoutAction()
|
5 |
+
{
|
6 |
+
/**
|
7 |
+
* @var TIG_Buckaroo3Extended_Model_Request_Abstract $request
|
8 |
+
*/
|
9 |
+
$request = Mage::getModel('buckaroo3extended/request_abstract');
|
10 |
+
$request->sendRequest();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function saveDataAction()
|
14 |
+
{
|
15 |
+
$data = $this->getRequest()->getPost();
|
16 |
+
|
17 |
+
if (!is_array($data) || !isset($data['name']) || !isset($data['value'])) {
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
|
21 |
+
$name = $data['name'];
|
22 |
+
$value = $data['value'];
|
23 |
+
|
24 |
+
$session = Mage::getSingleton('checkout/session');
|
25 |
+
$session->setData($name, $value);
|
26 |
+
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
}
|
@@ -0,0 +1,394 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class TIG_Buckaroo3Extended_NotifyController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
|
5 |
+
protected $_order;
|
6 |
+
protected $_postArray;
|
7 |
+
protected $_debugEmail;
|
8 |
+
protected $_paymentMethodCode;
|
9 |
+
protected $_paymentCode;
|
10 |
+
protected $_processPush;
|
11 |
+
|
12 |
+
|
13 |
+
public function setCurrentOrder($order)
|
14 |
+
{
|
15 |
+
$this->_order = $order;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getCurrentOrder()
|
19 |
+
{
|
20 |
+
return $this->_order;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setPostArray($array)
|
24 |
+
{
|
25 |
+
$this->_postArray = $array;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getPostArray()
|
29 |
+
{
|
30 |
+
return $this->_postArray;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function setMethod($paymentMethod)
|
34 |
+
{
|
35 |
+
$this->_paymentMethodCode = $paymentMethod;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getMethod()
|
39 |
+
{
|
40 |
+
return $this->_paymentMethodCode;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function setDebugEmail($debugEmail)
|
44 |
+
{
|
45 |
+
$this->_debugEmail = $debugEmail;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getDebugEmail()
|
49 |
+
{
|
50 |
+
return $this->_debugEmail;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function setPushLock($orderId)
|
54 |
+
{
|
55 |
+
$this->_processPush = Mage::getModel('buckaroo3extended/process')->setId('push_' . $orderId);
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getPushLock()
|
59 |
+
{
|
60 |
+
return $this->_processPush;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
*
|
65 |
+
* Prevents the page from being displayed using GET
|
66 |
+
*/
|
67 |
+
public function preDispatch()
|
68 |
+
{
|
69 |
+
$postData = $this->getRequest()->getPost();
|
70 |
+
if (empty($postData)) {
|
71 |
+
echo 'Only Buckaroo can call this page properly.';
|
72 |
+
exit;
|
73 |
+
}
|
74 |
+
return parent::preDispatch();
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
*
|
79 |
+
* Handles 'pushes' sent by Buckaroo meant to update the current status of payments/orders
|
80 |
+
*/
|
81 |
+
public function pushAction()
|
82 |
+
{
|
83 |
+
$postData = $this->getRequest()->getPost();
|
84 |
+
|
85 |
+
$this->_debugEmail = '';
|
86 |
+
if (isset($postData['brq_invoicenumber'])) {
|
87 |
+
$this->_postArray = $postData;
|
88 |
+
$orderId = $this->_postArray['brq_invoicenumber'];
|
89 |
+
} else if (isset($postData['bpe_invoice'])) {
|
90 |
+
$this->_restructurePostArray();
|
91 |
+
$orderId = $this->_postArray['brq_invoicenumber'];
|
92 |
+
} else {
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
$this->_debugEmail .= 'Buckaroo push recieved at ' . date('Y-m-d H:i:s') . "\n";
|
97 |
+
$this->_debugEmail .= 'Order ID: ' . $orderId . "\n";
|
98 |
+
|
99 |
+
if (isset($postData['brq_test']) && $postData['brq_test'] == 'true') {
|
100 |
+
$this->_debugEmail .= "\n/////////// TEST /////////\n";
|
101 |
+
}
|
102 |
+
|
103 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
104 |
+
|
105 |
+
if (!$this->_order) {
|
106 |
+
return false;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
//order exists, instantiate the lock-object for the push
|
111 |
+
$this->setPushLock($this->_order->getId());
|
112 |
+
|
113 |
+
if ($this->_processPush->isLocked())
|
114 |
+
{
|
115 |
+
$this->_debugEmail .= "\n".'Currently another push is being processed, the current push will not be processed.'."\n";
|
116 |
+
$this->_debugEmail .= "\n".'sent from: ' . __FILE__ . '@' . __LINE__."\n";
|
117 |
+
$module = Mage::getModel('buckaroo3extended/abstract', $this->_debugEmail);
|
118 |
+
$module->setDebugEmail($this->_debugEmail);
|
119 |
+
$module->sendDebugEmail();
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
|
123 |
+
$this->_processPush->lockAndBlock();
|
124 |
+
$this->_debugEmail .= "\n".'Push is gelocked, hij kan nu verwerkt worden.'."\n";
|
125 |
+
|
126 |
+
$this->_paymentCode = $this->_order->getPayment()->getMethod();
|
127 |
+
|
128 |
+
$this->_debugEmail .= 'Payment code: ' . $this->_paymentCode . "\n\n";
|
129 |
+
$this->_debugEmail .= 'POST variables recieved: ' . var_export($this->_postArray, true) . "\n\n";
|
130 |
+
|
131 |
+
try {
|
132 |
+
list($module, $processedPush) = $this->_processPushAccordingToType();
|
133 |
+
} catch (Exception $e) {
|
134 |
+
$this->_debugEmail .= "An Exception occurred: " . $e->getMessage() . "\n";
|
135 |
+
$this->_debugEmail .= "\nException trace: " . $e->getTraceAsString() . "\n";
|
136 |
+
|
137 |
+
Mage::register('buckaroo_push-error', true);
|
138 |
+
Mage::helper('buckaroo3extended')->logException($e);
|
139 |
+
//this will allow the script to continue unhindered
|
140 |
+
$processedPush = false;
|
141 |
+
$module = Mage::getModel('buckaroo3extended/abstract', $this->_debugEmail);
|
142 |
+
}
|
143 |
+
$this->_debugEmail = $module->getDebugEmail();
|
144 |
+
|
145 |
+
if ($processedPush === false) {
|
146 |
+
$this->_debugEmail .= 'Push was not fully processed!';
|
147 |
+
}
|
148 |
+
|
149 |
+
$this->_debugEmail .= "\n".' sent from: ' . __FILE__ . '@' . __LINE__;
|
150 |
+
|
151 |
+
// Remove the lock.
|
152 |
+
$this->_processPush->unlock();
|
153 |
+
$this->_debugEmail .= "\n".'Push is afgerond, lock is vrij gegeven'."\n";
|
154 |
+
//send debug email
|
155 |
+
$module->setDebugEmail($this->_debugEmail);
|
156 |
+
$module->sendDebugEmail();
|
157 |
+
}
|
158 |
+
|
159 |
+
public function returnAction()
|
160 |
+
{
|
161 |
+
$postData = $this->getRequest()->getPost();
|
162 |
+
if (isset($postData['brq_invoicenumber'])) {
|
163 |
+
$orderId = $postData['brq_invoicenumber'];
|
164 |
+
} else {
|
165 |
+
$this->_redirect('');
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
|
170 |
+
|
171 |
+
$this->_paymentCode = $this->_order->getPayment()->getMethod();
|
172 |
+
|
173 |
+
$debugEmail = 'Payment code: ' . $this->_paymentCode . "\n\n";
|
174 |
+
$debugEmail .= 'POST variables received: ' . var_export($postData, true) . "\n\n";
|
175 |
+
|
176 |
+
/**
|
177 |
+
* @var TIG_Buckaroo3Extended_Model_Response_Return $module
|
178 |
+
*/
|
179 |
+
$module = Mage::getModel(
|
180 |
+
'buckaroo3extended/response_return',
|
181 |
+
array(
|
182 |
+
'order' => $this->_order,
|
183 |
+
'postArray' => $postData,
|
184 |
+
'debugEmail' => $debugEmail,
|
185 |
+
'method' => $this->_paymentCode,
|
186 |
+
)
|
187 |
+
);
|
188 |
+
|
189 |
+
$module->processReturn();
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
$this->_redirect('');
|
195 |
+
}
|
196 |
+
|
197 |
+
protected function _processPushAccordingToType()
|
198 |
+
{
|
199 |
+
if (
|
200 |
+
$this->_order->getTransactionKey() == $this->_postArray['brq_transactions']
|
201 |
+
|| (isset($this->_postArray['brq_relatedtransaction_partialpayment'])
|
202 |
+
&& $this->_order->getTransactionKey() == $this->_postArray['brq_relatedtransaction_partialpayment'])
|
203 |
+
) {
|
204 |
+
list($processedPush, $module) = $this->_updateOrderWithKey();
|
205 |
+
return array($module, $processedPush);
|
206 |
+
}
|
207 |
+
|
208 |
+
$this->_paymentCode = $this->_order->getPayment()->getMethod();
|
209 |
+
$merchantKey = Mage::getStoreConfig('buckaroo/buckaroo3extended/key', $this->_order->getStoreId());
|
210 |
+
|
211 |
+
//fix for payperemail transactions with different transaction keys but belongs to the same order
|
212 |
+
if (
|
213 |
+
$this->_paymentCode == 'buckaroo3extended_payperemail'
|
214 |
+
&& $this->_postArray['brq_transaction_method'] != 'payperemail'
|
215 |
+
&& $this->_order->getIncrementId() == $this->_postArray['brq_invoicenumber']
|
216 |
+
&& (
|
217 |
+
isset($this->_postArray['brq_websitekey'])
|
218 |
+
&& $merchantKey == $this->_postArray['brq_websitekey']
|
219 |
+
)
|
220 |
+
){
|
221 |
+
list($processedPush, $module) = $this->_updateOrderWithKey();
|
222 |
+
return array($module, $processedPush);
|
223 |
+
}
|
224 |
+
|
225 |
+
if ($this->_pushIsCreditmemo($this->_postArray)) {
|
226 |
+
list($processedPush, $module) = $this->_updateCreditmemo();
|
227 |
+
return array($module, $processedPush);
|
228 |
+
}
|
229 |
+
|
230 |
+
if (isset($this->_postArray['brq_amount_credit'])) {
|
231 |
+
list($processedPush, $module) = $this->_newRefund();
|
232 |
+
return array($module, $processedPush);
|
233 |
+
}
|
234 |
+
|
235 |
+
if (!$this->_order->getTransactionKey()) {
|
236 |
+
list($processedPush, $module) = $this->_updateOrderWithoutKey();
|
237 |
+
return array($module, $processedPush);
|
238 |
+
}
|
239 |
+
|
240 |
+
Mage::throwException('unable to process PUSH');
|
241 |
+
return false;
|
242 |
+
}
|
243 |
+
|
244 |
+
protected function _updateOrderWithKey()
|
245 |
+
{
|
246 |
+
$this->_debugEmail .= "Transaction key matches the order. \n";
|
247 |
+
|
248 |
+
$module = Mage::getModel(
|
249 |
+
'buckaroo3extended/response_push',
|
250 |
+
array(
|
251 |
+
'order' => $this->_order,
|
252 |
+
'postArray' => $this->_postArray,
|
253 |
+
'debugEmail' => $this->_debugEmail,
|
254 |
+
'method' => $this->_paymentCode,
|
255 |
+
)
|
256 |
+
);
|
257 |
+
|
258 |
+
$processedPush = $module->processPush();
|
259 |
+
|
260 |
+
return array($processedPush, $module);
|
261 |
+
}
|
262 |
+
|
263 |
+
protected function _updateOrderWithoutKey()
|
264 |
+
{
|
265 |
+
$this->_debugEmail .= "Order does not yet have a transaction key and the PUSH does not constitute a refund. \n";
|
266 |
+
|
267 |
+
$this->_order->setTransactionKey($this->_postArray['brq_transactions'])
|
268 |
+
->save();
|
269 |
+
|
270 |
+
$this->_debugEmail .= "Transaction key saved: {$this->_postArray['brq_transactions']}";
|
271 |
+
|
272 |
+
$module = Mage::getModel(
|
273 |
+
'buckaroo3extended/response_push',
|
274 |
+
array(
|
275 |
+
'order' => $this->_order,
|
276 |
+
'postArray' => $this->_postArray,
|
277 |
+
'debugEmail' => $this->_debugEmail,
|
278 |
+
'method' => $this->_paymentCode,
|
279 |
+
)
|
280 |
+
);
|
281 |
+
|
282 |
+
$processedPush = $module->processPush();
|
283 |
+
|
284 |
+
return array($processedPush, $module);
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Creditmemo updates are currently not supported
|
289 |
+
*/
|
290 |
+
protected function _updateCreditmemo()
|
291 |
+
{
|
292 |
+
$this->_debugEmail .= "Recieved PUSH to update creditmemo. Unfortunately the module does not support creditmemo updates at this time. The PUSH is ignored.";
|
293 |
+
|
294 |
+
$debugEmailConfig = Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->_order->getStoreId());
|
295 |
+
if (empty($debugEmailConfig))
|
296 |
+
{
|
297 |
+
return;
|
298 |
+
}
|
299 |
+
|
300 |
+
$mail = $this->_debugEmail;
|
301 |
+
|
302 |
+
mail(
|
303 |
+
Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->_order->getStoreId()),
|
304 |
+
'Buckaroo 3 Extended Debug Email',
|
305 |
+
$mail
|
306 |
+
);
|
307 |
+
|
308 |
+
return $this;
|
309 |
+
}
|
310 |
+
|
311 |
+
protected function _newRefund()
|
312 |
+
{
|
313 |
+
$this->_debugEmail .= "The PUSH constitutes a new refund. \n";
|
314 |
+
|
315 |
+
if (isset($this->_postArray['ADD_refund_initiated_in_magento'])) {
|
316 |
+
$this->_debugEmail .= "The order is already being refunded. \n";
|
317 |
+
mail(
|
318 |
+
Mage::getStoreConfig('buckaroo/buckaroo3extended_advanced/debug_email', $this->_order->getStoreId()),
|
319 |
+
'Buckaroo 3 Extended Debug Email',
|
320 |
+
$this->_debugEmail
|
321 |
+
);
|
322 |
+
exit;
|
323 |
+
}
|
324 |
+
|
325 |
+
$module = Mage::getModel(
|
326 |
+
'TIG_Buckaroo3Extended_Model_Refund_Creditmemo',
|
327 |
+
array(
|
328 |
+
'order' => $this->_order,
|
329 |
+
'postArray' => $this->_postArray,
|
330 |
+
'debugEmail' => $this->_debugEmail,
|
331 |
+
)
|
332 |
+
);
|
333 |
+
$module->setRequest($this->getRequest());
|
334 |
+
|
335 |
+
try {
|
336 |
+
$processedPush = $module->processBuckarooRefundPush();
|
337 |
+
} catch (Exception $e) {
|
338 |
+
Mage::logException($e);exit;
|
339 |
+
}
|
340 |
+
|
341 |
+
return array($processedPush, $module);
|
342 |
+
}
|
343 |
+
|
344 |
+
protected function _updateOrderWithoutMatchingKey()
|
345 |
+
{
|
346 |
+
//the following payment methods allow the payment to be performed with a different method than the initial transaction request
|
347 |
+
if (
|
348 |
+
$this->_order->getpayment()->getMethod() != $this->_postArray['brq_transaction_method']
|
349 |
+
&&
|
350 |
+
($this->_order->getpayment()->getMethod() == 'payperemail'
|
351 |
+
|| $this->_order->getpayment()->getMethod() == 'onlinegiro'
|
352 |
+
)
|
353 |
+
) {
|
354 |
+
return $this->_updateOrderWithKey();
|
355 |
+
}
|
356 |
+
Mage::throwException('Unable to match push to order or creditmemo');
|
357 |
+
}
|
358 |
+
|
359 |
+
protected function _pushIsCreditmemo()
|
360 |
+
{
|
361 |
+
foreach ($this->_order->getCreditmemosCollection() as $creditmemo)
|
362 |
+
{
|
363 |
+
if ($creditmemo->getTransactionKey() == $this->_postArray['brq_transactions']) {
|
364 |
+
return true;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
return false;
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Restructure the Push message sent by the BPE 2.0 to one resembling a push message sent by BPE 3.0.
|
372 |
+
* This way push messages sent to update a 2.0 transaction can still be processed.
|
373 |
+
*/
|
374 |
+
protected function _restructurePostArray()
|
375 |
+
{
|
376 |
+
$postArray = array(
|
377 |
+
'brq_amount' => round($_POST['bpe_amount'] / 100, 2),
|
378 |
+
'brq_currency' => $_POST['bpe_currency'],
|
379 |
+
'brq_invoicenumber' => $_POST['bpe_invoice'],
|
380 |
+
'brq_statuscode' => $_POST['bpe_result'],
|
381 |
+
'brq_statusmessage' => null,
|
382 |
+
'brq_test' => $_POST['bpe_mode'] ? 'true' : 'false',
|
383 |
+
'brq_timestamp' => $_POST['bpe_timestamp'],
|
384 |
+
'brq_transaction_method' => null,
|
385 |
+
'brq_transaction_type' => null,
|
386 |
+
'brq_transactions' => $_POST['bpe_trx'],
|
387 |
+
'brq_signature' => $_POST['bpe_signature2'],
|
388 |
+
'isOldPost' => true,
|
389 |
+
'oldPost' => $_POST,
|
390 |
+
);
|
391 |
+
|
392 |
+
$this->setPostArray($postArray);
|
393 |
+
}
|
394 |
+
}
|
@@ -0,0 +1,41 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<system>
|
5 |
+
<children>
|
6 |
+
<buckaroo_giftcard translate="title" module="buckaroo3extended">
|
7 |
+
<title>Buckaroo Giftcards</title>
|
8 |
+
<sort_order>55</sort_order>
|
9 |
+
<action>admin_buckaroo3extended/adminhtml_giftcard</action>
|
10 |
+
</buckaroo_giftcard>
|
11 |
+
</children>
|
12 |
+
</system>
|
13 |
+
</menu>
|
14 |
+
<acl>
|
15 |
+
<resources>
|
16 |
+
<all>
|
17 |
+
<title>Allow Everything</title>
|
18 |
+
</all>
|
19 |
+
<admin>
|
20 |
+
<children>
|
21 |
+
<system>
|
22 |
+
<children>
|
23 |
+
<config>
|
24 |
+
<children>
|
25 |
+
<buckaroo translate="title">
|
26 |
+
<title>Buckaroo</title>
|
27 |
+
<sort_order>0</sort_order>
|
28 |
+
</buckaroo>
|
29 |
+
</children>
|
30 |
+
</config>
|
31 |
+
<buckaroo_giftcard translate="title">
|
32 |
+
<title>Buckaroo Giftcards</title>
|
33 |
+
<sort_order>55</sort_order>
|
34 |
+
</buckaroo_giftcard>
|
35 |
+
</children>
|
36 |
+
</system>
|
37 |
+
</children>
|
38 |
+
</admin>
|
39 |
+
</resources>
|
40 |
+
</acl>
|
41 |
+
</config>
|
@@ -0,0 +1,1738 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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>
|
12 |
+
<file>TIG/buckaroo3extended.xml</file>
|
13 |
+
</TIG_Buckaroo3Extended>
|
14 |
+
</updates>
|
15 |
+
</layout>
|
16 |
+
<routers>
|
17 |
+
<buckaroo3extended>
|
18 |
+
<use>standard</use>
|
19 |
+
<args>
|
20 |
+
<module>TIG_Buckaroo3Extended</module>
|
21 |
+
<frontName>buckaroo3extended</frontName>
|
22 |
+
</args>
|
23 |
+
</buckaroo3extended>
|
24 |
+
</routers>
|
25 |
+
<translate>
|
26 |
+
<modules>
|
27 |
+
<TIG_Buckaroo3Extended>
|
28 |
+
<files>
|
29 |
+
<default>TIG_Buckaroo3Extended.csv</default>
|
30 |
+
</files>
|
31 |
+
</TIG_Buckaroo3Extended>
|
32 |
+
</modules>
|
33 |
+
</translate>
|
34 |
+
</frontend>
|
35 |
+
<adminhtml>
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<TIG_Buckaroo3Extended>
|
39 |
+
<file>TIG/buckaroo3extended.xml</file>
|
40 |
+
</TIG_Buckaroo3Extended>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
<translate>
|
44 |
+
<modules>
|
45 |
+
<TIG_Buckaroo3Extended>
|
46 |
+
<files>
|
47 |
+
<default>TIG_Buckaroo3Extended.csv</default>
|
48 |
+
</files>
|
49 |
+
</TIG_Buckaroo3Extended>
|
50 |
+
</modules>
|
51 |
+
</translate>
|
52 |
+
<events>
|
53 |
+
<checkout_submit_all_after>
|
54 |
+
<observers>
|
55 |
+
<buckaroo3extended_backendOrder>
|
56 |
+
<type>Model</type>
|
57 |
+
<class>buckaroo3extended/observer_backendOrder</class>
|
58 |
+
<method>checkout_submit_all_after</method>
|
59 |
+
</buckaroo3extended_backendOrder>
|
60 |
+
</observers>
|
61 |
+
</checkout_submit_all_after>
|
62 |
+
</events>
|
63 |
+
</adminhtml>
|
64 |
+
<admin>
|
65 |
+
<routers>
|
66 |
+
<admin_buckaroo3extended>
|
67 |
+
<use>admin</use>
|
68 |
+
<args>
|
69 |
+
<module>TIG_Buckaroo3Extended</module>
|
70 |
+
<frontName>admin_buckaroo3extended</frontName>
|
71 |
+
</args>
|
72 |
+
</admin_buckaroo3extended>
|
73 |
+
</routers>
|
74 |
+
</admin>
|
75 |
+
<global>
|
76 |
+
|
77 |
+
<blocks>
|
78 |
+
<buckaroo3extended>
|
79 |
+
<class>TIG_Buckaroo3Extended_Block</class>
|
80 |
+
</buckaroo3extended>
|
81 |
+
</blocks>
|
82 |
+
|
83 |
+
<models>
|
84 |
+
<buckaroo3extended>
|
85 |
+
<class>TIG_Buckaroo3Extended_Model</class>
|
86 |
+
<resourceModel>buckaroo3extended_resource</resourceModel>
|
87 |
+
</buckaroo3extended>
|
88 |
+
<buckaroo3extended_resource>
|
89 |
+
<class>TIG_Buckaroo3Extended_Model_Resource</class>
|
90 |
+
<deprecatedNode>buckaroo3extended_mysql4</deprecatedNode>
|
91 |
+
<entities>
|
92 |
+
<certificate>
|
93 |
+
<table>buckaroo_certificates</table>
|
94 |
+
</certificate>
|
95 |
+
<giftcard>
|
96 |
+
<table>tig_buckaroo_giftcard</table>
|
97 |
+
</giftcard>
|
98 |
+
</entities>
|
99 |
+
</buckaroo3extended_resource>
|
100 |
+
</models>
|
101 |
+
|
102 |
+
<helpers>
|
103 |
+
<buckaroo3extended>
|
104 |
+
<class>TIG_Buckaroo3Extended_Helper</class>
|
105 |
+
</buckaroo3extended>
|
106 |
+
</helpers>
|
107 |
+
|
108 |
+
<resources>
|
109 |
+
<buckaroo3extended_setup>
|
110 |
+
<setup>
|
111 |
+
<module>TIG_Buckaroo3Extended</module>
|
112 |
+
<class>TIG_Buckaroo3Extended_Model_Resource_Setup</class>
|
113 |
+
</setup>
|
114 |
+
<connection>
|
115 |
+
<use>core_setup</use>
|
116 |
+
</connection>
|
117 |
+
</buckaroo3extended_setup>
|
118 |
+
<buckaroo3extended_write>
|
119 |
+
<connection>
|
120 |
+
<use>core_write</use>
|
121 |
+
</connection>
|
122 |
+
</buckaroo3extended_write>
|
123 |
+
<buckaroo3extended_read>
|
124 |
+
<connection>
|
125 |
+
<use>core_read</use>
|
126 |
+
</connection>
|
127 |
+
</buckaroo3extended_read>
|
128 |
+
</resources>
|
129 |
+
|
130 |
+
<payment>
|
131 |
+
<groups>
|
132 |
+
<buckaroo3extended>Buckaroo3Extended</buckaroo3extended>
|
133 |
+
</groups>
|
134 |
+
</payment>
|
135 |
+
|
136 |
+
<sales>
|
137 |
+
<quote>
|
138 |
+
<totals>
|
139 |
+
<buckaroo_fee>
|
140 |
+
<class>buckaroo3extended/paymentFee_quote_address_total_fee</class>
|
141 |
+
<before>tax,grand_total</before>
|
142 |
+
<after>subtotal,discount,shipping</after>
|
143 |
+
<renderer>buckaroo3extended/paymentFee_checkout_total_fee</renderer>
|
144 |
+
<admin_renderer>buckaroo3extended/adminhtml_sales_order_create_totals_fee</admin_renderer>
|
145 |
+
</buckaroo_fee>
|
146 |
+
<buckaroo_fee_tax>
|
147 |
+
<class>buckaroo3extended/paymentFee_quote_address_total_feeTax</class>
|
148 |
+
<before>grand_total</before>
|
149 |
+
<after>subtotal,discount,shipping,tax</after>
|
150 |
+
</buckaroo_fee_tax>
|
151 |
+
</totals>
|
152 |
+
</quote>
|
153 |
+
<order_invoice>
|
154 |
+
<totals>
|
155 |
+
<subtotal>
|
156 |
+
<class>buckaroo3extended/paymentFee_order_invoice_total_subtotal</class>
|
157 |
+
</subtotal>
|
158 |
+
<buckaroo_fee>
|
159 |
+
<class>buckaroo3extended/paymentFee_order_invoice_total_fee</class>
|
160 |
+
<after>subtotal,discount,shipping</after>
|
161 |
+
<before>tax,grand_total</before>
|
162 |
+
</buckaroo_fee>
|
163 |
+
<buckaroo_fee_tax>
|
164 |
+
<class>buckaroo3extended/paymentFee_order_invoice_total_feeTax</class>
|
165 |
+
<after>subtotal,discount,shipping,tax</after>
|
166 |
+
<before>grand_total</before>
|
167 |
+
</buckaroo_fee_tax>
|
168 |
+
</totals>
|
169 |
+
</order_invoice>
|
170 |
+
<order_creditmemo>
|
171 |
+
<totals>
|
172 |
+
<buckaroo_fee>
|
173 |
+
<class>buckaroo3extended/paymentFee_order_creditmemo_total_fee</class>
|
174 |
+
<after>subtotal,discount,shipping</after>
|
175 |
+
<before>tax,grand_total</before>
|
176 |
+
</buckaroo_fee>
|
177 |
+
<buckaroo_fee_tax>
|
178 |
+
<class>buckaroo3extended/paymentFee_order_creditmemo_total_feeTax</class>
|
179 |
+
<after>subtotal,discount,shipping,tax</after>
|
180 |
+
<before>grand_total</before>
|
181 |
+
</buckaroo_fee_tax>
|
182 |
+
</totals>
|
183 |
+
</order_creditmemo>
|
184 |
+
</sales>
|
185 |
+
<pdf>
|
186 |
+
<totals>
|
187 |
+
<tax>
|
188 |
+
<model>buckaroo3extended/paymentFee_order_pdf_total_tax</model>
|
189 |
+
</tax>
|
190 |
+
<grand_total>
|
191 |
+
<model>buckaroo3extended/paymentFee_order_pdf_total_grandtotal</model>
|
192 |
+
</grand_total>
|
193 |
+
<buckaroo_fee translate="title" module="buckaroo3extended">
|
194 |
+
<title>Buckaroo Payment Fee</title>
|
195 |
+
<source_field>buckaroo_fee</source_field>
|
196 |
+
<font_size>7</font_size>
|
197 |
+
<display_zero>0</display_zero>
|
198 |
+
<sort_order>300</sort_order>
|
199 |
+
<model>buckaroo3extended/paymentFee_order_pdf_total_fee</model>
|
200 |
+
</buckaroo_fee>
|
201 |
+
</totals>
|
202 |
+
</pdf>
|
203 |
+
<fieldsets>
|
204 |
+
<sales_convert_quote_address>
|
205 |
+
<buckaroo_fee>
|
206 |
+
<to_order>*</to_order>
|
207 |
+
</buckaroo_fee>
|
208 |
+
<base_buckaroo_fee>
|
209 |
+
<to_order>*</to_order>
|
210 |
+
</base_buckaroo_fee>
|
211 |
+
<buckaroo_fee_tax>
|
212 |
+
<to_order>*</to_order>
|
213 |
+
</buckaroo_fee_tax>
|
214 |
+
<base_buckaroo_fee_tax>
|
215 |
+
<to_order>*</to_order>
|
216 |
+
</base_buckaroo_fee_tax>
|
217 |
+
</sales_convert_quote_address>
|
218 |
+
<sales_convert_order>
|
219 |
+
<buckaroo_fee>
|
220 |
+
<to_quote_address_shipping>*</to_quote_address_shipping>
|
221 |
+
</buckaroo_fee>
|
222 |
+
<base_buckaroo_fee>
|
223 |
+
<to_quote_address_shipping>*</to_quote_address_shipping>
|
224 |
+
</base_buckaroo_fee>
|
225 |
+
<buckaroo_fee_tax>
|
226 |
+
<to_quote_address_shipping>*</to_quote_address_shipping>
|
227 |
+
</buckaroo_fee_tax>
|
228 |
+
<base_buckaroo_fee_tax>
|
229 |
+
<to_quote_address_shipping>*</to_quote_address_shipping>
|
230 |
+
</base_buckaroo_fee_tax>
|
231 |
+
</sales_convert_order>
|
232 |
+
</fieldsets>
|
233 |
+
<events>
|
234 |
+
<sales_order_payment_refund>
|
235 |
+
<observers>
|
236 |
+
<buckaroo3extended_refund_observer>
|
237 |
+
<type>Singleton</type>
|
238 |
+
<class>buckaroo3extended/refund_observer</class>
|
239 |
+
<method>sales_order_payment_refund</method>
|
240 |
+
</buckaroo3extended_refund_observer>
|
241 |
+
</observers>
|
242 |
+
</sales_order_payment_refund>
|
243 |
+
<buckaroo3extended_refund_request_setmethod>
|
244 |
+
<observers>
|
245 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
246 |
+
<type>Singleton</type>
|
247 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
248 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
249 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
250 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
251 |
+
<type>Singleton</type>
|
252 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
253 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
254 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
255 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
256 |
+
<type>Singleton</type>
|
257 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
258 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
259 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
260 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
261 |
+
<type>Singleton</type>
|
262 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
263 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
264 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
265 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
266 |
+
<type>Singleton</type>
|
267 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
268 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
269 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
270 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
271 |
+
<type>Singleton</type>
|
272 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
273 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
274 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
275 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
276 |
+
<type>Singleton</type>
|
277 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
278 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
279 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
280 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
281 |
+
<type>Singleton</type>
|
282 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
283 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
284 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
285 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
286 |
+
<type>Singleton</type>
|
287 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
288 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
289 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
290 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
291 |
+
<type>Singleton</type>
|
292 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
293 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
294 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
295 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
296 |
+
<type>Singleton</type>
|
297 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
298 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
299 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
300 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
301 |
+
<type>Singleton</type>
|
302 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
303 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
304 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
305 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
306 |
+
<type>Singleton</type>
|
307 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
308 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
309 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
310 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
311 |
+
<type>Singleton</type>
|
312 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
313 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
314 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
315 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
316 |
+
<type>Singleton</type>
|
317 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
318 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
319 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
320 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
321 |
+
<type>Singleton</type>
|
322 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
323 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
324 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
325 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
326 |
+
<type>Singleton</type>
|
327 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
328 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
329 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
330 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
331 |
+
<type>Singleton</type>
|
332 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
333 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
334 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
335 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
336 |
+
<type>Singleton</type>
|
337 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
338 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
339 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
340 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
341 |
+
<type>Singleton</type>
|
342 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
343 |
+
<method>buckaroo3extended_refund_request_setmethod</method>
|
344 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
345 |
+
</observers>
|
346 |
+
</buckaroo3extended_refund_request_setmethod>
|
347 |
+
<buckaroo3extended_refund_request_addservices>
|
348 |
+
<observers>
|
349 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
350 |
+
<type>Singleton</type>
|
351 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
352 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
353 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
354 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
355 |
+
<type>Singleton</type>
|
356 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
357 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
358 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
359 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
360 |
+
<type>Singleton</type>
|
361 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
362 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
363 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
364 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
365 |
+
<type>Singleton</type>
|
366 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
367 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
368 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
369 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
370 |
+
<type>Singleton</type>
|
371 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
372 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
373 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
374 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
375 |
+
<type>Singleton</type>
|
376 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
377 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
378 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
379 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
380 |
+
<type>Singleton</type>
|
381 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
382 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
383 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
384 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
385 |
+
<type>Singleton</type>
|
386 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
387 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
388 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
389 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
390 |
+
<type>Singleton</type>
|
391 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
392 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
393 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
394 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
395 |
+
<type>Singleton</type>
|
396 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
397 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
398 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
399 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
400 |
+
<type>Singleton</type>
|
401 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
402 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
403 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
404 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
405 |
+
<type>Singleton</type>
|
406 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
407 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
408 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
409 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
410 |
+
<type>Singleton</type>
|
411 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
412 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
413 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
414 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
415 |
+
<type>Singleton</type>
|
416 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
417 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
418 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
419 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
420 |
+
<type>Singleton</type>
|
421 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
422 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
423 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
424 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
425 |
+
<type>Singleton</type>
|
426 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
427 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
428 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
429 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
430 |
+
<type>Singleton</type>
|
431 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
432 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
433 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
434 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
435 |
+
<type>Singleton</type>
|
436 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
437 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
438 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
439 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
440 |
+
<type>Singleton</type>
|
441 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
442 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
443 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
444 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
445 |
+
<type>Singleton</type>
|
446 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
447 |
+
<method>buckaroo3extended_refund_request_addservices</method>
|
448 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
449 |
+
</observers>
|
450 |
+
</buckaroo3extended_refund_request_addservices>
|
451 |
+
<buckaroo3extended_refund_request_addcustomvars>
|
452 |
+
<observers>
|
453 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
454 |
+
<type>Singleton</type>
|
455 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
456 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
457 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
458 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
459 |
+
<type>Singleton</type>
|
460 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
461 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
462 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
463 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
464 |
+
<type>Singleton</type>
|
465 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
466 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
467 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
468 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
469 |
+
<type>Singleton</type>
|
470 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
471 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
472 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
473 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
474 |
+
<type>Singleton</type>
|
475 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
476 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
477 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
478 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
479 |
+
<type>Singleton</type>
|
480 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
481 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
482 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
483 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
484 |
+
<type>Singleton</type>
|
485 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
486 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
487 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
488 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
489 |
+
<type>Singleton</type>
|
490 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
491 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
492 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
493 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
494 |
+
<type>Singleton</type>
|
495 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
496 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
497 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
498 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
499 |
+
<type>Singleton</type>
|
500 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
501 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
502 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
503 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
504 |
+
<type>Singleton</type>
|
505 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
506 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
507 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
508 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
509 |
+
<type>Singleton</type>
|
510 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
511 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
512 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
513 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
514 |
+
<type>Singleton</type>
|
515 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
516 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
517 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
518 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
519 |
+
<type>Singleton</type>
|
520 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
521 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
522 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
523 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
524 |
+
<type>Singleton</type>
|
525 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
526 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
527 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
528 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
529 |
+
<type>Singleton</type>
|
530 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
531 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
532 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
533 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
534 |
+
<type>Singleton</type>
|
535 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
536 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
537 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
538 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
539 |
+
<type>Singleton</type>
|
540 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
541 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
542 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
543 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
544 |
+
<type>Singleton</type>
|
545 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
546 |
+
<method>buckaroo3extended_refund_request_addcustomvars</method>
|
547 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
548 |
+
</observers>
|
549 |
+
</buckaroo3extended_refund_request_addcustomvars>
|
550 |
+
<buckaroo3extended_refund_response_custom_processing>
|
551 |
+
<observers>
|
552 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
553 |
+
<type>Singleton</type>
|
554 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
555 |
+
<method>buckaroo3extended_refund_response_custom_processing</method>
|
556 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
557 |
+
</observers>
|
558 |
+
</buckaroo3extended_refund_response_custom_processing>
|
559 |
+
<controller_action_postdispatch_adminhtml_system_config_save>
|
560 |
+
<observers>
|
561 |
+
<buckaroo3extended_config_observer>
|
562 |
+
<type>Singleton</type>
|
563 |
+
<class>buckaroo3extended/observer</class>
|
564 |
+
<method>controller_action_postdispatch_adminhtml_system_config_save</method>
|
565 |
+
</buckaroo3extended_config_observer>
|
566 |
+
</observers>
|
567 |
+
</controller_action_postdispatch_adminhtml_system_config_save>
|
568 |
+
<buckaroo3extended_request_addservices>
|
569 |
+
<observers>
|
570 |
+
<buckaroo3extended_paymentmethod_observer_transfer>
|
571 |
+
<type>Singleton</type>
|
572 |
+
<class>buckaroo3extended/paymentMethods_transfer_observer</class>
|
573 |
+
<method>buckaroo3extended_request_addservices</method>
|
574 |
+
</buckaroo3extended_paymentmethod_observer_transfer>
|
575 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
576 |
+
<type>Singleton</type>
|
577 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
578 |
+
<method>buckaroo3extended_request_addservices</method>
|
579 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
580 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
581 |
+
<type>Singleton</type>
|
582 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
583 |
+
<method>buckaroo3extended_request_addservices</method>
|
584 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
585 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
586 |
+
<type>Singleton</type>
|
587 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
588 |
+
<method>buckaroo3extended_request_addservices</method>
|
589 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
590 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
591 |
+
<type>Singleton</type>
|
592 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
593 |
+
<method>buckaroo3extended_request_addservices</method>
|
594 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
595 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
596 |
+
<type>Singleton</type>
|
597 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
598 |
+
<method>buckaroo3extended_request_addservices</method>
|
599 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
600 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
601 |
+
<type>Singleton</type>
|
602 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
603 |
+
<method>buckaroo3extended_request_addservices</method>
|
604 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
605 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
606 |
+
<type>Singleton</type>
|
607 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
608 |
+
<method>buckaroo3extended_request_addservices</method>
|
609 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
610 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
611 |
+
<type>Singleton</type>
|
612 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
613 |
+
<method>buckaroo3extended_request_addservices</method>
|
614 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
615 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
616 |
+
<type>Singleton</type>
|
617 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
618 |
+
<method>buckaroo3extended_request_addservices</method>
|
619 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
620 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
621 |
+
<type>Singleton</type>
|
622 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
623 |
+
<method>buckaroo3extended_request_addservices</method>
|
624 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
625 |
+
<buckaroo3extended_paymentmethod_observer_paysafecard>
|
626 |
+
<type>Singleton</type>
|
627 |
+
<class>buckaroo3extended/paymentMethods_paysafecard_observer</class>
|
628 |
+
<method>buckaroo3extended_request_addservices</method>
|
629 |
+
</buckaroo3extended_paymentmethod_observer_paysafecard>
|
630 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
631 |
+
<type>Singleton</type>
|
632 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
633 |
+
<method>buckaroo3extended_request_addservices</method>
|
634 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
635 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
636 |
+
<type>Singleton</type>
|
637 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
638 |
+
<method>buckaroo3extended_request_addservices</method>
|
639 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
640 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
641 |
+
<type>Singleton</type>
|
642 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
643 |
+
<method>buckaroo3extended_request_addservices</method>
|
644 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
645 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
646 |
+
<type>Singleton</type>
|
647 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
648 |
+
<method>buckaroo3extended_request_addservices</method>
|
649 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
650 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
651 |
+
<type>Singleton</type>
|
652 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
653 |
+
<method>buckaroo3extended_request_addservices</method>
|
654 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
655 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
656 |
+
<type>Singleton</type>
|
657 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
658 |
+
<method>buckaroo3extended_request_addservices</method>
|
659 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
660 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
661 |
+
<type>Singleton</type>
|
662 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
663 |
+
<method>buckaroo3extended_request_addservices</method>
|
664 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
665 |
+
<buckaroo3extended_paymentmethod_observer_giftcards>
|
666 |
+
<type>Singleton</type>
|
667 |
+
<class>buckaroo3extended/paymentMethods_giftcards_observer</class>
|
668 |
+
<method>buckaroo3extended_request_addservices</method>
|
669 |
+
</buckaroo3extended_paymentmethod_observer_giftcards>
|
670 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
671 |
+
<type>Singleton</type>
|
672 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
673 |
+
<method>buckaroo3extended_request_addservices</method>
|
674 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
675 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
676 |
+
<type>Singleton</type>
|
677 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
678 |
+
<method>buckaroo3extended_request_addservices</method>
|
679 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
680 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
681 |
+
<type>Singleton</type>
|
682 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
683 |
+
<method>buckaroo3extended_request_addservices</method>
|
684 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
685 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
686 |
+
<type>Singleton</type>
|
687 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
688 |
+
<method>buckaroo3extended_request_addservices</method>
|
689 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
690 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
691 |
+
<type>Singleton</type>
|
692 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
693 |
+
<method>buckaroo3extended_request_addservices</method>
|
694 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
695 |
+
</observers>
|
696 |
+
</buckaroo3extended_request_addservices>
|
697 |
+
<buckaroo3extended_request_addcustomvars>
|
698 |
+
<observers>
|
699 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
700 |
+
<type>Singleton</type>
|
701 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
702 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
703 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
704 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
705 |
+
<type>Singleton</type>
|
706 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
707 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
708 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
709 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
710 |
+
<type>Singleton</type>
|
711 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
712 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
713 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
714 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
715 |
+
<type>Singleton</type>
|
716 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
717 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
718 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
719 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
720 |
+
<type>Singleton</type>
|
721 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
722 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
723 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
724 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
725 |
+
<type>Singleton</type>
|
726 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
727 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
728 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
729 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
730 |
+
<type>Singleton</type>
|
731 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
732 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
733 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
734 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
735 |
+
<type>Singleton</type>
|
736 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
737 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
738 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
739 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
740 |
+
<type>Singleton</type>
|
741 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
742 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
743 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
744 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
745 |
+
<type>Singleton</type>
|
746 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
747 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
748 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
749 |
+
<buckaroo3extended_paymentmethod_observer_paysafecard>
|
750 |
+
<type>Singleton</type>
|
751 |
+
<class>buckaroo3extended/paymentMethods_paysafecard_observer</class>
|
752 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
753 |
+
</buckaroo3extended_paymentmethod_observer_paysafecard>
|
754 |
+
<buckaroo3extended_paymentmethod_observer_transfer>
|
755 |
+
<type>Singleton</type>
|
756 |
+
<class>buckaroo3extended/paymentMethods_transfer_observer</class>
|
757 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
758 |
+
</buckaroo3extended_paymentmethod_observer_transfer>
|
759 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
760 |
+
<type>Singleton</type>
|
761 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
762 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
763 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
764 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
765 |
+
<type>Singleton</type>
|
766 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
767 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
768 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
769 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
770 |
+
<type>Singleton</type>
|
771 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
772 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
773 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
774 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
775 |
+
<type>Singleton</type>
|
776 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
777 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
778 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
779 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
780 |
+
<type>Singleton</type>
|
781 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
782 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
783 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
784 |
+
<buckaroo3extended_paymentmethod_observer_giftcards>
|
785 |
+
<type>Singleton</type>
|
786 |
+
<class>buckaroo3extended/paymentMethods_giftcards_observer</class>
|
787 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
788 |
+
</buckaroo3extended_paymentmethod_observer_giftcards>
|
789 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
790 |
+
<type>Singleton</type>
|
791 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
792 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
793 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
794 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
795 |
+
<type>Singleton</type>
|
796 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
797 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
798 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
799 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
800 |
+
<type>Singleton</type>
|
801 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
802 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
803 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
804 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
805 |
+
<type>Singleton</type>
|
806 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
807 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
808 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
809 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
810 |
+
<type>Singleton</type>
|
811 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
812 |
+
<method>buckaroo3extended_request_addcustomvars</method>
|
813 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
814 |
+
</observers>
|
815 |
+
</buckaroo3extended_request_addcustomvars>
|
816 |
+
<buckaroo3extended_request_setmethod>
|
817 |
+
<observers>
|
818 |
+
<buckaroo3extended_paymentmethod_observer_ideal>
|
819 |
+
<type>Singleton</type>
|
820 |
+
<class>buckaroo3extended/paymentMethods_ideal_observer</class>
|
821 |
+
<method>buckaroo3extended_request_setmethod</method>
|
822 |
+
</buckaroo3extended_paymentmethod_observer_ideal>
|
823 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
824 |
+
<type>Singleton</type>
|
825 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
826 |
+
<method>buckaroo3extended_request_setmethod</method>
|
827 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
828 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
829 |
+
<type>Singleton</type>
|
830 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
831 |
+
<method>buckaroo3extended_request_setmethod</method>
|
832 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
833 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
834 |
+
<type>Singleton</type>
|
835 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
836 |
+
<method>buckaroo3extended_request_setmethod</method>
|
837 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
838 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
839 |
+
<type>Singleton</type>
|
840 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
841 |
+
<method>buckaroo3extended_request_setmethod</method>
|
842 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
843 |
+
<buckaroo3extended_paymentmethod_observer_amex>
|
844 |
+
<type>Singleton</type>
|
845 |
+
<class>buckaroo3extended/paymentMethods_amex_observer</class>
|
846 |
+
<method>buckaroo3extended_request_setmethod</method>
|
847 |
+
</buckaroo3extended_paymentmethod_observer_amex>
|
848 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
849 |
+
<type>Singleton</type>
|
850 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
851 |
+
<method>buckaroo3extended_request_setmethod</method>
|
852 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
853 |
+
<buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
854 |
+
<type>Singleton</type>
|
855 |
+
<class>buckaroo3extended/paymentMethods_sofortueberweisung_observer</class>
|
856 |
+
<method>buckaroo3extended_request_setmethod</method>
|
857 |
+
</buckaroo3extended_paymentmethod_observer_sofortueberweisung>
|
858 |
+
<buckaroo3extended_paymentmethod_observer_eps>
|
859 |
+
<type>Singleton</type>
|
860 |
+
<class>buckaroo3extended/paymentMethods_eps_observer</class>
|
861 |
+
<method>buckaroo3extended_request_setmethod</method>
|
862 |
+
</buckaroo3extended_paymentmethod_observer_eps>
|
863 |
+
<buckaroo3extended_paymentmethod_observer_giropay>
|
864 |
+
<type>Singleton</type>
|
865 |
+
<class>buckaroo3extended/paymentMethods_giropay_observer</class>
|
866 |
+
<method>buckaroo3extended_request_setmethod</method>
|
867 |
+
</buckaroo3extended_paymentmethod_observer_giropay>
|
868 |
+
<buckaroo3extended_paymentmethod_observer_paysafecard>
|
869 |
+
<type>Singleton</type>
|
870 |
+
<class>buckaroo3extended/paymentMethods_paysafecard_observer</class>
|
871 |
+
<method>buckaroo3extended_request_setmethod</method>
|
872 |
+
</buckaroo3extended_paymentmethod_observer_paysafecard>
|
873 |
+
<buckaroo3extended_paymentmethod_observer_transfer>
|
874 |
+
<type>Singleton</type>
|
875 |
+
<class>buckaroo3extended/paymentMethods_transfer_observer</class>
|
876 |
+
<method>buckaroo3extended_request_setmethod</method>
|
877 |
+
</buckaroo3extended_paymentmethod_observer_transfer>
|
878 |
+
<buckaroo3extended_paymentmethod_observer_directdebit>
|
879 |
+
<type>Singleton</type>
|
880 |
+
<class>buckaroo3extended/paymentMethods_directdebit_observer</class>
|
881 |
+
<method>buckaroo3extended_request_setmethod</method>
|
882 |
+
</buckaroo3extended_paymentmethod_observer_directdebit>
|
883 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
884 |
+
<type>Singleton</type>
|
885 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
886 |
+
<method>buckaroo3extended_request_setmethod</method>
|
887 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
888 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
889 |
+
<type>Singleton</type>
|
890 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
891 |
+
<method>buckaroo3extended_request_setmethod</method>
|
892 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
893 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
894 |
+
<type>Singleton</type>
|
895 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
896 |
+
<method>buckaroo3extended_request_setmethod</method>
|
897 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
898 |
+
<buckaroo3extended_paymentmethod_observer_onlinegiro>
|
899 |
+
<type>Singleton</type>
|
900 |
+
<class>buckaroo3extended/paymentMethods_onlinegiro_observer</class>
|
901 |
+
<method>buckaroo3extended_request_setmethod</method>
|
902 |
+
</buckaroo3extended_paymentmethod_observer_onlinegiro>
|
903 |
+
<buckaroo3extended_paymentmethod_observer_giftcards>
|
904 |
+
<type>Singleton</type>
|
905 |
+
<class>buckaroo3extended/paymentMethods_giftcards_observer</class>
|
906 |
+
<method>buckaroo3extended_request_setmethod</method>
|
907 |
+
</buckaroo3extended_paymentmethod_observer_giftcards>
|
908 |
+
<buckaroo3extended_paymentmethod_observer_empayment>
|
909 |
+
<type>Singleton</type>
|
910 |
+
<class>buckaroo3extended/paymentMethods_empayment_observer</class>
|
911 |
+
<method>buckaroo3extended_request_setmethod</method>
|
912 |
+
</buckaroo3extended_paymentmethod_observer_empayment>
|
913 |
+
<buckaroo3extended_paymentmethod_observer_maestro>
|
914 |
+
<type>Singleton</type>
|
915 |
+
<class>buckaroo3extended/paymentMethods_maestro_observer</class>
|
916 |
+
<method>buckaroo3extended_request_setmethod</method>
|
917 |
+
</buckaroo3extended_paymentmethod_observer_maestro>
|
918 |
+
<buckaroo3extended_paymentmethod_observer_visaelectron>
|
919 |
+
<type>Singleton</type>
|
920 |
+
<class>buckaroo3extended/paymentMethods_visaelectron_observer</class>
|
921 |
+
<method>buckaroo3extended_request_setmethod</method>
|
922 |
+
</buckaroo3extended_paymentmethod_observer_visaelectron>
|
923 |
+
<buckaroo3extended_paymentmethod_observer_vpay>
|
924 |
+
<type>Singleton</type>
|
925 |
+
<class>buckaroo3extended/paymentMethods_vpay_observer</class>
|
926 |
+
<method>buckaroo3extended_request_setmethod</method>
|
927 |
+
</buckaroo3extended_paymentmethod_observer_vpay>
|
928 |
+
<buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
929 |
+
<type>Singleton</type>
|
930 |
+
<class>buckaroo3extended/paymentMethods_bancontactmrcash_observer</class>
|
931 |
+
<method>buckaroo3extended_request_setmethod</method>
|
932 |
+
</buckaroo3extended_paymentmethod_observer_bancontactmrcash>
|
933 |
+
</observers>
|
934 |
+
</buckaroo3extended_request_setmethod>
|
935 |
+
<buckaroo3extended_push_custom_processing>
|
936 |
+
<observers>
|
937 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
938 |
+
<type>Singleton</type>
|
939 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
940 |
+
<method>buckaroo3extended_push_custom_processing</method>
|
941 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
942 |
+
</observers>
|
943 |
+
<observers>
|
944 |
+
<buckaroo3extended_paymentmethod_observer_afterpay>
|
945 |
+
<type>Singleton</type>
|
946 |
+
<class>buckaroo3extended/paymentMethods_afterpay_observer</class>
|
947 |
+
<method>buckaroo3extended_push_custom_processing</method>
|
948 |
+
</buckaroo3extended_paymentmethod_observer_afterpay>
|
949 |
+
</observers>
|
950 |
+
<observers>
|
951 |
+
<buckaroo3extended_paymentmethod_observer_payperemail>
|
952 |
+
<type>Singleton</type>
|
953 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
954 |
+
<method>buckaroo3extended_push_custom_processing</method>
|
955 |
+
</buckaroo3extended_paymentmethod_observer_payperemail>
|
956 |
+
</observers>
|
957 |
+
<observers>
|
958 |
+
<buckaroo3extended_paymentmethod_observer_giftcard>
|
959 |
+
<type>Singleton</type>
|
960 |
+
<class>buckaroo3extended/paymentMethods_giftcards_observer</class>
|
961 |
+
<method>buckaroo3extended_push_custom_processing</method>
|
962 |
+
</buckaroo3extended_paymentmethod_observer_giftcard>
|
963 |
+
</observers>
|
964 |
+
</buckaroo3extended_push_custom_processing>
|
965 |
+
<buckaroo3extended_return_custom_processing>
|
966 |
+
<observers>
|
967 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
968 |
+
<type>Singleton</type>
|
969 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
970 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
971 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
972 |
+
</observers>
|
973 |
+
<observers>
|
974 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
975 |
+
<type>Singleton</type>
|
976 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
977 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
978 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
979 |
+
</observers>
|
980 |
+
<observers>
|
981 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
982 |
+
<type>Singleton</type>
|
983 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
984 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
985 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
986 |
+
</observers>
|
987 |
+
<observers>
|
988 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
989 |
+
<type>Singleton</type>
|
990 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
991 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
992 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
993 |
+
</observers>
|
994 |
+
<observers>
|
995 |
+
<buckaroo3extended_paymentmethod_observer_giftcard_return>
|
996 |
+
<type>Singleton</type>
|
997 |
+
<class>buckaroo3extended/paymentMethods_giftcards_observer</class>
|
998 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
999 |
+
</buckaroo3extended_paymentmethod_observer_giftcard_return>
|
1000 |
+
</observers>
|
1001 |
+
<observers>
|
1002 |
+
<buckaroo3extended_paymentmethod_observer_payperemail_return>
|
1003 |
+
<type>Singleton</type>
|
1004 |
+
<class>buckaroo3extended/paymentMethods_payperemail_observer</class>
|
1005 |
+
<method>buckaroo3extended_return_custom_processing</method>
|
1006 |
+
</buckaroo3extended_paymentmethod_observer_payperemail_return>
|
1007 |
+
</observers>
|
1008 |
+
</buckaroo3extended_return_custom_processing>
|
1009 |
+
<buckaroo3extended_push_custom_processing_after>
|
1010 |
+
<observers>
|
1011 |
+
<buckaroo3extended_paymentmethod_observer_mastercard>
|
1012 |
+
<type>Singleton</type>
|
1013 |
+
<class>buckaroo3extended/paymentMethods_mastercard_observer</class>
|
1014 |
+
<method>buckaroo3extended_push_custom_processing_after</method>
|
1015 |
+
</buckaroo3extended_paymentmethod_observer_mastercard>
|
1016 |
+
</observers>
|
1017 |
+
<observers>
|
1018 |
+
<buckaroo3extended_paymentmethod_observer_cartebancaire>
|
1019 |
+
<type>Singleton</type>
|
1020 |
+
<class>buckaroo3extended/paymentMethods_cartebancaire_observer</class>
|
1021 |
+
<method>buckaroo3extended_push_custom_processing_after</method>
|
1022 |
+
</buckaroo3extended_paymentmethod_observer_cartebancaire>
|
1023 |
+
</observers>
|
1024 |
+
<observers>
|
1025 |
+
<buckaroo3extended_paymentmethod_observer_cartebleue>
|
1026 |
+
<type>Singleton</type>
|
1027 |
+
<class>buckaroo3extended/paymentMethods_cartebleue_observer</class>
|
1028 |
+
<method>buckaroo3extended_push_custom_processing_after</method>
|
1029 |
+
</buckaroo3extended_paymentmethod_observer_cartebleue>
|
1030 |
+
</observers>
|
1031 |
+
<observers>
|
1032 |
+
<buckaroo3extended_paymentmethod_observer_visa>
|
1033 |
+
<type>Singleton</type>
|
1034 |
+
<class>buckaroo3extended/paymentMethods_visa_observer</class>
|
1035 |
+
<method>buckaroo3extended_push_custom_processing_after</method>
|
1036 |
+
</buckaroo3extended_paymentmethod_observer_visa>
|
1037 |
+
</observers>
|
1038 |
+
<observers>
|
1039 |
+
<buckaroo3extended_paymentmethod_observer_paypal>
|
1040 |
+
<type>Singleton</type>
|
1041 |
+
<class>buckaroo3extended/paymentMethods_paypal_observer</class>
|
1042 |
+
<method>buckaroo3extended_push_custom_processing_after</method>
|
1043 |
+
</buckaroo3extended_paymentmethod_observer_paypal>
|
1044 |
+
</observers>
|
1045 |
+
</buckaroo3extended_push_custom_processing_after>
|
1046 |
+
<buckaroo3extended_response_custom_processing>
|
1047 |
+
<observers>
|
1048 |
+
<buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
1049 |
+
<type>Singleton</type>
|
1050 |
+
<class>buckaroo3extended/paymentMethods_paymentguarantee_observer</class>
|
1051 |
+
<method>buckaroo3extended_response_custom_processing</method>
|
1052 |
+
</buckaroo3extended_paymentmethod_observer_paymentguarantee>
|
1053 |
+
</observers>
|
1054 |
+
|
1055 |
+
</buckaroo3extended_response_custom_processing>
|
1056 |
+
</events>
|
1057 |
+
</global>
|
1058 |
+
<default>
|
1059 |
+
<payment>
|
1060 |
+
<buckaroo3extended_ideal>
|
1061 |
+
<active>1</active>
|
1062 |
+
<model>buckaroo3extended/paymentMethods_ideal_paymentMethod</model>
|
1063 |
+
<title>iDEAL</title>
|
1064 |
+
<sort_order>10</sort_order>
|
1065 |
+
<sort_order></sort_order>
|
1066 |
+
<group>buckaroo3extended</group>
|
1067 |
+
</buckaroo3extended_ideal>
|
1068 |
+
<buckaroo3extended_paymentguarantee>
|
1069 |
+
<active>1</active>
|
1070 |
+
<model>buckaroo3extended/paymentMethods_paymentguarantee_paymentMethod</model>
|
1071 |
+
<title>Achteraf Betalen</title>
|
1072 |
+
<sort_order>20</sort_order>
|
1073 |
+
<group>buckaroo3extended</group>
|
1074 |
+
</buckaroo3extended_paymentguarantee>
|
1075 |
+
<buckaroo3extended_afterpay>
|
1076 |
+
<active>1</active>
|
1077 |
+
<model>buckaroo3extended/paymentMethods_afterpay_paymentMethod</model>
|
1078 |
+
<title>Afterpay</title>
|
1079 |
+
<sort_order>25</sort_order>
|
1080 |
+
<group>buckaroo3extended</group>
|
1081 |
+
</buckaroo3extended_afterpay>
|
1082 |
+
<buckaroo3extended_mastercard>
|
1083 |
+
<active>1</active>
|
1084 |
+
<model>buckaroo3extended/paymentMethods_mastercard_paymentMethod</model>
|
1085 |
+
<title>Mastercard</title>
|
1086 |
+
<sort_order>30</sort_order>
|
1087 |
+
<group>buckaroo3extended</group>
|
1088 |
+
</buckaroo3extended_mastercard>
|
1089 |
+
<buckaroo3extended_visa>
|
1090 |
+
<active>1</active>
|
1091 |
+
<model>buckaroo3extended/paymentMethods_visa_paymentMethod</model>
|
1092 |
+
<title>Visa</title>
|
1093 |
+
<sort_order>35</sort_order>
|
1094 |
+
<group>buckaroo3extended</group>
|
1095 |
+
</buckaroo3extended_visa>
|
1096 |
+
<buckaroo3extended_cartebancaire>
|
1097 |
+
<active>1</active>
|
1098 |
+
<model>buckaroo3extended/paymentMethods_cartebancaire_paymentMethod</model>
|
1099 |
+
<title>Carte Bancaire</title>
|
1100 |
+
<sort_order>40</sort_order>
|
1101 |
+
<group>buckaroo3extended</group>
|
1102 |
+
</buckaroo3extended_cartebancaire>
|
1103 |
+
<buckaroo3extended_cartebleue>
|
1104 |
+
<active>1</active>
|
1105 |
+
<model>buckaroo3extended/paymentMethods_cartebleue_paymentMethod</model>
|
1106 |
+
<title>Carte Bleue</title>
|
1107 |
+
<sort_order>45</sort_order>
|
1108 |
+
<group>buckaroo3extended</group>
|
1109 |
+
</buckaroo3extended_cartebleue>
|
1110 |
+
<buckaroo3extended_amex>
|
1111 |
+
<active>1</active>
|
1112 |
+
<model>buckaroo3extended/paymentMethods_amex_paymentMethod</model>
|
1113 |
+
<title>American Express</title>
|
1114 |
+
<sort_order>50</sort_order>
|
1115 |
+
<group>buckaroo3extended</group>
|
1116 |
+
</buckaroo3extended_amex>
|
1117 |
+
<buckaroo3extended_visaelectron>
|
1118 |
+
<active>1</active>
|
1119 |
+
<model>buckaroo3extended/paymentMethods_visaelectron_paymentMethod</model>
|
1120 |
+
<title>Visa Electron</title>
|
1121 |
+
<sort_order>60</sort_order>
|
1122 |
+
<group>buckaroo3extended</group>
|
1123 |
+
</buckaroo3extended_visaelectron>
|
1124 |
+
<buckaroo3extended_maestro>
|
1125 |
+
<active>1</active>
|
1126 |
+
<model>buckaroo3extended/paymentMethods_maestro_paymentMethod</model>
|
1127 |
+
<title>eMaestro</title>
|
1128 |
+
<sort_order>70</sort_order>
|
1129 |
+
<group>buckaroo3extended</group>
|
1130 |
+
</buckaroo3extended_maestro>
|
1131 |
+
<buckaroo3extended_vpay>
|
1132 |
+
<active>1</active>
|
1133 |
+
<model>buckaroo3extended/paymentMethods_vpay_paymentMethod</model>
|
1134 |
+
<title>V PAY</title>
|
1135 |
+
<sort_order>80</sort_order>
|
1136 |
+
<group>buckaroo3extended</group>
|
1137 |
+
</buckaroo3extended_vpay>
|
1138 |
+
<buckaroo3extended_paypal>
|
1139 |
+
<active>1</active>
|
1140 |
+
<model>buckaroo3extended/paymentMethods_paypal_paymentMethod</model>
|
1141 |
+
<title>PayPal</title>
|
1142 |
+
<sort_order>90</sort_order>
|
1143 |
+
<group>buckaroo3extended</group>
|
1144 |
+
</buckaroo3extended_paypal>
|
1145 |
+
<buckaroo3extended_transfer>
|
1146 |
+
<active>1</active>
|
1147 |
+
<model>buckaroo3extended/paymentMethods_transfer_paymentMethod</model>
|
1148 |
+
<title>Overboeking</title>
|
1149 |
+
<sort_order>100</sort_order>
|
1150 |
+
<group>buckaroo3extended</group>
|
1151 |
+
</buckaroo3extended_transfer>
|
1152 |
+
<buckaroo3extended_directdebit>
|
1153 |
+
<active>1</active>
|
1154 |
+
<model>buckaroo3extended/paymentMethods_directdebit_paymentMethod</model>
|
1155 |
+
<title>SEPA Machtiging</title>
|
1156 |
+
<sort_order>110</sort_order>
|
1157 |
+
<group>buckaroo3extended</group>
|
1158 |
+
</buckaroo3extended_directdebit>
|
1159 |
+
<buckaroo3extended_empayment>
|
1160 |
+
<active>1</active>
|
1161 |
+
<model>buckaroo3extended/paymentMethods_empayment_paymentMethod</model>
|
1162 |
+
<title>éM! Payment</title>
|
1163 |
+
<sort_order>120</sort_order>
|
1164 |
+
<group>buckaroo3extended</group>
|
1165 |
+
</buckaroo3extended_empayment>
|
1166 |
+
<buckaroo3extended_paysafecard>
|
1167 |
+
<active>1</active>
|
1168 |
+
<model>buckaroo3extended/paymentMethods_paysafecard_paymentMethod</model>
|
1169 |
+
<title>Paysafecard</title>
|
1170 |
+
<sort_order>130</sort_order>
|
1171 |
+
<group>buckaroo3extended</group>
|
1172 |
+
</buckaroo3extended_paysafecard>
|
1173 |
+
<buckaroo3extended_sofortueberweisung>
|
1174 |
+
<active>1</active>
|
1175 |
+
<model>buckaroo3extended/paymentMethods_sofortueberweisung_paymentMethod</model>
|
1176 |
+
<title>Sofortbanking</title>
|
1177 |
+
<sort_order>150</sort_order>
|
1178 |
+
<group>buckaroo3extended</group>
|
1179 |
+
</buckaroo3extended_sofortueberweisung>
|
1180 |
+
<buckaroo3extended_bancontactmrcash>
|
1181 |
+
<active>1</active>
|
1182 |
+
<model>buckaroo3extended/paymentMethods_bancontactmrcash_paymentMethod</model>
|
1183 |
+
<title>Bancontact/ Mister Cash</title>
|
1184 |
+
<sort_order>140</sort_order>
|
1185 |
+
<group>buckaroo3extended</group>
|
1186 |
+
</buckaroo3extended_bancontactmrcash>
|
1187 |
+
<buckaroo3extended_giropay>
|
1188 |
+
<active>1</active>
|
1189 |
+
<model>buckaroo3extended/paymentMethods_giropay_paymentMethod</model>
|
1190 |
+
<title>Giropay</title>
|
1191 |
+
<sort_order>160</sort_order>
|
1192 |
+
<group>buckaroo3extended</group>
|
1193 |
+
</buckaroo3extended_giropay>
|
1194 |
+
<buckaroo3extended_giftcards>
|
1195 |
+
<active>1</active>
|
1196 |
+
<model>buckaroo3extended/paymentMethods_giftcards_paymentMethod</model>
|
1197 |
+
<title>Cadeaukaarten</title>
|
1198 |
+
<sort_order>170</sort_order>
|
1199 |
+
<group>buckaroo3extended</group>
|
1200 |
+
</buckaroo3extended_giftcards>
|
1201 |
+
<buckaroo3extended_payperemail>
|
1202 |
+
<active>1</active>
|
1203 |
+
<model>buckaroo3extended/paymentMethods_payperemail_paymentMethod</model>
|
1204 |
+
<title>PayperEmail</title>
|
1205 |
+
<sort_order>180</sort_order>
|
1206 |
+
<group>buckaroo3extended</group>
|
1207 |
+
</buckaroo3extended_payperemail>
|
1208 |
+
<buckaroo3extended_onlinegiro>
|
1209 |
+
<active>1</active>
|
1210 |
+
<model>buckaroo3extended/paymentMethods_onlinegiro_paymentMethod</model>
|
1211 |
+
<title>Online Giro</title>
|
1212 |
+
<sort_order>190</sort_order>
|
1213 |
+
<group>buckaroo3extended</group>
|
1214 |
+
</buckaroo3extended_onlinegiro>
|
1215 |
+
<buckaroo3extended_eps>
|
1216 |
+
<active>1</active>
|
1217 |
+
<model>buckaroo3extended/paymentMethods_eps_paymentMethod</model>
|
1218 |
+
<title>EPS</title>
|
1219 |
+
<sort_order>195</sort_order>
|
1220 |
+
<group>buckaroo3extended</group>
|
1221 |
+
</buckaroo3extended_eps>
|
1222 |
+
<buckaroo2012ideal>
|
1223 |
+
<active>0</active>
|
1224 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1225 |
+
</buckaroo2012ideal>
|
1226 |
+
<buckaroo>
|
1227 |
+
<active>0</active>
|
1228 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1229 |
+
</buckaroo>
|
1230 |
+
<buckarooideal>
|
1231 |
+
<active>0</active>
|
1232 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1233 |
+
</buckarooideal>
|
1234 |
+
<buckaroo2012betaalgarant>
|
1235 |
+
<active>0</active>
|
1236 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1237 |
+
</buckaroo2012betaalgarant>
|
1238 |
+
<buckarootransfergarant>
|
1239 |
+
<active>0</active>
|
1240 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1241 |
+
</buckarootransfergarant>
|
1242 |
+
<buckaroo2012cashticketpaysafecard>
|
1243 |
+
<active>o</active>
|
1244 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1245 |
+
</buckaroo2012cashticketpaysafecard>
|
1246 |
+
<buckaroocashticket>
|
1247 |
+
<active>0</active>
|
1248 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1249 |
+
</buckaroocashticket>
|
1250 |
+
<buckaroopaysafecard>
|
1251 |
+
<active>0</active>
|
1252 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1253 |
+
</buckaroopaysafecard>
|
1254 |
+
<buckaroo2012creditcard>
|
1255 |
+
<active>0</active>
|
1256 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1257 |
+
</buckaroo2012creditcard>
|
1258 |
+
<buckaroocc>
|
1259 |
+
<active>0</active>
|
1260 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1261 |
+
</buckaroocc>
|
1262 |
+
<buckaroo2012giftcard>
|
1263 |
+
<active>0</active>
|
1264 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1265 |
+
</buckaroo2012giftcard>
|
1266 |
+
<buckaroogiftcard>
|
1267 |
+
<active>0</active>
|
1268 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1269 |
+
</buckaroogiftcard>
|
1270 |
+
<buckaroo2012giropay>
|
1271 |
+
<active>0</active>
|
1272 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1273 |
+
</buckaroo2012giropay>
|
1274 |
+
<buckaroogiropay>
|
1275 |
+
<active>0</active>
|
1276 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1277 |
+
</buckaroogiropay>
|
1278 |
+
<buckaroo2012machtiging>
|
1279 |
+
<active>0</active>
|
1280 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1281 |
+
</buckaroo2012machtiging>
|
1282 |
+
<buckaroocollect>
|
1283 |
+
<active>0</active>
|
1284 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1285 |
+
</buckaroocollect>
|
1286 |
+
<buckaroo2012onlinegiro>
|
1287 |
+
<active>0</active>
|
1288 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1289 |
+
</buckaroo2012onlinegiro>
|
1290 |
+
<buckaroo2012callcenter>
|
1291 |
+
<active>0</active>
|
1292 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1293 |
+
</buckaroo2012callcenter>
|
1294 |
+
<buckaroo>
|
1295 |
+
<active>0</active>
|
1296 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1297 |
+
</buckaroo>
|
1298 |
+
<buckarooonlinegiro>
|
1299 |
+
<active>0</active>
|
1300 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1301 |
+
</buckarooonlinegiro>
|
1302 |
+
<buckaroo2012overschrijving>
|
1303 |
+
<active>0</active>
|
1304 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1305 |
+
</buckaroo2012overschrijving>
|
1306 |
+
<buckarootransfer>
|
1307 |
+
<active>0</active>
|
1308 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1309 |
+
</buckarootransfer>
|
1310 |
+
<buckaroo2012paypal>
|
1311 |
+
<active>0</active>
|
1312 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1313 |
+
</buckaroo2012paypal>
|
1314 |
+
<buckaroopaypal>
|
1315 |
+
<active>0</active>
|
1316 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1317 |
+
</buckaroopaypal>
|
1318 |
+
<buckaroo2012payperemail>
|
1319 |
+
<active>0</active>
|
1320 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1321 |
+
</buckaroo2012payperemail>
|
1322 |
+
<buckaroopayperemail>
|
1323 |
+
<active>0</active>
|
1324 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1325 |
+
</buckaroopayperemail>
|
1326 |
+
<buckaroo3>
|
1327 |
+
<active>0</active>
|
1328 |
+
<model>buckaroo3extended/oldPaymentMethods_oldPaymentMethod</model>
|
1329 |
+
</buckaroo3>
|
1330 |
+
</payment>
|
1331 |
+
<buckaroo>
|
1332 |
+
<buckaroo3extended>
|
1333 |
+
<active>1</active>
|
1334 |
+
<limit_by_ip>0</limit_by_ip>
|
1335 |
+
<key></key>
|
1336 |
+
<thumbprint></thumbprint>
|
1337 |
+
<mode>1</mode>
|
1338 |
+
<payment_description>Magento Buckaroo</payment_description>
|
1339 |
+
</buckaroo3extended>
|
1340 |
+
|
1341 |
+
<buckaroo3extended_advanced>
|
1342 |
+
<order_status>pending</order_status>
|
1343 |
+
<order_status_success>processing</order_status_success>
|
1344 |
+
<order_status_failed>canceled</order_status_failed>
|
1345 |
+
<order_status_pendingpayment>buckaroo_pending_payment</order_status_pendingpayment>
|
1346 |
+
<success_redirect>checkout/onepage/success</success_redirect>
|
1347 |
+
<failure_redirect>checkout/onepage</failure_redirect>
|
1348 |
+
<auto_invoice>1</auto_invoice>
|
1349 |
+
<invoice_mail>1</invoice_mail>
|
1350 |
+
<order_state_success>processing</order_state_success>
|
1351 |
+
<order_state_failed>canceled</order_state_failed>
|
1352 |
+
<order_state_pendingpayment>new</order_state_pendingpayment>
|
1353 |
+
<debug_email></debug_email>
|
1354 |
+
<debug_order_updates>0</debug_order_updates>
|
1355 |
+
<cancel_on_failed>1</cancel_on_failed>
|
1356 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1357 |
+
<fee_percentage_mode>subtotal</fee_percentage_mode>
|
1358 |
+
</buckaroo3extended_advanced>
|
1359 |
+
|
1360 |
+
<buckaroo3extended_ideal>
|
1361 |
+
<active>0</active>
|
1362 |
+
<mode>0</mode>
|
1363 |
+
<title>iDEAL</title>
|
1364 |
+
<allowspecific>0</allowspecific>
|
1365 |
+
<specificcountry></specificcountry>
|
1366 |
+
<order_status_success></order_status_success>
|
1367 |
+
<order_status_failed></order_status_failed>
|
1368 |
+
<sort_order>10</sort_order>
|
1369 |
+
<limit_by_ip>0</limit_by_ip>
|
1370 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1371 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1372 |
+
<service_version>2</service_version>
|
1373 |
+
<order_email>1</order_email>
|
1374 |
+
</buckaroo3extended_ideal>
|
1375 |
+
|
1376 |
+
<buckaroo3extended_visa>
|
1377 |
+
<active>0</active>
|
1378 |
+
<mode>0</mode>
|
1379 |
+
<title>Visa</title>
|
1380 |
+
<allowspecific>0</allowspecific>
|
1381 |
+
<specificcountry></specificcountry>
|
1382 |
+
<order_status_success></order_status_success>
|
1383 |
+
<order_status_failed></order_status_failed>
|
1384 |
+
<sort_order>40</sort_order>
|
1385 |
+
<limit_by_ip>0</limit_by_ip>
|
1386 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1387 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1388 |
+
<order_email>1</order_email>
|
1389 |
+
</buckaroo3extended_visa>
|
1390 |
+
|
1391 |
+
<buckaroo3extended_mastercard>
|
1392 |
+
<active>0</active>
|
1393 |
+
<mode>0</mode>
|
1394 |
+
<title>Mastercard</title>
|
1395 |
+
<allowspecific>0</allowspecific>
|
1396 |
+
<specificcountry></specificcountry>
|
1397 |
+
<order_status_success></order_status_success>
|
1398 |
+
<order_status_failed></order_status_failed>
|
1399 |
+
<sort_order>30</sort_order>
|
1400 |
+
<limit_by_ip>0</limit_by_ip>
|
1401 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1402 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1403 |
+
<order_email>1</order_email>
|
1404 |
+
</buckaroo3extended_mastercard>
|
1405 |
+
|
1406 |
+
<buckaroo3extended_cartebancaire>
|
1407 |
+
<active>0</active>
|
1408 |
+
<mode>0</mode>
|
1409 |
+
<title>Carte Bancaire</title>
|
1410 |
+
<allowspecific>0</allowspecific>
|
1411 |
+
<specificcountry></specificcountry>
|
1412 |
+
<order_status_success></order_status_success>
|
1413 |
+
<order_status_failed></order_status_failed>
|
1414 |
+
<sort_order>40</sort_order>
|
1415 |
+
<limit_by_ip>0</limit_by_ip>
|
1416 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1417 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1418 |
+
<order_email>1</order_email>
|
1419 |
+
</buckaroo3extended_cartebancaire>
|
1420 |
+
|
1421 |
+
<buckaroo3extended_cartebleue>
|
1422 |
+
<active>0</active>
|
1423 |
+
<mode>0</mode>
|
1424 |
+
<title>Carte Bleue</title>
|
1425 |
+
<allowspecific>0</allowspecific>
|
1426 |
+
<specificcountry></specificcountry>
|
1427 |
+
<order_status_success></order_status_success>
|
1428 |
+
<order_status_failed></order_status_failed>
|
1429 |
+
<sort_order>45</sort_order>
|
1430 |
+
<limit_by_ip>0</limit_by_ip>
|
1431 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1432 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1433 |
+
<order_email>1</order_email>
|
1434 |
+
</buckaroo3extended_cartebleue>
|
1435 |
+
|
1436 |
+
<buckaroo3extended_amex>
|
1437 |
+
<active>0</active>
|
1438 |
+
<mode>0</mode>
|
1439 |
+
<title>American Express</title>
|
1440 |
+
<allowspecific>0</allowspecific>
|
1441 |
+
<specificcountry></specificcountry>
|
1442 |
+
<order_status_success></order_status_success>
|
1443 |
+
<order_status_failed></order_status_failed>
|
1444 |
+
<sort_order>50</sort_order>
|
1445 |
+
<limit_by_ip>0</limit_by_ip>
|
1446 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1447 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1448 |
+
<order_email>1</order_email>
|
1449 |
+
</buckaroo3extended_amex>
|
1450 |
+
|
1451 |
+
<buckaroo3extended_paypal>
|
1452 |
+
<active>0</active>
|
1453 |
+
<mode>0</mode>
|
1454 |
+
<title>PayPal</title>
|
1455 |
+
<allowspecific>0</allowspecific>
|
1456 |
+
<specificcountry></specificcountry>
|
1457 |
+
<order_status_success></order_status_success>
|
1458 |
+
<order_status_failed></order_status_failed>
|
1459 |
+
<sort_order>90</sort_order>
|
1460 |
+
<limit_by_ip>0</limit_by_ip>
|
1461 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1462 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1463 |
+
<sellers_protection_eligible>Processing</sellers_protection_eligible>
|
1464 |
+
<sellers_protection_itemnotreceived_eligible>Processing</sellers_protection_itemnotreceived_eligible>
|
1465 |
+
<sellers_protection_unauthorizedpayment_eligible>Processing</sellers_protection_unauthorizedpayment_eligible>
|
1466 |
+
<sellers_protection_ineligible>Processing</sellers_protection_ineligible>
|
1467 |
+
<order_email>1</order_email>
|
1468 |
+
</buckaroo3extended_paypal>
|
1469 |
+
|
1470 |
+
<buckaroo3extended_sofortueberweisung>
|
1471 |
+
<active>0</active>
|
1472 |
+
<mode>0</mode>
|
1473 |
+
<title>Sofortbanking</title>
|
1474 |
+
<allowspecific>0</allowspecific>
|
1475 |
+
<specificcountry></specificcountry>
|
1476 |
+
<order_status_success></order_status_success>
|
1477 |
+
<order_status_failed></order_status_failed>
|
1478 |
+
<sort_order>150</sort_order>
|
1479 |
+
<limit_by_ip>0</limit_by_ip>
|
1480 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1481 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1482 |
+
<order_email>1</order_email>
|
1483 |
+
</buckaroo3extended_sofortueberweisung>
|
1484 |
+
|
1485 |
+
<buckaroo3extended_eps>
|
1486 |
+
<active>0</active>
|
1487 |
+
<mode>0</mode>
|
1488 |
+
<title>EPS</title>
|
1489 |
+
<allowspecific>0</allowspecific>
|
1490 |
+
<specificcountry></specificcountry>
|
1491 |
+
<order_status_success></order_status_success>
|
1492 |
+
<order_status_failed></order_status_failed>
|
1493 |
+
<sort_order>195</sort_order>
|
1494 |
+
<limit_by_ip>0</limit_by_ip>
|
1495 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1496 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1497 |
+
<order_email>1</order_email>
|
1498 |
+
</buckaroo3extended_eps>
|
1499 |
+
|
1500 |
+
<buckaroo3extended_giropay>
|
1501 |
+
<active>0</active>
|
1502 |
+
<mode>0</mode>
|
1503 |
+
<title>Giropay</title>
|
1504 |
+
<allowspecific>0</allowspecific>
|
1505 |
+
<specificcountry></specificcountry>
|
1506 |
+
<order_status_success></order_status_success>
|
1507 |
+
<order_status_failed></order_status_failed>
|
1508 |
+
<sort_order>160</sort_order>
|
1509 |
+
<limit_by_ip>0</limit_by_ip>
|
1510 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1511 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1512 |
+
<order_email>1</order_email>
|
1513 |
+
</buckaroo3extended_giropay>
|
1514 |
+
|
1515 |
+
<buckaroo3extended_paysafecard>
|
1516 |
+
<active>0</active>
|
1517 |
+
<mode>0</mode>
|
1518 |
+
<title>paysafecard</title>
|
1519 |
+
<allowspecific>0</allowspecific>
|
1520 |
+
<specificcountry></specificcountry>
|
1521 |
+
<order_status_success></order_status_success>
|
1522 |
+
<order_status_failed></order_status_failed>
|
1523 |
+
<sort_order>130</sort_order>
|
1524 |
+
<limit_by_ip>0</limit_by_ip>
|
1525 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1526 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1527 |
+
<order_email>1</order_email>
|
1528 |
+
</buckaroo3extended_paysafecard>
|
1529 |
+
|
1530 |
+
<buckaroo3extended_transfer>
|
1531 |
+
<active>0</active>
|
1532 |
+
<mode>0</mode>
|
1533 |
+
<title>Overboeking</title>
|
1534 |
+
<allowspecific>0</allowspecific>
|
1535 |
+
<specificcountry></specificcountry>
|
1536 |
+
<order_status_success></order_status_success>
|
1537 |
+
<order_status_failed></order_status_failed>
|
1538 |
+
<sort_order>100</sort_order>
|
1539 |
+
<limit_by_ip>0</limit_by_ip>
|
1540 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1541 |
+
<due_date_invoice>0</due_date_invoice>
|
1542 |
+
<due_date>7</due_date>
|
1543 |
+
<send_mail>1</send_mail>
|
1544 |
+
<use_creditmanagement>0</use_creditmanagement>
|
1545 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1546 |
+
<order_email>1</order_email>
|
1547 |
+
</buckaroo3extended_transfer>
|
1548 |
+
|
1549 |
+
<buckaroo3extended_directdebit>
|
1550 |
+
<active>0</active>
|
1551 |
+
<mode>0</mode>
|
1552 |
+
<title>SEPA Machtiging</title>
|
1553 |
+
<allowspecific>0</allowspecific>
|
1554 |
+
<specificcountry></specificcountry>
|
1555 |
+
<order_status_success></order_status_success>
|
1556 |
+
<order_status_failed></order_status_failed>
|
1557 |
+
<sort_order>110</sort_order>
|
1558 |
+
<limit_by_ip>0</limit_by_ip>
|
1559 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1560 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1561 |
+
<order_email>1</order_email>
|
1562 |
+
</buckaroo3extended_directdebit>
|
1563 |
+
|
1564 |
+
<buckaroo3extended_paymentguarantee>
|
1565 |
+
<active>0</active>
|
1566 |
+
<mode>0</mode>
|
1567 |
+
<title>Achteraf Betalen</title>
|
1568 |
+
<allowspecific>0</allowspecific>
|
1569 |
+
<specificcountry></specificcountry>
|
1570 |
+
<order_status_success></order_status_success>
|
1571 |
+
<order_status_failed></order_status_failed>
|
1572 |
+
<sort_order>20</sort_order>
|
1573 |
+
<limit_by_ip>0</limit_by_ip>
|
1574 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1575 |
+
<allowed_methods>buckaroo3extended_ideal</allowed_methods>
|
1576 |
+
<duedate>0</duedate>
|
1577 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1578 |
+
<order_email>1</order_email>
|
1579 |
+
<creditnote>0</creditnote>
|
1580 |
+
</buckaroo3extended_paymentguarantee>
|
1581 |
+
|
1582 |
+
<!--<buckaroo3extended_afterpay>-->
|
1583 |
+
<!--<active>0</active>-->
|
1584 |
+
<!--<mode>0</mode>-->
|
1585 |
+
<!--<title>Afterpay</title>-->
|
1586 |
+
<!--<allowspecific>0</allowspecific>-->
|
1587 |
+
<!--<specificcountry></specificcountry>-->
|
1588 |
+
<!--<order_status_success></order_status_success>-->
|
1589 |
+
<!--<order_status_failed></order_status_failed>-->
|
1590 |
+
<!--<sort_order>25</sort_order>-->
|
1591 |
+
<!--<limit_by_ip>0</limit_by_ip>-->
|
1592 |
+
<!--<allowed_currencies>EUR</allowed_currencies>-->
|
1593 |
+
<!--<allowed_methods>all</allowed_methods>-->
|
1594 |
+
<!--<duedate>0</duedate>-->
|
1595 |
+
<!--<payment_fee_label>Fee</payment_fee_label>-->
|
1596 |
+
<!--<order_email>1</order_email>-->
|
1597 |
+
<!--<paymethod>afterpayacceptgiro</paymethod>-->
|
1598 |
+
<!--<business>1</business>-->
|
1599 |
+
<!--</buckaroo3extended_afterpay>-->
|
1600 |
+
|
1601 |
+
<buckaroo3extended_payperemail>
|
1602 |
+
<active>0</active>
|
1603 |
+
<mode>0</mode>
|
1604 |
+
<title>PayperEmail</title>
|
1605 |
+
<allowspecific>0</allowspecific>
|
1606 |
+
<specificcountry></specificcountry>
|
1607 |
+
<order_status_success></order_status_success>
|
1608 |
+
<order_status_failed></order_status_failed>
|
1609 |
+
<sort_order>180</sort_order>
|
1610 |
+
<limit_by_ip>0</limit_by_ip>
|
1611 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1612 |
+
<allowed_methods>all</allowed_methods>
|
1613 |
+
<send_mail>1</send_mail>
|
1614 |
+
<area>backend</area>
|
1615 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1616 |
+
<order_email>1</order_email>
|
1617 |
+
</buckaroo3extended_payperemail>
|
1618 |
+
|
1619 |
+
<buckaroo3extended_onlinegiro>
|
1620 |
+
<active>0</active>
|
1621 |
+
<mode>0</mode>
|
1622 |
+
<title>online giro</title>
|
1623 |
+
<allowspecific>0</allowspecific>
|
1624 |
+
<specificcountry></specificcountry>
|
1625 |
+
<order_status_success></order_status_success>
|
1626 |
+
<order_status_failed></order_status_failed>
|
1627 |
+
<sort_order>190</sort_order>
|
1628 |
+
<limit_by_ip>0</limit_by_ip>
|
1629 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1630 |
+
<area>backend</area>
|
1631 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1632 |
+
<order_email>1</order_email>
|
1633 |
+
</buckaroo3extended_onlinegiro>
|
1634 |
+
|
1635 |
+
<buckaroo3extended_giftcards>
|
1636 |
+
<active>0</active>
|
1637 |
+
<mode>0</mode>
|
1638 |
+
<title>Cadeaukaarten</title>
|
1639 |
+
<allowspecific>0</allowspecific>
|
1640 |
+
<specificcountry></specificcountry>
|
1641 |
+
<order_status_success></order_status_success>
|
1642 |
+
<order_status_failed></order_status_failed>
|
1643 |
+
<sort_order>170</sort_order>
|
1644 |
+
<limit_by_ip>0</limit_by_ip>
|
1645 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1646 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1647 |
+
<order_email>1</order_email>
|
1648 |
+
</buckaroo3extended_giftcards>
|
1649 |
+
|
1650 |
+
<buckaroo3extended_empayment>
|
1651 |
+
<active>0</active>
|
1652 |
+
<mode>0</mode>
|
1653 |
+
<title>èM! Payment</title>
|
1654 |
+
<allowspecific>0</allowspecific>
|
1655 |
+
<specificcountry></specificcountry>
|
1656 |
+
<order_status_success></order_status_success>
|
1657 |
+
<order_status_failed></order_status_failed>
|
1658 |
+
<sort_order>120</sort_order>
|
1659 |
+
<limit_by_ip>0</limit_by_ip>
|
1660 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1661 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1662 |
+
<order_email>1</order_email>
|
1663 |
+
</buckaroo3extended_empayment>
|
1664 |
+
|
1665 |
+
<buckaroo3extended_maestro>
|
1666 |
+
<active>0</active>
|
1667 |
+
<mode>0</mode>
|
1668 |
+
<title>eMaestro</title>
|
1669 |
+
<allowspecific>0</allowspecific>
|
1670 |
+
<specificcountry></specificcountry>
|
1671 |
+
<order_status_success></order_status_success>
|
1672 |
+
<order_status_failed></order_status_failed>
|
1673 |
+
<sort_order>70</sort_order>
|
1674 |
+
<limit_by_ip>0</limit_by_ip>
|
1675 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1676 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1677 |
+
<order_email>1</order_email>
|
1678 |
+
</buckaroo3extended_maestro>
|
1679 |
+
|
1680 |
+
<buckaroo3extended_visaelectron>
|
1681 |
+
<active>0</active>
|
1682 |
+
<mode>0</mode>
|
1683 |
+
<title>Visa Electron</title>
|
1684 |
+
<allowspecific>0</allowspecific>
|
1685 |
+
<specificcountry></specificcountry>
|
1686 |
+
<order_status_success></order_status_success>
|
1687 |
+
<order_status_failed></order_status_failed>
|
1688 |
+
<sort_order>60</sort_order>
|
1689 |
+
<limit_by_ip>0</limit_by_ip>
|
1690 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1691 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1692 |
+
<order_email>1</order_email>
|
1693 |
+
</buckaroo3extended_visaelectron>
|
1694 |
+
|
1695 |
+
<buckaroo3extended_vpay>
|
1696 |
+
<active>0</active>
|
1697 |
+
<mode>0</mode>
|
1698 |
+
<title>V PAY</title>
|
1699 |
+
<allowspecific>0</allowspecific>
|
1700 |
+
<specificcountry></specificcountry>
|
1701 |
+
<order_status_success></order_status_success>
|
1702 |
+
<order_status_failed></order_status_failed>
|
1703 |
+
<sort_order>80</sort_order>
|
1704 |
+
<limit_by_ip>0</limit_by_ip>
|
1705 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1706 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1707 |
+
<order_email>1</order_email>
|
1708 |
+
</buckaroo3extended_vpay>
|
1709 |
+
|
1710 |
+
<buckaroo3extended_bancontactmrcash>
|
1711 |
+
<active>0</active>
|
1712 |
+
<mode>0</mode>
|
1713 |
+
<title>Bancontact/ Mister Cash</title>
|
1714 |
+
<allowspecific>0</allowspecific>
|
1715 |
+
<specificcountry></specificcountry>
|
1716 |
+
<order_status_success></order_status_success>
|
1717 |
+
<order_status_failed></order_status_failed>
|
1718 |
+
<sort_order>140</sort_order>
|
1719 |
+
<limit_by_ip>0</limit_by_ip>
|
1720 |
+
<allowed_currencies>EUR</allowed_currencies>
|
1721 |
+
<payment_fee_label>Fee</payment_fee_label>
|
1722 |
+
<order_email>1</order_email>
|
1723 |
+
</buckaroo3extended_bancontactmrcash>
|
1724 |
+
|
1725 |
+
<buckaroo3extended_refund>
|
1726 |
+
<active>0</active>
|
1727 |
+
<allow_push>1</allow_push>
|
1728 |
+
<order_status_processing_success></order_status_processing_success>
|
1729 |
+
<order_status_processing_failed></order_status_processing_failed>
|
1730 |
+
<order_status_closed_success></order_status_closed_success>
|
1731 |
+
<order_status_closed_failed></order_status_closed_failed>
|
1732 |
+
<order_status_complete_success></order_status_complete_success>
|
1733 |
+
<order_status_complete_failed></order_status_complete_failed>
|
1734 |
+
</buckaroo3extended_refund>
|
1735 |
+
</buckaroo>
|
1736 |
+
|
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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<buckaroo_banner module="buckaroo3extended">
|
7 |
+
<frontend_model>buckaroo3extended/adminhtml_system_config_paymentmethodbanner</frontend_model>
|
8 |
+
<sort_order>0</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>1</show_in_website>
|
11 |
+
<show_in_store>1</show_in_store>
|
12 |
+
</buckaroo_banner>
|
13 |
+
</groups>
|
14 |
+
</payment>
|
15 |
+
|
16 |
+
<sales>
|
17 |
+
<groups>
|
18 |
+
<totals_sort>
|
19 |
+
<fields>
|
20 |
+
<buckaroo_fee translate="label" module="buckaroo3extended">
|
21 |
+
<label>Buckaroo Payment fee</label>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>100</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>0</show_in_store>
|
27 |
+
</buckaroo_fee>
|
28 |
+
</fields>
|
29 |
+
</totals_sort>
|
30 |
+
</groups>
|
31 |
+
</sales>
|
32 |
+
|
33 |
+
<tax>
|
34 |
+
<groups>
|
35 |
+
<classes>
|
36 |
+
<fields>
|
37 |
+
<buckaroo_fee translate="label comment" module="buckaroo3extended">
|
38 |
+
<label>Tax class for Buckaroo Payment fee</label>
|
39 |
+
<comment>This tax class will be used when calculating the tax for the Buckaroo Payment fee.</comment>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>buckaroo3extended/paymentFee_system_config_source_feeTaxClass</source_model>
|
42 |
+
<sort_order>20</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>0</show_in_store>
|
46 |
+
</buckaroo_fee>
|
47 |
+
</fields>
|
48 |
+
</classes>
|
49 |
+
<calculation>
|
50 |
+
<fields>
|
51 |
+
<buckaroo_fee_including_tax translate="label comment" module="buckaroo3extended">
|
52 |
+
<label>Buckaroo Payment fee</label>
|
53 |
+
<comment>Whether the Buckaroo Payment fee you have entered is incl. or excl. tax.</comment>
|
54 |
+
<frontend_type>select</frontend_type>
|
55 |
+
<backend_model>tax/config_price_include</backend_model>
|
56 |
+
<source_model>tax/system_config_source_priceType</source_model>
|
57 |
+
<sort_order>25</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>0</show_in_store>
|
61 |
+
</buckaroo_fee_including_tax>
|
62 |
+
</fields>
|
63 |
+
</calculation>
|
64 |
+
<cart_display>
|
65 |
+
<fields>
|
66 |
+
<buckaroo_fee translate="label" module="buckaroo3extended">
|
67 |
+
<label>Display Buckaroo Payment fee</label>
|
68 |
+
<frontend_type>select</frontend_type>
|
69 |
+
<source_model>tax/system_config_source_tax_display_type</source_model>
|
70 |
+
<sort_order>25</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
</buckaroo_fee>
|
75 |
+
</fields>
|
76 |
+
</cart_display>
|
77 |
+
<sales_display>
|
78 |
+
<fields>
|
79 |
+
<buckaroo_fee translate="label" module="buckaroo3extended">
|
80 |
+
<label>Display Buckaroo Payment fee</label>
|
81 |
+
<frontend_type>select</frontend_type>
|
82 |
+
<source_model>tax/system_config_source_tax_display_type</source_model>
|
83 |
+
<sort_order>25</sort_order>
|
84 |
+
<show_in_default>1</show_in_default>
|
85 |
+
<show_in_website>1</show_in_website>
|
86 |
+
<show_in_store>1</show_in_store>
|
87 |
+
</buckaroo_fee>
|
88 |
+
</fields>
|
89 |
+
</sales_display>
|
90 |
+
</groups>
|
91 |
+
</tax>
|
92 |
+
|
93 |
+
<buckaroo translate="label" module="buckaroo3extended">
|
94 |
+
<label>Buckaroo</label>
|
95 |
+
<tab>sales</tab>
|
96 |
+
<class>buckaroo-section</class>
|
97 |
+
<header_css>buckaroo-header</header_css>
|
98 |
+
<frontend_type>text</frontend_type>
|
99 |
+
<sort_order>340</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
+
<groups>
|
104 |
+
<klarna_check>
|
105 |
+
<frontend_model>buckaroo3extended/adminhtml_system_config_klarnaCheck</frontend_model>
|
106 |
+
<sort_order>0</sort_order>
|
107 |
+
<show_in_default>1</show_in_default>
|
108 |
+
<show_in_website>1</show_in_website>
|
109 |
+
<show_in_store>1</show_in_store>
|
110 |
+
</klarna_check>
|
111 |
+
<sellers_protection_check>
|
112 |
+
<frontend_model>buckaroo3extended/adminhtml_system_config_sellersProtectionCheck</frontend_model>
|
113 |
+
<sort_order>1</sort_order>
|
114 |
+
<show_in_default>1</show_in_default>
|
115 |
+
<show_in_website>1</show_in_website>
|
116 |
+
<show_in_store>1</show_in_store>
|
117 |
+
</sellers_protection_check>
|
118 |
+
<buckaroo3extended_support>
|
119 |
+
<label>Version & Support</label>
|
120 |
+
<sort_order>1000</sort_order>
|
121 |
+
<show_in_default>1</show_in_default>
|
122 |
+
<show_in_website>1</show_in_website>
|
123 |
+
<show_in_store>1</show_in_store>
|
124 |
+
<fields>
|
125 |
+
<support>
|
126 |
+
<sort_order>10</sort_order>
|
127 |
+
<frontend_model>buckaroo3extended/adminhtml_system_config_supportTab</frontend_model>
|
128 |
+
<show_in_default>1</show_in_default>
|
129 |
+
<show_in_website>1</show_in_website>
|
130 |
+
<show_in_store>1</show_in_store>
|
131 |
+
</support>
|
132 |
+
</fields>
|
133 |
+
</buckaroo3extended_support>
|
134 |
+
<buckaroo3extended translate="label">
|
135 |
+
<label>General Configuration</label>
|
136 |
+
<sort_order>2000</sort_order>
|
137 |
+
<show_in_default>1</show_in_default>
|
138 |
+
<show_in_website>1</show_in_website>
|
139 |
+
<show_in_store>1</show_in_store>
|
140 |
+
<fields>
|
141 |
+
<active translate="label comment tooltip">
|
142 |
+
<label>Enabled</label>
|
143 |
+
<comment>Enable or disable the Buckaroo module.</comment>
|
144 |
+
<tooltip>Selecting 'No' will overrule all individual settings.</tooltip>
|
145 |
+
<frontend_type>select</frontend_type>
|
146 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
147 |
+
<sort_order>10</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
<show_in_website>1</show_in_website>
|
150 |
+
<show_in_store>1</show_in_store>
|
151 |
+
</active>
|
152 |
+
<mode translate="label comment tooltip">
|
153 |
+
<label>Payment modus</label>
|
154 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
155 |
+
<tooltip>Buckaroo can support a seperate environment. Contact Buckaroo for the conditions.</tooltip>
|
156 |
+
<frontend_type>select</frontend_type>
|
157 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
158 |
+
<sort_order>20</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>1</show_in_website>
|
161 |
+
<show_in_store>1</show_in_store>
|
162 |
+
</mode>
|
163 |
+
<digital_signature translate="label comment tooltip">
|
164 |
+
<label>Secret key</label>
|
165 |
+
<comment>Enter your Buckaroo Secret Key.</comment>
|
166 |
+
<tooltip>The Secret Key can be retrieved in Payment Plaza under the configuration tab. For support contact Buckaroo.</tooltip>
|
167 |
+
<frontend_type>text</frontend_type>
|
168 |
+
<sort_order>30</sort_order>
|
169 |
+
<show_in_default>1</show_in_default>
|
170 |
+
<show_in_website>1</show_in_website>
|
171 |
+
<show_in_store>1</show_in_store>
|
172 |
+
</digital_signature>
|
173 |
+
<key translate="label comment tooltip">
|
174 |
+
<label>(Merchant) key</label>
|
175 |
+
<comment>Enter your Buckaroo merchant/website key.</comment>
|
176 |
+
<tooltip>The (Merchant) Key can be retrieved in Payment Plaza under the profile tab. For support contact Buckaroo.</tooltip>
|
177 |
+
<frontend_type>text</frontend_type>
|
178 |
+
<sort_order>40</sort_order>
|
179 |
+
<show_in_default>1</show_in_default>
|
180 |
+
<show_in_website>1</show_in_website>
|
181 |
+
<show_in_store>1</show_in_store>
|
182 |
+
</key>
|
183 |
+
<certificate_selection translate="label comment tooltip">
|
184 |
+
<label>Certificate file</label>
|
185 |
+
<comment>Upload certificates at the certificate management tab.</comment>
|
186 |
+
<tooltip>The certificate can be retrieved in Payment Plaza under the profile tab. For support contact Buckaroo.</tooltip>
|
187 |
+
<frontend_type>select</frontend_type>
|
188 |
+
<source_model>buckaroo3extended/sources_certificates</source_model>
|
189 |
+
<sort_order>50</sort_order>
|
190 |
+
<show_in_default>1</show_in_default>
|
191 |
+
<show_in_website>1</show_in_website>
|
192 |
+
<show_in_store>1</show_in_store>
|
193 |
+
</certificate_selection>
|
194 |
+
<thumbprint translate="label comment tooltip">
|
195 |
+
<label>Certificate thumbprint</label>
|
196 |
+
<comment>The thumbprint and certificate should form a pair.</comment>
|
197 |
+
<tooltip>The certificate thumbprint can be retrieved in Payment Plaza under the profile tab. For support contact Buckaroo.</tooltip>
|
198 |
+
<frontend_type>text</frontend_type>
|
199 |
+
<sort_order>60</sort_order>
|
200 |
+
<show_in_default>1</show_in_default>
|
201 |
+
<show_in_website>1</show_in_website>
|
202 |
+
<show_in_store>1</show_in_store>
|
203 |
+
</thumbprint>
|
204 |
+
<payment_description translate="label comment">
|
205 |
+
<label>Transaction label</label>
|
206 |
+
<comment>The transaction description in Payment Plaza.</comment>
|
207 |
+
<frontend_type>text</frontend_type>
|
208 |
+
<sort_order>70</sort_order>
|
209 |
+
<show_in_default>1</show_in_default>
|
210 |
+
<show_in_website>1</show_in_website>
|
211 |
+
<show_in_store>1</show_in_store>
|
212 |
+
</payment_description>
|
213 |
+
</fields>
|
214 |
+
</buckaroo3extended>
|
215 |
+
<buckaroo3extended_ideal translate="label">
|
216 |
+
<label>iDEAL</label>
|
217 |
+
<sort_order>4000</sort_order>
|
218 |
+
<show_in_default>1</show_in_default>
|
219 |
+
<show_in_website>1</show_in_website>
|
220 |
+
<show_in_store>1</show_in_store>
|
221 |
+
<fields>
|
222 |
+
<active translate="label comment">
|
223 |
+
<label>Enabled</label>
|
224 |
+
<comment>Enable or disable this payment method.</comment>
|
225 |
+
<frontend_type>select</frontend_type>
|
226 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
227 |
+
<sort_order>10</sort_order>
|
228 |
+
<show_in_default>1</show_in_default>
|
229 |
+
<show_in_website>1</show_in_website>
|
230 |
+
<show_in_store>1</show_in_store>
|
231 |
+
</active>
|
232 |
+
<mode translate="label comment">
|
233 |
+
<label>Payment modus</label>
|
234 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
235 |
+
<frontend_type>select</frontend_type>
|
236 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
237 |
+
<sort_order>20</sort_order>
|
238 |
+
<show_in_default>1</show_in_default>
|
239 |
+
<show_in_website>1</show_in_website>
|
240 |
+
<show_in_store>1</show_in_store>
|
241 |
+
</mode>
|
242 |
+
<title translate="label comment">
|
243 |
+
<label>Frontend label</label>
|
244 |
+
<comment>Determines the frontend label shown.</comment>
|
245 |
+
<frontend_type>text</frontend_type>
|
246 |
+
<sort_order>30</sort_order>
|
247 |
+
<show_in_default>1</show_in_default>
|
248 |
+
<show_in_website>1</show_in_website>
|
249 |
+
<show_in_store>1</show_in_store>
|
250 |
+
</title>
|
251 |
+
<sort_order translate="label comment">
|
252 |
+
<label>Frontend sort order</label>
|
253 |
+
<comment>Determines the sorting of payment methods.</comment>
|
254 |
+
<frontend_type>text</frontend_type>
|
255 |
+
<sort_order>40</sort_order>
|
256 |
+
<show_in_default>1</show_in_default>
|
257 |
+
<show_in_website>1</show_in_website>
|
258 |
+
<show_in_store>1</show_in_store>
|
259 |
+
</sort_order>
|
260 |
+
<order_email translate="label comment">
|
261 |
+
<label>Send order confirmation email</label>
|
262 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
263 |
+
<frontend_type>select</frontend_type>
|
264 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
265 |
+
<sort_order>45</sort_order>
|
266 |
+
<show_in_default>1</show_in_default>
|
267 |
+
<show_in_website>1</show_in_website>
|
268 |
+
<show_in_store>1</show_in_store>
|
269 |
+
</order_email>
|
270 |
+
<show_advanced translate="label comment">
|
271 |
+
<comment>Enable or disable advanced options.</comment>
|
272 |
+
<frontend_type>select</frontend_type>
|
273 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
274 |
+
<sort_order>50</sort_order>
|
275 |
+
<show_in_default>1</show_in_default>
|
276 |
+
<show_in_website>1</show_in_website>
|
277 |
+
<show_in_store>1</show_in_store>
|
278 |
+
</show_advanced>
|
279 |
+
<!-- Uncomment to manually set the version to be used. Default will always be 2 -->
|
280 |
+
<!-- <service_version translate="label comment tooltip">
|
281 |
+
<label>Service version used</label>
|
282 |
+
<comment>Select which version of the payment service to use.</comment>
|
283 |
+
<tooltip>Version 1 is the old version of IDEAL. Version 2 is the new SEPA version. Please contact Buckaroo for more information.</tooltip>
|
284 |
+
<frontend_type>select</frontend_type>
|
285 |
+
<source_model>buckaroo3extended/sources_ideal_serviceVersion</source_model>
|
286 |
+
<sort_order>51</sort_order>
|
287 |
+
<show_in_default>1</show_in_default>
|
288 |
+
<show_in_website>1</show_in_website>
|
289 |
+
<show_in_store>1</show_in_store>
|
290 |
+
<depends>
|
291 |
+
<show_advanced>1</show_advanced>
|
292 |
+
</depends>
|
293 |
+
</service_version> -->
|
294 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
295 |
+
<label>Fee</label>
|
296 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
297 |
+
<frontend_type>text</frontend_type>
|
298 |
+
<sort_order>53</sort_order>
|
299 |
+
<show_in_default>1</show_in_default>
|
300 |
+
<show_in_website>1</show_in_website>
|
301 |
+
<show_in_store>1</show_in_store>
|
302 |
+
<validate>validate-not-negative-number</validate>
|
303 |
+
<depends>
|
304 |
+
<show_advanced>1</show_advanced>
|
305 |
+
</depends>
|
306 |
+
</payment_fee>
|
307 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
308 |
+
<label>Fee label</label>
|
309 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
310 |
+
<frontend_type>text</frontend_type>
|
311 |
+
<sort_order>54</sort_order>
|
312 |
+
<show_in_default>1</show_in_default>
|
313 |
+
<show_in_website>1</show_in_website>
|
314 |
+
<show_in_store>1</show_in_store>
|
315 |
+
<validate>required-entry</validate>
|
316 |
+
<depends>
|
317 |
+
<show_advanced>1</show_advanced>
|
318 |
+
</depends>
|
319 |
+
</payment_fee_label>
|
320 |
+
<max_amount translate="label comment tooltip">
|
321 |
+
<label>Max order amount (in Base Currency)</label>
|
322 |
+
<comment>Maximum order amount allowed.</comment>
|
323 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
324 |
+
<frontend_type>text</frontend_type>
|
325 |
+
<sort_order>55</sort_order>
|
326 |
+
<show_in_default>1</show_in_default>
|
327 |
+
<show_in_website>1</show_in_website>
|
328 |
+
<show_in_store>1</show_in_store>
|
329 |
+
<depends>
|
330 |
+
<show_advanced>1</show_advanced>
|
331 |
+
</depends>
|
332 |
+
</max_amount>
|
333 |
+
<min_amount translate="label comment tooltip">
|
334 |
+
<label>Min order amount (in Base Currency)</label>
|
335 |
+
<comment>Minimum order amount allowed.</comment>
|
336 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
337 |
+
<frontend_type>text</frontend_type>
|
338 |
+
<sort_order>56</sort_order>
|
339 |
+
<show_in_default>1</show_in_default>
|
340 |
+
<show_in_website>1</show_in_website>
|
341 |
+
<show_in_store>1</show_in_store>
|
342 |
+
<depends>
|
343 |
+
<show_advanced>1</show_advanced>
|
344 |
+
</depends>
|
345 |
+
</min_amount>
|
346 |
+
<active_status translate="label comment">
|
347 |
+
<label>Method specific status enabled</label>
|
348 |
+
<comment>Enable or disable specific status.</comment>
|
349 |
+
<frontend_type>select</frontend_type>
|
350 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
351 |
+
<sort_order>60</sort_order>
|
352 |
+
<show_in_default>1</show_in_default>
|
353 |
+
<show_in_website>1</show_in_website>
|
354 |
+
<show_in_store>1</show_in_store>
|
355 |
+
<depends>
|
356 |
+
<show_advanced>1</show_advanced>
|
357 |
+
</depends>
|
358 |
+
</active_status>
|
359 |
+
<order_status_success translate="label comment tooltip">
|
360 |
+
<label>Method specific success status</label>
|
361 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
362 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
363 |
+
<frontend_type>select</frontend_type>
|
364 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
365 |
+
<sort_order>61</sort_order>
|
366 |
+
<show_in_default>1</show_in_default>
|
367 |
+
<show_in_website>1</show_in_website>
|
368 |
+
<show_in_store>1</show_in_store>
|
369 |
+
<validate>buckaroo3extended_ideal_advanced</validate>
|
370 |
+
<depends>
|
371 |
+
<show_advanced>1</show_advanced>
|
372 |
+
<active_status>1</active_status>
|
373 |
+
</depends>
|
374 |
+
</order_status_success>
|
375 |
+
<order_status_failed translate="label comment tooltip">
|
376 |
+
<label>Method specific failed status</label>
|
377 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
378 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
379 |
+
<frontend_type>select</frontend_type>
|
380 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
381 |
+
<sort_order>62</sort_order>
|
382 |
+
<show_in_default>1</show_in_default>
|
383 |
+
<show_in_website>1</show_in_website>
|
384 |
+
<show_in_store>1</show_in_store>
|
385 |
+
<validate>buckaroo3extended_ideal_advanced</validate>
|
386 |
+
<depends>
|
387 |
+
<show_advanced>1</show_advanced>
|
388 |
+
<active_status>1</active_status>
|
389 |
+
</depends>
|
390 |
+
</order_status_failed>
|
391 |
+
<allowed_currencies translate="label comment tooltip">
|
392 |
+
<label>Allowed currencies</label>
|
393 |
+
<comment>Select payment method specific currencies.</comment>
|
394 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
395 |
+
<frontend_type>multiselect</frontend_type>
|
396 |
+
<source_model>buckaroo3extended/sources_ideal_availableCurrencies</source_model>
|
397 |
+
<sort_order>90</sort_order>
|
398 |
+
<show_in_default>1</show_in_default>
|
399 |
+
<show_in_website>1</show_in_website>
|
400 |
+
<show_in_store>1</show_in_store>
|
401 |
+
<validate>buckaroo3extended_ideal_advanced</validate>
|
402 |
+
<depends>
|
403 |
+
<show_advanced>1</show_advanced>
|
404 |
+
</depends>
|
405 |
+
</allowed_currencies>
|
406 |
+
<allowspecific translate="label">
|
407 |
+
<label>Payment from applicable countries</label>
|
408 |
+
<frontend_type>allowspecific</frontend_type>
|
409 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
410 |
+
<sort_order>100</sort_order>
|
411 |
+
<show_in_default>1</show_in_default>
|
412 |
+
<show_in_website>1</show_in_website>
|
413 |
+
<show_in_store>1</show_in_store>
|
414 |
+
<depends>
|
415 |
+
<show_advanced>1</show_advanced>
|
416 |
+
</depends>
|
417 |
+
</allowspecific>
|
418 |
+
<specificcountry translate="label comment">
|
419 |
+
<label>Payment from Specific Country</label>
|
420 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
421 |
+
<frontend_type>multiselect</frontend_type>
|
422 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
423 |
+
<sort_order>110</sort_order>
|
424 |
+
<show_in_default>1</show_in_default>
|
425 |
+
<show_in_website>1</show_in_website>
|
426 |
+
<show_in_store>1</show_in_store>
|
427 |
+
<depends>
|
428 |
+
<allowspecific>1</allowspecific>
|
429 |
+
<show_advanced>1</show_advanced>
|
430 |
+
</depends>
|
431 |
+
</specificcountry>
|
432 |
+
<limit_by_ip translate="label comment">
|
433 |
+
<label>Display only for selected IP's</label>
|
434 |
+
<comment>Show method only to Magento set IP's.</comment>
|
435 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
436 |
+
<frontend_type>select</frontend_type>
|
437 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
438 |
+
<sort_order>120</sort_order>
|
439 |
+
<show_in_default>1</show_in_default>
|
440 |
+
<show_in_website>1</show_in_website>
|
441 |
+
<show_in_store>1</show_in_store>
|
442 |
+
<depends>
|
443 |
+
<show_advanced>1</show_advanced>
|
444 |
+
</depends>
|
445 |
+
</limit_by_ip>
|
446 |
+
</fields>
|
447 |
+
</buckaroo3extended_ideal>
|
448 |
+
<buckaroo3extended_paymentguarantee translate="label">
|
449 |
+
<label>Achteraf betalen</label>
|
450 |
+
<sort_order>5000</sort_order>
|
451 |
+
<show_in_default>1</show_in_default>
|
452 |
+
<show_in_website>1</show_in_website>
|
453 |
+
<show_in_store>1</show_in_store>
|
454 |
+
<fields>
|
455 |
+
<active translate="label comment">
|
456 |
+
<label>Enabled</label>
|
457 |
+
<comment>Enable or disable this payment method.</comment>
|
458 |
+
<frontend_type>select</frontend_type>
|
459 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
460 |
+
<sort_order>10</sort_order>
|
461 |
+
<show_in_default>1</show_in_default>
|
462 |
+
<show_in_website>1</show_in_website>
|
463 |
+
<show_in_store>1</show_in_store>
|
464 |
+
</active>
|
465 |
+
<mode translate="label comment">
|
466 |
+
<label>Payment modus</label>
|
467 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
468 |
+
<frontend_type>select</frontend_type>
|
469 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
470 |
+
<sort_order>20</sort_order>
|
471 |
+
<show_in_default>1</show_in_default>
|
472 |
+
<show_in_website>1</show_in_website>
|
473 |
+
<show_in_store>1</show_in_store>
|
474 |
+
</mode>
|
475 |
+
<title translate="label comment">
|
476 |
+
<label>Frontend label</label>
|
477 |
+
<comment>Determines the frontend label shown.</comment>
|
478 |
+
<frontend_type>text</frontend_type>
|
479 |
+
<sort_order>30</sort_order>
|
480 |
+
<show_in_default>1</show_in_default>
|
481 |
+
<show_in_website>1</show_in_website>
|
482 |
+
<show_in_store>1</show_in_store>
|
483 |
+
</title>
|
484 |
+
<sort_order translate="label comment">
|
485 |
+
<label>Frontend sort order</label>
|
486 |
+
<comment>Determines the sorting of payment methods.</comment>
|
487 |
+
<frontend_type>text</frontend_type>
|
488 |
+
<sort_order>40</sort_order>
|
489 |
+
<show_in_default>1</show_in_default>
|
490 |
+
<show_in_website>1</show_in_website>
|
491 |
+
<show_in_store>1</show_in_store>
|
492 |
+
</sort_order>
|
493 |
+
<duedate translate="label comment tooltip">
|
494 |
+
<label>Number of days between order and invoice</label>
|
495 |
+
<comment>Maximum days of delay 30.</comment>
|
496 |
+
<tooltip>After invoicing the customer has 14 days before the payment reminder.</tooltip>
|
497 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
498 |
+
<frontend_type>text</frontend_type>
|
499 |
+
<sort_order>70</sort_order>
|
500 |
+
<show_in_default>1</show_in_default>
|
501 |
+
<show_in_website>1</show_in_website>
|
502 |
+
<show_in_store>1</show_in_store>
|
503 |
+
</duedate>
|
504 |
+
<sendmail translate="label comment tooltip">
|
505 |
+
<label>Send payment email</label>
|
506 |
+
<comment>Buckaroo sends an email to the customer with the payment procedures.</comment>
|
507 |
+
<tooltip>Set to 'No' leaves the customer uninformed on the payment obligations.</tooltip>
|
508 |
+
<frontend_type>select</frontend_type>
|
509 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
510 |
+
<sort_order>80</sort_order>
|
511 |
+
<show_in_default>1</show_in_default>
|
512 |
+
<show_in_website>1</show_in_website>
|
513 |
+
<show_in_store>1</show_in_store>
|
514 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
515 |
+
</sendmail>
|
516 |
+
<allowed_methods translate="label comment">
|
517 |
+
<label>Allowed payment methods</label>
|
518 |
+
<comment>Select payment methods for settling paymentguarantee.</comment>
|
519 |
+
<frontend_type>multiselect</frontend_type>
|
520 |
+
<source_model>buckaroo3extended/sources_availablemethods</source_model>
|
521 |
+
<sort_order>90</sort_order>
|
522 |
+
<show_in_default>1</show_in_default>
|
523 |
+
<show_in_website>1</show_in_website>
|
524 |
+
<show_in_store>1</show_in_store>
|
525 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
526 |
+
</allowed_methods>
|
527 |
+
<order_email translate="label comment">
|
528 |
+
<label>Send order confirmation email</label>
|
529 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
530 |
+
<frontend_type>select</frontend_type>
|
531 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
532 |
+
<sort_order>45</sort_order>
|
533 |
+
<show_in_default>1</show_in_default>
|
534 |
+
<show_in_website>1</show_in_website>
|
535 |
+
<show_in_store>1</show_in_store>
|
536 |
+
</order_email>
|
537 |
+
<creditnote translate="label comment tooltip">
|
538 |
+
<label>Enable Credit Note functionality</label>
|
539 |
+
<comment>Enable this setting to create a credit note in the Payment Plaza when creating a creditmemo in Magento.</comment>
|
540 |
+
<tooltip>When enabling this setting, it is possible to create a creditnote in Payment Plaza. Note that it does not constitute a refund. You have to create a refund manually in the Payment Plaza.</tooltip>
|
541 |
+
<frontend_type>select</frontend_type>
|
542 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
543 |
+
<sort_order>46</sort_order>
|
544 |
+
<show_in_default>1</show_in_default>
|
545 |
+
<show_in_website>1</show_in_website>
|
546 |
+
<show_in_store>1</show_in_store>
|
547 |
+
</creditnote>
|
548 |
+
<show_advanced translate="label comment">
|
549 |
+
<comment>Enable or disable advanced options.</comment>
|
550 |
+
<frontend_type>select</frontend_type>
|
551 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
552 |
+
<sort_order>100</sort_order>
|
553 |
+
<show_in_default>1</show_in_default>
|
554 |
+
<show_in_website>1</show_in_website>
|
555 |
+
<show_in_store>1</show_in_store>
|
556 |
+
</show_advanced>
|
557 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
558 |
+
<label>Fee</label>
|
559 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
560 |
+
<frontend_type>text</frontend_type>
|
561 |
+
<sort_order>101</sort_order>
|
562 |
+
<show_in_default>1</show_in_default>
|
563 |
+
<show_in_website>1</show_in_website>
|
564 |
+
<show_in_store>1</show_in_store>
|
565 |
+
<validate>validate-not-negative-number</validate>
|
566 |
+
<depends>
|
567 |
+
<show_advanced>1</show_advanced>
|
568 |
+
</depends>
|
569 |
+
</payment_fee>
|
570 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
571 |
+
<label>Fee label</label>
|
572 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
573 |
+
<frontend_type>text</frontend_type>
|
574 |
+
<sort_order>102</sort_order>
|
575 |
+
<show_in_default>1</show_in_default>
|
576 |
+
<show_in_website>1</show_in_website>
|
577 |
+
<show_in_store>1</show_in_store>
|
578 |
+
<validate>required-entry</validate>
|
579 |
+
<depends>
|
580 |
+
<show_advanced>1</show_advanced>
|
581 |
+
</depends>
|
582 |
+
</payment_fee_label>
|
583 |
+
<active_status translate="label comment">
|
584 |
+
<label>Method specific status enabled</label>
|
585 |
+
<comment>Enable or disable specific status.</comment>
|
586 |
+
<frontend_type>select</frontend_type>
|
587 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
588 |
+
<sort_order>110</sort_order>
|
589 |
+
<show_in_default>1</show_in_default>
|
590 |
+
<show_in_website>1</show_in_website>
|
591 |
+
<show_in_store>1</show_in_store>
|
592 |
+
<depends>
|
593 |
+
<show_advanced>1</show_advanced>
|
594 |
+
</depends>
|
595 |
+
</active_status>
|
596 |
+
<order_status_success translate="label comment tooltip">
|
597 |
+
<label>Method specific success status</label>
|
598 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
599 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
600 |
+
<frontend_type>select</frontend_type>
|
601 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
602 |
+
<sort_order>111</sort_order>
|
603 |
+
<show_in_default>1</show_in_default>
|
604 |
+
<show_in_website>1</show_in_website>
|
605 |
+
<show_in_store>1</show_in_store>
|
606 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
607 |
+
<depends>
|
608 |
+
<show_advanced>1</show_advanced>
|
609 |
+
<active_status>1</active_status>
|
610 |
+
</depends>
|
611 |
+
</order_status_success>
|
612 |
+
<order_status_failed translate="label comment tooltip">
|
613 |
+
<label>Method specific failed status</label>
|
614 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
615 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
616 |
+
<frontend_type>select</frontend_type>
|
617 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
618 |
+
<sort_order>112</sort_order>
|
619 |
+
<show_in_default>1</show_in_default>
|
620 |
+
<show_in_website>1</show_in_website>
|
621 |
+
<show_in_store>1</show_in_store>
|
622 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
623 |
+
<depends>
|
624 |
+
<show_advanced>1</show_advanced>
|
625 |
+
<active_status>1</active_status>
|
626 |
+
</depends>
|
627 |
+
</order_status_failed>
|
628 |
+
<max_amount translate="label comment tooltip">
|
629 |
+
<label>Max order amount (in Base Currency)</label>
|
630 |
+
<comment>Maximum order amount allowed.</comment>
|
631 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
632 |
+
<frontend_type>text</frontend_type>
|
633 |
+
<sort_order>113</sort_order>
|
634 |
+
<show_in_default>1</show_in_default>
|
635 |
+
<show_in_website>1</show_in_website>
|
636 |
+
<show_in_store>1</show_in_store>
|
637 |
+
<depends>
|
638 |
+
<show_advanced>1</show_advanced>
|
639 |
+
</depends>
|
640 |
+
</max_amount>
|
641 |
+
<min_amount translate="label comment tooltip">
|
642 |
+
<label>Min order amount (in Base Currency)</label>
|
643 |
+
<comment>Minimum order amount allowed.</comment>
|
644 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
645 |
+
<frontend_type>text</frontend_type>
|
646 |
+
<sort_order>114</sort_order>
|
647 |
+
<show_in_default>1</show_in_default>
|
648 |
+
<show_in_website>1</show_in_website>
|
649 |
+
<show_in_store>1</show_in_store>
|
650 |
+
<depends>
|
651 |
+
<show_advanced>1</show_advanced>
|
652 |
+
</depends>
|
653 |
+
</min_amount>
|
654 |
+
<allowed_currencies translate="label comment tooltip">
|
655 |
+
<label>Allowed currencies</label>
|
656 |
+
<comment>Select payment method specific currencies.</comment>
|
657 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
658 |
+
<frontend_type>multiselect</frontend_type>
|
659 |
+
<source_model>buckaroo3extended/sources_paymentguarantee_availableCurrencies</source_model>
|
660 |
+
<sort_order>130</sort_order>
|
661 |
+
<show_in_default>1</show_in_default>
|
662 |
+
<show_in_website>1</show_in_website>
|
663 |
+
<show_in_store>1</show_in_store>
|
664 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
665 |
+
<depends>
|
666 |
+
<show_advanced>1</show_advanced>
|
667 |
+
</depends>
|
668 |
+
</allowed_currencies>
|
669 |
+
<allowspecific translate="label">
|
670 |
+
<label>Payment from applicable countries</label>
|
671 |
+
<frontend_type>allowspecific</frontend_type>
|
672 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
673 |
+
<sort_order>140</sort_order>
|
674 |
+
<show_in_default>1</show_in_default>
|
675 |
+
<show_in_website>1</show_in_website>
|
676 |
+
<show_in_store>1</show_in_store>
|
677 |
+
<depends>
|
678 |
+
<show_advanced>1</show_advanced>
|
679 |
+
</depends>
|
680 |
+
</allowspecific>
|
681 |
+
<specificcountry translate="label comment">
|
682 |
+
<label>Payment from Specific Country</label>
|
683 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
684 |
+
<frontend_type>multiselect</frontend_type>
|
685 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
686 |
+
<sort_order>150</sort_order>
|
687 |
+
<show_in_default>1</show_in_default>
|
688 |
+
<show_in_website>1</show_in_website>
|
689 |
+
<show_in_store>1</show_in_store>
|
690 |
+
<depends>
|
691 |
+
<show_advanced>1</show_advanced>
|
692 |
+
<allowspecific>1</allowspecific>
|
693 |
+
</depends>
|
694 |
+
</specificcountry>
|
695 |
+
<limit_by_ip translate="label comment">
|
696 |
+
<label>Display only for selected IP's</label>
|
697 |
+
<comment>Show method only to Magento set IP's.</comment>
|
698 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
699 |
+
<frontend_type>select</frontend_type>
|
700 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
701 |
+
<sort_order>160</sort_order>
|
702 |
+
<show_in_default>1</show_in_default>
|
703 |
+
<show_in_website>1</show_in_website>
|
704 |
+
<show_in_store>1</show_in_store>
|
705 |
+
<depends>
|
706 |
+
<show_advanced>1</show_advanced>
|
707 |
+
</depends>
|
708 |
+
</limit_by_ip>
|
709 |
+
</fields>
|
710 |
+
</buckaroo3extended_paymentguarantee>
|
711 |
+
<buckaroo3extended_afterpay translate="label">
|
712 |
+
<label>Afterpay</label>
|
713 |
+
<sort_order>5001</sort_order>
|
714 |
+
<show_in_default>1</show_in_default>
|
715 |
+
<show_in_website>1</show_in_website>
|
716 |
+
<show_in_store>1</show_in_store>
|
717 |
+
<fields>
|
718 |
+
<active translate="label comment">
|
719 |
+
<label>Enabled</label>
|
720 |
+
<comment>Enable or disable this payment method.</comment>
|
721 |
+
<frontend_type>select</frontend_type>
|
722 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
723 |
+
<sort_order>10</sort_order>
|
724 |
+
<show_in_default>1</show_in_default>
|
725 |
+
<show_in_website>1</show_in_website>
|
726 |
+
<show_in_store>1</show_in_store>
|
727 |
+
</active>
|
728 |
+
<mode translate="label comment">
|
729 |
+
<label>Payment modus</label>
|
730 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
731 |
+
<frontend_type>select</frontend_type>
|
732 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
733 |
+
<sort_order>20</sort_order>
|
734 |
+
<show_in_default>1</show_in_default>
|
735 |
+
<show_in_website>1</show_in_website>
|
736 |
+
<show_in_store>1</show_in_store>
|
737 |
+
</mode>
|
738 |
+
<title translate="label comment">
|
739 |
+
<label>Frontend label</label>
|
740 |
+
<comment>Determines the frontend label shown.</comment>
|
741 |
+
<frontend_type>text</frontend_type>
|
742 |
+
<sort_order>30</sort_order>
|
743 |
+
<show_in_default>1</show_in_default>
|
744 |
+
<show_in_website>1</show_in_website>
|
745 |
+
<show_in_store>1</show_in_store>
|
746 |
+
</title>
|
747 |
+
<sort_order translate="label comment">
|
748 |
+
<label>Frontend sort order</label>
|
749 |
+
<comment>Determines the sorting of payment methods.</comment>
|
750 |
+
<frontend_type>text</frontend_type>
|
751 |
+
<sort_order>45</sort_order>
|
752 |
+
<show_in_default>1</show_in_default>
|
753 |
+
<show_in_website>1</show_in_website>
|
754 |
+
<show_in_store>1</show_in_store>
|
755 |
+
</sort_order>
|
756 |
+
<paymethod translate="label comment">
|
757 |
+
<label>Afterpay payment method</label>
|
758 |
+
<comment>Select which paymethod must be used at Afterpay</comment>
|
759 |
+
<frontend_type>select</frontend_type>
|
760 |
+
<source_model>buckaroo3extended/sources_acceptgiroDirectdebit</source_model>
|
761 |
+
<sort_order>46</sort_order>
|
762 |
+
<show_in_default>1</show_in_default>
|
763 |
+
<show_in_website>1</show_in_website>
|
764 |
+
<show_in_store>1</show_in_store>
|
765 |
+
</paymethod>
|
766 |
+
<business translate="label comment">
|
767 |
+
<label>Set Business</label>
|
768 |
+
<comment>When B2B is selected, some additional fields are required for the customer to fill in.</comment>
|
769 |
+
<frontend_type>select</frontend_type>
|
770 |
+
<source_model>buckaroo3extended/sources_businessToBusiness</source_model>
|
771 |
+
<sort_order>47</sort_order>
|
772 |
+
<show_in_default>1</show_in_default>
|
773 |
+
<show_in_website>1</show_in_website>
|
774 |
+
<show_in_store>1</show_in_store>
|
775 |
+
<depends>
|
776 |
+
<paymethod>afterpaydigiaccept</paymethod>
|
777 |
+
</depends>
|
778 |
+
</business>
|
779 |
+
<high translate="label comment tooltip">
|
780 |
+
<label>High VAT tax classes</label>
|
781 |
+
<comment>Select which tax classes count as 'high' VAT</comment>
|
782 |
+
<frontend_type>multiselect</frontend_type>
|
783 |
+
<source_model>buckaroo3extended/sources_taxClasses</source_model>
|
784 |
+
<sort_order>48</sort_order>
|
785 |
+
<show_in_default>1</show_in_default>
|
786 |
+
<show_in_website>1</show_in_website>
|
787 |
+
<show_in_store>1</show_in_store>
|
788 |
+
</high>
|
789 |
+
<middle translate="label comment tooltip">
|
790 |
+
<label>Middle VAT tax classes</label>
|
791 |
+
<comment>Select which tax classes count as 'middle' VAT</comment>
|
792 |
+
<frontend_type>multiselect</frontend_type>
|
793 |
+
<source_model>buckaroo3extended/sources_taxClasses</source_model>
|
794 |
+
<sort_order>49</sort_order>
|
795 |
+
<show_in_default>1</show_in_default>
|
796 |
+
<show_in_website>1</show_in_website>
|
797 |
+
<show_in_store>1</show_in_store>
|
798 |
+
</middle>
|
799 |
+
<low translate="label comment tooltip">
|
800 |
+
<label>Low VAT tax classes</label>
|
801 |
+
<comment>Select which tax classes count as 'low' VAT</comment>
|
802 |
+
<frontend_type>multiselect</frontend_type>
|
803 |
+
<source_model>buckaroo3extended/sources_taxClasses</source_model>
|
804 |
+
<sort_order>50</sort_order>
|
805 |
+
<show_in_default>1</show_in_default>
|
806 |
+
<show_in_website>1</show_in_website>
|
807 |
+
<show_in_store>1</show_in_store>
|
808 |
+
</low>
|
809 |
+
<zero translate="label comment tooltip">
|
810 |
+
<label>Zero VAT tax classes</label>
|
811 |
+
<comment>Select which tax classes count as 'zero' VAT</comment>
|
812 |
+
<frontend_type>multiselect</frontend_type>
|
813 |
+
<source_model>buckaroo3extended/sources_taxClasses</source_model>
|
814 |
+
<sort_order>51</sort_order>
|
815 |
+
<show_in_default>1</show_in_default>
|
816 |
+
<show_in_website>1</show_in_website>
|
817 |
+
<show_in_store>1</show_in_store>
|
818 |
+
</zero>
|
819 |
+
<no translate="label comment tooltip">
|
820 |
+
<label>No VAT tax classes</label>
|
821 |
+
<comment>Select which tax classes count as 'no' VAT</comment>
|
822 |
+
<frontend_type>multiselect</frontend_type>
|
823 |
+
<source_model>buckaroo3extended/sources_taxClasses</source_model>
|
824 |
+
<sort_order>52</sort_order>
|
825 |
+
<show_in_default>1</show_in_default>
|
826 |
+
<show_in_website>1</show_in_website>
|
827 |
+
<show_in_store>1</show_in_store>
|
828 |
+
</no>
|
829 |
+
<sendmail translate="label comment tooltip">
|
830 |
+
<label>Send payment email</label>
|
831 |
+
<comment>Buckaroo sends an email to the customer with the payment procedures.</comment>
|
832 |
+
<tooltip>Set to 'No' leaves the customer uninformed on the payment obligations.</tooltip>
|
833 |
+
<frontend_type>select</frontend_type>
|
834 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
835 |
+
<sort_order>80</sort_order>
|
836 |
+
<show_in_default>1</show_in_default>
|
837 |
+
<show_in_website>1</show_in_website>
|
838 |
+
<show_in_store>1</show_in_store>
|
839 |
+
<validate>buckaroo3extended_paymentguarantee_advanced</validate>
|
840 |
+
</sendmail>
|
841 |
+
<order_email translate="label comment">
|
842 |
+
<label>Send order confirmation email</label>
|
843 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
844 |
+
<frontend_type>select</frontend_type>
|
845 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
846 |
+
<sort_order>45</sort_order>
|
847 |
+
<show_in_default>1</show_in_default>
|
848 |
+
<show_in_website>1</show_in_website>
|
849 |
+
<show_in_store>1</show_in_store>
|
850 |
+
</order_email>
|
851 |
+
<show_advanced translate="label comment">
|
852 |
+
<comment>Enable or disable advanced options.</comment>
|
853 |
+
<frontend_type>select</frontend_type>
|
854 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
855 |
+
<sort_order>100</sort_order>
|
856 |
+
<show_in_default>1</show_in_default>
|
857 |
+
<show_in_website>1</show_in_website>
|
858 |
+
<show_in_store>1</show_in_store>
|
859 |
+
</show_advanced>
|
860 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
861 |
+
<label>Fee</label>
|
862 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
863 |
+
<frontend_type>text</frontend_type>
|
864 |
+
<sort_order>101</sort_order>
|
865 |
+
<show_in_default>1</show_in_default>
|
866 |
+
<show_in_website>1</show_in_website>
|
867 |
+
<show_in_store>1</show_in_store>
|
868 |
+
<validate>validate-not-negative-number</validate>
|
869 |
+
<depends>
|
870 |
+
<show_advanced>1</show_advanced>
|
871 |
+
</depends>
|
872 |
+
</payment_fee>
|
873 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
874 |
+
<label>Fee label</label>
|
875 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
876 |
+
<frontend_type>text</frontend_type>
|
877 |
+
<sort_order>102</sort_order>
|
878 |
+
<show_in_default>1</show_in_default>
|
879 |
+
<show_in_website>1</show_in_website>
|
880 |
+
<show_in_store>1</show_in_store>
|
881 |
+
<validate>required-entry</validate>
|
882 |
+
<depends>
|
883 |
+
<show_advanced>1</show_advanced>
|
884 |
+
</depends>
|
885 |
+
</payment_fee_label>
|
886 |
+
<active_status translate="label comment">
|
887 |
+
<label>Method specific status enabled</label>
|
888 |
+
<comment>Enable or disable specific status.</comment>
|
889 |
+
<frontend_type>select</frontend_type>
|
890 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
891 |
+
<sort_order>110</sort_order>
|
892 |
+
<show_in_default>1</show_in_default>
|
893 |
+
<show_in_website>1</show_in_website>
|
894 |
+
<show_in_store>1</show_in_store>
|
895 |
+
<depends>
|
896 |
+
<show_advanced>1</show_advanced>
|
897 |
+
</depends>
|
898 |
+
</active_status>
|
899 |
+
<order_status_success translate="label comment tooltip">
|
900 |
+
<label>Method specific success status</label>
|
901 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
902 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
903 |
+
<frontend_type>select</frontend_type>
|
904 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
905 |
+
<sort_order>111</sort_order>
|
906 |
+
<show_in_default>1</show_in_default>
|
907 |
+
<show_in_website>1</show_in_website>
|
908 |
+
<show_in_store>1</show_in_store>
|
909 |
+
<validate>buckaroo3extended_afterpay_advanced</validate>
|
910 |
+
<depends>
|
911 |
+
<show_advanced>1</show_advanced>
|
912 |
+
<active_status>1</active_status>
|
913 |
+
</depends>
|
914 |
+
</order_status_success>
|
915 |
+
<order_status_failed translate="label comment tooltip">
|
916 |
+
<label>Method specific failed status</label>
|
917 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
918 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
919 |
+
<frontend_type>select</frontend_type>
|
920 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
921 |
+
<sort_order>112</sort_order>
|
922 |
+
<show_in_default>1</show_in_default>
|
923 |
+
<show_in_website>1</show_in_website>
|
924 |
+
<show_in_store>1</show_in_store>
|
925 |
+
<validate>buckaroo3extended_afterpay_advanced</validate>
|
926 |
+
<depends>
|
927 |
+
<show_advanced>1</show_advanced>
|
928 |
+
<active_status>1</active_status>
|
929 |
+
</depends>
|
930 |
+
</order_status_failed>
|
931 |
+
<max_amount translate="label comment tooltip">
|
932 |
+
<label>Max order amount (in Base Currency)</label>
|
933 |
+
<comment>Maximum order amount allowed.</comment>
|
934 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
935 |
+
<frontend_type>text</frontend_type>
|
936 |
+
<sort_order>113</sort_order>
|
937 |
+
<show_in_default>1</show_in_default>
|
938 |
+
<show_in_website>1</show_in_website>
|
939 |
+
<show_in_store>1</show_in_store>
|
940 |
+
<depends>
|
941 |
+
<show_advanced>1</show_advanced>
|
942 |
+
</depends>
|
943 |
+
</max_amount>
|
944 |
+
<min_amount translate="label comment tooltip">
|
945 |
+
<label>Min order amount (in Base Currency)</label>
|
946 |
+
<comment>Minimum order amount allowed.</comment>
|
947 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
948 |
+
<frontend_type>text</frontend_type>
|
949 |
+
<sort_order>114</sort_order>
|
950 |
+
<show_in_default>1</show_in_default>
|
951 |
+
<show_in_website>1</show_in_website>
|
952 |
+
<show_in_store>1</show_in_store>
|
953 |
+
<depends>
|
954 |
+
<show_advanced>1</show_advanced>
|
955 |
+
</depends>
|
956 |
+
</min_amount>
|
957 |
+
<allowed_currencies translate="label comment tooltip">
|
958 |
+
<label>Allowed currencies</label>
|
959 |
+
<comment>Select payment method specific currencies.</comment>
|
960 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
961 |
+
<frontend_type>multiselect</frontend_type>
|
962 |
+
<source_model>buckaroo3extended/sources_afterpay_availableCurrencies</source_model>
|
963 |
+
<sort_order>130</sort_order>
|
964 |
+
<show_in_default>1</show_in_default>
|
965 |
+
<show_in_website>1</show_in_website>
|
966 |
+
<show_in_store>1</show_in_store>
|
967 |
+
<validate>buckaroo3extended_afterpay_advanced</validate>
|
968 |
+
<depends>
|
969 |
+
<show_advanced>1</show_advanced>
|
970 |
+
</depends>
|
971 |
+
</allowed_currencies>
|
972 |
+
<allowspecific translate="label">
|
973 |
+
<label>Payment from applicable countries</label>
|
974 |
+
<frontend_type>allowspecific</frontend_type>
|
975 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
976 |
+
<sort_order>140</sort_order>
|
977 |
+
<show_in_default>1</show_in_default>
|
978 |
+
<show_in_website>1</show_in_website>
|
979 |
+
<show_in_store>1</show_in_store>
|
980 |
+
<depends>
|
981 |
+
<show_advanced>1</show_advanced>
|
982 |
+
</depends>
|
983 |
+
</allowspecific>
|
984 |
+
<specificcountry translate="label comment">
|
985 |
+
<label>Payment from Specific Country</label>
|
986 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
987 |
+
<frontend_type>multiselect</frontend_type>
|
988 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
989 |
+
<sort_order>150</sort_order>
|
990 |
+
<show_in_default>1</show_in_default>
|
991 |
+
<show_in_website>1</show_in_website>
|
992 |
+
<show_in_store>1</show_in_store>
|
993 |
+
<depends>
|
994 |
+
<show_advanced>1</show_advanced>
|
995 |
+
<allowspecific>1</allowspecific>
|
996 |
+
</depends>
|
997 |
+
</specificcountry>
|
998 |
+
<limit_by_ip translate="label comment">
|
999 |
+
<label>Display only for selected IP's</label>
|
1000 |
+
<comment>Show method only to Magento set IP's.</comment>
|
1001 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
1002 |
+
<frontend_type>select</frontend_type>
|
1003 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1004 |
+
<sort_order>160</sort_order>
|
1005 |
+
<show_in_default>1</show_in_default>
|
1006 |
+
<show_in_website>1</show_in_website>
|
1007 |
+
<show_in_store>1</show_in_store>
|
1008 |
+
<depends>
|
1009 |
+
<show_advanced>1</show_advanced>
|
1010 |
+
</depends>
|
1011 |
+
</limit_by_ip>
|
1012 |
+
</fields>
|
1013 |
+
</buckaroo3extended_afterpay>
|
1014 |
+
<buckaroo3extended_amex translate="label">
|
1015 |
+
<label>American Express</label>
|
1016 |
+
<sort_order>6000</sort_order>
|
1017 |
+
<show_in_default>1</show_in_default>
|
1018 |
+
<show_in_website>1</show_in_website>
|
1019 |
+
<show_in_store>1</show_in_store>
|
1020 |
+
<fields>
|
1021 |
+
<active translate="label comment">
|
1022 |
+
<label>Enabled</label>
|
1023 |
+
<comment>Enable or disable this payment method.</comment>
|
1024 |
+
<frontend_type>select</frontend_type>
|
1025 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1026 |
+
<sort_order>10</sort_order>
|
1027 |
+
<show_in_default>1</show_in_default>
|
1028 |
+
<show_in_website>1</show_in_website>
|
1029 |
+
<show_in_store>1</show_in_store>
|
1030 |
+
</active>
|
1031 |
+
<mode translate="label comment">
|
1032 |
+
<label>Payment modus</label>
|
1033 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
1034 |
+
<frontend_type>select</frontend_type>
|
1035 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
1036 |
+
<sort_order>20</sort_order>
|
1037 |
+
<show_in_default>1</show_in_default>
|
1038 |
+
<show_in_website>1</show_in_website>
|
1039 |
+
<show_in_store>1</show_in_store>
|
1040 |
+
</mode>
|
1041 |
+
<title translate="label comment">
|
1042 |
+
<label>Frontend label</label>
|
1043 |
+
<comment>Determines the frontend label shown.</comment>
|
1044 |
+
<frontend_type>text</frontend_type>
|
1045 |
+
<sort_order>30</sort_order>
|
1046 |
+
<show_in_default>1</show_in_default>
|
1047 |
+
<show_in_website>1</show_in_website>
|
1048 |
+
<show_in_store>1</show_in_store>
|
1049 |
+
</title>
|
1050 |
+
<sort_order translate="label comment">
|
1051 |
+
<label>Frontend sort order</label>
|
1052 |
+
<comment>Determines the sorting of payment methods.</comment>
|
1053 |
+
<frontend_type>text</frontend_type>
|
1054 |
+
<sort_order>40</sort_order>
|
1055 |
+
<show_in_default>1</show_in_default>
|
1056 |
+
<show_in_website>1</show_in_website>
|
1057 |
+
<show_in_store>1</show_in_store>
|
1058 |
+
</sort_order>
|
1059 |
+
<order_email translate="label comment">
|
1060 |
+
<label>Send order confirmation email</label>
|
1061 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
1062 |
+
<frontend_type>select</frontend_type>
|
1063 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1064 |
+
<sort_order>45</sort_order>
|
1065 |
+
<show_in_default>1</show_in_default>
|
1066 |
+
<show_in_website>1</show_in_website>
|
1067 |
+
<show_in_store>1</show_in_store>
|
1068 |
+
</order_email>
|
1069 |
+
<address_verification translate="label comment">
|
1070 |
+
<label>Verfiy address</label>
|
1071 |
+
<comment>Set true to verify the address at American Express. Set false to disable address verification</comment>
|
1072 |
+
<frontend_type>select</frontend_type>
|
1073 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1074 |
+
<sort_order>46</sort_order>
|
1075 |
+
<show_in_default>1</show_in_default>
|
1076 |
+
<show_in_website>1</show_in_website>
|
1077 |
+
<show_in_store>1</show_in_store>
|
1078 |
+
</address_verification>
|
1079 |
+
<show_advanced translate="label comment">
|
1080 |
+
<comment>Enable or disable advanced options.</comment>
|
1081 |
+
<frontend_type>select</frontend_type>
|
1082 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1083 |
+
<sort_order>50</sort_order>
|
1084 |
+
<show_in_default>1</show_in_default>
|
1085 |
+
<show_in_website>1</show_in_website>
|
1086 |
+
<show_in_store>1</show_in_store>
|
1087 |
+
</show_advanced>
|
1088 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
1089 |
+
<label>Fee</label>
|
1090 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
1091 |
+
<frontend_type>text</frontend_type>
|
1092 |
+
<sort_order>51</sort_order>
|
1093 |
+
<show_in_default>1</show_in_default>
|
1094 |
+
<show_in_website>1</show_in_website>
|
1095 |
+
<show_in_store>1</show_in_store>
|
1096 |
+
<validate>validate-not-negative-number</validate>
|
1097 |
+
<depends>
|
1098 |
+
<show_advanced>1</show_advanced>
|
1099 |
+
</depends>
|
1100 |
+
</payment_fee>
|
1101 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
1102 |
+
<label>Fee label</label>
|
1103 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
1104 |
+
<frontend_type>text</frontend_type>
|
1105 |
+
<sort_order>52</sort_order>
|
1106 |
+
<show_in_default>1</show_in_default>
|
1107 |
+
<show_in_website>1</show_in_website>
|
1108 |
+
<show_in_store>1</show_in_store>
|
1109 |
+
<validate>required-entry</validate>
|
1110 |
+
<depends>
|
1111 |
+
<show_advanced>1</show_advanced>
|
1112 |
+
</depends>
|
1113 |
+
</payment_fee_label>
|
1114 |
+
<max_amount translate="label comment tooltip">
|
1115 |
+
<label>Max order amount (in Base Currency)</label>
|
1116 |
+
<comment>Maximum order amount allowed.</comment>
|
1117 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
1118 |
+
<frontend_type>text</frontend_type>
|
1119 |
+
<sort_order>54</sort_order>
|
1120 |
+
<show_in_default>1</show_in_default>
|
1121 |
+
<show_in_website>1</show_in_website>
|
1122 |
+
<show_in_store>1</show_in_store>
|
1123 |
+
<depends>
|
1124 |
+
<show_advanced>1</show_advanced>
|
1125 |
+
</depends>
|
1126 |
+
</max_amount>
|
1127 |
+
<min_amount translate="label comment tooltip">
|
1128 |
+
<label>Min order amount (in Base Currency)</label>
|
1129 |
+
<comment>Minimum order amount allowed.</comment>
|
1130 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
1131 |
+
<frontend_type>text</frontend_type>
|
1132 |
+
<sort_order>55</sort_order>
|
1133 |
+
<show_in_default>1</show_in_default>
|
1134 |
+
<show_in_website>1</show_in_website>
|
1135 |
+
<show_in_store>1</show_in_store>
|
1136 |
+
<depends>
|
1137 |
+
<show_advanced>1</show_advanced>
|
1138 |
+
</depends>
|
1139 |
+
</min_amount>
|
1140 |
+
<active_status translate="label comment">
|
1141 |
+
<label>Method specific status enabled</label>
|
1142 |
+
<comment>Enable or disable specific status.</comment>
|
1143 |
+
<frontend_type>select</frontend_type>
|
1144 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1145 |
+
<sort_order>60</sort_order>
|
1146 |
+
<show_in_default>1</show_in_default>
|
1147 |
+
<show_in_website>1</show_in_website>
|
1148 |
+
<show_in_store>1</show_in_store>
|
1149 |
+
<depends>
|
1150 |
+
<show_advanced>1</show_advanced>
|
1151 |
+
</depends>
|
1152 |
+
</active_status>
|
1153 |
+
<order_status_success translate="label comment tooltip">
|
1154 |
+
<label>Method specific success status</label>
|
1155 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1156 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1157 |
+
<frontend_type>select</frontend_type>
|
1158 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1159 |
+
<sort_order>61</sort_order>
|
1160 |
+
<show_in_default>1</show_in_default>
|
1161 |
+
<show_in_website>1</show_in_website>
|
1162 |
+
<show_in_store>1</show_in_store>
|
1163 |
+
<validate>buckaroo3extended_amex_advanced</validate>
|
1164 |
+
<depends>
|
1165 |
+
<show_advanced>1</show_advanced>
|
1166 |
+
<active_status>1</active_status>
|
1167 |
+
</depends>
|
1168 |
+
</order_status_success>
|
1169 |
+
<order_status_failed translate="label comment tooltip">
|
1170 |
+
<label>Method specific failed status</label>
|
1171 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
1172 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1173 |
+
<frontend_type>select</frontend_type>
|
1174 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
1175 |
+
<sort_order>62</sort_order>
|
1176 |
+
<show_in_default>1</show_in_default>
|
1177 |
+
<show_in_website>1</show_in_website>
|
1178 |
+
<show_in_store>1</show_in_store>
|
1179 |
+
<validate>buckaroo3extended_amex_advanced</validate>
|
1180 |
+
<depends>
|
1181 |
+
<show_advanced>1</show_advanced>
|
1182 |
+
<active_status>1</active_status>
|
1183 |
+
</depends>
|
1184 |
+
</order_status_failed>
|
1185 |
+
<allowed_currencies translate="label comment tooltip">
|
1186 |
+
<label>Allowed currencies</label>
|
1187 |
+
<comment>Select payment method specific currencies.</comment>
|
1188 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
1189 |
+
<frontend_type>multiselect</frontend_type>
|
1190 |
+
<source_model>buckaroo3extended/sources_amex_availableCurrencies</source_model>
|
1191 |
+
<sort_order>80</sort_order>
|
1192 |
+
<show_in_default>1</show_in_default>
|
1193 |
+
<show_in_website>1</show_in_website>
|
1194 |
+
<show_in_store>1</show_in_store>
|
1195 |
+
<validate>buckaroo3extended_amex_advanced</validate>
|
1196 |
+
<depends>
|
1197 |
+
<show_advanced>1</show_advanced>
|
1198 |
+
</depends>
|
1199 |
+
</allowed_currencies>
|
1200 |
+
<allowspecific translate="label">
|
1201 |
+
<label>Payment from applicable countries</label>
|
1202 |
+
<frontend_type>allowspecific</frontend_type>
|
1203 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
1204 |
+
<sort_order>90</sort_order>
|
1205 |
+
<show_in_default>1</show_in_default>
|
1206 |
+
<show_in_website>1</show_in_website>
|
1207 |
+
<show_in_store>1</show_in_store>
|
1208 |
+
<depends>
|
1209 |
+
<show_advanced>1</show_advanced>
|
1210 |
+
</depends>
|
1211 |
+
</allowspecific>
|
1212 |
+
<specificcountry translate="label comment">
|
1213 |
+
<label>Payment from Specific Country</label>
|
1214 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
1215 |
+
<frontend_type>multiselect</frontend_type>
|
1216 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
1217 |
+
<sort_order>100</sort_order>
|
1218 |
+
<show_in_default>1</show_in_default>
|
1219 |
+
<show_in_website>1</show_in_website>
|
1220 |
+
<show_in_store>1</show_in_store>
|
1221 |
+
<depends>
|
1222 |
+
<show_advanced>1</show_advanced>
|
1223 |
+
<allowspecific>1</allowspecific>
|
1224 |
+
</depends>
|
1225 |
+
</specificcountry>
|
1226 |
+
<limit_by_ip translate="label comment tooltip">
|
1227 |
+
<label>Display only for selected IP's</label>
|
1228 |
+
<comment>Show method only to Magento set IP's.</comment>
|
1229 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
1230 |
+
<frontend_type>select</frontend_type>
|
1231 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1232 |
+
<sort_order>110</sort_order>
|
1233 |
+
<show_in_default>1</show_in_default>
|
1234 |
+
<show_in_website>1</show_in_website>
|
1235 |
+
<show_in_store>1</show_in_store>
|
1236 |
+
<depends>
|
1237 |
+
<show_advanced>1</show_advanced>
|
1238 |
+
</depends>
|
1239 |
+
</limit_by_ip>
|
1240 |
+
</fields>
|
1241 |
+
</buckaroo3extended_amex>
|
1242 |
+
<buckaroo3extended_mastercard translate="label">
|
1243 |
+
<label>MasterCard</label>
|
1244 |
+
<sort_order>7000</sort_order>
|
1245 |
+
<show_in_default>1</show_in_default>
|
1246 |
+
<show_in_website>1</show_in_website>
|
1247 |
+
<show_in_store>1</show_in_store>
|
1248 |
+
<fields>
|
1249 |
+
<active translate="label comment">
|
1250 |
+
<label>Enabled</label>
|
1251 |
+
<comment>Enable or disable this payment method.</comment>
|
1252 |
+
<frontend_type>select</frontend_type>
|
1253 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1254 |
+
<sort_order>10</sort_order>
|
1255 |
+
<show_in_default>1</show_in_default>
|
1256 |
+
<show_in_website>1</show_in_website>
|
1257 |
+
<show_in_store>1</show_in_store>
|
1258 |
+
</active>
|
1259 |
+
<mode translate="label comment">
|
1260 |
+
<label>Payment modus</label>
|
1261 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
1262 |
+
<frontend_type>select</frontend_type>
|
1263 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
1264 |
+
<sort_order>20</sort_order>
|
1265 |
+
<show_in_default>1</show_in_default>
|
1266 |
+
<show_in_website>1</show_in_website>
|
1267 |
+
<show_in_store>1</show_in_store>
|
1268 |
+
</mode>
|
1269 |
+
<title translate="label comment">
|
1270 |
+
<label>Frontend label</label>
|
1271 |
+
<comment>Determines the frontend label shown.</comment>
|
1272 |
+
<frontend_type>text</frontend_type>
|
1273 |
+
<sort_order>30</sort_order>
|
1274 |
+
<show_in_default>1</show_in_default>
|
1275 |
+
<show_in_website>1</show_in_website>
|
1276 |
+
<show_in_store>1</show_in_store>
|
1277 |
+
</title>
|
1278 |
+
<sort_order translate="label comment">
|
1279 |
+
<label>Frontend sort order</label>
|
1280 |
+
<comment>Determines the sorting of payment methods.</comment>
|
1281 |
+
<frontend_type>text</frontend_type>
|
1282 |
+
<sort_order>40</sort_order>
|
1283 |
+
<show_in_default>1</show_in_default>
|
1284 |
+
<show_in_website>1</show_in_website>
|
1285 |
+
<show_in_store>1</show_in_store>
|
1286 |
+
</sort_order>
|
1287 |
+
<unsecure_status_processing translate="label comment tooltip">
|
1288 |
+
<label>No SecureCode order status</label>
|
1289 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1290 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1291 |
+
<frontend_type>select</frontend_type>
|
1292 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1293 |
+
<sort_order>41</sort_order>
|
1294 |
+
<show_in_default>1</show_in_default>
|
1295 |
+
<show_in_website>1</show_in_website>
|
1296 |
+
<show_in_store>1</show_in_store>
|
1297 |
+
</unsecure_status_processing>
|
1298 |
+
<unsecure_hold translate="label comment tooltip">
|
1299 |
+
<label>Set no SecureCode orders onhold</label>
|
1300 |
+
<comment>Hold orders which have no MasterCard SecureCode.</comment>
|
1301 |
+
<frontend_type>select</frontend_type>
|
1302 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1303 |
+
<sort_order>42</sort_order>
|
1304 |
+
<show_in_default>1</show_in_default>
|
1305 |
+
<show_in_website>1</show_in_website>
|
1306 |
+
<show_in_store>1</show_in_store>
|
1307 |
+
</unsecure_hold>
|
1308 |
+
<order_email translate="label comment">
|
1309 |
+
<label>Send order confirmation email</label>
|
1310 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
1311 |
+
<frontend_type>select</frontend_type>
|
1312 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1313 |
+
<sort_order>44</sort_order>
|
1314 |
+
<show_in_default>1</show_in_default>
|
1315 |
+
<show_in_website>1</show_in_website>
|
1316 |
+
<show_in_store>1</show_in_store>
|
1317 |
+
</order_email>
|
1318 |
+
<show_advanced translate="label comment">
|
1319 |
+
<comment>Enable or disable advanced options.</comment>
|
1320 |
+
<frontend_type>select</frontend_type>
|
1321 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1322 |
+
<sort_order>45</sort_order>
|
1323 |
+
<show_in_default>1</show_in_default>
|
1324 |
+
<show_in_website>1</show_in_website>
|
1325 |
+
<show_in_store>1</show_in_store>
|
1326 |
+
</show_advanced>
|
1327 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
1328 |
+
<label>Fee</label>
|
1329 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
1330 |
+
<frontend_type>text</frontend_type>
|
1331 |
+
<sort_order>46</sort_order>
|
1332 |
+
<show_in_default>1</show_in_default>
|
1333 |
+
<show_in_website>1</show_in_website>
|
1334 |
+
<show_in_store>1</show_in_store>
|
1335 |
+
<validate>validate-not-negative-number</validate>
|
1336 |
+
<depends>
|
1337 |
+
<show_advanced>1</show_advanced>
|
1338 |
+
</depends>
|
1339 |
+
</payment_fee>
|
1340 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
1341 |
+
<label>Fee label</label>
|
1342 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
1343 |
+
<frontend_type>text</frontend_type>
|
1344 |
+
<sort_order>47</sort_order>
|
1345 |
+
<show_in_default>1</show_in_default>
|
1346 |
+
<show_in_website>1</show_in_website>
|
1347 |
+
<show_in_store>1</show_in_store>
|
1348 |
+
<validate>required-entry</validate>
|
1349 |
+
<depends>
|
1350 |
+
<show_advanced>1</show_advanced>
|
1351 |
+
</depends>
|
1352 |
+
</payment_fee_label>
|
1353 |
+
<max_amount translate="label comment tooltip">
|
1354 |
+
<label>Max order amount (in Base Currency)</label>
|
1355 |
+
<comment>Maximum order amount allowed.</comment>
|
1356 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
1357 |
+
<frontend_type>text</frontend_type>
|
1358 |
+
<sort_order>53</sort_order>
|
1359 |
+
<show_in_default>1</show_in_default>
|
1360 |
+
<show_in_website>1</show_in_website>
|
1361 |
+
<show_in_store>1</show_in_store>
|
1362 |
+
<depends>
|
1363 |
+
<show_advanced>1</show_advanced>
|
1364 |
+
</depends>
|
1365 |
+
</max_amount>
|
1366 |
+
<min_amount translate="label comment tooltip">
|
1367 |
+
<label>Min order amount (in Base Currency)</label>
|
1368 |
+
<comment>Minimum order amount allowed.</comment>
|
1369 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
1370 |
+
<frontend_type>text</frontend_type>
|
1371 |
+
<sort_order>54</sort_order>
|
1372 |
+
<show_in_default>1</show_in_default>
|
1373 |
+
<show_in_website>1</show_in_website>
|
1374 |
+
<show_in_store>1</show_in_store>
|
1375 |
+
<depends>
|
1376 |
+
<show_advanced>1</show_advanced>
|
1377 |
+
</depends>
|
1378 |
+
</min_amount>
|
1379 |
+
<active_status translate="label comment">
|
1380 |
+
<label>Method specific status enabled</label>
|
1381 |
+
<comment>Enable or disable specific status.</comment>
|
1382 |
+
<frontend_type>select</frontend_type>
|
1383 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1384 |
+
<sort_order>60</sort_order>
|
1385 |
+
<show_in_default>1</show_in_default>
|
1386 |
+
<show_in_website>1</show_in_website>
|
1387 |
+
<show_in_store>1</show_in_store>
|
1388 |
+
<depends>
|
1389 |
+
<show_advanced>1</show_advanced>
|
1390 |
+
</depends>
|
1391 |
+
</active_status>
|
1392 |
+
<secure_status_processing translate="label comment tooltip">
|
1393 |
+
<label>Method specific SecureCode success status</label>
|
1394 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1395 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1396 |
+
<frontend_type>select</frontend_type>
|
1397 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1398 |
+
<sort_order>61</sort_order>
|
1399 |
+
<show_in_default>1</show_in_default>
|
1400 |
+
<show_in_website>1</show_in_website>
|
1401 |
+
<show_in_store>1</show_in_store>
|
1402 |
+
<depends>
|
1403 |
+
<show_advanced>1</show_advanced>
|
1404 |
+
<active_status>1</active_status>
|
1405 |
+
</depends>
|
1406 |
+
</secure_status_processing>
|
1407 |
+
<order_status_failed translate="label comment tooltip">
|
1408 |
+
<label>Method specific failed status</label>
|
1409 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
1410 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1411 |
+
<frontend_type>select</frontend_type>
|
1412 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
1413 |
+
<sort_order>62</sort_order>
|
1414 |
+
<show_in_default>1</show_in_default>
|
1415 |
+
<show_in_website>1</show_in_website>
|
1416 |
+
<show_in_store>1</show_in_store>
|
1417 |
+
<validate>buckaroo3extended_mastercard_advanced</validate>
|
1418 |
+
<depends>
|
1419 |
+
<show_advanced>1</show_advanced>
|
1420 |
+
<active_status>1</active_status>
|
1421 |
+
</depends>
|
1422 |
+
</order_status_failed>
|
1423 |
+
<allowed_currencies translate="label comment tooltip">
|
1424 |
+
<label>Allowed currencies</label>
|
1425 |
+
<comment>Select payment method specific currencies.</comment>
|
1426 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
1427 |
+
<frontend_type>multiselect</frontend_type>
|
1428 |
+
<source_model>buckaroo3extended/sources_mastercard_availableCurrencies</source_model>
|
1429 |
+
<sort_order>80</sort_order>
|
1430 |
+
<show_in_default>1</show_in_default>
|
1431 |
+
<show_in_website>1</show_in_website>
|
1432 |
+
<show_in_store>1</show_in_store>
|
1433 |
+
<validate>buckaroo3extended_mastercard_advanced</validate>
|
1434 |
+
<depends>
|
1435 |
+
<show_advanced>1</show_advanced>
|
1436 |
+
</depends>
|
1437 |
+
</allowed_currencies>
|
1438 |
+
<allowspecific translate="label">
|
1439 |
+
<label>Payment from applicable countries</label>
|
1440 |
+
<frontend_type>allowspecific</frontend_type>
|
1441 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
1442 |
+
<sort_order>90</sort_order>
|
1443 |
+
<show_in_default>1</show_in_default>
|
1444 |
+
<show_in_website>1</show_in_website>
|
1445 |
+
<show_in_store>1</show_in_store>
|
1446 |
+
<depends>
|
1447 |
+
<show_advanced>1</show_advanced>
|
1448 |
+
</depends>
|
1449 |
+
</allowspecific>
|
1450 |
+
<specificcountry translate="label comment">
|
1451 |
+
<label>Payment from Specific Country</label>
|
1452 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
1453 |
+
<frontend_type>multiselect</frontend_type>
|
1454 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
1455 |
+
<sort_order>100</sort_order>
|
1456 |
+
<show_in_default>1</show_in_default>
|
1457 |
+
<show_in_website>1</show_in_website>
|
1458 |
+
<show_in_store>1</show_in_store>
|
1459 |
+
<depends>
|
1460 |
+
<show_advanced>1</show_advanced>
|
1461 |
+
<allowspecific>1</allowspecific>
|
1462 |
+
</depends>
|
1463 |
+
</specificcountry>
|
1464 |
+
<limit_by_ip translate="label comment tooltip">
|
1465 |
+
<label>Display only for selected IP's</label>
|
1466 |
+
<comment>Show method only to Magento set IP's.</comment>
|
1467 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
1468 |
+
<frontend_type>select</frontend_type>
|
1469 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1470 |
+
<sort_order>110</sort_order>
|
1471 |
+
<show_in_default>1</show_in_default>
|
1472 |
+
<show_in_website>1</show_in_website>
|
1473 |
+
<show_in_store>1</show_in_store>
|
1474 |
+
<depends>
|
1475 |
+
<show_advanced>1</show_advanced>
|
1476 |
+
</depends>
|
1477 |
+
</limit_by_ip>
|
1478 |
+
</fields>
|
1479 |
+
</buckaroo3extended_mastercard>
|
1480 |
+
<buckaroo3extended_cartebancaire translate="label">
|
1481 |
+
<label>Carte Bancaire</label>
|
1482 |
+
<sort_order>7150</sort_order>
|
1483 |
+
<show_in_default>1</show_in_default>
|
1484 |
+
<show_in_website>1</show_in_website>
|
1485 |
+
<show_in_store>1</show_in_store>
|
1486 |
+
<fields>
|
1487 |
+
<active translate="label comment">
|
1488 |
+
<label>Enabled</label>
|
1489 |
+
<comment>Enable or disable this payment method.</comment>
|
1490 |
+
<frontend_type>select</frontend_type>
|
1491 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1492 |
+
<sort_order>10</sort_order>
|
1493 |
+
<show_in_default>1</show_in_default>
|
1494 |
+
<show_in_website>1</show_in_website>
|
1495 |
+
<show_in_store>1</show_in_store>
|
1496 |
+
</active>
|
1497 |
+
<mode translate="label comment">
|
1498 |
+
<label>Payment modus</label>
|
1499 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
1500 |
+
<frontend_type>select</frontend_type>
|
1501 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
1502 |
+
<sort_order>20</sort_order>
|
1503 |
+
<show_in_default>1</show_in_default>
|
1504 |
+
<show_in_website>1</show_in_website>
|
1505 |
+
<show_in_store>1</show_in_store>
|
1506 |
+
</mode>
|
1507 |
+
<title translate="label comment">
|
1508 |
+
<label>Frontend label</label>
|
1509 |
+
<comment>Determines the frontend label shown.</comment>
|
1510 |
+
<frontend_type>text</frontend_type>
|
1511 |
+
<sort_order>30</sort_order>
|
1512 |
+
<show_in_default>1</show_in_default>
|
1513 |
+
<show_in_website>1</show_in_website>
|
1514 |
+
<show_in_store>1</show_in_store>
|
1515 |
+
</title>
|
1516 |
+
<sort_order translate="label comment">
|
1517 |
+
<label>Frontend sort order</label>
|
1518 |
+
<comment>Determines the sorting of payment methods.</comment>
|
1519 |
+
<frontend_type>text</frontend_type>
|
1520 |
+
<sort_order>40</sort_order>
|
1521 |
+
<show_in_default>1</show_in_default>
|
1522 |
+
<show_in_website>1</show_in_website>
|
1523 |
+
<show_in_store>1</show_in_store>
|
1524 |
+
</sort_order>
|
1525 |
+
<unsecure_status_processing translate="label comment tooltip">
|
1526 |
+
<label>No SecureCode order status</label>
|
1527 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1528 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1529 |
+
<frontend_type>select</frontend_type>
|
1530 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1531 |
+
<sort_order>41</sort_order>
|
1532 |
+
<show_in_default>1</show_in_default>
|
1533 |
+
<show_in_website>1</show_in_website>
|
1534 |
+
<show_in_store>1</show_in_store>
|
1535 |
+
</unsecure_status_processing>
|
1536 |
+
<unsecure_hold translate="label comment tooltip">
|
1537 |
+
<label>Set no SecureCode orders onhold</label>
|
1538 |
+
<comment>Hold orders which have no Carte Bancaire SecureCode.</comment>
|
1539 |
+
<frontend_type>select</frontend_type>
|
1540 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1541 |
+
<sort_order>42</sort_order>
|
1542 |
+
<show_in_default>1</show_in_default>
|
1543 |
+
<show_in_website>1</show_in_website>
|
1544 |
+
<show_in_store>1</show_in_store>
|
1545 |
+
</unsecure_hold>
|
1546 |
+
<order_email translate="label comment">
|
1547 |
+
<label>Send order confirmation email</label>
|
1548 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
1549 |
+
<frontend_type>select</frontend_type>
|
1550 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1551 |
+
<sort_order>44</sort_order>
|
1552 |
+
<show_in_default>1</show_in_default>
|
1553 |
+
<show_in_website>1</show_in_website>
|
1554 |
+
<show_in_store>1</show_in_store>
|
1555 |
+
</order_email>
|
1556 |
+
<show_advanced translate="label comment">
|
1557 |
+
<comment>Enable or disable advanced options.</comment>
|
1558 |
+
<frontend_type>select</frontend_type>
|
1559 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1560 |
+
<sort_order>45</sort_order>
|
1561 |
+
<show_in_default>1</show_in_default>
|
1562 |
+
<show_in_website>1</show_in_website>
|
1563 |
+
<show_in_store>1</show_in_store>
|
1564 |
+
</show_advanced>
|
1565 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
1566 |
+
<label>Fee</label>
|
1567 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
1568 |
+
<frontend_type>text</frontend_type>
|
1569 |
+
<sort_order>46</sort_order>
|
1570 |
+
<show_in_default>1</show_in_default>
|
1571 |
+
<show_in_website>1</show_in_website>
|
1572 |
+
<show_in_store>1</show_in_store>
|
1573 |
+
<validate>validate-not-negative-number</validate>
|
1574 |
+
<depends>
|
1575 |
+
<show_advanced>1</show_advanced>
|
1576 |
+
</depends>
|
1577 |
+
</payment_fee>
|
1578 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
1579 |
+
<label>Fee label</label>
|
1580 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
1581 |
+
<frontend_type>text</frontend_type>
|
1582 |
+
<sort_order>47</sort_order>
|
1583 |
+
<show_in_default>1</show_in_default>
|
1584 |
+
<show_in_website>1</show_in_website>
|
1585 |
+
<show_in_store>1</show_in_store>
|
1586 |
+
<validate>required-entry</validate>
|
1587 |
+
<depends>
|
1588 |
+
<show_advanced>1</show_advanced>
|
1589 |
+
</depends>
|
1590 |
+
</payment_fee_label>
|
1591 |
+
<max_amount translate="label comment tooltip">
|
1592 |
+
<label>Max order amount (in Base Currency)</label>
|
1593 |
+
<comment>Maximum order amount allowed.</comment>
|
1594 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
1595 |
+
<frontend_type>text</frontend_type>
|
1596 |
+
<sort_order>53</sort_order>
|
1597 |
+
<show_in_default>1</show_in_default>
|
1598 |
+
<show_in_website>1</show_in_website>
|
1599 |
+
<show_in_store>1</show_in_store>
|
1600 |
+
<depends>
|
1601 |
+
<show_advanced>1</show_advanced>
|
1602 |
+
</depends>
|
1603 |
+
</max_amount>
|
1604 |
+
<min_amount translate="label comment tooltip">
|
1605 |
+
<label>Min order amount (in Base Currency)</label>
|
1606 |
+
<comment>Minimum order amount allowed.</comment>
|
1607 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
1608 |
+
<frontend_type>text</frontend_type>
|
1609 |
+
<sort_order>54</sort_order>
|
1610 |
+
<show_in_default>1</show_in_default>
|
1611 |
+
<show_in_website>1</show_in_website>
|
1612 |
+
<show_in_store>1</show_in_store>
|
1613 |
+
<depends>
|
1614 |
+
<show_advanced>1</show_advanced>
|
1615 |
+
</depends>
|
1616 |
+
</min_amount>
|
1617 |
+
<active_status translate="label comment">
|
1618 |
+
<label>Method specific status enabled</label>
|
1619 |
+
<comment>Enable or disable specific status.</comment>
|
1620 |
+
<frontend_type>select</frontend_type>
|
1621 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1622 |
+
<sort_order>60</sort_order>
|
1623 |
+
<show_in_default>1</show_in_default>
|
1624 |
+
<show_in_website>1</show_in_website>
|
1625 |
+
<show_in_store>1</show_in_store>
|
1626 |
+
<depends>
|
1627 |
+
<show_advanced>1</show_advanced>
|
1628 |
+
</depends>
|
1629 |
+
</active_status>
|
1630 |
+
<secure_status_processing translate="label comment tooltip">
|
1631 |
+
<label>Method specific SecureCode success status</label>
|
1632 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1633 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1634 |
+
<frontend_type>select</frontend_type>
|
1635 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1636 |
+
<sort_order>61</sort_order>
|
1637 |
+
<show_in_default>1</show_in_default>
|
1638 |
+
<show_in_website>1</show_in_website>
|
1639 |
+
<show_in_store>1</show_in_store>
|
1640 |
+
<depends>
|
1641 |
+
<show_advanced>1</show_advanced>
|
1642 |
+
<active_status>1</active_status>
|
1643 |
+
</depends>
|
1644 |
+
</secure_status_processing>
|
1645 |
+
<order_status_failed translate="label comment tooltip">
|
1646 |
+
<label>Method specific failed status</label>
|
1647 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
1648 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1649 |
+
<frontend_type>select</frontend_type>
|
1650 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
1651 |
+
<sort_order>62</sort_order>
|
1652 |
+
<show_in_default>1</show_in_default>
|
1653 |
+
<show_in_website>1</show_in_website>
|
1654 |
+
<show_in_store>1</show_in_store>
|
1655 |
+
<validate>buckaroo3extended_cartebancaire_advanced</validate>
|
1656 |
+
<depends>
|
1657 |
+
<show_advanced>1</show_advanced>
|
1658 |
+
<active_status>1</active_status>
|
1659 |
+
</depends>
|
1660 |
+
</order_status_failed>
|
1661 |
+
<allowed_currencies translate="label comment tooltip">
|
1662 |
+
<label>Allowed currencies</label>
|
1663 |
+
<comment>Select payment method specific currencies.</comment>
|
1664 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
1665 |
+
<frontend_type>multiselect</frontend_type>
|
1666 |
+
<source_model>buckaroo3extended/sources_cartebancaire_availableCurrencies</source_model>
|
1667 |
+
<sort_order>80</sort_order>
|
1668 |
+
<show_in_default>1</show_in_default>
|
1669 |
+
<show_in_website>1</show_in_website>
|
1670 |
+
<show_in_store>1</show_in_store>
|
1671 |
+
<validate>buckaroo3extended_cartebancaire_advanced</validate>
|
1672 |
+
<depends>
|
1673 |
+
<show_advanced>1</show_advanced>
|
1674 |
+
</depends>
|
1675 |
+
</allowed_currencies>
|
1676 |
+
<allowspecific translate="label">
|
1677 |
+
<label>Payment from applicable countries</label>
|
1678 |
+
<frontend_type>allowspecific</frontend_type>
|
1679 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
1680 |
+
<sort_order>90</sort_order>
|
1681 |
+
<show_in_default>1</show_in_default>
|
1682 |
+
<show_in_website>1</show_in_website>
|
1683 |
+
<show_in_store>1</show_in_store>
|
1684 |
+
<depends>
|
1685 |
+
<show_advanced>1</show_advanced>
|
1686 |
+
</depends>
|
1687 |
+
</allowspecific>
|
1688 |
+
<specificcountry translate="label comment">
|
1689 |
+
<label>Payment from Specific Country</label>
|
1690 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
1691 |
+
<frontend_type>multiselect</frontend_type>
|
1692 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
1693 |
+
<sort_order>100</sort_order>
|
1694 |
+
<show_in_default>1</show_in_default>
|
1695 |
+
<show_in_website>1</show_in_website>
|
1696 |
+
<show_in_store>1</show_in_store>
|
1697 |
+
<depends>
|
1698 |
+
<show_advanced>1</show_advanced>
|
1699 |
+
<allowspecific>1</allowspecific>
|
1700 |
+
</depends>
|
1701 |
+
</specificcountry>
|
1702 |
+
<limit_by_ip translate="label comment tooltip">
|
1703 |
+
<label>Display only for selected IP's</label>
|
1704 |
+
<comment>Show method only to Magento set IP's.</comment>
|
1705 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
1706 |
+
<frontend_type>select</frontend_type>
|
1707 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1708 |
+
<sort_order>110</sort_order>
|
1709 |
+
<show_in_default>1</show_in_default>
|
1710 |
+
<show_in_website>1</show_in_website>
|
1711 |
+
<show_in_store>1</show_in_store>
|
1712 |
+
<depends>
|
1713 |
+
<show_advanced>1</show_advanced>
|
1714 |
+
</depends>
|
1715 |
+
</limit_by_ip>
|
1716 |
+
</fields>
|
1717 |
+
</buckaroo3extended_cartebancaire>
|
1718 |
+
<buckaroo3extended_cartebleue translate="label">
|
1719 |
+
<label>Carte Bleue</label>
|
1720 |
+
<sort_order>7200</sort_order>
|
1721 |
+
<show_in_default>1</show_in_default>
|
1722 |
+
<show_in_website>1</show_in_website>
|
1723 |
+
<show_in_store>1</show_in_store>
|
1724 |
+
<fields>
|
1725 |
+
<active translate="label comment">
|
1726 |
+
<label>Enabled</label>
|
1727 |
+
<comment>Enable or disable this payment method.</comment>
|
1728 |
+
<frontend_type>select</frontend_type>
|
1729 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1730 |
+
<sort_order>10</sort_order>
|
1731 |
+
<show_in_default>1</show_in_default>
|
1732 |
+
<show_in_website>1</show_in_website>
|
1733 |
+
<show_in_store>1</show_in_store>
|
1734 |
+
</active>
|
1735 |
+
<mode translate="label comment">
|
1736 |
+
<label>Payment modus</label>
|
1737 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
1738 |
+
<frontend_type>select</frontend_type>
|
1739 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
1740 |
+
<sort_order>20</sort_order>
|
1741 |
+
<show_in_default>1</show_in_default>
|
1742 |
+
<show_in_website>1</show_in_website>
|
1743 |
+
<show_in_store>1</show_in_store>
|
1744 |
+
</mode>
|
1745 |
+
<title translate="label comment">
|
1746 |
+
<label>Frontend label</label>
|
1747 |
+
<comment>Determines the frontend label shown.</comment>
|
1748 |
+
<frontend_type>text</frontend_type>
|
1749 |
+
<sort_order>30</sort_order>
|
1750 |
+
<show_in_default>1</show_in_default>
|
1751 |
+
<show_in_website>1</show_in_website>
|
1752 |
+
<show_in_store>1</show_in_store>
|
1753 |
+
</title>
|
1754 |
+
<sort_order translate="label comment">
|
1755 |
+
<label>Frontend sort order</label>
|
1756 |
+
<comment>Determines the sorting of payment methods.</comment>
|
1757 |
+
<frontend_type>text</frontend_type>
|
1758 |
+
<sort_order>40</sort_order>
|
1759 |
+
<show_in_default>1</show_in_default>
|
1760 |
+
<show_in_website>1</show_in_website>
|
1761 |
+
<show_in_store>1</show_in_store>
|
1762 |
+
</sort_order>
|
1763 |
+
<unsecure_status_processing translate="label comment tooltip">
|
1764 |
+
<label>No SecureCode order status</label>
|
1765 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1766 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1767 |
+
<frontend_type>select</frontend_type>
|
1768 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1769 |
+
<sort_order>41</sort_order>
|
1770 |
+
<show_in_default>1</show_in_default>
|
1771 |
+
<show_in_website>1</show_in_website>
|
1772 |
+
<show_in_store>1</show_in_store>
|
1773 |
+
</unsecure_status_processing>
|
1774 |
+
<unsecure_hold translate="label comment tooltip">
|
1775 |
+
<label>Set no SecureCode orders onhold</label>
|
1776 |
+
<comment>Hold orders which have no Carte Bleue SecureCode.</comment>
|
1777 |
+
<frontend_type>select</frontend_type>
|
1778 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1779 |
+
<sort_order>42</sort_order>
|
1780 |
+
<show_in_default>1</show_in_default>
|
1781 |
+
<show_in_website>1</show_in_website>
|
1782 |
+
<show_in_store>1</show_in_store>
|
1783 |
+
</unsecure_hold>
|
1784 |
+
<order_email translate="label comment">
|
1785 |
+
<label>Send order confirmation email</label>
|
1786 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
1787 |
+
<frontend_type>select</frontend_type>
|
1788 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1789 |
+
<sort_order>44</sort_order>
|
1790 |
+
<show_in_default>1</show_in_default>
|
1791 |
+
<show_in_website>1</show_in_website>
|
1792 |
+
<show_in_store>1</show_in_store>
|
1793 |
+
</order_email>
|
1794 |
+
<show_advanced translate="label comment">
|
1795 |
+
<comment>Enable or disable advanced options.</comment>
|
1796 |
+
<frontend_type>select</frontend_type>
|
1797 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1798 |
+
<sort_order>45</sort_order>
|
1799 |
+
<show_in_default>1</show_in_default>
|
1800 |
+
<show_in_website>1</show_in_website>
|
1801 |
+
<show_in_store>1</show_in_store>
|
1802 |
+
</show_advanced>
|
1803 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
1804 |
+
<label>Fee</label>
|
1805 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
1806 |
+
<frontend_type>text</frontend_type>
|
1807 |
+
<sort_order>46</sort_order>
|
1808 |
+
<show_in_default>1</show_in_default>
|
1809 |
+
<show_in_website>1</show_in_website>
|
1810 |
+
<show_in_store>1</show_in_store>
|
1811 |
+
<validate>validate-not-negative-number</validate>
|
1812 |
+
<depends>
|
1813 |
+
<show_advanced>1</show_advanced>
|
1814 |
+
</depends>
|
1815 |
+
</payment_fee>
|
1816 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
1817 |
+
<label>Fee label</label>
|
1818 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
1819 |
+
<frontend_type>text</frontend_type>
|
1820 |
+
<sort_order>47</sort_order>
|
1821 |
+
<show_in_default>1</show_in_default>
|
1822 |
+
<show_in_website>1</show_in_website>
|
1823 |
+
<show_in_store>1</show_in_store>
|
1824 |
+
<validate>required-entry</validate>
|
1825 |
+
<depends>
|
1826 |
+
<show_advanced>1</show_advanced>
|
1827 |
+
</depends>
|
1828 |
+
</payment_fee_label>
|
1829 |
+
<max_amount translate="label comment tooltip">
|
1830 |
+
<label>Max order amount (in Base Currency)</label>
|
1831 |
+
<comment>Maximum order amount allowed.</comment>
|
1832 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
1833 |
+
<frontend_type>text</frontend_type>
|
1834 |
+
<sort_order>53</sort_order>
|
1835 |
+
<show_in_default>1</show_in_default>
|
1836 |
+
<show_in_website>1</show_in_website>
|
1837 |
+
<show_in_store>1</show_in_store>
|
1838 |
+
<depends>
|
1839 |
+
<show_advanced>1</show_advanced>
|
1840 |
+
</depends>
|
1841 |
+
</max_amount>
|
1842 |
+
<min_amount translate="label comment tooltip">
|
1843 |
+
<label>Min order amount (in Base Currency)</label>
|
1844 |
+
<comment>Minimum order amount allowed.</comment>
|
1845 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
1846 |
+
<frontend_type>text</frontend_type>
|
1847 |
+
<sort_order>54</sort_order>
|
1848 |
+
<show_in_default>1</show_in_default>
|
1849 |
+
<show_in_website>1</show_in_website>
|
1850 |
+
<show_in_store>1</show_in_store>
|
1851 |
+
<depends>
|
1852 |
+
<show_advanced>1</show_advanced>
|
1853 |
+
</depends>
|
1854 |
+
</min_amount>
|
1855 |
+
<active_status translate="label comment">
|
1856 |
+
<label>Method specific status enabled</label>
|
1857 |
+
<comment>Enable or disable specific status.</comment>
|
1858 |
+
<frontend_type>select</frontend_type>
|
1859 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1860 |
+
<sort_order>60</sort_order>
|
1861 |
+
<show_in_default>1</show_in_default>
|
1862 |
+
<show_in_website>1</show_in_website>
|
1863 |
+
<show_in_store>1</show_in_store>
|
1864 |
+
<depends>
|
1865 |
+
<show_advanced>1</show_advanced>
|
1866 |
+
</depends>
|
1867 |
+
</active_status>
|
1868 |
+
<secure_status_processing translate="label comment tooltip">
|
1869 |
+
<label>Method specific SecureCode success status</label>
|
1870 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
1871 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1872 |
+
<frontend_type>select</frontend_type>
|
1873 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
1874 |
+
<sort_order>61</sort_order>
|
1875 |
+
<show_in_default>1</show_in_default>
|
1876 |
+
<show_in_website>1</show_in_website>
|
1877 |
+
<show_in_store>1</show_in_store>
|
1878 |
+
<depends>
|
1879 |
+
<show_advanced>1</show_advanced>
|
1880 |
+
<active_status>1</active_status>
|
1881 |
+
</depends>
|
1882 |
+
</secure_status_processing>
|
1883 |
+
<order_status_failed translate="label comment tooltip">
|
1884 |
+
<label>Method specific failed status</label>
|
1885 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
1886 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
1887 |
+
<frontend_type>select</frontend_type>
|
1888 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
1889 |
+
<sort_order>62</sort_order>
|
1890 |
+
<show_in_default>1</show_in_default>
|
1891 |
+
<show_in_website>1</show_in_website>
|
1892 |
+
<show_in_store>1</show_in_store>
|
1893 |
+
<validate>buckaroo3extended_cartebleue_advanced</validate>
|
1894 |
+
<depends>
|
1895 |
+
<show_advanced>1</show_advanced>
|
1896 |
+
<active_status>1</active_status>
|
1897 |
+
</depends>
|
1898 |
+
</order_status_failed>
|
1899 |
+
<allowed_currencies translate="label comment tooltip">
|
1900 |
+
<label>Allowed currencies</label>
|
1901 |
+
<comment>Select payment method specific currencies.</comment>
|
1902 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
1903 |
+
<frontend_type>multiselect</frontend_type>
|
1904 |
+
<source_model>buckaroo3extended/sources_cartebleue_availableCurrencies</source_model>
|
1905 |
+
<sort_order>80</sort_order>
|
1906 |
+
<show_in_default>1</show_in_default>
|
1907 |
+
<show_in_website>1</show_in_website>
|
1908 |
+
<show_in_store>1</show_in_store>
|
1909 |
+
<validate>buckaroo3extended_cartebleue_advanced</validate>
|
1910 |
+
<depends>
|
1911 |
+
<show_advanced>1</show_advanced>
|
1912 |
+
</depends>
|
1913 |
+
</allowed_currencies>
|
1914 |
+
<allowspecific translate="label">
|
1915 |
+
<label>Payment from applicable countries</label>
|
1916 |
+
<frontend_type>allowspecific</frontend_type>
|
1917 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
1918 |
+
<sort_order>90</sort_order>
|
1919 |
+
<show_in_default>1</show_in_default>
|
1920 |
+
<show_in_website>1</show_in_website>
|
1921 |
+
<show_in_store>1</show_in_store>
|
1922 |
+
<depends>
|
1923 |
+
<show_advanced>1</show_advanced>
|
1924 |
+
</depends>
|
1925 |
+
</allowspecific>
|
1926 |
+
<specificcountry translate="label comment">
|
1927 |
+
<label>Payment from Specific Country</label>
|
1928 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
1929 |
+
<frontend_type>multiselect</frontend_type>
|
1930 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
1931 |
+
<sort_order>100</sort_order>
|
1932 |
+
<show_in_default>1</show_in_default>
|
1933 |
+
<show_in_website>1</show_in_website>
|
1934 |
+
<show_in_store>1</show_in_store>
|
1935 |
+
<depends>
|
1936 |
+
<show_advanced>1</show_advanced>
|
1937 |
+
<allowspecific>1</allowspecific>
|
1938 |
+
</depends>
|
1939 |
+
</specificcountry>
|
1940 |
+
<limit_by_ip translate="label comment tooltip">
|
1941 |
+
<label>Display only for selected IP's</label>
|
1942 |
+
<comment>Show method only to Magento set IP's.</comment>
|
1943 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
1944 |
+
<frontend_type>select</frontend_type>
|
1945 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1946 |
+
<sort_order>110</sort_order>
|
1947 |
+
<show_in_default>1</show_in_default>
|
1948 |
+
<show_in_website>1</show_in_website>
|
1949 |
+
<show_in_store>1</show_in_store>
|
1950 |
+
<depends>
|
1951 |
+
<show_advanced>1</show_advanced>
|
1952 |
+
</depends>
|
1953 |
+
</limit_by_ip>
|
1954 |
+
</fields>
|
1955 |
+
</buckaroo3extended_cartebleue>
|
1956 |
+
<buckaroo3extended_maestro translate="label">
|
1957 |
+
<label>eMaestro</label>
|
1958 |
+
<sort_order>7250</sort_order>
|
1959 |
+
<show_in_default>1</show_in_default>
|
1960 |
+
<show_in_website>1</show_in_website>
|
1961 |
+
<show_in_store>1</show_in_store>
|
1962 |
+
<fields>
|
1963 |
+
<active translate="label comment">
|
1964 |
+
<label>Enabled</label>
|
1965 |
+
<comment>Enable or disable this payment method.</comment>
|
1966 |
+
<frontend_type>select</frontend_type>
|
1967 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
1968 |
+
<sort_order>10</sort_order>
|
1969 |
+
<show_in_default>1</show_in_default>
|
1970 |
+
<show_in_website>1</show_in_website>
|
1971 |
+
<show_in_store>1</show_in_store>
|
1972 |
+
</active>
|
1973 |
+
<mode translate="label comment">
|
1974 |
+
<label>Payment modus</label>
|
1975 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
1976 |
+
<frontend_type>select</frontend_type>
|
1977 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
1978 |
+
<sort_order>20</sort_order>
|
1979 |
+
<show_in_default>1</show_in_default>
|
1980 |
+
<show_in_website>1</show_in_website>
|
1981 |
+
<show_in_store>1</show_in_store>
|
1982 |
+
</mode>
|
1983 |
+
<title translate="label comment">
|
1984 |
+
<label>Frontend label</label>
|
1985 |
+
<comment>Determines the frontend label shown.</comment>
|
1986 |
+
<frontend_type>text</frontend_type>
|
1987 |
+
<sort_order>30</sort_order>
|
1988 |
+
<show_in_default>1</show_in_default>
|
1989 |
+
<show_in_website>1</show_in_website>
|
1990 |
+
<show_in_store>1</show_in_store>
|
1991 |
+
</title>
|
1992 |
+
<sort_order translate="label comment">
|
1993 |
+
<label>Frontend sort order</label>
|
1994 |
+
<comment>Determines the sorting of payment methods.</comment>
|
1995 |
+
<frontend_type>text</frontend_type>
|
1996 |
+
<sort_order>40</sort_order>
|
1997 |
+
<show_in_default>1</show_in_default>
|
1998 |
+
<show_in_website>1</show_in_website>
|
1999 |
+
<show_in_store>1</show_in_store>
|
2000 |
+
</sort_order>
|
2001 |
+
<order_email translate="label comment">
|
2002 |
+
<label>Send order confirmation email</label>
|
2003 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
2004 |
+
<frontend_type>select</frontend_type>
|
2005 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2006 |
+
<sort_order>44</sort_order>
|
2007 |
+
<show_in_default>1</show_in_default>
|
2008 |
+
<show_in_website>1</show_in_website>
|
2009 |
+
<show_in_store>1</show_in_store>
|
2010 |
+
</order_email>
|
2011 |
+
<show_advanced translate="label comment">
|
2012 |
+
<comment>Enable or disable advanced options.</comment>
|
2013 |
+
<frontend_type>select</frontend_type>
|
2014 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2015 |
+
<sort_order>45</sort_order>
|
2016 |
+
<show_in_default>1</show_in_default>
|
2017 |
+
<show_in_website>1</show_in_website>
|
2018 |
+
<show_in_store>1</show_in_store>
|
2019 |
+
</show_advanced>
|
2020 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
2021 |
+
<label>Fee</label>
|
2022 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
2023 |
+
<frontend_type>text</frontend_type>
|
2024 |
+
<sort_order>46</sort_order>
|
2025 |
+
<show_in_default>1</show_in_default>
|
2026 |
+
<show_in_website>1</show_in_website>
|
2027 |
+
<show_in_store>1</show_in_store>
|
2028 |
+
<validate>validate-not-negative-number</validate>
|
2029 |
+
<depends>
|
2030 |
+
<show_advanced>1</show_advanced>
|
2031 |
+
</depends>
|
2032 |
+
</payment_fee>
|
2033 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
2034 |
+
<label>Fee label</label>
|
2035 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
2036 |
+
<frontend_type>text</frontend_type>
|
2037 |
+
<sort_order>47</sort_order>
|
2038 |
+
<show_in_default>1</show_in_default>
|
2039 |
+
<show_in_website>1</show_in_website>
|
2040 |
+
<show_in_store>1</show_in_store>
|
2041 |
+
<validate>required-entry</validate>
|
2042 |
+
<depends>
|
2043 |
+
<show_advanced>1</show_advanced>
|
2044 |
+
</depends>
|
2045 |
+
</payment_fee_label>
|
2046 |
+
<max_amount translate="label comment tooltip">
|
2047 |
+
<label>Max order amount (in Base Currency)</label>
|
2048 |
+
<comment>Maximum order amount allowed.</comment>
|
2049 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
2050 |
+
<frontend_type>text</frontend_type>
|
2051 |
+
<sort_order>53</sort_order>
|
2052 |
+
<show_in_default>1</show_in_default>
|
2053 |
+
<show_in_website>1</show_in_website>
|
2054 |
+
<show_in_store>1</show_in_store>
|
2055 |
+
<depends>
|
2056 |
+
<show_advanced>1</show_advanced>
|
2057 |
+
</depends>
|
2058 |
+
</max_amount>
|
2059 |
+
<min_amount translate="label comment tooltip">
|
2060 |
+
<label>Min order amount (in Base Currency)</label>
|
2061 |
+
<comment>Minimum order amount allowed.</comment>
|
2062 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
2063 |
+
<frontend_type>text</frontend_type>
|
2064 |
+
<sort_order>54</sort_order>
|
2065 |
+
<show_in_default>1</show_in_default>
|
2066 |
+
<show_in_website>1</show_in_website>
|
2067 |
+
<show_in_store>1</show_in_store>
|
2068 |
+
<depends>
|
2069 |
+
<show_advanced>1</show_advanced>
|
2070 |
+
</depends>
|
2071 |
+
</min_amount>
|
2072 |
+
<active_status translate="label comment">
|
2073 |
+
<label>Method specific status enabled</label>
|
2074 |
+
<comment>Enable or disable specific status.</comment>
|
2075 |
+
<frontend_type>select</frontend_type>
|
2076 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2077 |
+
<sort_order>60</sort_order>
|
2078 |
+
<show_in_default>1</show_in_default>
|
2079 |
+
<show_in_website>1</show_in_website>
|
2080 |
+
<show_in_store>1</show_in_store>
|
2081 |
+
<depends>
|
2082 |
+
<show_advanced>1</show_advanced>
|
2083 |
+
</depends>
|
2084 |
+
</active_status>
|
2085 |
+
<order_status_pendingpayment translate="label comment tooltip">
|
2086 |
+
<label>Method specific pending status</label>
|
2087 |
+
<comment>Leave empty to use default 'pending' status.</comment>
|
2088 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2089 |
+
<frontend_type>select</frontend_type>
|
2090 |
+
<source_model>buckaroo3extended/sources_statusesPendingPayment</source_model>
|
2091 |
+
<sort_order>61</sort_order>
|
2092 |
+
<show_in_default>1</show_in_default>
|
2093 |
+
<show_in_website>1</show_in_website>
|
2094 |
+
<show_in_store>1</show_in_store>
|
2095 |
+
<validate>buckaroo3extended_maestro_advanced</validate>
|
2096 |
+
<depends>
|
2097 |
+
<show_advanced>1</show_advanced>
|
2098 |
+
<active_status>1</active_status>
|
2099 |
+
</depends>
|
2100 |
+
</order_status_pendingpayment>
|
2101 |
+
<order_status_success translate="label comment tooltip">
|
2102 |
+
<label>Method specific success status</label>
|
2103 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
2104 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2105 |
+
<frontend_type>select</frontend_type>
|
2106 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
2107 |
+
<sort_order>62</sort_order>
|
2108 |
+
<show_in_default>1</show_in_default>
|
2109 |
+
<show_in_website>1</show_in_website>
|
2110 |
+
<show_in_store>1</show_in_store>
|
2111 |
+
<validate>buckaroo3extended_maestro_advanced</validate>
|
2112 |
+
<depends>
|
2113 |
+
<show_advanced>1</show_advanced>
|
2114 |
+
<active_status>1</active_status>
|
2115 |
+
</depends>
|
2116 |
+
</order_status_success>
|
2117 |
+
<order_status_failed translate="label comment tooltip">
|
2118 |
+
<label>Method specific failed status</label>
|
2119 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
2120 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2121 |
+
<frontend_type>select</frontend_type>
|
2122 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
2123 |
+
<sort_order>63</sort_order>
|
2124 |
+
<show_in_default>1</show_in_default>
|
2125 |
+
<show_in_website>1</show_in_website>
|
2126 |
+
<show_in_store>1</show_in_store>
|
2127 |
+
<validate>buckaroo3extended_maestro_advanced</validate>
|
2128 |
+
<depends>
|
2129 |
+
<show_advanced>1</show_advanced>
|
2130 |
+
<active_status>1</active_status>
|
2131 |
+
</depends>
|
2132 |
+
</order_status_failed>
|
2133 |
+
<allowed_currencies translate="label comment tooltip">
|
2134 |
+
<label>Allowed currencies</label>
|
2135 |
+
<comment>Select payment method specific currencies.</comment>
|
2136 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
2137 |
+
<frontend_type>multiselect</frontend_type>
|
2138 |
+
<source_model>buckaroo3extended/sources_maestro_availableCurrencies</source_model>
|
2139 |
+
<sort_order>90</sort_order>
|
2140 |
+
<show_in_default>1</show_in_default>
|
2141 |
+
<show_in_website>1</show_in_website>
|
2142 |
+
<show_in_store>1</show_in_store>
|
2143 |
+
<validate>buckaroo3extended_maestro_advanced</validate>
|
2144 |
+
<depends>
|
2145 |
+
<show_advanced>1</show_advanced>
|
2146 |
+
</depends>
|
2147 |
+
</allowed_currencies>
|
2148 |
+
<allowspecific translate="label">
|
2149 |
+
<label>Payment from applicable countries</label>
|
2150 |
+
<frontend_type>allowspecific</frontend_type>
|
2151 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
2152 |
+
<sort_order>100</sort_order>
|
2153 |
+
<show_in_default>1</show_in_default>
|
2154 |
+
<show_in_website>1</show_in_website>
|
2155 |
+
<show_in_store>1</show_in_store>
|
2156 |
+
<depends>
|
2157 |
+
<show_advanced>1</show_advanced>
|
2158 |
+
</depends>
|
2159 |
+
</allowspecific>
|
2160 |
+
<specificcountry translate="label comment">
|
2161 |
+
<label>Payment from Specific Country</label>
|
2162 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
2163 |
+
<frontend_type>multiselect</frontend_type>
|
2164 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2165 |
+
<sort_order>110</sort_order>
|
2166 |
+
<show_in_default>1</show_in_default>
|
2167 |
+
<show_in_website>1</show_in_website>
|
2168 |
+
<show_in_store>1</show_in_store>
|
2169 |
+
<depends>
|
2170 |
+
<show_advanced>1</show_advanced>
|
2171 |
+
<allowspecific>1</allowspecific>
|
2172 |
+
</depends>
|
2173 |
+
</specificcountry>
|
2174 |
+
<limit_by_ip translate="label comment tooltip">
|
2175 |
+
<label>Display only for selected IP's</label>
|
2176 |
+
<comment>Show method only to Magento set IP's.</comment>
|
2177 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
2178 |
+
<frontend_type>select</frontend_type>
|
2179 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2180 |
+
<sort_order>120</sort_order>
|
2181 |
+
<show_in_default>1</show_in_default>
|
2182 |
+
<show_in_website>1</show_in_website>
|
2183 |
+
<show_in_store>1</show_in_store>
|
2184 |
+
<depends>
|
2185 |
+
<show_advanced>1</show_advanced>
|
2186 |
+
</depends>
|
2187 |
+
</limit_by_ip>
|
2188 |
+
</fields>
|
2189 |
+
</buckaroo3extended_maestro>
|
2190 |
+
<buckaroo3extended_visa translate="label">
|
2191 |
+
<label>Visa</label>
|
2192 |
+
<sort_order>8000</sort_order>
|
2193 |
+
<show_in_default>1</show_in_default>
|
2194 |
+
<show_in_website>1</show_in_website>
|
2195 |
+
<show_in_store>1</show_in_store>
|
2196 |
+
<fields>
|
2197 |
+
<active translate="label comment">
|
2198 |
+
<label>Enabled</label>
|
2199 |
+
<comment>Enable or disable this payment method.</comment>
|
2200 |
+
<frontend_type>select</frontend_type>
|
2201 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2202 |
+
<sort_order>10</sort_order>
|
2203 |
+
<show_in_default>1</show_in_default>
|
2204 |
+
<show_in_website>1</show_in_website>
|
2205 |
+
<show_in_store>1</show_in_store>
|
2206 |
+
</active>
|
2207 |
+
<mode translate="label comment">
|
2208 |
+
<label>Payment modus</label>
|
2209 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
2210 |
+
<frontend_type>select</frontend_type>
|
2211 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
2212 |
+
<sort_order>20</sort_order>
|
2213 |
+
<show_in_default>1</show_in_default>
|
2214 |
+
<show_in_website>1</show_in_website>
|
2215 |
+
<show_in_store>1</show_in_store>
|
2216 |
+
</mode>
|
2217 |
+
<title translate="label comment">
|
2218 |
+
<label>Frontend label</label>
|
2219 |
+
<comment>Determines the frontend label shown.</comment>
|
2220 |
+
<frontend_type>text</frontend_type>
|
2221 |
+
<sort_order>30</sort_order>
|
2222 |
+
<show_in_default>1</show_in_default>
|
2223 |
+
<show_in_website>1</show_in_website>
|
2224 |
+
<show_in_store>1</show_in_store>
|
2225 |
+
</title>
|
2226 |
+
<sort_order translate="label comment">
|
2227 |
+
<label>Frontend sort order</label>
|
2228 |
+
<comment>Determines the sorting of payment methods.</comment>
|
2229 |
+
<frontend_type>text</frontend_type>
|
2230 |
+
<sort_order>40</sort_order>
|
2231 |
+
<show_in_default>1</show_in_default>
|
2232 |
+
<show_in_website>1</show_in_website>
|
2233 |
+
<show_in_store>1</show_in_store>
|
2234 |
+
</sort_order>
|
2235 |
+
<unsecure_status_processing translate="label comment tooltip">
|
2236 |
+
<label>No 3D Secure order status</label>
|
2237 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
2238 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2239 |
+
<frontend_type>select</frontend_type>
|
2240 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
2241 |
+
<sort_order>42</sort_order>
|
2242 |
+
<show_in_default>1</show_in_default>
|
2243 |
+
<show_in_website>1</show_in_website>
|
2244 |
+
<show_in_store>1</show_in_store>
|
2245 |
+
</unsecure_status_processing>
|
2246 |
+
<unsecure_hold translate="label comment tooltip">
|
2247 |
+
<label>Set no 3D Secure orders onhold</label>
|
2248 |
+
<comment>Hold orders which are not 3D Secure.</comment>
|
2249 |
+
<frontend_type>select</frontend_type>
|
2250 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2251 |
+
<sort_order>45</sort_order>
|
2252 |
+
<show_in_default>1</show_in_default>
|
2253 |
+
<show_in_website>1</show_in_website>
|
2254 |
+
<show_in_store>1</show_in_store>
|
2255 |
+
</unsecure_hold>
|
2256 |
+
<order_email translate="label comment">
|
2257 |
+
<label>Send order confirmation email</label>
|
2258 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
2259 |
+
<frontend_type>select</frontend_type>
|
2260 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2261 |
+
<sort_order>49</sort_order>
|
2262 |
+
<show_in_default>1</show_in_default>
|
2263 |
+
<show_in_website>1</show_in_website>
|
2264 |
+
<show_in_store>1</show_in_store>
|
2265 |
+
</order_email>
|
2266 |
+
<show_advanced translate="label comment">
|
2267 |
+
<comment>Enable or disable advanced options.</comment>
|
2268 |
+
<frontend_type>select</frontend_type>
|
2269 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2270 |
+
<sort_order>50</sort_order>
|
2271 |
+
<show_in_default>1</show_in_default>
|
2272 |
+
<show_in_website>1</show_in_website>
|
2273 |
+
<show_in_store>1</show_in_store>
|
2274 |
+
</show_advanced>
|
2275 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
2276 |
+
<label>Fee</label>
|
2277 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
2278 |
+
<frontend_type>text</frontend_type>
|
2279 |
+
<sort_order>51</sort_order>
|
2280 |
+
<show_in_default>1</show_in_default>
|
2281 |
+
<show_in_website>1</show_in_website>
|
2282 |
+
<show_in_store>1</show_in_store>
|
2283 |
+
<validate>validate-not-negative-number</validate>
|
2284 |
+
<depends>
|
2285 |
+
<show_advanced>1</show_advanced>
|
2286 |
+
</depends>
|
2287 |
+
</payment_fee>
|
2288 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
2289 |
+
<label>Fee label</label>
|
2290 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
2291 |
+
<frontend_type>text</frontend_type>
|
2292 |
+
<sort_order>52</sort_order>
|
2293 |
+
<show_in_default>1</show_in_default>
|
2294 |
+
<show_in_website>1</show_in_website>
|
2295 |
+
<show_in_store>1</show_in_store>
|
2296 |
+
<validate>required-entry</validate>
|
2297 |
+
<depends>
|
2298 |
+
<show_advanced>1</show_advanced>
|
2299 |
+
</depends>
|
2300 |
+
</payment_fee_label>
|
2301 |
+
<max_amount translate="label comment tooltip">
|
2302 |
+
<label>Max order amount (in Base Currency)</label>
|
2303 |
+
<comment>Maximum order amount allowed.</comment>
|
2304 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
2305 |
+
<frontend_type>text</frontend_type>
|
2306 |
+
<sort_order>63</sort_order>
|
2307 |
+
<show_in_default>1</show_in_default>
|
2308 |
+
<show_in_website>1</show_in_website>
|
2309 |
+
<show_in_store>1</show_in_store>
|
2310 |
+
<depends>
|
2311 |
+
<show_advanced>1</show_advanced>
|
2312 |
+
</depends>
|
2313 |
+
</max_amount>
|
2314 |
+
<min_amount translate="label comment tooltip">
|
2315 |
+
<label>Min order amount (in Base Currency)</label>
|
2316 |
+
<comment>Minimum order amount allowed.</comment>
|
2317 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
2318 |
+
<frontend_type>text</frontend_type>
|
2319 |
+
<sort_order>64</sort_order>
|
2320 |
+
<show_in_default>1</show_in_default>
|
2321 |
+
<show_in_website>1</show_in_website>
|
2322 |
+
<show_in_store>1</show_in_store>
|
2323 |
+
<depends>
|
2324 |
+
<show_advanced>1</show_advanced>
|
2325 |
+
</depends>
|
2326 |
+
</min_amount>
|
2327 |
+
<active_status translate="label comment">
|
2328 |
+
<label>Method specific status enabled</label>
|
2329 |
+
<comment>Enable or disable specific status.</comment>
|
2330 |
+
<frontend_type>select</frontend_type>
|
2331 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2332 |
+
<sort_order>70</sort_order>
|
2333 |
+
<show_in_default>1</show_in_default>
|
2334 |
+
<show_in_website>1</show_in_website>
|
2335 |
+
<show_in_store>1</show_in_store>
|
2336 |
+
<depends>
|
2337 |
+
<show_advanced>1</show_advanced>
|
2338 |
+
</depends>
|
2339 |
+
</active_status>
|
2340 |
+
<secure_status_processing translate="label comment tooltip">
|
2341 |
+
<label>Method specific 3D Secure success status</label>
|
2342 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
2343 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2344 |
+
<frontend_type>select</frontend_type>
|
2345 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
2346 |
+
<sort_order>71</sort_order>
|
2347 |
+
<show_in_default>1</show_in_default>
|
2348 |
+
<show_in_website>1</show_in_website>
|
2349 |
+
<show_in_store>1</show_in_store>
|
2350 |
+
<depends>
|
2351 |
+
<show_advanced>1</show_advanced>
|
2352 |
+
<active_status>1</active_status>
|
2353 |
+
</depends>
|
2354 |
+
</secure_status_processing>
|
2355 |
+
<order_status_failed translate="label comment tooltip">
|
2356 |
+
<label>Method specific failed status</label>
|
2357 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
2358 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2359 |
+
<frontend_type>select</frontend_type>
|
2360 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
2361 |
+
<sort_order>72</sort_order>
|
2362 |
+
<show_in_default>1</show_in_default>
|
2363 |
+
<show_in_website>1</show_in_website>
|
2364 |
+
<show_in_store>1</show_in_store>
|
2365 |
+
<validate>buckaroo3extended_visa_advanced</validate>
|
2366 |
+
<depends>
|
2367 |
+
<show_advanced>1</show_advanced>
|
2368 |
+
<active_status>1</active_status>
|
2369 |
+
</depends>
|
2370 |
+
</order_status_failed>
|
2371 |
+
<allowed_currencies translate="label comment tooltip">
|
2372 |
+
<label>Allowed currencies</label>
|
2373 |
+
<comment>Select payment method specific currencies.</comment>
|
2374 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
2375 |
+
<frontend_type>multiselect</frontend_type>
|
2376 |
+
<source_model>buckaroo3extended/sources_visa_availableCurrencies</source_model>
|
2377 |
+
<sort_order>80</sort_order>
|
2378 |
+
<show_in_default>1</show_in_default>
|
2379 |
+
<show_in_website>1</show_in_website>
|
2380 |
+
<show_in_store>1</show_in_store>
|
2381 |
+
<validate>buckaroo3extended_visa_advanced</validate>
|
2382 |
+
<depends>
|
2383 |
+
<show_advanced>1</show_advanced>
|
2384 |
+
</depends>
|
2385 |
+
</allowed_currencies>
|
2386 |
+
<allowspecific translate="label">
|
2387 |
+
<label>Payment from applicable countries</label>
|
2388 |
+
<frontend_type>allowspecific</frontend_type>
|
2389 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
2390 |
+
<sort_order>90</sort_order>
|
2391 |
+
<show_in_default>1</show_in_default>
|
2392 |
+
<show_in_website>1</show_in_website>
|
2393 |
+
<show_in_store>1</show_in_store>
|
2394 |
+
<depends>
|
2395 |
+
<show_advanced>1</show_advanced>
|
2396 |
+
</depends>
|
2397 |
+
</allowspecific>
|
2398 |
+
<specificcountry translate="label comment">
|
2399 |
+
<label>Payment from Specific Country</label>
|
2400 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
2401 |
+
<frontend_type>multiselect</frontend_type>
|
2402 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2403 |
+
<sort_order>100</sort_order>
|
2404 |
+
<show_in_default>1</show_in_default>
|
2405 |
+
<show_in_website>1</show_in_website>
|
2406 |
+
<show_in_store>1</show_in_store>
|
2407 |
+
<depends>
|
2408 |
+
<show_advanced>1</show_advanced>
|
2409 |
+
<allowspecific>1</allowspecific>
|
2410 |
+
</depends>
|
2411 |
+
</specificcountry>
|
2412 |
+
<limit_by_ip translate="label comment tooltip">
|
2413 |
+
<label>Display only for selected IP's</label>
|
2414 |
+
<comment>Show method only to Magento set IP's.</comment>
|
2415 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
2416 |
+
<frontend_type>select</frontend_type>
|
2417 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2418 |
+
<sort_order>110</sort_order>
|
2419 |
+
<show_in_default>1</show_in_default>
|
2420 |
+
<show_in_website>1</show_in_website>
|
2421 |
+
<show_in_store>1</show_in_store>
|
2422 |
+
<depends>
|
2423 |
+
<show_advanced>1</show_advanced>
|
2424 |
+
</depends>
|
2425 |
+
</limit_by_ip>
|
2426 |
+
</fields>
|
2427 |
+
</buckaroo3extended_visa>
|
2428 |
+
<buckaroo3extended_visaelectron translate="label">
|
2429 |
+
<label>Visa Electron</label>
|
2430 |
+
<sort_order>8250</sort_order>
|
2431 |
+
<show_in_default>1</show_in_default>
|
2432 |
+
<show_in_website>1</show_in_website>
|
2433 |
+
<show_in_store>1</show_in_store>
|
2434 |
+
<fields>
|
2435 |
+
<active translate="label comment">
|
2436 |
+
<label>Enabled</label>
|
2437 |
+
<comment>Enable or disable this payment method.</comment>
|
2438 |
+
<frontend_type>select</frontend_type>
|
2439 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2440 |
+
<sort_order>10</sort_order>
|
2441 |
+
<show_in_default>1</show_in_default>
|
2442 |
+
<show_in_website>1</show_in_website>
|
2443 |
+
<show_in_store>1</show_in_store>
|
2444 |
+
</active>
|
2445 |
+
<mode translate="label comment">
|
2446 |
+
<label>Payment modus</label>
|
2447 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
2448 |
+
<frontend_type>select</frontend_type>
|
2449 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
2450 |
+
<sort_order>20</sort_order>
|
2451 |
+
<show_in_default>1</show_in_default>
|
2452 |
+
<show_in_website>1</show_in_website>
|
2453 |
+
<show_in_store>1</show_in_store>
|
2454 |
+
</mode>
|
2455 |
+
<title translate="label comment">
|
2456 |
+
<label>Frontend label</label>
|
2457 |
+
<comment>Determines the frontend label shown.</comment>
|
2458 |
+
<frontend_type>text</frontend_type>
|
2459 |
+
<sort_order>30</sort_order>
|
2460 |
+
<show_in_default>1</show_in_default>
|
2461 |
+
<show_in_website>1</show_in_website>
|
2462 |
+
<show_in_store>1</show_in_store>
|
2463 |
+
</title>
|
2464 |
+
<sort_order translate="label comment">
|
2465 |
+
<label>Frontend sort order</label>
|
2466 |
+
<comment>Determines the sorting of payment methods.</comment>
|
2467 |
+
<frontend_type>text</frontend_type>
|
2468 |
+
<sort_order>40</sort_order>
|
2469 |
+
<show_in_default>1</show_in_default>
|
2470 |
+
<show_in_website>1</show_in_website>
|
2471 |
+
<show_in_store>1</show_in_store>
|
2472 |
+
</sort_order>
|
2473 |
+
<order_email translate="label comment">
|
2474 |
+
<label>Send order confirmation email</label>
|
2475 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
2476 |
+
<frontend_type>select</frontend_type>
|
2477 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2478 |
+
<sort_order>44</sort_order>
|
2479 |
+
<show_in_default>1</show_in_default>
|
2480 |
+
<show_in_website>1</show_in_website>
|
2481 |
+
<show_in_store>1</show_in_store>
|
2482 |
+
</order_email>
|
2483 |
+
<show_advanced translate="label comment">
|
2484 |
+
<comment>Enable or disable advanced options.</comment>
|
2485 |
+
<frontend_type>select</frontend_type>
|
2486 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2487 |
+
<sort_order>45</sort_order>
|
2488 |
+
<show_in_default>1</show_in_default>
|
2489 |
+
<show_in_website>1</show_in_website>
|
2490 |
+
<show_in_store>1</show_in_store>
|
2491 |
+
</show_advanced>
|
2492 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
2493 |
+
<label>Fee</label>
|
2494 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
2495 |
+
<frontend_type>text</frontend_type>
|
2496 |
+
<sort_order>46</sort_order>
|
2497 |
+
<show_in_default>1</show_in_default>
|
2498 |
+
<show_in_website>1</show_in_website>
|
2499 |
+
<show_in_store>1</show_in_store>
|
2500 |
+
<validate>validate-not-negative-number</validate>
|
2501 |
+
<depends>
|
2502 |
+
<show_advanced>1</show_advanced>
|
2503 |
+
</depends>
|
2504 |
+
</payment_fee>
|
2505 |
+
<payment_fee_label translate="label comment" module="buckaroo3extended">
|
2506 |
+
<label>Fee label</label>
|
2507 |
+
<comment>This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.</comment>
|
2508 |
+
<frontend_type>text</frontend_type>
|
2509 |
+
<sort_order>47</sort_order>
|
2510 |
+
<show_in_default>1</show_in_default>
|
2511 |
+
<show_in_website>1</show_in_website>
|
2512 |
+
<show_in_store>1</show_in_store>
|
2513 |
+
<validate>required-entry</validate>
|
2514 |
+
<depends>
|
2515 |
+
<show_advanced>1</show_advanced>
|
2516 |
+
</depends>
|
2517 |
+
</payment_fee_label>
|
2518 |
+
<max_amount translate="label comment tooltip">
|
2519 |
+
<label>Max order amount (in Base Currency)</label>
|
2520 |
+
<comment>Maximum order amount allowed.</comment>
|
2521 |
+
<tooltip>The payment method show only for orders with an order amount smaller then the maximum amount.</tooltip>
|
2522 |
+
<frontend_type>text</frontend_type>
|
2523 |
+
<sort_order>53</sort_order>
|
2524 |
+
<show_in_default>1</show_in_default>
|
2525 |
+
<show_in_website>1</show_in_website>
|
2526 |
+
<show_in_store>1</show_in_store>
|
2527 |
+
<depends>
|
2528 |
+
<show_advanced>1</show_advanced>
|
2529 |
+
</depends>
|
2530 |
+
</max_amount>
|
2531 |
+
<min_amount translate="label comment tooltip">
|
2532 |
+
<label>Min order amount (in Base Currency)</label>
|
2533 |
+
<comment>Minimum order amount allowed.</comment>
|
2534 |
+
<tooltip>The payment method show only for orders with an order amount greater than the minimum amount.</tooltip>
|
2535 |
+
<frontend_type>text</frontend_type>
|
2536 |
+
<sort_order>54</sort_order>
|
2537 |
+
<show_in_default>1</show_in_default>
|
2538 |
+
<show_in_website>1</show_in_website>
|
2539 |
+
<show_in_store>1</show_in_store>
|
2540 |
+
<depends>
|
2541 |
+
<show_advanced>1</show_advanced>
|
2542 |
+
</depends>
|
2543 |
+
</min_amount>
|
2544 |
+
<active_status translate="label comment">
|
2545 |
+
<label>Method specific status enabled</label>
|
2546 |
+
<comment>Enable or disable specific status.</comment>
|
2547 |
+
<frontend_type>select</frontend_type>
|
2548 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2549 |
+
<sort_order>60</sort_order>
|
2550 |
+
<show_in_default>1</show_in_default>
|
2551 |
+
<show_in_website>1</show_in_website>
|
2552 |
+
<show_in_store>1</show_in_store>
|
2553 |
+
<depends>
|
2554 |
+
<show_advanced>1</show_advanced>
|
2555 |
+
</depends>
|
2556 |
+
</active_status>
|
2557 |
+
<order_status_pendingpayment translate="label comment tooltip">
|
2558 |
+
<label>Method specific pending status</label>
|
2559 |
+
<comment>Leave empty to use default 'pending' status.</comment>
|
2560 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2561 |
+
<frontend_type>select</frontend_type>
|
2562 |
+
<source_model>buckaroo3extended/sources_statusesPendingPayment</source_model>
|
2563 |
+
<sort_order>61</sort_order>
|
2564 |
+
<show_in_default>1</show_in_default>
|
2565 |
+
<show_in_website>1</show_in_website>
|
2566 |
+
<show_in_store>1</show_in_store>
|
2567 |
+
<validate>buckaroo3extended_visaelectron_advanced</validate>
|
2568 |
+
<depends>
|
2569 |
+
<show_advanced>1</show_advanced>
|
2570 |
+
<active_status>1</active_status>
|
2571 |
+
</depends>
|
2572 |
+
</order_status_pendingpayment>
|
2573 |
+
<order_status_success translate="label comment tooltip">
|
2574 |
+
<label>Method specific success status</label>
|
2575 |
+
<comment>Leave empty to use default 'success' status.</comment>
|
2576 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2577 |
+
<frontend_type>select</frontend_type>
|
2578 |
+
<source_model>buckaroo3extended/sources_statusesSuccess</source_model>
|
2579 |
+
<sort_order>62</sort_order>
|
2580 |
+
<show_in_default>1</show_in_default>
|
2581 |
+
<show_in_website>1</show_in_website>
|
2582 |
+
<show_in_store>1</show_in_store>
|
2583 |
+
<validate>buckaroo3extended_visaelectron_advanced</validate>
|
2584 |
+
<depends>
|
2585 |
+
<show_advanced>1</show_advanced>
|
2586 |
+
<active_status>1</active_status>
|
2587 |
+
</depends>
|
2588 |
+
</order_status_success>
|
2589 |
+
<order_status_failed translate="label comment tooltip">
|
2590 |
+
<label>Method specific failed status</label>
|
2591 |
+
<comment>Leave empty to use default 'failed' status.</comment>
|
2592 |
+
<tooltip>To make a new status available it needs to be assigned to the correct state. See Magento documentation about state and status.</tooltip>
|
2593 |
+
<frontend_type>select</frontend_type>
|
2594 |
+
<source_model>buckaroo3extended/sources_statusesFailed</source_model>
|
2595 |
+
<sort_order>63</sort_order>
|
2596 |
+
<show_in_default>1</show_in_default>
|
2597 |
+
<show_in_website>1</show_in_website>
|
2598 |
+
<show_in_store>1</show_in_store>
|
2599 |
+
<validate>buckaroo3extended_visaelectron_advanced</validate>
|
2600 |
+
<depends>
|
2601 |
+
<show_advanced>1</show_advanced>
|
2602 |
+
<active_status>1</active_status>
|
2603 |
+
</depends>
|
2604 |
+
</order_status_failed>
|
2605 |
+
<allowed_currencies translate="label comment tooltip">
|
2606 |
+
<label>Allowed currencies</label>
|
2607 |
+
<comment>Select payment method specific currencies.</comment>
|
2608 |
+
<tooltip>Your contract with Buckaroo must allow for the selected currencies to be used with this payment method.</tooltip>
|
2609 |
+
<frontend_type>multiselect</frontend_type>
|
2610 |
+
<source_model>buckaroo3extended/sources_visaelectron_availableCurrencies</source_model>
|
2611 |
+
<sort_order>90</sort_order>
|
2612 |
+
<show_in_default>1</show_in_default>
|
2613 |
+
<show_in_website>1</show_in_website>
|
2614 |
+
<show_in_store>1</show_in_store>
|
2615 |
+
<validate>buckaroo3extended_visaelectron_advanced</validate>
|
2616 |
+
<depends>
|
2617 |
+
<show_advanced>1</show_advanced>
|
2618 |
+
</depends>
|
2619 |
+
</allowed_currencies>
|
2620 |
+
<allowspecific translate="label">
|
2621 |
+
<label>Payment from applicable countries</label>
|
2622 |
+
<frontend_type>allowspecific</frontend_type>
|
2623 |
+
<source_model>buckaroo3extended/sources_allspecificcountries</source_model>
|
2624 |
+
<sort_order>100</sort_order>
|
2625 |
+
<show_in_default>1</show_in_default>
|
2626 |
+
<show_in_website>1</show_in_website>
|
2627 |
+
<show_in_store>1</show_in_store>
|
2628 |
+
<depends>
|
2629 |
+
<show_advanced>1</show_advanced>
|
2630 |
+
</depends>
|
2631 |
+
</allowspecific>
|
2632 |
+
<specificcountry translate="label comment">
|
2633 |
+
<label>Payment from Specific Country</label>
|
2634 |
+
<comment>Only available when set to 'specific countries'.</comment>
|
2635 |
+
<frontend_type>multiselect</frontend_type>
|
2636 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
2637 |
+
<sort_order>110</sort_order>
|
2638 |
+
<show_in_default>1</show_in_default>
|
2639 |
+
<show_in_website>1</show_in_website>
|
2640 |
+
<show_in_store>1</show_in_store>
|
2641 |
+
<depends>
|
2642 |
+
<show_advanced>1</show_advanced>
|
2643 |
+
<allowspecific >1</allowspecific>
|
2644 |
+
</depends>
|
2645 |
+
</specificcountry>
|
2646 |
+
<limit_by_ip translate="label comment tooltip">
|
2647 |
+
<label>Display only for selected IP's</label>
|
2648 |
+
<comment>Show method only to Magento set IP's.</comment>
|
2649 |
+
<tooltip>Magento developer client restrictions.</tooltip>
|
2650 |
+
<frontend_type>select</frontend_type>
|
2651 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2652 |
+
<sort_order>120</sort_order>
|
2653 |
+
<show_in_default>1</show_in_default>
|
2654 |
+
<show_in_website>1</show_in_website>
|
2655 |
+
<show_in_store>1</show_in_store>
|
2656 |
+
<depends>
|
2657 |
+
<show_advanced>1</show_advanced>
|
2658 |
+
</depends>
|
2659 |
+
</limit_by_ip>
|
2660 |
+
</fields>
|
2661 |
+
</buckaroo3extended_visaelectron>
|
2662 |
+
<buckaroo3extended_vpay translate="label">
|
2663 |
+
<label>V PAY</label>
|
2664 |
+
<sort_order>8500</sort_order>
|
2665 |
+
<show_in_default>1</show_in_default>
|
2666 |
+
<show_in_website>1</show_in_website>
|
2667 |
+
<show_in_store>1</show_in_store>
|
2668 |
+
<fields>
|
2669 |
+
<active translate="label comment">
|
2670 |
+
<label>Enabled</label>
|
2671 |
+
<comment>Enable or disable this payment method.</comment>
|
2672 |
+
<frontend_type>select</frontend_type>
|
2673 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2674 |
+
<sort_order>10</sort_order>
|
2675 |
+
<show_in_default>1</show_in_default>
|
2676 |
+
<show_in_website>1</show_in_website>
|
2677 |
+
<show_in_store>1</show_in_store>
|
2678 |
+
</active>
|
2679 |
+
<mode translate="label comment">
|
2680 |
+
<label>Payment modus</label>
|
2681 |
+
<comment>! Test transactions are registered in Payment plaza !</comment>
|
2682 |
+
<frontend_type>select</frontend_type>
|
2683 |
+
<source_model>buckaroo3extended/sources_testLive</source_model>
|
2684 |
+
<sort_order>20</sort_order>
|
2685 |
+
<show_in_default>1</show_in_default>
|
2686 |
+
<show_in_website>1</show_in_website>
|
2687 |
+
<show_in_store>1</show_in_store>
|
2688 |
+
</mode>
|
2689 |
+
<title translate="label comment">
|
2690 |
+
<label>Frontend label</label>
|
2691 |
+
<comment>Determines the frontend label shown.</comment>
|
2692 |
+
<frontend_type>text</frontend_type>
|
2693 |
+
<sort_order>30</sort_order>
|
2694 |
+
<show_in_default>1</show_in_default>
|
2695 |
+
<show_in_website>1</show_in_website>
|
2696 |
+
<show_in_store>1</show_in_store>
|
2697 |
+
</title>
|
2698 |
+
<sort_order translate="label comment">
|
2699 |
+
<label>Frontend sort order</label>
|
2700 |
+
<comment>Determines the sorting of payment methods.</comment>
|
2701 |
+
<frontend_type>text</frontend_type>
|
2702 |
+
<sort_order>40</sort_order>
|
2703 |
+
<show_in_default>1</show_in_default>
|
2704 |
+
<show_in_website>1</show_in_website>
|
2705 |
+
<show_in_store>1</show_in_store>
|
2706 |
+
</sort_order>
|
2707 |
+
<order_email translate="label comment">
|
2708 |
+
<label>Send order confirmation email</label>
|
2709 |
+
<comment>Enable to send an order confirmation email to the customer when the payment is succesfull. Specific for this payment method.</comment>
|
2710 |
+
<frontend_type>select</frontend_type>
|
2711 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2712 |
+
<sort_order>44</sort_order>
|
2713 |
+
<show_in_default>1</show_in_default>
|
2714 |
+
<show_in_website>1</show_in_website>
|
2715 |
+
<show_in_store>1</show_in_store>
|
2716 |
+
</order_email>
|
2717 |
+
<show_advanced translate="label comment">
|
2718 |
+
<comment>Enable or disable advanced options.</comment>
|
2719 |
+
<frontend_type>select</frontend_type>
|
2720 |
+
<source_model>buckaroo3extended/sources_yesno</source_model>
|
2721 |
+
<sort_order>45</sort_order>
|
2722 |
+
<show_in_default>1</show_in_default>
|
2723 |
+
<show_in_website>1</show_in_website>
|
2724 |
+
<show_in_store>1</show_in_store>
|
2725 |
+
</show_advanced>
|
2726 |
+
<payment_fee translate="label comment" module="buckaroo3extended">
|
2727 |
+
<label>Fee</label>
|
2728 |
+
<comment>The above amount is calculated based on de Tax settings in System > Configuration > Sales > Tax.</comment>
|
2729 |
+
<frontend_type>text</frontend_type>
|
2730 |
+
<sort_order>46</sort_order>
|
2731 |
+
<show_in_default>1</show_in_default>
|
2732 |
+
<show_in_website>1</show_in_website>
|
2733 |
+
<show_in_store>1</show_in_store>
|
2734 |
+
<validate>validate-not-negative-number</validate>
|