Download the PHP package victorybiz/laravel-crypto-payment-gateway without Composer
On this page you can find all versions of the php package victorybiz/laravel-crypto-payment-gateway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download victorybiz/laravel-crypto-payment-gateway
More information about victorybiz/laravel-crypto-payment-gateway
Files in victorybiz/laravel-crypto-payment-gateway
Package laravel-crypto-payment-gateway
Short Description GoUrl.io Crypto Payment Gateway for Laravel
License MIT
Homepage https://github.com/victorybiz/laravel-crypto-payment-gateway
Informations about the package laravel-crypto-payment-gateway
Laravel Crypto Payment Gateway
GoUrl.io Crypto Payment Gateway for Laravel.
Table of Contents
- Laravel Crypto Payment Gateway
- Table of Contents
- Installation
- Requirements
- Dependencies
- Configuration
- Define payment routes
- Define the public key and private keys in environment file
- Config Options
- Usage
- Payment Data Submission
- Usage with Form Submit
- Usage with AJAX Request
- Usage with Session Redirect (through controller, Livewire component or anywhere in your application)
- The Callback
- Callback Controller
- Callback Route
- IPN (Instant Payment Notification)
- Eloquent Model for
crypto_payments
table - Advanced Usage
- Instance of GoUrl.io PHP Class API (
cryptobox.class.php
) - Resources
- Testing
- Changelog
- Contributing
- Security
- Credits
- License
- Laravel Package Boilerplate
Installation
You can install the package via composer:
Next, you should publish the configuration, migration and asset files using the vendor:publish
Artisan command. The configuration, migration and asset files will be placed in your application's config
, database/migrations
and public/vendor
directory respectively:
Requirements
This package is create a laravel wrapper on the GoUrl.io's CryptoAPI Payment Gatway.
- Register for Free or Login on the GoUrl.io website.
- Create new payment box.
- Ensure to specify your External wallet address and Callback Url
- Obtain the Public Key and Private of each coin's payment box you want to support.
Dependencies
The compact
and standard
box template uses Alpinejs and TailwindCSS. While the gourl-cryptobox-iframe
and gourl-cryptobox-boostrap
uses assets provided by GoUrl.io. You do not need to install any of the dependencies, the package uses the CDN version of dependencies.
Configuration
You need create the following files;
- A
PaymentController
with acallback
method. Learn more below. - A static class method anywhere in your application to hook IPN (Instant Payment Notification). Preferably you can just define the static method
public static function ipn($cryptoPaymentModel, $payment_details, $box_status){..}
in the samePaymentController
for easy code management. Learn more below - Define the payment routes.
- Define the public key and private keys in environment file
Define payment routes
Learn more about The Callback Route below.
Define the public key and private keys in environment file
Defined the created payment box's public key and private key for the various coins in your .env
file.
Config Options
See the published config/laravel-crypto-payment-gateway.php
for available options to customize the payment box like changing logo
, box_template
, box_template_options
and other configuration options.
Usage
Payment Data Submission
The payment data can be submitted in the following ways;
- Form Submit
- AJAX Request
- Session Redirect (through controller, Livewire component or anywhere in your application)
Which ever method data field amount
in BTC or amountUSD
need to be sent, both cannot be used. And optional data fields userID
, orderID
(if you want to reference the data to any model in app e.g Product model) and redirect
(a url you want to redirect to once payment is received).
Usage with Form Submit
Usage with AJAX Request
Usage with Session Redirect (through controller, Livewire component or anywhere in your application)
You need to ensure you validate your data before sending to the payment gateway
The Callback
When a user has made a payment, the GoUrl.io's server will send payment data using HTTP POST method on your callback url specified in field Callback URL of your crypto payment box.
Callback Controller
Create a PaymentController
and call instance of Laravel Crypto Payment Gateway's callback method.
Callback Route
Define the callback route to the created controller, the callback route should be a publicly accessible route with no auth. However, you may also exclude the route from CSRF Protection by adding their URIs to the $except
property of the VerifyCsrfToken
middleware.
If you use Cloudflare & Mod_Security & other CDN services, Click Here to view the GoUrl.io's server IPs you need to add in Whitelist.
IPN (Instant Payment Notification)
Once the GoUrl.io's Cryptobox Class
finished processing the received callback behind the scene, then it make a call to a cryptobox_new_payment(...)
function which allows you to define your processing after payment. To hook on to this function to handle IPN (Instant payment notification) with your custom processing like sending email notifications and giving value to the user once payment is confirmed, create a static class method.
This can be a static class method defined anywhere in your application.
Preferably you can just define the static method in the same PaymentController
for easy code management.
Then update the published config/laravel-crypto-payment-gateway.php
and set value for hook_ipn
key to hook IPN (Instant Payment Notification) function to the static class method defined above.
config file
Eloquent Model for crypto_payments
table
This package provide eloquent model for the crypto_payments
.
Advanced Usage
Instance of GoUrl.io PHP Class API (cryptobox.class.php
)
This package provide access to instance of the core GoUrl.io's cryptobox.class.php which this package uses under the hood.
Click Here to learn more about GoUrl.io PHP Class API and the available methods.
Resources
The following packages was put together to makeup this seamless package.
- GoUrl.io Website
- GoUrl.io's CryptoAPI Payment Gateway Repository
- PHP Class API Doc
- TailwindCSS
- AlpineJS
- Alpine Clipboard
- Alpine Tooltip
- tc-lib-barcode
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Victory Osayi Airuoyuwa
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
All versions of laravel-crypto-payment-gateway with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
tecnickcom/tc-lib-barcode Version ^1.15