File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class Candy
2626 protected $ token = null ;
2727 protected $ driver ;
2828 protected $ logger ;
29+ protected $ currency ;
2930
3031 public function __construct ($ app , $ driver = 'guzzle ' )
3132 {
@@ -85,7 +86,7 @@ public function init($url, array $config = [])
8586 $ this ->locale = $ config ['locale ' ] ?? $ this ->locale ;
8687 $ this ->channel = $ config ['channel ' ] ?? $ this ->channel ;
8788 $ this ->debug = $ config ['debug ' ] ?? false ;
88-
89+ $ this -> currency = $ config [ ' currency ' ] ?? null ;
8990 $ this ->client = new Client ([
9091 'base_uri ' => $ this ->getUri (),
9192 ]);
@@ -106,6 +107,11 @@ public function getChannel()
106107 return $ this ->channel ;
107108 }
108109
110+ public function getCurrency ()
111+ {
112+ return $ this ->currency ;
113+ }
114+
109115 public function getLocale ()
110116 {
111117 return $ this ->locale ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ protected function getDefaultHeaders($force = false)
3030 'accept ' => 'application/json ' ,
3131 'Content-Type ' => 'application/json ' ,
3232 'X-CANDYAPI ' => 'TRUE ' ,
33+ 'X-CANDY-CURRENCY ' => CandyClient::getCurrency (),
3334 'X-CANDY-CHANNEL ' => CandyClient::getChannel (),
3435 'Accept-Language ' => $ this ->app ->getLocale (),
3536 ];
You can’t perform that action at this time.
0 commit comments