Skip to content

Commit 708fc82

Browse files
authored
Merge pull request #31 from devinweb/analysis-xg0A9N
Apply fixes from StyleCI
2 parents cd0e15d + 7dc0b5e commit 708fc82

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

config/hyperpay.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
*/
3030
'transaction_model' => 'Devinweb\LaravelHyperpay\Models\Transaction',
3131

32-
'notificationUrl' => '/hyperpay/webhook'
32+
'notificationUrl' => '/hyperpay/webhook',
3333
];

src/LaravelHyperpay.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class LaravelHyperpay implements Hyperpay
4747
*/
4848
protected $gateway_url = 'https://test.oppwa.com';
4949

50-
5150
/**
5251
* @var bool demand to register the user card
5352
*/
@@ -180,15 +179,12 @@ public function paymentStatus(string $resourcePath, string $checkout_id)
180179
return $response;
181180
}
182181

183-
/**
184-
*
185-
*/
186182
public function recurringPayment(string $registration_id, $amount, $checkout_id)
187183
{
188184
$result = (new HttpClient($this->client, $this->gateway_url.'/v1/registrations/'.$registration_id.'/payments', $this->config))->post(
189185
(new HttpParameters())->postRecurringPayment($amount, $this->redirect_url, $checkout_id),
190186
);
191-
187+
192188
$response = (new HttpResponse($result, null, []))->recurringPayment();
193189

194190
return $response;
@@ -221,7 +217,7 @@ public function addRedirectUrl($url)
221217
}
222218

223219
/**
224-
* Set the register user card information, to use it when we prepare the checkout
220+
* Set the register user card information, to use it when we prepare the checkout.
225221
*
226222
* @return $this
227223
*/

src/Support/HttpParameters.php

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,25 @@ public function getParams($checkout_id): array
4444
}
4545

4646
/**
47-
* Generate the params that used in the recurring payment
48-
* @param string $amount
49-
* @param string $shopperResultUrl
50-
* @param string $checkout_id That define the entity_id related to the registration id.
47+
* Generate the params that used in the recurring payment.
48+
*
49+
* @param string $amount
50+
* @param string $shopperResultUrl
51+
* @param string $checkout_id That define the entity_id related to the registration id.
5152
* @return array
5253
*/
5354
public function postRecurringPayment($amount, $shopperResultUrl, $checkout_id)
5455
{
5556
$currency = config('hyperpay.currency');
5657

5758
return array_merge([
58-
"standingInstruction.mode"=>"REPEATED",
59-
"standingInstruction.type" => "RECURRING",
60-
"standingInstruction.source"=>"MIT",
61-
"amount"=> $amount,
62-
"currency" => $currency,
63-
"paymentType"=>"PA",
64-
"shopperResultUrl" => $shopperResultUrl
59+
'standingInstruction.mode'=>'REPEATED',
60+
'standingInstruction.type' => 'RECURRING',
61+
'standingInstruction.source'=>'MIT',
62+
'amount'=> $amount,
63+
'currency' => $currency,
64+
'paymentType'=>'PA',
65+
'shopperResultUrl' => $shopperResultUrl,
6566
], $this->getParams($checkout_id));
6667
}
6768

@@ -94,16 +95,17 @@ protected function getBodyParameters($amount, Model $user, $heyPerPayConfig): ar
9495
}
9596

9697
/**
97-
* The init recurring payment params
98+
* The init recurring payment params.
99+
*
98100
* @return array
99101
*/
100102
protected function registerPaymentData()
101103
{
102104
return [
103-
"standingInstruction.mode"=>"INITIAL",
104-
"standingInstruction.type" => "RECURRING",
105-
"standingInstruction.source"=>"CIT",
106-
"createRegistration"=>true,
105+
'standingInstruction.mode'=>'INITIAL',
106+
'standingInstruction.type' => 'RECURRING',
107+
'standingInstruction.source'=>'CIT',
108+
'createRegistration'=>true,
107109
];
108110
}
109111

0 commit comments

Comments
 (0)