Skip to content

Commit

Permalink
support laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrackkanza committed Feb 27, 2024
1 parent 901f0a2 commit 8906eb7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package FlexPay API

Only supports Laravel 10
For Laravel 9 and 10

## Installation

Expand All @@ -24,12 +24,13 @@ This is the contents of the published config file:
return [
'token' => env('FLEXPAY_TOKEN'),
'merchant' => env('FLEXPAY_MERCHANT'),
'url_api' => env('FLEXPAY_URL_API','http://41.243.7.46:3006'),
'url_api_card' => env('FLEXPAY_URL_API_CARD','https://beta-cardpayment.flexpay.cd'),
'url_c2b' => '/api/rest/v1/paymentService',
'url_b2c' => '/api/rest/v1/merchantPayOutService',
'url_card' => '/api/rest/v1/vpos/ask',
'url_check_transaction' => '/api/rest/v1/check',
'url_api' => env('FLEXPAY_URL_API','https://backend.flexpay.cd'),
'url_api_card' => env('FLEXPAY_URL_API_CARD','https://cardpayment.flexpay.cd'),
'url_c2b' => env('FLEXPAY_URL_C2B','/api/rest/v1/paymentService'),
'url_b2c' => env('FLEXPAY_URL_B2C','/api/rest/v1/merchantPayOutService'),
'url_card' => env('FLEXPAY_URL_CARD','/api/rest/v1/vpos/ask'),
'url_check_transaction' => env('FLEXPAY_URL_CHECK','/api/rest/v1/check'),
'url_get_order_number' => env('FLEXPAY_URL_GET_ORDER_NUMBER','/api/rest/v1/vpos/orderNumber'),
];
```

Expand All @@ -43,6 +44,7 @@ Add these lines in your .env file
FLEXPAY_TOKEN="YOUR_FLEXPAY_TOKEN"
FLEXPAY_MERCHANT="YOUR_FLEXPAY_MERCHANT"
FLEXPAY_URL_API="FLEXPAY_URL_API"
FLEXPAY_URL_API_CARD="FLEXPAY_URL_API_CARD"
```


Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.0",
"spatie/laravel-package-tools": "^1.14.0",
"illuminate/contracts": "^10.0"
"illuminate/contracts": "^9.0"
},
"require-dev": {
"laravel/pint": "^1.0",
Expand Down
4 changes: 2 additions & 2 deletions config/flexpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
return [
'token' => env('FLEXPAY_TOKEN'),
'merchant' => env('FLEXPAY_MERCHANT'),
'url_api' => env('FLEXPAY_URL_API','https://beta-backend.flexpay.cd'),
'url_api_card' => env('FLEXPAY_URL_API_CARD','https://beta-cardpayment.flexpay.cd'),
'url_api' => env('FLEXPAY_URL_API','https://backend.flexpay.cd'),
'url_api_card' => env('FLEXPAY_URL_API_CARD','https://cardpayment.flexpay.cd'),
'url_c2b' => env('FLEXPAY_URL_C2B','/api/rest/v1/paymentService'),
'url_b2c' => env('FLEXPAY_URL_B2C','/api/rest/v1/merchantPayOutService'),
'url_card' => env('FLEXPAY_URL_CARD','/api/rest/v1/vpos/ask'),
Expand Down
5 changes: 2 additions & 3 deletions src/Flexpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public function b2c(string $phoneNumber, float $amount, string $currency, string
]
);

//var_dump($result);
return $result;
}

Expand All @@ -111,7 +110,6 @@ public function payment(string $reference , string $description , float $amount,
]
);

//var_dump($result);
return $result;
}

Expand Down Expand Up @@ -191,7 +189,8 @@ private function init(string $uri, array $body, string $method = 'POST')
}
catch (\Exception $exception) {
// operation failed
return false;

return $exception;
}
}
}

0 comments on commit 8906eb7

Please sign in to comment.