mooore / ecurring-api-php
eCurring API client library for PHP.
Installs: 9 063
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 5
Forks: 4
Open Issues: 2
Requires
- php: >=7.2
- ext-json: *
- composer/ca-bundle: ^1.1
- guzzlehttp/guzzle: ^6.3|^7.0.1
Requires (Dev)
- fzaninotto/faker: ^1.8
- phpro/grumphp: ^0.19.0
- phpstan/phpstan: ^0.12.0
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-10-29 05:47:10 UTC
README
This is an unofficial library which provides PHP bindings for the eCurring API.
eCurring Home | eCurring API Documentation
This library is inspired by Mollie API client for PHP.
Requirements
In order to use this library, you need:
- An active eCurring account and API key.
- PHP >= 7.2
Installation
composer require mooore/ecurring-api-php
Getting started
Initializing the eCurring client
use Mooore\eCurring\eCurringHttpClient; $client = new eCurringHttpClient(); $client->setApiKey('your_api_key');
Creating a customer
$customer = $client->customers->create([ 'first_name' => 'John', 'last_name' => 'Doe', 'email' => 'example@domain.com' ]);
Creating a subscription from customer
$customer = $client->customers->get(200); $subscription = $customer->createSubscription(1);
Creating a subscription from subscription plan
$subscriptionPlan = $client->subscriptionPlans->get(1); $subscription = $subscriptionPlan->createSubscription(200);
Get all subscriptions
$customers = $client->customers->page(); do { foreach ($customers as $customer) { if ($subscription->isActive()) { // do something } } } while ($customers = $customers->next());
Roadmap
- Implement Included resources
- Implement Sparse Fieldsets