Skip to content

Commit

Permalink
Merge pull request #337 from OXID-eSales/PSPAYPAL-838_BNCodes
Browse files Browse the repository at this point in the history
Provide BN-Codes in all places
  • Loading branch information
HonkDerHase authored Sep 9, 2024
2 parents fa2d214 + fbdbf45 commit f8462f2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.3.11] - 2024-??-??

- Provide BN codes even to previously overlooked API calls

## [1.3.10] - 2024-08-15

- [0007666](https://bugs.oxid-esales.com/view.php?id=7666): Fix: Price surcharges on the detail page for selection lists are not taken into account
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"giggsey/libphonenumber-for-php": "^8.12",
"viison/address-splitter": "^0.3.4",
"webmozart/path-util": "^2.3.0",
"oxid-solution-catalysts/paypal-client": "v1.0.10"
"oxid-solution-catalysts/paypal-client": "v1.0.11"
},
"require-dev": {
"oxid-esales/oxideshop-ce": "^v6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'en' => 'Use of the online payment service from PayPal. Documentation: <a href="https://docs.oxid-esales.com/modules/paypal-checkout/en/latest/" target="_blank">PayPal Checkout</a>'
],
'thumbnail' => 'out/img/paypal.png',
'version' => '1.3.10',
'version' => '1.3.11',
'author' => 'OXID eSales AG',
'url' => 'https://www.oxid-esales.com',
'email' => '[email protected]',
Expand Down
6 changes: 5 additions & 1 deletion src/Controller/ProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ public function approveOrder()
$service = $serviceFactory->getOrderService();

try {
$response = $service->showOrderDetails($orderId, '');
$response = $service->showOrderDetails(
$orderId,
'',
Constants::PAYPAL_PARTNER_ATTRIBUTION_ID_PPCP
);
} catch (Exception $exception) {
$logger = new PayPalLogger();
$logger->error("Error on order capture call.", [$exception]);
Expand Down
5 changes: 4 additions & 1 deletion src/Core/Webhook/EventVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ public function verify(array $headers, string $body): bool
'webhook_event' => $normalizedBody
];

$headers = [];
$headers['PayPal-Partner-Attribution-Id'] = Constants::PAYPAL_PARTNER_ATTRIBUTION_ID_PPCP;

/** @var GenericService $notificationService */
$notificationService = Registry::get(ServiceFactory::class)->getNotificationService();
$response = $notificationService->request('post', $payload);
$response = $notificationService->request('post', $payload, [], $headers);

if (
!$response['verification_status'] || (
Expand Down
7 changes: 6 additions & 1 deletion src/Core/Webhook/Handler/PaymentCaptureCompletedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace OxidSolutionCatalysts\PayPal\Core\Webhook\Handler;

use OxidEsales\EshopCommunity\Core\Registry;
use OxidSolutionCatalysts\PayPal\Core\Constants;
use OxidSolutionCatalysts\PayPal\Core\ServiceFactory;
use OxidSolutionCatalysts\PayPal\Core\Utils\PayPalLogger;
use OxidSolutionCatalysts\PayPalApi\Exception\ApiException;
Expand Down Expand Up @@ -45,7 +46,11 @@ protected function getPayPalOrderDetails(string $payPalOrderId)
try {
$apiOrder = Registry::get(ServiceFactory::class)
->getOrderService()
->showOrderDetails($payPalOrderId, '');
->showOrderDetails(
$payPalOrderId,
'',
Constants::PAYPAL_PARTNER_ATTRIBUTION_ID_PPCP
);
} catch (ApiException $exception) {
$logger = new PayPalLogger();
$logger->debug(
Expand Down
6 changes: 5 additions & 1 deletion src/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ public function getPayPalCheckoutOrder($payPalOrderId = ''): PayPalApiOrder
if (!$this->payPalApiOrder) {
/** @var Orders $orderService */
$orderService = Registry::get(ServiceFactory::class)->getOrderService();
$this->payPalApiOrder = $orderService->showOrderDetails($payPalOrderId, '');
$this->payPalApiOrder = $orderService->showOrderDetails(
$payPalOrderId,
'',
Constants::PAYPAL_PARTNER_ATTRIBUTION_ID_PPCP
);
}

return $this->payPalApiOrder;
Expand Down

0 comments on commit f8462f2

Please sign in to comment.