Download the PHP package gr4vy/gr4vy-php without Composer

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

Gr4vy SDK for PHP

Gr4vy provides any of your payment integrations through one unified API. For more details, visit gr4vy.com.

Installation

The Gr4vy PHP SDK can be installed via Composer.

Getting Started

To make your first API call, you will need to request a Gr4vy instance to be set up. Please contact our sales team for a demo.

Once you have been set up with a Gr4vy account you will need to head over to the Integrations panel and generate a private key. We recommend storing this key in a secure location but in this code sample we simply read the file from disk.

Environment

The SDK defaults the environment to "sandbox", to send transactions to production, set the environment in Gr4vyConfig:

Gr4vy Embed

To create a token for Gr4vy Embed, call the config->getEmbedToken() function with the amount, currency, optional buyer information and optional checkout session for Gr4vy Embed.

Or, generate a checkout session and Embed Token with a single call:

You can now pass this token to your front end where it can be used to authenticate Gr4vy Embed.

The buyerId and buyerExternalIdentifier fields can be used to allow the token to pull in previously stored payment methods for a user. A buyer needs to be created before it can be used in this way.

Checkout Sessions

A checkout session can be used across Embed sessions to track retries or shopping cart updates. To achieve this the same checkoutSessionId can be used in multiple getEmbedToken calls.

NOTE: a checkout session is valid for 1h from creation.

Initialization

The client can be initialized with the Gr4vy ID (gr4vyId) and the private key.

Alternatively, you can set the host of the server to use directly.

Your API key can be created in your admin panel on the Integrations tab.

Multi merchant

In a multi-merchant environment, the merchant account ID can be set by passing merchantAccountId to the Config:

Making API calls

This library conveniently maps every API path to a seperate function. For example, GET /buyers?limit=100 would be:

To create or update a resource an array should be sent with the request data.

Similarly, to update a buyer you will need to pass in the BuyerUpdateRequest.

Generate API bearer token

The SDK can be used to create API access tokens for use with other request libraries.

The first parameter is the location of your private key. The second parameter is an array of scopes for the token.

The resulting token can be used as a bearer token in the header of the HTTP request made to the API.

Logging & Debugging

The SDK makes it easy possible to the requests and responses to the console.

This will print debug output for the request to the console.

Development

Tests

To run the tests, store a private key for the spider environment and then run the following commands.

Publishing

Publishing of this project is done through Packagist. New versions are released by creating a new Git tag.

License

This library is released under the MIT License.


All versions of gr4vy-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version >=6.5.5
lcobucci/jwt Version ^4.1.5
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 gr4vy/gr4vy-php contains the following files

Loading the files please wait ....