Download the PHP package asciisd/knet without Composer
On this page you can find all versions of the php package asciisd/knet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package knet
Short Description Knet package is provides an expressive, fluent interface to KNet's payment services.
License MIT
Informations about the package knet
Knet
This package used to integrate with the new Knet payment portal
Usage
Here are a few short examples of what you can do:
[!CAUTION] Please note that this package is updated to work with the new Knet payment portal, and it's not compatible with the old one, we removed the receipt system from the package that because it may conflict with your own system, so you can use the
KnetTransaction
model details to show your own receipt.[!NOTE] The package now is under updating process, so please don't use it in production until we release the stable version.
First Step
add HasKnet
trait to the User model
Second Step
user pay()
method
After finished the payment you will redirect to [/knet/response]() you can change that from config file to make your own handler
Another Example:
you can use pay()
method inside controller like this
Change Environment
you can change your environment from local to production in case you want to make sure that everything is working fine,
to do that change .env
file like this
Installation
You can install the bindings via Composer. Run the following command:
Run install command:
this command will install ServiceProvider
, Configs
and views
Run publish command:
this command will knet assets
After the migration has been published you can create the knet_transactions
table by running the migrations:
KnetServiceProvider
This package provides a receipt system, but you should fill your identity details inside KnetServiceProvider
=>
$details
array
also you need to update your logo inside vendor
=> knet
public assets
Test cards
Card Number | Expiry Date | PIN | Status |
---|---|---|---|
8888880000000001 | 09/25 | 1234 | CAPTURED |
8888880000000002 | 05/25 | 1234 | NOT CAPTURED |
Events
You can add this code to EventServiceProvider