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 PHP SDK (Beta)

Developer-friendly & type-safe PHP SDK specifically catered to leverage the Gr4vy API.

Packagist Version



[!IMPORTANT] This is a Beta release of our latest SDK. Please refer to the legacy PHP SDK for the latest stable build.

Summary

Gr4vy Typescript SDK

The official Gr4vy SDK for Typescript provides a convenient way to interact with the Gr4vy API from your server-side application. This SDK allows you to seamlessly integrate Gr4vy's powerful payment orchestration capabilities, including:

This SDK is designed to simplify development, reduce boilerplate code, and help you get up and running with Gr4vy quickly and efficiently. It handles authentication, request signing, and provides easy-to-use methods for most API endpoints.

Table of Contents

SDK Installation

The SDK relies on Composer to manage its dependencies.

To install the SDK and add it as a dependency to an existing composer.json file:

SDK Example Usage

Example



[!IMPORTANT] Please use ->setSecuritySource(Auth::withToken($privateKey)) where the documentation mentions ->setSecurity('<YOUR_BEARER_TOKEN_HERE>').

Bearer token generation

Alternatively, you can create a token for use with the SDK or with your own client library.

Note: This will only create a token once. Use Auth::withToken with our SDK to dynamically generate a token for every request.

Embed token generation

Alternatively, you can create a token for use with Embed as follows.

Note: This will only create a token once. Use Auth::withToken with our SDK to dynamically generate a token for every request.

Merchant account ID selection

Depending on the key used, you might need to explicitly define a merchant account ID to use. In our API, this uses the X-GR4VY-MERCHANT-ACCOUNT-ID header. When using the SDK, you can set the merchantAccountId when initializing the SDK.

Webhooks verification

The SDK makes it easy to verify that incoming webhooks were actually sent by Gr4vy. Once you have configured the webhook subscription with its corresponding secret, that can be verified the following way:

Parameters

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
bearerAuth http HTTP Bearer

To authenticate with the API the bearerAuth parameter must be set when initializing the SDK. For example:

Available Resources and Operations

