-
Notifications
You must be signed in to change notification settings - Fork 18
/
Stripe.php
45 lines (36 loc) · 878 Bytes
/
Stripe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* @copyright Copyright Victor Demin, 2014
* @license https://github.com/ruskid/yii2-stripe/LICENSE
* @link https://github.com/ruskid/yii2-stripe#readme
*/
namespace ruskid\stripe;
use yii\base\Exception;
/**
* Yii stripe component.
*
* @author Victor Demin <demmbox@gmail.com>
*/
class Stripe extends \yii\base\Component {
/**
* @see Stripe
* @var string Stripe's public key
*/
public $publicKey;
/**
* @see Stripe
* @var string Stripe's private key
*/
public $privateKey;
/**
* @see Init extension default
*/
public function init() {
if (!$this->publicKey) {
throw new Exception("Stripe's public key is not set.");
} elseif (!$this->privateKey) {
throw new Exception("Stripe's private key is not set.");
}
parent::init();
}
}