|
1
|
|
|
<?php namespace Arcanedev\Stripe\Resources; |
|
2
|
|
|
|
|
3
|
|
|
use Arcanedev\Stripe\Contracts\Resources\Token as TokenContract; |
|
4
|
|
|
use Arcanedev\Stripe\StripeResource; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Class Token |
|
8
|
|
|
* |
|
9
|
|
|
* @package Arcanedev\Stripe\Resources |
|
10
|
|
|
* @author ARCANEDEV <[email protected]> |
|
11
|
|
|
* @link https://stripe.com/docs/api/php#token_object |
|
12
|
|
|
* |
|
13
|
|
|
* @property string id |
|
14
|
|
|
* @property string object // 'token' |
|
15
|
|
|
* @property \Arcanedev\Stripe\Resources\BankAccount bank_account |
|
16
|
|
|
* @property \Arcanedev\Stripe\Resources\Card card |
|
17
|
|
|
* @property string client_ip |
|
18
|
|
|
* @property int created // timestamp |
|
19
|
|
|
* @property bool livemode |
|
20
|
|
|
* @property string type // 'card' or 'bank_account' |
|
21
|
|
|
* @property bool used |
|
22
|
|
|
*/ |
|
23
|
|
|
class Token extends StripeResource implements TokenContract |
|
24
|
|
|
{ |
|
25
|
|
|
/* ------------------------------------------------------------------------------------------------ |
|
26
|
|
|
| Main Functions |
|
27
|
|
|
| ------------------------------------------------------------------------------------------------ |
|
28
|
|
|
*/ |
|
29
|
|
|
/** |
|
30
|
|
|
* Retrieve a Token. |
|
31
|
|
|
* @link https://stripe.com/docs/api/php#retrieve_token |
|
32
|
|
|
* |
|
33
|
|
|
* @param string $id |
|
34
|
|
|
* @param array|string|null $options |
|
35
|
|
|
* |
|
36
|
|
|
* @return self |
|
37
|
|
|
*/ |
|
38
|
2 |
|
public static function retrieve($id, $options = null) |
|
39
|
|
|
{ |
|
40
|
2 |
|
return self::scopedRetrieve($id, $options); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Create a Token. |
|
45
|
|
|
* @link https://stripe.com/docs/api/php#create_card_token |
|
46
|
|
|
* @link https://stripe.com/docs/api/php#create_bank_account_token |
|
47
|
|
|
* |
|
48
|
|
|
* @param array|null $params |
|
49
|
|
|
* @param array|string|null $options |
|
50
|
|
|
* |
|
51
|
|
|
* @return self|array |
|
52
|
|
|
*/ |
|
53
|
6 |
|
public static function create($params = [], $options = null) |
|
54
|
|
|
{ |
|
55
|
6 |
|
return self::scopedCreate($params, $options); |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|