Available methods ### [accountUpdater](docs/sdks/accountupdater/README.md) #### [accountUpdater->jobs](docs/sdks/jobs/README.md) * [create](docs/sdks/jobs/README.md#create) - Create account updater job ### [auditLogs](docs/sdks/auditlogs/README.md) * [list](docs/sdks/auditlogs/README.md#list) - List audit log entries ### [buyers](docs/sdks/buyerssdk/README.md) * [list](docs/sdks/buyerssdk/README.md#list) - List all buyers * [create](docs/sdks/buyerssdk/README.md#create) - Add a buyer * [get](docs/sdks/buyerssdk/README.md#get) - Get a buyer * [update](docs/sdks/buyerssdk/README.md#update) - Update a buyer * [delete](docs/sdks/buyerssdk/README.md#delete) - Delete a buyer #### [buyers->giftCards](docs/sdks/buyersgiftcards/README.md) * [list](docs/sdks/buyersgiftcards/README.md#list) - List gift cards for a buyer #### [buyers->paymentMethods](docs/sdks/buyerspaymentmethods/README.md) * [list](docs/sdks/buyerspaymentmethods/README.md#list) - List payment methods for a buyer #### [buyers->shippingDetails](docs/sdks/buyersshippingdetails/README.md) * [create](docs/sdks/buyersshippingdetails/README.md#create) - Add buyer shipping details * [list](docs/sdks/buyersshippingdetails/README.md#list) - List a buyer's shipping details * [get](docs/sdks/buyersshippingdetails/README.md#get) - Get buyer shipping details * [update](docs/sdks/buyersshippingdetails/README.md#update) - Update a buyer's shipping details * [delete](docs/sdks/buyersshippingdetails/README.md#delete) - Delete a buyer's shipping details ### [cardSchemeDefinitions](docs/sdks/cardschemedefinitionssdk/README.md) * [list](docs/sdks/cardschemedefinitionssdk/README.md#list) - List card scheme definitions ### [checkoutSessions](docs/sdks/checkoutsessions/README.md) * [create](docs/sdks/checkoutsessions/README.md#create) - Create checkout session * [update](docs/sdks/checkoutsessions/README.md#update) - Update checkout session * [get](docs/sdks/checkoutsessions/README.md#get) - Get checkout session * [delete](docs/sdks/checkoutsessions/README.md#delete) - Delete checkout session ### [digitalWallets](docs/sdks/digitalwalletssdk/README.md) * [create](docs/sdks/digitalwalletssdk/README.md#create) - Register digital wallet * [list](docs/sdks/digitalwalletssdk/README.md#list) - List digital wallets * [get](docs/sdks/digitalwalletssdk/README.md#get) - Get digital wallet * [delete](docs/sdks/digitalwalletssdk/README.md#delete) - Delete digital wallet * [update](docs/sdks/digitalwalletssdk/README.md#update) - Update digital wallet #### [digitalWallets->domains](docs/sdks/domains/README.md) * [create](docs/sdks/domains/README.md#create) - Register a digital wallet domain * [delete](docs/sdks/domains/README.md#delete) - Remove a digital wallet domain #### [digitalWallets->sessions](docs/sdks/sessions/README.md) * [googlePay](docs/sdks/sessions/README.md#googlepay) - Create a Google Pay session * [applePay](docs/sdks/sessions/README.md#applepay) - Create a Apple Pay session * [clickToPay](docs/sdks/sessions/README.md#clicktopay) - Create a Click to Pay session ### [giftCards](docs/sdks/giftcardssdk/README.md) * [get](docs/sdks/giftcardssdk/README.md#get) - Get gift card * [delete](docs/sdks/giftcardssdk/README.md#delete) - Delete a gift card * [create](docs/sdks/giftcardssdk/README.md#create) - Create gift card * [list](docs/sdks/giftcardssdk/README.md#list) - List gift cards #### [giftCards->balances](docs/sdks/balances/README.md) * [list](docs/sdks/balances/README.md#list) - List gift card balances ### [merchantAccounts](docs/sdks/merchantaccountssdk/README.md) * [list](docs/sdks/merchantaccountssdk/README.md#list) - List all merchant accounts * [create](docs/sdks/merchantaccountssdk/README.md#create) - Create a merchant account * [get](docs/sdks/merchantaccountssdk/README.md#get) - Get a merchant account * [update](docs/sdks/merchantaccountssdk/README.md#update) - Update a merchant account ### [paymentLinks](docs/sdks/paymentlinks/README.md) * [create](docs/sdks/paymentlinks/README.md#create) - Add a payment link * [list](docs/sdks/paymentlinks/README.md#list) - List all payment links * [expire](docs/sdks/paymentlinks/README.md#expire) - Expire a payment link * [get](docs/sdks/paymentlinks/README.md#get) - Get payment link ### [paymentMethods](docs/sdks/paymentmethodssdk/README.md) * [list](docs/sdks/paymentmethodssdk/README.md#list) - List all payment methods * [create](docs/sdks/paymentmethodssdk/README.md#create) - Create payment method * [get](docs/sdks/paymentmethodssdk/README.md#get) - Get payment method * [delete](docs/sdks/paymentmethodssdk/README.md#delete) - Delete payment method #### [paymentMethods->networkTokens](docs/sdks/paymentmethodsnetworktokens/README.md) * [list](docs/sdks/paymentmethodsnetworktokens/README.md#list) - List network tokens * [create](docs/sdks/paymentmethodsnetworktokens/README.md#create) - Provision network token * [suspend](docs/sdks/paymentmethodsnetworktokens/README.md#suspend) - Suspend network token * [resume](docs/sdks/paymentmethodsnetworktokens/README.md#resume) - Resume network token * [delete](docs/sdks/paymentmethodsnetworktokens/README.md#delete) - Delete network token #### [paymentMethods->networkTokens->cryptogram](docs/sdks/networktokenscryptogram/README.md) * [create](docs/sdks/networktokenscryptogram/README.md#create) - Provision network token cryptogram #### [paymentMethods->paymentServiceTokens](docs/sdks/paymentmethodspaymentservicetokens/README.md) * [list](docs/sdks/paymentmethodspaymentservicetokens/README.md#list) - List payment service tokens * [create](docs/sdks/paymentmethodspaymentservicetokens/README.md#create) - Create payment service token * [delete](docs/sdks/paymentmethodspaymentservicetokens/README.md#delete) - Delete payment service token ### [paymentOptions](docs/sdks/paymentoptionssdk/README.md) * [list](docs/sdks/paymentoptionssdk/README.md#list) - List payment options ### [paymentServiceDefinitions](docs/sdks/paymentservicedefinitionssdk/README.md) * [list](docs/sdks/paymentservicedefinitionssdk/README.md#list) - List payment service definitions * [get](docs/sdks/paymentservicedefinitionssdk/README.md#get) - Get a payment service definition * [session](docs/sdks/paymentservicedefinitionssdk/README.md#session) - Create a session for apayment service definition ### [paymentServices](docs/sdks/paymentservicessdk/README.md) * [list](docs/sdks/paymentservicessdk/README.md#list) - List payment services * [create](docs/sdks/paymentservicessdk/README.md#create) - Update a configured payment service * [get](docs/sdks/paymentservicessdk/README.md#get) - Get payment service * [update](docs/sdks/paymentservicessdk/README.md#update) - Configure a payment service * [delete](docs/sdks/paymentservicessdk/README.md#delete) - Delete a configured payment service * [verify](docs/sdks/paymentservicessdk/README.md#verify) - Verify payment service credentials * [session](docs/sdks/paymentservicessdk/README.md#session) - Create a session for apayment service definition ### [payouts](docs/sdks/payouts/README.md) * [list](docs/sdks/payouts/README.md#list) - List payouts created. * [create](docs/sdks/payouts/README.md#create) - Create a payout. * [get](docs/sdks/payouts/README.md#get) - Get a payout. ### [refunds](docs/sdks/refundssdk/README.md) * [get](docs/sdks/refundssdk/README.md#get) - Get refund ### [reportExecutions](docs/sdks/reportexecutionssdk/README.md) * [list](docs/sdks/reportexecutionssdk/README.md#list) - List executed reports ### [reports](docs/sdks/reportssdk/README.md) * [list](docs/sdks/reportssdk/README.md#list) - List configured reports * [create](docs/sdks/reportssdk/README.md#create) - Add a report * [get](docs/sdks/reportssdk/README.md#get) - Get a report * [put](docs/sdks/reportssdk/README.md#put) - Update a report #### [reports->executions](docs/sdks/executions/README.md) * [list](docs/sdks/executions/README.md#list) - List executions for report * [url](docs/sdks/executions/README.md#url) - Create URL for executed report * [get](docs/sdks/executions/README.md#get) - Get executed report ### [transactions](docs/sdks/transactions/README.md) * [list](docs/sdks/transactions/README.md#list) - List transactions * [create](docs/sdks/transactions/README.md#create) - Create transaction * [get](docs/sdks/transactions/README.md#get) - Get transaction * [capture](docs/sdks/transactions/README.md#capture) - Capture transaction * [void](docs/sdks/transactions/README.md#void) - Void transaction * [sync](docs/sdks/transactions/README.md#sync) - Sync transaction #### [transactions->events](docs/sdks/events/README.md) * [list](docs/sdks/events/README.md#list) - List transaction events #### [transactions->refunds](docs/sdks/transactionsrefunds/README.md) * [list](docs/sdks/transactionsrefunds/README.md#list) - List transaction refunds * [create](docs/sdks/transactionsrefunds/README.md#create) - Create transaction refund * [get](docs/sdks/transactionsrefunds/README.md#get) - Get transaction refund #### [transactions->refunds->all](docs/sdks/all/README.md) * [create](docs/sdks/all/README.md#create) - Create batch transaction refund #### [transactions->settlements](docs/sdks/transactionssettlements/README.md) * [get](docs/sdks/transactionssettlements/README.md#get) - Get transaction settlement * [list](docs/sdks/transactionssettlements/README.md#list) - List transaction settlements

