@@ -156,10 +156,10 @@ |
||
| 156 | 156 | * @return mixed |
| 157 | 157 | * @throws MpesaApiRequestException |
| 158 | 158 | */ |
| 159 | - protected function call($url, $options = [], $method = 'POST') |
|
| 159 | + protected function call($url, $options = [ ], $method = 'POST') |
|
| 160 | 160 | { |
| 161 | 161 | if (isset($this->accessToken)) { |
| 162 | - $options['headers'] = ['Authorization' => 'Bearer ' . $this->accessToken]; |
|
| 162 | + $options[ 'headers' ] = [ 'Authorization' => 'Bearer ' . $this->accessToken ]; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | try { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $this->initiatorName = config('laravel-daraja.initiator.name'); |
| 82 | 82 | $this->securityCredential = $this->securityCredential(config('laravel-daraja.initiator.credential')); |
| 83 | 83 | $this->partyA = config('laravel-daraja.initiator.short_code'); |
| 84 | - $this->senderIdentifierType = $this->identifier[config('laravel-daraja.initiator.type')]; |
|
| 84 | + $this->senderIdentifierType = $this->identifier[ config('laravel-daraja.initiator.type') ]; |
|
| 85 | 85 | |
| 86 | 86 | $this->queueTimeOutURL = $this->setUrl(config('laravel-daraja.queue_timeout_url.b2b')); |
| 87 | 87 | $this->resultURL = $this->setUrl(config('laravel-daraja.result_url.b2b')); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function setShortCode($code, $type) |
| 118 | 118 | { |
| 119 | 119 | $this->partyA = $code; |
| 120 | - $this->senderIdentifierType = $this->identifier[$type]; |
|
| 120 | + $this->senderIdentifierType = $this->identifier[ $type ]; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public function payToPayBill($payBillNo, $amount, $remarks, $accountReference = '') |
| 155 | 155 | { |
| 156 | 156 | $this->setCommandId('BusinessPayBill'); |
| 157 | - $this->receiverIdentifierType = $this->identifier['paybill']; |
|
| 157 | + $this->receiverIdentifierType = $this->identifier[ 'paybill' ]; |
|
| 158 | 158 | return $this->pay($payBillNo, $amount, $remarks, $accountReference); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function payToBuyGoods($tillNo, $amount, $remarks) |
| 171 | 171 | { |
| 172 | 172 | $this->setCommandId('BusinessBuyGoods'); |
| 173 | - $this->receiverIdentifierType = $this->identifier['till']; |
|
| 173 | + $this->receiverIdentifierType = $this->identifier[ 'till' ]; |
|
| 174 | 174 | return $this->pay($tillNo, $amount, $remarks); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -204,6 +204,6 @@ discard block |
||
| 204 | 204 | "ResultURL" => $this->resultURL |
| 205 | 205 | ]; |
| 206 | 206 | |
| 207 | - return $response = $this->call($this->endPoint, ['json' => $parameters]); |
|
| 207 | + return $response = $this->call($this->endPoint, [ 'json' => $parameters ]); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | \ No newline at end of file |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | "Occasion" => str_limit($occasion, 100, '') |
| 117 | 117 | ]; |
| 118 | 118 | |
| 119 | - return $this->call($this->reversalEndPoint, ['json' => $parameters]); |
|
| 119 | + return $this->call($this->reversalEndPoint, [ 'json' => $parameters ]); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | } |
| 123 | 123 | \ No newline at end of file |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | "TransactionDesc" => str_limit($description, 20, '') |
| 130 | 130 | ]; |
| 131 | 131 | |
| 132 | - return $this->call($this->stkEndpoint, ['json' => $parameters]); |
|
| 132 | + return $this->call($this->stkEndpoint, [ 'json' => $parameters ]); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | "CheckoutRequestID" => $checkoutRequestId |
| 151 | 151 | ]; |
| 152 | 152 | |
| 153 | - return $this->call($this->statusEndPoint, ['json' => $parameters]); |
|
| 153 | + return $this->call($this->statusEndPoint, [ 'json' => $parameters ]); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | } |
| 157 | 157 | \ No newline at end of file |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function toPayBillStatus($transactionID, $remarks, $occasion = '') |
| 108 | 108 | { |
| 109 | - $this->identifierType = $this->identifier['paybill']; |
|
| 109 | + $this->identifierType = $this->identifier[ 'paybill' ]; |
|
| 110 | 110 | return $this->status($transactionID, $remarks, $occasion); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function toTillStatus($transactionID, $remarks, $occasion = '') |
| 122 | 122 | { |
| 123 | - $this->identifierType = $this->identifier['till']; |
|
| 123 | + $this->identifierType = $this->identifier[ 'till' ]; |
|
| 124 | 124 | return $this->status($transactionID, $remarks, $occasion); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function toMsisdnStatus($transactionID, $remarks, $occasion = '') |
| 136 | 136 | { |
| 137 | - $this->identifierType = $this->identifier['msisdn']; |
|
| 137 | + $this->identifierType = $this->identifier[ 'msisdn' ]; |
|
| 138 | 138 | return $this->status($transactionID, $remarks, $occasion); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | public function fromMsisdnStatus($msisdn, $transactionID, $remarks, $occasion = '') |
| 152 | 152 | { |
| 153 | 153 | $this->partyA = $msisdn; |
| 154 | - $this->identifierType = $this->identifier['msisdn']; |
|
| 154 | + $this->identifierType = $this->identifier[ 'msisdn' ]; |
|
| 155 | 155 | return $this->status($transactionID, $remarks, $occasion); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -178,6 +178,6 @@ discard block |
||
| 178 | 178 | "Remarks" => $remarks, |
| 179 | 179 | "Occasion" => $occasion |
| 180 | 180 | ]; |
| 181 | - return $this->call($this->queryEndPoint, ['json' => $parameters]); |
|
| 181 | + return $this->call($this->queryEndPoint, [ 'json' => $parameters ]); |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | \ No newline at end of file |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | "QueueTimeOutURL" => $this->queueTimeoutURL, |
| 110 | 110 | "ResultURL" => $this->resultURL |
| 111 | 111 | ]; |
| 112 | - return $this->call($this->queryEndPoint, ['json' => $parameters]); |
|
| 112 | + return $this->call($this->queryEndPoint, [ 'json' => $parameters ]); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | "ConfirmationURL" => $this->setUrl($confirmationUrl), |
| 56 | 56 | "ValidationURL" => $this->setUrl($validationUrl) |
| 57 | 57 | ]; |
| 58 | - return $this->call($this->urlRegistrationEndPoint, ['json' => $parameters]); |
|
| 58 | + return $this->call($this->urlRegistrationEndPoint, [ 'json' => $parameters ]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -116,6 +116,6 @@ discard block |
||
| 116 | 116 | "Msisdn" => $phoneNumber, |
| 117 | 117 | "BillRefNumber" => $reference |
| 118 | 118 | ]; |
| 119 | - return $this->call($this->simulationEndpoint, ['json' => $parameters]); |
|
| 119 | + return $this->call($this->simulationEndpoint, [ 'json' => $parameters ]); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | \ No newline at end of file |
@@ -196,6 +196,6 @@ |
||
| 196 | 196 | "Occassion" => $occasion |
| 197 | 197 | ]; |
| 198 | 198 | |
| 199 | - return $response = $this->call($this->endPoint, ['json' => $parameters]); |
|
| 199 | + return $response = $this->call($this->endPoint, [ 'json' => $parameters ]); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | \ No newline at end of file |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | 'laravel-daraja' |
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | - $this->app->bind('mpesa-api', function () { |
|
| 44 | + $this->app->bind('mpesa-api', function() { |
|
| 45 | 45 | return new MpesaApi(); |
| 46 | 46 | }); |
| 47 | 47 | } |