| Total Complexity | 8 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait LaravelBitpayTrait |
||
| 11 | { |
||
| 12 | public function authenticate() |
||
| 13 | { |
||
| 14 | $this->validateAndLoadConfig(); |
||
| 15 | |||
| 16 | $this->client = BitpayClient::create()->withData( |
||
|
|
|||
| 17 | 'testnet' == $this->config['network'] ? Env::Test : Env::Prod, |
||
| 18 | $this->config['private_key'], |
||
| 19 | new Tokens( |
||
| 20 | $this->config['token'] //merchant |
||
| 21 | ), |
||
| 22 | $this->config['key_storage_password'] //used to decrypt your private key, if encrypted |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function validateAndLoadConfig() |
||
| 47 | } |
||
| 48 | } |
||
| 49 |