Download the PHP package ramiroauditore/coinbase-laravel without Composer

On this page you can find all versions of the php package ramiroauditore/coinbase-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package coinbase-laravel

coinbase-laravel

A wrapper for Coinbase Commerce's API for Laravel projects that require token purchases. It should work without issues if you follow the README to the tee, but I'm still new to cryptocurrency and Coinbase doesn't have the best docs, so please do submit an issue if you find a bug or something that could be improved and I'll take a look at it.

Notes

Right now the package just handles creating charges and has a webhook for the updates of charges. I might add the rest of endpoints in the future.

Installation

Install with Composer:

Then you need to include the ServiceProvider in the config/app.php file like this:

Add the following to your .env file:

Run php artisan: migrate and a migration will run, adding the coinbase_transactions table to your database.

Usage

Create a charge

To create a charge you will need a POST to the following route:

You will need to send the following data:

Should the request be successful a new row will be added to your coinbase_transactions with the charge data and you will receive the following JSON response:

In which each object in the pricing object represents the equivalent of the local (USD) price the user submitted and each property in the qr_strings object represents a string you can use to generate a QR code to pay with the respective currency.

Webhooks

The webhook function resides in the following route:

So you should exclude it from the CSRF protection by modfying your Http/Middleware/VerifyCsrfToken.php file like this:

After doing that you should register the webhook by providing the URL of the route in the settings of you Coinbase Commerce and it should automatically start functioning whenever there's an event (I recommend disabling the charge:created hook). It will update the corresponding table entry with the new data. Including doing recalculations of the amount and token_amount fields to adjust in case the user underpaid or overpaid.

NOTE: Keep in mind, though, that if the user does over or underpay and you want the charge to still be valid, you will need to "resolve it" manually through the dashboard, otherwise it will be marked as failed and the money will be returned to the user. There's a way to do this through an endpoint, I might add it later.


All versions of coinbase-laravel with dependencies

PHP Build Version
Package Version
Requires ramiroauditore/coinbase-commerce Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ramiroauditore/coinbase-laravel contains the following files

Loading the files please wait ....