Download the PHP package detain/coinbase-commerce without Composer

On this page you can find all versions of the php package detain/coinbase-commerce. 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-commerce

CircleCI

Coinbase Commerce

PHP library for the Coinbase Commerce API and the new Coinbase Payment Link API.

Table of contents

PHP versions

PHP version 7.4 and above is supported.

Documentation

This library supports two Coinbase APIs:

Commerce API (Legacy) Payment Link API (New)
Auth X-CC-Api-Key header JWT Bearer token (ES256)
Base URL api.commerce.coinbase.com business.coinbase.com/api/v1
Currency Multiple cryptocurrencies USDC only
Resources Checkout, Charge, Invoice, Event PaymentLink
Namespace CoinbaseCommerce\ CoinbaseCommerce\PaymentLink\

All errors that occur during any interaction with either API will be raised as exceptions:

Error Status Code
APIException *
InvalidRequestException 400
ParamRequiredException 400
ValidationException 400
AuthenticationException 401
ResourceNotFoundException 404
RateLimitExceededException 429
InternalServerException 500
ServiceUnavailableException 503

Installation

Install with composer:

This will also install firebase/php-jwt (required for the Payment Link API).

Usage


Commerce API (Legacy)

To start using the Commerce API, register an account on Coinbase Commerce. You will find your API_KEY from User Settings.

Initialize a Client for interacting with the API:

Disable SSL Check

The API resource class provides the following static methods: list, all, create, retrieve, updateById, deleteById. Additionally, the API resource class also provides the following instance methods: save, delete, insert, update.

Each API method returns an ApiResource which represents the JSON response from the API. When the response data is parsed into objects, the appropriate ApiResource subclass will automatically be used.

Warnings

It's prudent to be conscious of warnings. The library will log all warnings to a standard PSR-3 logger if one is configured.

Checkouts

Checkouts API docs More examples on how to use checkouts can be found in the examples/Resources/CheckoutExample.php file

Load checkout resource class

Retrieve

Create

Update

Delete

List

List method returns ApiResourceList object.

Get all checkouts

Charges

Charges API docs More examples on how to use charges can be found in the examples/Resources/ChargeExample.php file

Load charge resource class

Retrieve

Create

List

Get all charges

Resolve a charge

Resolve a charge that has been previously marked as unresolved.

Cancel a charge

Cancels a charge that has been previously created. Note: Only new charges can be successfully canceled. Once payment is detected, charge can no longer be canceled.

Invoices

Invoices API docs More examples on how to use charges can be found in the examples/Resources/InvoiceExample.php file

Load invoice resource class

Retrieve

Create

List

Get all invoices

Resolve an invoice

Resolve an invoice that has been previously marked as unresolved.

Void an invoice

Voids an invoice that has been previously created. Note: Only new or viewed invoices can be successfully voided. Once payment is detected, invoice can no longer be canceled.

Events

Events API Docs More examples on how to use events can be found in the examples/Resources/EventExample.php file

Load event resource class

Retrieve

List

Get all events

Webhooks

Coinbase Commerce signs the webhook events it sends to your endpoint, allowing you to validate and verify that they weren't sent by someone else. You can find a simple example of how to use this with Express in the examples/Webhook folder

Verify Signature header


Payment Link API (New)

The Payment Link API uses CDP (Coinbase Developer Platform) API keys with ES256 JWT authentication. It currently supports USDC payments only.

More examples can be found in examples/PaymentLink/.

Authentication

You'll need a CDP API key from the Coinbase Developer Platform. This gives you a key name (used as the JWT sub/kid) and an EC private key (PEM format) for ES256 signing.

Create a Payment Link

Get a Payment Link

List Payment Links

Deactivate a Payment Link

Idempotency

Pass an idempotency key to safely retry create requests:

Payment Link Webhooks

The Payment Link API uses a different webhook signature format (X-Hook0-Signature) than the Commerce API. See examples/PaymentLink/WebhookExample.php for a complete example.

Payment Link Statuses

Status Description
ACTIVE Link is live and accepting payments
PROCESSING Payment is being processed
COMPLETED Payment received successfully
EXPIRED Link expired without payment
DEACTIVATED Manually deactivated
FAILED Payment failed

Testing and Contributing

Any and all contributions are welcome! The process is simple: fork this repo, make your changes, run the test suite, and submit a pull request. To run the tests, clone the repository and run the following commands:

License

Apache-2.0


All versions of coinbase-commerce with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ~5.0|~6.0|~7.0
psr/http-message Version ^1.0 || ^2.0
firebase/php-jwt Version ^6.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 detain/coinbase-commerce contains the following files

Loading the files please wait ...