bestit / amazon-pay-oxid Goto Github PK
View Code? Open in Web Editor NEWAmazon Pay & Login for OXID eShop
License: MIT License
Amazon Pay & Login for OXID eShop
License: MIT License
please call parent constructor before using it, eg. bestitAmazonPay4Oxid_oxEmail::__construct()
/** * bestitAmazonPay4Oxid_oxEmail constructor. */ public function __construct() { parent::__construct(); $this->_oLogger = $this->_getContainer()->getLogger(); }
only in bestitAmazonPay4Oxid_oxViewConfig::__construct()
it´s used.
had some problems with rendering html mails in order modules ...
This line of code
contains a syntax error.
You probably want self:self::setValue
instead of self::setValue
.
Hi,
we recently found a big issue in the module in combination with OXID EE.
On amazon user creation / update the OXID user gets deleted/overwritten and gets a new oxid, wich cause a lot of internal problems.
I think the problem is in:
modules/bestit/amazonpay4oxid/ext/bestitamazonpay4oxid_oxcmp_user.php -> amazonLogin().
It seems that every oxid user that dosnt have an password gets deleted, wich would be all oxid guest users. It deletes only the actual oxuser entry not the data in all related tables, wich makes sense, to keep existing orders..., but cause troubles in other parts.
The specific problem we have, is that the OXID EE Version removes the unique key on the oxnewssubscribed table, in combination with the deletion/new creaton of the oxid user on amazon login, we have the same email multiple times in the oxnewssubscribed with different oxuserids and and newsletter subscriptions, wich can cause legal problems and could affect
business if newsletters cant be sended.
In our case we were lucky because we use an external service and only have one shop, so we readded the unique key to oxnewssubscribed, deleted the duplicate mails and imported them
correctly from the external service.
At the moment we cant fully see all effects of the user deletion/new creation and hope it dosnt cause more trouble, it would be good if you could look into that issue and maybe rework the login/user creation process.
OXID 6.1.6
Module: 3.6.8
Greetings
Oliver
In modules/bestit/amazonpay4oxid/ext/bestitamazonpay4oxid_oxorder.php::getAmazonChangePaymentLink() Line 397. Here the module try to get the sAmazonPaymentChangeLink Property. But this gives us nothing back. For example the property _sAmazonPaymentChangeLinkDESandbox does not exist.
I installed the new plugin 3.6.8 in Oxid 4.10.4 with a azure based child theme.
When clicking on confirmation button, the shops redirects to "mydomain.com/#openModalLoading", without saving the order. Browser: firefox
The problem is located in "bestitamazonpay4oxid_order_confirm_button.tpl" in line 12. So i fixed it.
Before:
window.location.href = "#openModalLoading";
After:
window.location.href = window.location.href+"#openModalLoading";
bestitAmazonCron::amazonCall()
is called by oxView::executeFunction()
(which is called \OxidEsales\Eshop\Core\Controller\BaseController
since version 6.0) which expects a new controller string as return value.
Passing true
or false
leads to a dispatch exception because there is no class named true/false.
You can trigger that exception when you click on one of the expert links in the oxid eshop backend (select an order which was payed with amazon pay and go to the amazon pay tab).
The unit test could look at the assigned view variables instead of checking the return value and and integration test would have covered that exception case.
Due to missing contribution guidelines (e.g. CLA required?) I did not provide a pull request but I think it is trivial to fix for you.
Side note: This issue is also present in module (v2.5.1) for OXID eShop 4.10.
As I mentioned there is no way to place multiple Pay with Amazon
buttons on the same page.
When the module is configured to capture automatically when orders are shipped it needs to be checked if the order's payment type is "bestitamazon".
Otherwise the internal state of every order not payed with "bestitamazon" will change to "AMZ-Error-InvalidParameterValu" because the capture fails.
A quick fix which worked for me was:
--- a/code/modules/bestit/amazonpay4oxid/application/models/bestitamazonpay4oxidclient.php
+++ b/code/modules/bestit/amazonpay4oxid/application/models/bestitamazonpay4oxidclient.php
@@ -694,6 +694,14 @@ class bestitAmazonPay4OxidClient extends bestitAmazonPay4OxidContainer
*/
public function capture($oOrder = null, $aRequestParameters = array())
{
+ if ($oOrder !== null && $aRequestParameters === []) {
+ $paymentType = $oOrder->getFieldData('oxpaymenttype');
+ if ($paymentType !== 'bestitamazon') {
+ return;
+ }
+ }
+
$oData = $this->_callOrderRequest(
'capture',
$oOrder,
Side note: This issue is also present in module (v2.5.1) for OXID eShop 4.10.
When deactivating the module (v2.5.1) in OXID eShop 4.10 an exception (oxSystemComponentException
) is thrown in bestitAmazonPay4Oxid_oxViewConfig::getSelfLink()
when calling $this->_getContainer()
.
I don't know if this issue is still relevant in OXID eShop 6.0.
A quick fix that worked for me was:
--- a/modules/bestit/amazonpay4oxid/ext/bestitamazonpay4oxid_oxviewconfig.php
+++ b/modules/bestit/amazonpay4oxid/ext/bestitamazonpay4oxid_oxviewconfig.php
@@ -127,6 +127,14 @@ class bestitAmazonPay4Oxid_oxViewConfig extends bestitAmazonPay4Oxid_oxViewConfi
*/
public function getSelfLink()
{
+ // quick fix (when module was deactivated before within the same request)
+ try {
+ $this->_getContainer();
+ }
+ catch (oxSystemComponentException $ex) {
+ return parent::getSelfLink();
+ }
+
if ((bool)$this->_getContainer()->getConfig()->getConfigParam('sSSLShopURL') === true
&& !$this->isAdmin()
&& $this->getAmazonLoginIsActive()
Excerpt from EXCEPTION_LOG.txt
:
oxSystemComponentException-oxException (time: 2018-02-07 21:50:04): [0]: EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND
Stack Trace: #0 <SHOP_BASE_DIR>\core\oxutilsobject.php(188): oxUtilsObject->_getObject('oxsystemcompone...', 0, Array)
#1 [internal function]: oxUtilsObject->oxNew('oxSystemCompone...')
#2 <SHOP_BASE_DIR>\core\oxfunctions.php(368): call_user_func_array(Array, Array)
#3 <SHOP_BASE_DIR>\core\oxutilsobject.php(178): oxNew('oxSystemCompone...')
#4 [internal function]: oxUtilsObject->oxNew('bestitAmazonPay...')
#5 <SHOP_BASE_DIR>\core\oxfunctions.php(368): call_user_func_array(Array, Array)
#6 <SHOP_BASE_DIR>\modules\bestit\amazonpay4oxid\ext\bestitamazonpay4oxid_oxviewconfig.php(42): oxNew('bestitAmazonPay...')
#7 <SHOP_BASE_DIR>\modules\bestit\amazonpay4oxid\ext\bestitamazonpay4oxid_oxviewconfig.php(132): bestitAmazonPay4Oxid_oxViewConfig->_getContainer()
#8 <SHOP_BASE_DIR>\tmp\smarty\2338d2425adbff76c2c2807c150f6147^%%16^161^161A2516%%module_main.tpl.php(102): bestitAmazonPay4Oxid_oxViewConfig->getSelfLink()
#9 <SHOP_BASE_DIR>\core\smarty\Smarty.class.php(1264): include('...')
#10 <SHOP_BASE_DIR>\core\oxshopcontrol.php(519): Smarty->fetch('module_main.tpl', 'tbclmodule_main')
#11 <SHOP_BASE_DIR>\core\oxshopcontrol.php(364): oxShopControl->_render(Object(Module_Main))
#12 <SHOP_BASE_DIR>\core\oxshopcontrol.php(126): oxShopControl->_process('module_main', 'deactivateModul...', NULL, NULL)
#13 <SHOP_BASE_DIR>\core\oxid.php(40): oxShopControl->start()
#14 <SHOP_BASE_DIR>\index.php(26): Oxid::run()
#15 <SHOP_BASE_DIR>\admin\index.php(27): require_once('...')
#16 {main}
Faulty component --> bestitamazonpay4oxidcontainer
---------------------------------------------
I have recognized the following error in V 3.6.4 / Oxid 6.2.1:
In some browsers the buy button forces a redirect to the start page instead of showing the thankyou page. I placed all return Urls in the seller central but this did not help. Safari did not work at all, other browsers worked randomly.
I think the reason is that I am using a custom theme that is still based on azure. I could not reproduce the error in flow and wave.
I finally fixed it by removing line 12 in bestitamazonpay4oxid_order_confirm_button.tpl.
window.location.href = "#openModalLoading";
I hope some kind of fix for my issue in the next version.
Regards,
Bernhard
Hi,
habe in der aktuellen Version 3.3.0 ein Problem entdeckt.
bestitamazonpay4oxid::isActive() prüft am Ende den getBruttoPrice() vom WK, durch das (int) wird aber z.b 0,54 zu 0 und die Methode gib ein "false" zurück und zeigt den Button nicht an.
Gruß
Oliver
Shop Configuration:
Scenario:
Solution:
Add the following language parameter to all return urls: &lang=[{$oViewConf->getActLanguageId()}]
Example bestitamazonpay4oxid_paybutton.tpl (line 85):
var newLocation = '[{$oViewConf->getSslSelfLink()|html_entity_decode}]'
+ 'cl=user&fnc=amazonLogin&redirectCl=user&lang=[{$oViewConf->getActLanguageId()}]'
+ '&amazonOrderReferenceId=' + amazonOrderReferenceId
+ '&access_token=' + addressConsentToken;
Hi,
with https://github.com/OXID-eSales/oxideshop_ce/tree/b-6.1.x we are getting the errors as attached below.
=========
running php version 7.1.19============
Adding unit tests from /srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests//unit/ext/*Test.php
Adding unit tests from /srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests//unit/application/controllers/*Test.php
Adding unit tests from /srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests//unit/application/models/*Test.php
Adding unit tests from /srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests//unit/application/controllers/admin/*Test.php
PHPUnit 4.8.26 by Sebastian Bergmann and contributors......................E......E.......................E.......... 63 / 145 ( 43%)
..E...................EE.....................E.....EE.E........ 126 / 145 ( 86%)
.EE........E.....EETime: 7.35 seconds, Memory: 34.00MB
There were 15 errors:
- bestitAmazonPay4OxidOxDeliverySetListTest::testGetDeliverySetData
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/ext/bestitAmazonPay4OxidOxDeliverySetListTest.php:129
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidOxOrderTest::testPreFinalizeOrder
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/ext/bestitAmazonPay4OxidOxOrderTest.php:440
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidPaymentTest::testSetPrimaryAmazonUserData
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/ext/bestitAmazonPay4OxidPaymentTest.php:339
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidAddressUtilTest::testParseAmazonAddress
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidAdressUtilTest.php:76
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidClientTest::testRefund
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidClientTest.php:1422
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidClientTest::testGetRefundDetails
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidClientTest.php:1538
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidIpnHandlerTest::testProcessIPNAction
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidIpnHandlerTest.php:164
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidLoginClientTest::testAmazonUserIdExists
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidLoginClientTest.php:267
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidLoginClientTest::testOxidUserExists
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidLoginClientTest.php:315
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidLoginClientTest::testDeleteUser
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidLoginClientTest.php:433
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidTest::testIsActive
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidTest.php:208
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidTest::testCleanAmazonPay
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/models/bestitAmazonPay4OxidTest.php:327
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidInitTest::testOnDeactivate
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/controllers/admin/bestitAmazonPay4OxidInitTest.php:422
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidMainTest::testGetRefunds
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/controllers/admin/bestitAmazonPay4OxidMainTest.php:436
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149
- bestitAmazonPay4OxidMainTest::testGetRefundsStatus
Error: Class 'MatchIgnoreWhitespace' not found/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/source/modules/bestit/amazonpay4oxid/tests/unit/application/controllers/admin/bestitAmazonPay4OxidMainTest.php:472
/srv/pool/public_html/compilation_tests_unit_EDITION_ce_label_unit/5840/vendor/oxid-esales/testing-library/library/UnitTestCase.php:149FAILURES!
Tests: 145, Assertions: 413, Errors: 15.
When a shop is located in a subfolder (mydomain.tld/myShop/), the Script calls & redirect to mydomain.tld/index.php.
Todo:
Remove the beginning slashes on these 2 lines:
Editor:
Kristian Hempel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.