File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313namespace BitBag \SyliusPayUPlugin \Bridge ;
1414
15+ use OauthCacheFile ;
1516use OpenPayU_Configuration ;
1617use OpenPayU_Order ;
1718use OpenPayU_Result ;
1819
1920final class OpenPayUBridge implements OpenPayUBridgeInterface
2021{
22+ /*** @var string|null */
23+ private $ cacheDir ;
24+
25+ public function __construct (string $ cacheDir = null )
26+ {
27+ $ this ->cacheDir = $ cacheDir ;
28+ }
29+
2130 public function setAuthorizationData (
2231 string $ environment ,
2332 string $ signatureKey ,
@@ -34,6 +43,8 @@ public function setAuthorizationData(
3443 //set Oauth Client Id and Oauth Client Secret (from merchant admin panel)
3544 OpenPayU_Configuration::setOauthClientId ($ clientId );
3645 OpenPayU_Configuration::setOauthClientSecret ($ clientSecret );
46+
47+ OpenPayU_Configuration::setOauthTokenCache (new OauthCacheFile ($ this ->cacheDir ));
3748 }
3849
3950 public function create (array $ order ): ?OpenPayU_Result
Original file line number Diff line number Diff line change 44 <import resource =" services/**/*.xml" />
55 </imports >
66
7+ <parameters >
8+ <parameter key =" bitbag_open_payu_cache_dir" >%kernel.project_dir%/var/cache/%env(APP_ENV)%</parameter >
9+ </parameters >
10+
711 <services >
812 <defaults public =" false" autoconfigure =" false" autowire =" false" />
913
Original file line number Diff line number Diff line change 44
55 <defaults public =" true" autoconfigure =" false" autowire =" false" />
66
7- <service id =" bitbag.payu_plugin.bridge.open_payu" class =" BitBag\SyliusPayUPlugin\Bridge\OpenPayUBridge" />
7+ <service id =" bitbag.payu_plugin.bridge.open_payu" class =" BitBag\SyliusPayUPlugin\Bridge\OpenPayUBridge" >
8+ <argument >%bitbag_open_payu_cache_dir%</argument >
9+ </service >
810 </services >
911</container >
You can’t perform that action at this time.
0 commit comments