@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $this->client = new \GoCardlessPro\Client([ |
| 28 | 28 | 'access_token' => env('NEW_GOCARDLESS_ACCESS_TOKEN'), |
| 29 | - 'environment' => (env('NEW_GOCARDLESS_ENV', 'LIVE') == 'LIVE')? \GoCardlessPro\Environment::LIVE: \GoCardlessPro\Environment::SANDBOX, |
|
| 29 | + 'environment' => (env('NEW_GOCARDLESS_ENV', 'LIVE') == 'LIVE') ? \GoCardlessPro\Environment::LIVE : \GoCardlessPro\Environment::SANDBOX, |
|
| 30 | 30 | ]); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | return $this->client->redirectFlows()->complete( |
| 53 | 53 | $user->gocardless_setup_id, |
| 54 | - ["params" => ["session_token" => 'user-token-'.$user->id]] |
|
| 54 | + ["params" => ["session_token" => 'user-token-' . $user->id]] |
|
| 55 | 55 | ); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -30,6 +30,9 @@ |
||
| 30 | 30 | ]); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @return double |
|
| 35 | + */ |
|
| 33 | 36 | public function getPayment($paymentId) |
| 34 | 37 | { |
| 35 | 38 | return $this->client->payments()->get($paymentId); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $payment_details = array( |
| 38 | 38 | "description" => "Build Brighton", |
| 39 | 39 | 'success_redirect_url' => route('account.subscription.store', $user->id), |
| 40 | - "session_token" => 'user-token-'.$user->id, |
|
| 40 | + "session_token" => 'user-token-' . $user->id, |
|
| 41 | 41 | 'prefilled_customer' => [ |
| 42 | 42 | 'given_name' => $user->given_name, |
| 43 | 43 | 'family_name' => $user->family_name, |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | - if (!isset($confirmed_resource->links->mandate) || empty($confirmed_resource->links->mandate)) { |
|
| 85 | + if ( ! isset($confirmed_resource->links->mandate) || empty($confirmed_resource->links->mandate)) { |
|
| 86 | 86 | \Notification::error('Something went wrong, you can try again or get in contact'); |
| 87 | 87 | return \Redirect::route('account.show', $user->id); |
| 88 | 88 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | if ($paymentMethod === 'balance' && empty($user->payment_method) && ($user->status == 'setting-up')) { |
| 157 | 157 | // Activate a users membership with a payment method of balance |
| 158 | - $user->payment_method = 'balance'; |
|
| 158 | + $user->payment_method = 'balance'; |
|
| 159 | 159 | $user->secondary_payment_method = null; |
| 160 | 160 | $user->payment_day = Carbon::now()->day; |
| 161 | 161 | $user->save(); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if ($paymentMethod === 'balance' && $user->payment_method == 'gocardless-variable') { |
| 167 | - $user->payment_method = 'balance'; |
|
| 167 | + $user->payment_method = 'balance'; |
|
| 168 | 168 | $user->secondary_payment_method = 'gocardless-variable'; |
| 169 | 169 | $user->save(); |
| 170 | 170 | } |