File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
namespace BitBag \SyliusPayUPlugin \Bridge ;
14
14
15
+ use OauthCacheFile ;
15
16
use OpenPayU_Configuration ;
16
17
use OpenPayU_Order ;
17
18
use OpenPayU_Result ;
18
19
19
20
final class OpenPayUBridge implements OpenPayUBridgeInterface
20
21
{
22
+ /*** @var string|null */
23
+ private $ cacheDir ;
24
+
25
+ public function __construct (string $ cacheDir = null )
26
+ {
27
+ $ this ->cacheDir = $ cacheDir ;
28
+ }
29
+
21
30
public function setAuthorizationData (
22
31
string $ environment ,
23
32
string $ signatureKey ,
@@ -34,6 +43,8 @@ public function setAuthorizationData(
34
43
//set Oauth Client Id and Oauth Client Secret (from merchant admin panel)
35
44
OpenPayU_Configuration::setOauthClientId ($ clientId );
36
45
OpenPayU_Configuration::setOauthClientSecret ($ clientSecret );
46
+
47
+ OpenPayU_Configuration::setOauthTokenCache (new OauthCacheFile ($ this ->cacheDir ));
37
48
}
38
49
39
50
public function create (array $ order ): ?OpenPayU_Result
Original file line number Diff line number Diff line change 4
4
<import resource =" services/**/*.xml" />
5
5
</imports >
6
6
7
+ <parameters >
8
+ <parameter key =" bitbag_open_payu_cache_dir" >%kernel.project_dir%/var/cache/%env(APP_ENV)%</parameter >
9
+ </parameters >
10
+
7
11
<services >
8
12
<defaults public =" false" autoconfigure =" false" autowire =" false" />
9
13
Original file line number Diff line number Diff line change 4
4
5
5
<defaults public =" true" autoconfigure =" false" autowire =" false" />
6
6
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 >
8
10
</services >
9
11
</container >
You can’t perform that action at this time.
0 commit comments