|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Containers\Stripe\Tasks; |
|
4
|
|
|
|
|
5
|
|
|
use App\Containers\Stripe\Data\Repositories\StripeAccountRepository; |
|
6
|
|
|
use App\Containers\Stripe\Models\StripeAccount; |
|
7
|
|
|
use App\Containers\User\Models\User; |
|
8
|
|
|
use App\Ship\Parents\Tasks\Task; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class CreateStripeAccountObjectTask. |
|
12
|
|
|
* |
|
13
|
|
|
* @author Mahmoud Zalt <[email protected]> |
|
14
|
|
|
*/ |
|
15
|
|
|
class CreateStripeAccountObjectTask extends Task |
|
16
|
|
|
{ |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @var \App\Containers\Stripe\Data\Repositories\StripeAccountRepository |
|
20
|
|
|
*/ |
|
21
|
|
|
private $stripeAccountRepository; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* CreateStripeAccountObjectTask constructor. |
|
25
|
|
|
* |
|
26
|
|
|
* @param \App\Containers\Stripe\Data\Repositories\StripeAccountRepository $stripeAccountRepository |
|
27
|
|
|
*/ |
|
28
|
|
|
public function __construct(StripeAccountRepository $stripeAccountRepository) |
|
29
|
|
|
{ |
|
30
|
|
|
$this->stripeAccountRepository = $stripeAccountRepository; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Create stripe account in my database |
|
35
|
|
|
* |
|
36
|
|
|
* @param \App\Containers\User\Models\User $user |
|
37
|
|
|
* @param $customer_id |
|
38
|
|
|
* @param $card_id |
|
39
|
|
|
* @param $card_funding |
|
40
|
|
|
* @param $card_last_digits |
|
41
|
|
|
* @param $card_fingerprint |
|
42
|
|
|
* |
|
43
|
|
|
* @return \App\Containers\Stripe\Models\StripeAccount|mixed |
|
44
|
|
|
*/ |
|
45
|
|
|
public function run(User $user, $customer_id, $card_id, $card_funding, $card_last_digits, $card_fingerprint) |
|
46
|
|
|
{ |
|
47
|
|
|
$stripeAccount = new StripeAccount(); |
|
48
|
|
|
$stripeAccount->customer_id = $customer_id; |
|
|
|
|
|
|
49
|
|
|
$stripeAccount->card_id = $card_id; |
|
|
|
|
|
|
50
|
|
|
$stripeAccount->card_funding = $card_funding; |
|
|
|
|
|
|
51
|
|
|
$stripeAccount->card_last_digits = $card_last_digits; |
|
|
|
|
|
|
52
|
|
|
$stripeAccount->card_fingerprint = $card_fingerprint; |
|
|
|
|
|
|
53
|
|
|
$stripeAccount->user()->associate($user); |
|
54
|
|
|
|
|
55
|
|
|
$stripeAccount = $this->stripeAccountRepository->create($stripeAccount->toArray()); |
|
56
|
|
|
|
|
57
|
|
|
return $stripeAccount; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
} |
|
61
|
|
|
|
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.