Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-8524] Updated to Model based PHP library version #427

Merged
merged 72 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ae6ece6
Refactored the preparation of the PaymentRequest object.
Sep 6, 2023
435b60d
Refactored the PaymentResponse object and usages.
Sep 6, 2023
27ee7d2
Refactored the DonationService to use Request and Response objects.
Sep 6, 2023
f53893f
Payment request-response cleanup
Sep 18, 2023
0203947
fixed payment method for gift cards and other minor changes
Sep 18, 2023
687d9db
Small bug fixes
Sep 20, 2023
22bbaf7
Request body fix
Sep 27, 2023
1a1f25c
Action changed from object to array
Sep 27, 2023
2573f8d
result code bug fix
Sep 27, 2023
20bbe39
change response format in the handler
Sep 27, 2023
526ad2b
payment details object updates
Oct 2, 2023
bcdc3da
finalised giftcards and donations and fixed some other bugs
Oct 6, 2023
28d2b62
changed comments
Oct 9, 2023
2f0d028
updated shopper details assignments and organised code sections
Oct 19, 2023
78c1319
Removes dummy comments
Oct 19, 2023
b946aee
Refunds and capture request/response updated
Oct 25, 2023
78e02c0
OrderService updates
Oct 25, 2023
3da66c1
OrderCancelService updates
Oct 27, 2023
41a6125
clean up
Oct 27, 2023
008d211
[ECP-8719] Fix capture, refund and notifications blocks in admin orde…
candemiralp Nov 1, 2023
19db834
[ECP-8719] Extend extra block to support Shopware 6.4
candemiralp Nov 3, 2023
351c6cc
[ECP-8719] Remove unused left-over block from prepared payment project
candemiralp Nov 3, 2023
18ac4d8
Merge remote-tracking branch 'origin/ECP-8719' into ECP-8524
Nov 3, 2023
31338c7
Capture fix (without lineItems)
Nov 8, 2023
1b944b6
lineItems format
Nov 29, 2023
24756fc
lineItems format update
Nov 29, 2023
f74e923
Revert orderApi updates
Dec 8, 2023
79d96b8
Remove lineitems from capture
Dec 8, 2023
d135890
Merged development into branch
Dec 8, 2023
7982e3b
Resolved complaints from PHP sniffer
Dec 8, 2023
d5e8b5d
Resolved a few more complaints from PHP sniffer
Dec 8, 2023
abfdd19
Frontend build update
Dec 8, 2023
f6bb428
Making PHP 7.4 compatible
Dec 8, 2023
1ab271a
Again - Making PHP 7.4 compatible
Dec 8, 2023
0c1ddf7
LineItems format update
Dec 20, 2023
e98dc35
Syntax fix
Dec 20, 2023
46930ab
Store payment methods fixes
Dec 28, 2023
536ebe9
further typecast stored payment method objects
Dec 28, 2023
fd5a350
Spaces
Dec 28, 2023
041e24b
updated payment response type in payment subscriber and filter service
Dec 29, 2023
188f2e7
updated payment methods API response
Dec 29, 2023
f17b35d
Merge branch 'develop' into ECP-8524
SushmitaThakur Feb 2, 2024
31bd2c8
Updated json serialize
Feb 2, 2024
2a75f5f
newline because the maximum length is reached.
Feb 2, 2024
d91545d
update the passed parameter type to paymentResponseHandler
Feb 5, 2024
bcac18f
cleanup
Feb 5, 2024
de0b980
Newline added
Feb 8, 2024
bb86659
Merge branch 'develop' into ECP-8524
SushmitaThakur Apr 3, 2024
18f1294
Cleanup
Apr 3, 2024
9d67bf7
Merge remote-tracking branch 'origin/ECP-8524' into ECP-8524
Apr 3, 2024
160bd4f
Cleanup
Apr 3, 2024
765db07
Removed old comment
Apr 5, 2024
e64a93d
Removed test code
Apr 5, 2024
23a9942
Resolved merge conflicts -2
Apr 17, 2024
fd5ccaa
extra lines removed
Apr 17, 2024
fb9fdfc
Merge branch 'develop' into ECP-8524
khushboo-singhvi Apr 17, 2024
4002fe4
removed duplicate method
Apr 17, 2024
006299b
Update payment-handlers.xml
khushboo-singhvi Apr 17, 2024
56dfad6
updated json encode/decodes to toArray()
Apr 17, 2024
376ee9e
Merge remote-tracking branch 'origin/ECP-8524' into ECP-8524
Apr 17, 2024
3ce6bf7
forgot one (updated json encode/decodes to toArray())
Apr 17, 2024
44f0bc6
just to check
Apr 17, 2024
e75c266
[ECP-8524] Update Adyen PHP API Library version
Apr 19, 2024
417eec0
[ECP-8524] Add missing import and use arrays while logging /payments …
Apr 19, 2024
c9ab2e2
[ECP-8524] Set response action with an array
Apr 19, 2024
2665628
[ECP-8524] Add property type declaration instead of if block, refacto…
Apr 19, 2024
f268925
Put back toArray()
Apr 19, 2024
8841c4c
[ECP-8524] Skip deprecated payment method handlers while webhook proc…
Apr 19, 2024
5822201
[ECP-8524] Use array in capture response
Apr 19, 2024
b51e952
Merge remote-tracking branch 'origin/ECP-8524' into ECP-8524
Apr 19, 2024
867d44d
[ECP-8524] Update donations endpoint
Apr 19, 2024
98c4f63
[ECP-8524] Revert method signature to support PHP7.4
Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,20 @@ public function postRefund(Request $request): JsonResponse
try {
$result = $this->refundService->refund($order, $amountInMinorUnit);
// If response does not contain pspReference
if (!array_key_exists('pspReference', $result)) {
if (empty($result->getPspReference())) {
$message = sprintf('Invalid response for refund on order %s', $order->getOrderNumber());
throw new AdyenException($message);
}

$statesToSearch = RefundService::REFUNDABLE_STATES;
$orderTransaction = $this->refundService->getAdyenOrderTransactionForRefund($order, $statesToSearch);
$adyenRefund = $this->adyenRefundRepository
->getRefundForOrderByPspReference($orderTransaction->getId(), $result['pspReference']);
->getRefundForOrderByPspReference($orderTransaction->getId(), $result->getPspReference());

if (is_null($adyenRefund)) {
$this->refundService->insertAdyenRefund(
$order,
$result['pspReference'],
$result->getPspReference(),
RefundEntity::SOURCE_SHOPWARE,
RefundEntity::STATUS_PENDING_WEBHOOK,
$amountInMinorUnit
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/StoreApi/Payment/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

namespace Adyen\Shopware\Controller\StoreApi\Payment;

use Adyen\Model\Checkout\PaymentDetailsRequest;
use Adyen\Service\Validator\CheckoutStateDataValidator;
use Adyen\Shopware\Exception\PaymentFailedException;
use Adyen\Shopware\Handlers\PaymentResponseHandler;
Expand Down Expand Up @@ -179,7 +180,8 @@ public function __construct(
*/
public function getPaymentMethods(SalesChannelContext $context): JsonResponse
{
return new JsonResponse($this->paymentMethodsService->getPaymentMethods($context));
$paymentMethodsResponse = $this->paymentMethodsService->getPaymentMethods($context);
return new JsonResponse($this->paymentMethodsService->getPaymentMethodsArray($paymentMethodsResponse));
}

/**
Expand Down Expand Up @@ -225,7 +227,7 @@ public function postPaymentDetails(

try {
$result = $this->paymentDetailsService->getPaymentDetails(
$stateData,
new PaymentDetailsRequest($stateData),
$paymentResponse->getOrderTransaction()
);
} catch (PaymentFailedException $exception) {
Expand Down
Loading
Loading