plentymarkets / plentymarkets-shopware-connector

plentymarkets shopware connector plugin
http://www.plentymarkets.eu/shopware/
MIT License
30 stars 51 forks source link

Amazon Payment Callback isn't working #525

Closed bvogel closed 5 years ago

bvogel commented 5 years ago
Q A
issue or Enhancement issue
Version b940d029442bb86dd7efc1c0399dffe6959c22a8

Actual Behavior

Every Payment will issue a POST to the Plenty Amazon Payment Plugin, additionally that fails. I'm aware that at https://github.com/plentymarkets/plentymarkets-shopware-connector/blob/46de788860a7ff218e8bb55b060176fe107cf887/Components/AmazonPay/Plentymarkets/HandleAmazonPayPaymentCommandHandler.php#L72 a sanity check is in place, still every payment will result in a POST.

Expected Behavior

Only Amazon Payments should invoke the POST and it should succeed

Steps to Reproduce

Add an order with the current BestIT Amazon Plugin and add the AmazonPayPlugin to Plenty, have an open URL to call amazon-shopware-connect (which won't work if the shop is disabled as one would expect if you have a shopware shop - doh). watch the connector log which will show:

[2019-10-25 13:57:04] plentyconnector.ERROR: Command failed: TransferObjectCommand {"adapterName":"PlentymarketsAdapter","objectType":"Payment","commandType":"handle","priority":70,"payload":"46511838-abe8-4589-92ba-2ddf0a58fbe9","exception":"[object] (PlentymarketsAdapter\\Client\\Exception\\InvalidResponseException(code: 0): The response was null. Method: POST, Path: amazon-shopware-connect, options: {\"key\":\"SOME_KEY\",\"order_reference_id\":\"0G95083031447590P\",\"order_id\":\"1530275\"}\n at /var/www/clients/client1/web13/web/custom/plugins/PlentyConnector/Adapter/PlentymarketsAdapter/Client/Exception/InvalidResponseException.php:21)"} {"uid":"8bcd0c9"}

Possible Solutions

using a curl call with the same data will result in a success message:

$ curl --data '{"key":"SOME_KEY","order_reference_id":"0G95083031447590P","order_id":"1530275"}' -H "Content-Type: application/json" https://www.plenty-reverse-retail.de/amazon-shopware-connect
    {"success":true}
bvogel commented 5 years ago

Upon further investigation, the mentioned order_id isn't payed by amazon, still it will trigger the POST. However the order payed by amazon does not show up in the log and will not register a payment in plenty.

bvogel commented 5 years ago

The order which was payed by amazon will not receive an plenty_identity record for the Plenty side and will be constantly processed (every 5 minutes):

[2019-10-25 15:51:14] plentyconnector.DEBUG: Command enqueued {"adapterName":"PlentymarketsAdapter","objectType":"Payment","commandType":"handle","transferObject":"76c75a9d-8242-4d89-95d1-7f8a3ce4de5b"} {"uid":"9a607b4"}
[2019-10-25 15:51:14] plentyconnector.DEBUG: Command received: TransferObjectCommand {"adapterName":"PlentymarketsAdapter","objectType":"Payment","commandType":"handle","priority":70,"payload":"76c75a9d-8242-4d89-95d1-7f8a3ce4de5b"} {"uid":"9d701a8"}
[2019-10-25 15:51:15] plentyconnector.DEBUG: Command processed: TransferObjectCommand {"adapterName":"PlentymarketsAdapter","objectType":"Payment","commandType":"handle","priority":70,"payload":"76c75a9d-8242-4d89-95d1-7f8a3ce4de5b"} {"uid":"9d701a8"}
bvogel commented 5 years ago

May have been fixed through ab09540e697fa175a6a332503e508e30f5b96fb2