Skip to content
CoinPayment PHP client for Laravel 5.6
PHP Vue CSS HTML JavaScript
Branch: master
Clone or download
Latest commit 2a12dbe Sep 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src 2.0 Sep 2, 2019
.gitignore Spelling fixes May 27, 2018
LICENSE Create LICENSE Mar 24, 2018
README.md Update README.md Sep 7, 2019
composer.json license Sep 2, 2019
examplev2.png image Sep 2, 2019
module.json 2.0 Sep 2, 2019
package.json 2.0 Sep 2, 2019
setting.png setting example Apr 5, 2018
start.php upload Mar 23, 2018
webpack.mix.js 2.0 Sep 2, 2019

README.md

CoinPayments v2

Latest Stable Version Total Downloads License

New transform coinpayment package

CoinPayment is a Laravel module for handling transactions from CoinPayment like a create transaction, history transaction, etc.

Example Image

Version support

version laravel
v1.1.3 5.6
v2.0.0 ^5.8

Requirement

  • Laravel ^5.8
  • PHP >= ^7.2

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

  . . . 
  /*
  *   @required true
  */
  $transaction['amountTotal'] = 30;
  $transaction['note'] = 'Note for your transaction';
  $transaction['buyer_email'] = 'buyer@mailinator.com';
  $transaction['redirect_url'] = url('/back_to_tarnsaction');

  /*
  *   @required true
  *   @example first item
  */
  $transaction['items'][] = [
    'itemDescription' => 'Product one',
    'itemPrice' => 10, // USD
    'itemQty' => 1,
    'itemSubtotalAmount' => 10 // USD
  ];

  /*
  *   @example second item
  */
  $transaction['items'][] = [
    'itemDescription' => 'Product two',
    'itemPrice' => 10, // USD
    'itemQty' => 1,
    'itemSubtotalAmount' => 10 // USD
  ];

  /*
  *   @example third item
  */
  $transaction['items'][] = [
    'itemDescription' => 'Product Three',
    'itemPrice' => 10, // USD
    'itemQty' => 1,
    'itemSubtotalAmount' => 10 // 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

/**
* this is triger function for running Job proccess
*/
return \CoinPayment::getstatusbytxnid("CPDA4VUGSBHYLXXXXXXXXXXXXXXX");
/**
  output example: "celled / Timed Out"
*/

Get histories transaction Eloquent

\CoinPayment::gettransactions()->where('status', 0)->get();

Gift me a coffee ☕☕☕☕

BTC: 1388MHjeHmq6kUC7WpSS6pPtgG7hm7fCau 
You can’t perform that action at this time.