Skip to content

Commit

Permalink
Merge branch 'refs/heads/b-7.0.x' into b-7.0.x-PSPAYPAL-815-merge-6.3…
Browse files Browse the repository at this point in the history
…-plus-google-pay

# Conflicts:
#	views/en/admin_translations.php
  • Loading branch information
René Gust committed Dec 16, 2024
2 parents 78d28e2 + 51d9b06 commit 16eabb4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [0007675](https://bugs.oxid-esales.com/view.php?id=7675): fix the possibility to finish order without redirect and login to Paypal
- [0007676](https://bugs.oxid-esales.com/view.php?id=7676): If we have a corrupted generated_services.yaml and try to deactivate the module via the admin, we will display a more understandable error message about what happened.
- introduce ActionHash to make the PayPal-Request-ID more unique
- use PayPal-Client v3.0.11
- use PayPal-Client v3.0.12
- [0007588](https://bugs.oxid-esales.com/view.php?id=7588): Improve Error handling for Capture Order Requests (thanks to mount7)
- remove Sofort and MyBank, Paymentmethods will soon no longer be accepted via PayPal
- fix: Refund only with note to Buyer (required)
Expand All @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fix PayPalExpress Reauth is necessary if the cart amount (total is greater than before) has changed during the checkout process
- [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
- [0007695](https://bugs.oxid-esales.com/view.php?id=7695): Fix: if DeliverySet is set in Frontend, then do not add any PseudoDeliveryCosts for PPExpress
- add possibility to ignore cached tokens. It helps e.g. for webhook registration
- [0007695](https://bugs.oxid-esales.com/view.php?id=7695): Explain better Pseudo delivery costs

### NEW
- PayPal-Request-Id based on serialized body, no extra PayPal-Request-Id necessary anymore
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"giggsey/libphonenumber-for-php": "^8.12",
"viison/address-splitter": "^0.3.4",
"webmozart/path-util": "^2.3.0",
"oxid-solution-catalysts/paypal-client": "v3.0.11"
"oxid-solution-catalysts/paypal-client": "v3.0.12"
},
"require-dev": {
"codeception/module-rest": "^3.3.0",
Expand Down
7 changes: 6 additions & 1 deletion src/Core/Onboarding/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OxidSolutionCatalysts\PayPal\Exception\OnboardingException;
use OxidSolutionCatalysts\PayPal\Service\ModuleSettings;
use OxidSolutionCatalysts\PayPal\Traits\ServiceContainer;
use OxidSolutionCatalysts\PayPalApi\Exception\ApiException;
use OxidSolutionCatalysts\PayPalApi\Service\GenericService;

class Webhook
Expand Down Expand Up @@ -127,7 +128,11 @@ public function getAllRegisteredWebhooks(): array
* @var GenericService $notificationService
*/
$webhookService = Registry::get(ServiceFactory::class)->getWebhookService();
$result = $webhookService->request('GET');
try {
$result = $webhookService->request('GET');
} catch (ApiException $e) {
$result = [];
}

return $result['webhooks'] ?? [];
}
Expand Down
7 changes: 4 additions & 3 deletions src/Core/ServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getWebhookService(string $uri = ''): GenericService
{
return oxNew(
GenericService::class,
$this->getClient(),
$this->getClient(false),
'/v1/notifications/webhooks' . $uri
);
}
Expand Down Expand Up @@ -126,7 +126,7 @@ public function getIdentityService(): IdentityService
*
* @return Client
*/
private function getClient(): Client
private function getClient(bool $useToken = true): Client
{
if ($this->client === null) {
/**
Expand All @@ -147,12 +147,13 @@ private function getClient(): Client
$paymentId = $session->getVariable('paymentid');
$actionHash = md5($sessionId . $basketId . $paymentId);

$sTokenCacheFileName = $useToken ? $config->getTokenCacheFileName() : '';
$client = new Client(
$logger,
$config->isSandbox() ? Client::SANDBOX_URL : Client::PRODUCTION_URL,
$config->getClientId(),
$config->getClientSecret(),
$config->getTokenCacheFileName(),
$sTokenCacheFileName,
$actionHash,
// must be empty. We do not have the merchant's payerid
//and confirmed by paypal we should not use it for auth and
Expand Down
3 changes: 2 additions & 1 deletion views/de/admin_translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@
'OSC_PAYPAL_STARTTIME_CLEANUP_ORDERS' => 'Startzeit für automatisches Stornieren',
'HELP_OSC_PAYPAL_STARTTIME_CLEANUP_ORDERS' => 'Wie alt müssen nicht beendete Bestellungen sein, damit sie frühestens automatisch storniert werden (in Minuten)?',
'OSC_PAYPAL_EXPRESS_SHIPPING_TITLE' => 'Pseudoversandkosten für PayPal Express',
'OSC_PAYPAL_EXPRESS_SHIPPING_DESC' => 'Die hier eingegebenen Pseudeversandkosten werden verwendet, wenn die Shopoption “Versandkosten auch dann berechnen, wenn der Kunde noch nicht eingeloggt ist” nicht aktiviert ist.',
'OSC_PAYPAL_EXPRESS_SHIPPING_DESC' => 'PayPal Express benötigt für die Autorisierung des Warenkorbbetrages Versandkosten. Wenn ein Kunde sich im Shop weder eingeloggt noch seine Versandadresse angegeben hat, kann der Shop standardmäßig noch keine Versandkosten berechen. In den Shopeinstellungen (Stammdaten > Grundeinstellungen > Reiter Einstellungen > Abschnitt weitere Einstellungen) gibt es eine Option "Versandkosten auch dann berechnen, wenn der Kunde noch nicht eingeloggt ist". Damit kann OXID versuchen die Versandkosten für die Standardfälle zu ermitteln. Wenn man diese Option nicht nutzen möchte, besteht hier als letzte Möglichkeit Pseudoversandkosten zu hinterlegen. Die sollten Ihren meißt genutzten Versandkosten am nächsten kommen. Sobald sich der Kunde im Checkout befindet und seine Lieferadresse sowie seine gewünschte Versandart dem Shop bekannt sind, werden die tatsächlichen Versandkosten berechnet. Diese überschreiben alle vorher genutzten "Hilfs-"Versandkosten.',

'OSC_PAYPAL_ORDER_MAIN_TRACKCARRIER_COUNTRY' => 'Versanddienstleister (Land)',
'OSC_PAYPAL_ORDER_MAIN_TRACKCARRIER_PROVIDER' => 'Versanddienstleister (Anbieter)',
'OSC_PAYPAL_TRACKCARRIER_GLOBAL' => 'weltweit',
Expand Down
11 changes: 6 additions & 5 deletions views/en/admin_translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@
cancel manually.',
'OSC_PAYPAL_STARTTIME_CLEANUP_ORDERS' => 'Start time for automatic cancellation',
'HELP_OSC_PAYPAL_STARTTIME_CLEANUP_ORDERS' => 'How old do not finished orders have to be before they are automatically canceled (in minutes)?',
'OSC_PAYPAL_EXPRESS_SHIPPING_TITLE' => 'Pseudo shipping costs for PayPal Express',
'OSC_PAYPAL_EXPRESS_SHIPPING_DESC' => 'The shipping costs entered here are used if the store option "Calculate default Shipping costs when User is not logged in yet” in not activated.',
'OSC_PAYPAL_EXPRESS_SHIPPING_TITLE' => 'Pseudo shipping costs for PayPal Express',
'OSC_PAYPAL_EXPRESS_SHIPPING_DESC' => 'PayPal Express requires shipping costs to authorize the shopping cart amount. If a customer has neither logged in to the shop nor provided their shipping address, the shop cannot calculate shipping costs by default. In the shop settings (Master Settings > Core Settings > Tab Settings > Section Other Settings ) there is an option "Calculate default Shipping costs when User is not logged in yet". This allows OXID to try to calculate the shipping costs for standard cases. If you do not want to use this option, the last option is to enter pseudo shipping costs. These should be as close to the shipping costs you use most often. As soon as the customer is in the checkout and their delivery address and desired shipping method are known to the shop, the actual shipping costs are calculated. These overwrite all previously used "auxiliary" shipping costs.',

'OSC_PAYPAL_ORDER_MAIN_TRACKCARRIER_COUNTRY' => 'Tracking Carrier (Country)',
'OSC_PAYPAL_ORDER_MAIN_TRACKCARRIER_PROVIDER' => 'Tracking Carrier (Provider)',
Expand All @@ -284,13 +284,14 @@
'HELP_OSC_PAYPAL_VAULTING_ACTIVATE_VAULTING' => 'Repeat purchases made easy: With PayPal you can securely store your customers preferred payment methods, making it quick and easy
Enable purchase processing. With their saved payment details, customers can make repeat purchases with just a few clicks. This can be for you
mean higher checkout conversion.',
'OSC_PAYPAL_EXPRESS_SHIPPING_TITLE' => 'Pseudo shipping costs for PayPal Express',
'OSC_PAYPAL_EXPRESS_SHIPPING_DESC' => 'The shipping costs entered here are used if the store option "Calculate default Shipping costs when User is not logged in yet” in not activated.',
'OSC_PAYPAL_GOOGLEPAY_TITLE' => 'Google Pay address',
'OSC_PAYPAL_GOOGLEPAY_ADDRESS_ACTIVATE' => 'Google Pay address active',
'HELP_OSC_OSC_PAYPAL_GOOGLEPAY_ADRESS_ACTIVATE' => 'Takeover delivery address from googlepay',

'OSC_PAYPAL_INSTALLPROCESS_FAILED' => 'Because the module was not installed correctly via Composer, errors occurred during the (de)activation of the module. Please reinstall the module via composer and repeat the process.',
'OSC_PAYPAL_INSTALLPROCESS_FAILED' => 'Because the module was not installed correctly via Composer, errors occurred during the (de)activation of the module. Please reinstall the module via composer and repeat the process.',

'OSC_PAYPAL_CUSTOM_ID_CONTENTS_TITLE' => 'PayPal custom id field contents',
'OSC_PAYPAL_CUSTOM_ID_CONTENTS_DESC' => 'PayPal custom id field will be JSON encoded string with order number, shop version and the PayPal module version.',

// PayPal Payment
'OSC_PAYPAL_PAYMENT_DEPRECATED' => 'This PayPal payment method can no longer be activated as it will be removed soon!',
Expand Down

0 comments on commit 16eabb4

Please sign in to comment.