Skip to content

Commit

Permalink
Make Pawapay momo flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjude committed Nov 21, 2023
1 parent cd7be7a commit b996b7a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ use \Stephenjude\PaymentGateway\PaymentGateway;

$pawapay = PaymentGateway::make(Provider::PAWAPAY())->initializeCheckout([
"amount" => 15,
"mobile_number" => "233593456789",
"country" => "ZMB",
'meta' => [
"description" => "Note of 4 to 22 chars",
Expand Down
1 change: 1 addition & 0 deletions src/Providers/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public function parseProviderError(Response $response): string
Provider::MONNIFY() => $response->json('responseMessage')
?? $response->json('error').'. '.$response->json('error_description'),
Provider::KLASHA() => $response->json('error').'. '.$response->json('message'),
Provider::PAWAPAY() => $response->json('errorMessage'),
default => $response->reason()
};
}
Expand Down
1 change: 0 additions & 1 deletion src/Providers/PawapayProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function initializeCheckout(array $parameters = []): SessionData
'depositId' => Arr::get($parameters, 'reference'),
'amount' => "$amount", // Pawapay accepts amount as string
"country" => Arr::get($parameters, 'country'),
'msisdn' => Arr::get($parameters, 'mobile_number'),
"statementDescription" => Arr::get($parameters, 'meta.description'),
"reason" => Arr::get($parameters, 'meta.reason'),
'returnUrl' => $parameters['callback_url'] ?? route(config('payment-gateways.routes.callback.name'), [
Expand Down

0 comments on commit b996b7a

Please sign in to comment.