Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | trait TokenTrait |
||
27 | { |
||
28 | use HasPurchaseParent; |
||
29 | use TimestampableTrait; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | static protected $createTimestamps = ['created']; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | static protected $updateTimestamps = ['modified']; |
||
40 | |||
41 | /** |
||
42 | * @param AbstractGateway $gateway |
||
43 | */ |
||
44 | public function populateFromGateway($gateway) |
||
45 | { |
||
46 | $this->gateway = $gateway->getName(); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param PaymentMethod $gateway |
||
51 | */ |
||
52 | public function populateFromPaymentMethod($method) |
||
53 | { |
||
54 | $this->id_method = is_object($method) ? $method->id : $method; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param TokenInterface $token |
||
59 | */ |
||
60 | public function populateFromToken(TokenInterface $token) |
||
64 | } |
||
65 | } |
||
66 |