hexters / coinpayment
CoinPayment is a Laravel module for handling transactions from CoinPayment like a create transaction, history transaction, etc.
Installs: 39 945
Dependents: 0
Suggesters: 0
Security: 0
Stars: 73
Watchers: 6
Forks: 42
Open Issues: 32
Language:JavaScript
- dev-master
- v3.0.0
- v2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- v1.0.15
- v1.0.14
- v1.0.13.1
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/minimatch-3.0.8
- dev-dependabot/npm_and_yarn/moment-timezone-0.5.35
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/minimist-1.2.6
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
This package is auto-updated.
Last update: 2024-10-30 01:53:45 UTC
README
Coinpayment Laravel Package
CoinPayment is a Laravel package for handling transactions from CoinPayment like a create transaction, history transaction, etc.
Version support
Installation
You can install this package via composer:
$ composer require hexters/coinpayment
Publishing vendor
$ php artisan vendor:publish --tag=coinpayment
Install CoinPayment configuration
$ php artisan coinpayment:install
Installation finish.
Getting Started
Create Button transaction. Example placed on your controller
use Hexters\CoinPayment\CoinPayment; . . . /* * @required true */ $transaction['order_id'] = uniqid(); // invoice number $transaction['amountTotal'] = (FLOAT) 37.5; $transaction['note'] = 'Transaction note'; $transaction['buyer_name'] = 'Jhone Due'; $transaction['buyer_email'] = 'buyer@mail.com'; $transaction['redirect_url'] = url('/back_to_tarnsaction'); // When Transaction was comleted $transaction['cancel_url'] = url('/back_to_tarnsaction'); // When user click cancel link /* * @required true * @example first item */ $transaction['items'][] = [ 'itemDescription' => 'Product one', 'itemPrice' => (FLOAT) 7.5, // USD 'itemQty' => (INT) 1, 'itemSubtotalAmount' => (FLOAT) 7.5 // USD ]; /* * @example second item */ $transaction['items'][] = [ 'itemDescription' => 'Product two', 'itemPrice' => (FLOAT) 10, // USD 'itemQty' => (INT) 1, 'itemSubtotalAmount' => (FLOAT) 10 // USD ]; /* * @example third item */ $transaction['items'][] = [ 'itemDescription' => 'Product Three', 'itemPrice' => (FLOAT) 10, // USD 'itemQty' => (INT) 2, 'itemSubtotalAmount' => (FLOAT) 20 // USD ]; $transaction['payload'] = [ 'foo' => [ 'bar' => 'baz' ] ]; return CoinPayment::generatelink($transaction); . . .
Listening status transaction
Open the Job file App\Jobs\CoinpaymentListener
for the listen the our transaction and proccess
Manual check without IPN
This function will execute orders without having to wait for the process from IPN
We can also make cron to run this function if we don't use IPN
use Hexters\CoinPayment\CoinPayment; . . . /** * this is triger function for running Job proccess */ return CoinPayment::getstatusbytxnid("CPDA4VUGSBHYLXXXXXXXXXXXXXXX"); // output example: "celled / Timed Out"
Get histories transaction Eloquent
use Hexters\CoinPayment\CoinPayment; . . . CoinPayment::gettransactions()->where('status', 0)->get();
IPN Route
Except this path /coinpayment/ipn
into csrf proccess in App\Http\Middleware\VerifyCsrfToken
. . . /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ '/coinpayment/ipn' ]; . . .
Promote New Features
Now you can integrate you coinpayment transaction with Ladmin (Laravel Admin scaffolding). You just buy for the package price starting at $ 36.25 per version.
What is the features?
- List of the transaction from CoinPayment base on database
- Create new transaction from admin page & send to buyer email
- You can Check status of transaction via admin page manually
- Remove pending transaction
- List of CoinPayment Balance
- Top Up balance
- Easy and quick Installation
For details source visit the pakcage Ladmin CoinPayment
Troubleshooting
Cannot use object of type Illuminate\Http\JsonResponse as array
Visit the CoinPayment API Keys page, under Actions, click on the Edit Permissions button. Enter the IP address of your API endpoint (e.g. your website server) in the Restrict to IP/IP Range input. Leaving it empty, may cause this error to occur.
Supporting the project
You can support the maintainer of this project through the referral links below