-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UNZER-522 [Oxid 7] Refactor ApplePay credentials handling
- Loading branch information
Daniil Tkachev
committed
Nov 15, 2024
1 parent
d6e2ba6
commit 5610ed3
Showing
7 changed files
with
287 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/Service/ModuleConfiguration/AppleMerchantCertificate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidSolutionCatalysts\Unzer\Service\ModuleConfiguration; | ||
|
||
use OxidSolutionCatalysts\Unzer\Service\ModuleSettings; | ||
|
||
class AppleMerchantCertificate | ||
{ | ||
private ModuleSettings $moduleSettings; | ||
|
||
public function __construct(ModuleSettings $moduleSettings) | ||
{ | ||
$this->moduleSettings = $moduleSettings; | ||
} | ||
public function saveCertificate(?string $certificate): bool | ||
{ | ||
if (is_null($certificate)) { | ||
return false; | ||
} | ||
|
||
return (bool) file_put_contents( | ||
$this->moduleSettings->getApplePayMerchantCertFilePath(), | ||
$certificate | ||
); | ||
} | ||
public function saveCertificateKey(?string $certificateKey): bool | ||
{ | ||
if (is_null($certificateKey)) { | ||
return false; | ||
} | ||
|
||
return (bool) file_put_contents( | ||
$this->moduleSettings->getApplePayMerchantCertKeyFilePath(), | ||
$certificateKey | ||
); | ||
} | ||
} |
Oops, something went wrong.