From e1172bf2e6c8ce579bbd6b7825d52cc16f53ae1b Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Wed, 3 Jan 2018 11:31:39 -0200 Subject: [PATCH] Add new endpoints --- CHANGELOG.md | 5 ++++ composer.json | 2 +- .../createSubscriptionHistory.php | 28 +++++++++++++++++++ examples/subscription/updatePlan.php | 26 +++++++++++++++++ src/Gerencianet/config.json | 8 ++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100755 examples/subscription/createSubscriptionHistory.php create mode 100755 examples/subscription/updatePlan.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a67dc..bb5b459 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.1.0 + +- Added: new endpoint (update plan) +- Added: new endpoint (create subscription history) + # 2.0.0 - Breaking change: Drop PHP 5.4 support diff --git a/composer.json b/composer.json index e22174f..d1ee0cb 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "gerencianet/gerencianet-sdk-php", "description": "GN API SDK PHP", - "version": "2.0.0", + "version": "2.1.0", "require": { "guzzlehttp/guzzle": "^6.0.0", "php": ">=5.5.0" diff --git a/examples/subscription/createSubscriptionHistory.php b/examples/subscription/createSubscriptionHistory.php new file mode 100755 index 0000000..9495690 --- /dev/null +++ b/examples/subscription/createSubscriptionHistory.php @@ -0,0 +1,28 @@ + 0]; + +$body = [ + 'description' => 'This carnet is about a service' +]; + +try { + $api = new Gerencianet($options); + $response = $api->createSubscriptionHistory($params, $body); + + print_r($response); +} catch (GerencianetException $e) { + print_r($e->code); + print_r($e->error); + print_r($e->errorDescription); +} catch (Exception $e) { + print_r($e->getMessage()); +} diff --git a/examples/subscription/updatePlan.php b/examples/subscription/updatePlan.php new file mode 100755 index 0000000..a8e3a43 --- /dev/null +++ b/examples/subscription/updatePlan.php @@ -0,0 +1,26 @@ + 0]; + +$body = [ 'name' => 'My new plan' ]; + +try { + $api = new Gerencianet($options); + $subscription = $api->updatePlan($params, $body); + + print_r($subscription); +} catch (GerencianetException $e) { + print_r($e->code); + print_r($e->error); + print_r($e->errorDescription); +} catch (Exception $e) { + print_r($e->getMessage()); +} diff --git a/src/Gerencianet/config.json b/src/Gerencianet/config.json index cb1fe42..533e149 100755 --- a/src/Gerencianet/config.json +++ b/src/Gerencianet/config.json @@ -127,6 +127,14 @@ "updateChargeLink": { "route": "/v1/charge/:id/link", "method": "put" + }, + "updatePlan": { + "route": "/v1/plan/:id", + "method": "put" + }, + "createSubscriptionHistory": { + "route": "/v1/subscription/:id/history", + "method": "post" } } }