Global Parameters

A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.

For example, you can set merchant_account_id to ` at SDK initialization and then you do not have to pass the same value on calls to operations likeget`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.

Available Globals

The following global parameter is available.

Name Type Description
merchantAccountId string The ID of the merchant account to use for this request.

Example

Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned object will be a Generator instead of an individual response.

Working with generators is as simple as iterating over the responses in a foreach loop, and you can see an example below:

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide an Options object built with a RetryConfig object to the call:

If you'd like to override the default retry strategy for all operations that support retries, you can pass a RetryConfig object to the SDKBuilder->setRetryConfig function when initializing the SDK:

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.

By default an API error will raise a errors\APIException exception, which has the following properties:

Property Type Description
$message string The error message
$statusCode int The HTTP status code
$rawResponse ?\Psr\Http\Message\ResponseInterface The raw HTTP response
$body string The response content

When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the create method throws the following exceptions:

Error Type Status Code Content Type
errors\Error400 400 application/json
errors\Error401 401 application/json
errors\Error403 403 application/json
errors\Error404 404 application/json
errors\Error405 405 application/json
errors\Error409 409 application/json
errors\HTTPValidationError 422 application/json
errors\Error425 425 application/json
errors\Error429 429 application/json
errors\Error500 500 application/json
errors\Error502 502 application/json
errors\Error504 504 application/json
errors\APIException 4XX, 5XX */*

Example

Server Selection

Select Server by Name

You can override the default server globally using the setServer(string $serverName) builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

Name Server Variables Description
production https://api.{id}.gr4vy.app id
sandbox https://api.sandbox.{id}.gr4vy.app id

If the selected server has variables, you may override its default values using the associated builder method(s):

Variable BuilderMethod Default Description
id setId(string id) "example" The subdomain for your Gr4vy instance.

Example

Override Server URL Per-Client

The default server can also be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:

Development

Testing

To run the tests, install PHP and compose, ensure to download the private_key.pem for the test environment, and run the following.

Additionally, the following tools can be used to lint the code.

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

SDK Created by Speakeasy


All versions of gr4vy-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
galbar/jsonpath Version ^3.0
guzzlehttp/guzzle Version ^7.0
speakeasy/serializer Version ^4.0.3
brick/date-time Version ^0.7.0
phpdocumentor/type-resolver Version ^1.8
brick/math Version ^0.12.1
ramsey/uuid Version ^4.7.6
lcobucci/jwt Version ^5.5.0
paragonie/sodium_compat_ext_sodium Version >= 1
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 ....