Skip to content

Commit

Permalink
Merge pull request #24 from burakcakirel/get-payment-method
Browse files Browse the repository at this point in the history
Get payment method
  • Loading branch information
bakura10 committed Apr 7, 2020
2 parents f49050e + 0c2f3a2 commit f5eb829
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,12 @@ have been tested and are working as of 17th January 2017, but it's basically "us
* getWebhook(array $args = [])
* createWebhook(array $args = [])
* updateWebhook(array $args = [])
* deleteWebhook(array $args = [])
* deleteWebhook(array $args = [])

**PAYMENT RELATED METHODS (NOT OFFICIALLY SUPPORTED YET):**

* getPayment(array $args = [])
* getPayments(array $args = [])
* createPayment(array $args = [])
* updatePayment(array $args = [])
* deletePayment(array $args = [])
195 changes: 195 additions & 0 deletions src/ServiceDescription/TradeGecko-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -6845,6 +6845,201 @@
],
],
],

/**
* --------------------------------------------------------------------------------
* PAYMENT RELATED METHODS
*
* DOC: http://developer.tradegecko.com/#payment
* --------------------------------------------------------------------------------
*/

'GetPayments' => [
'httpMethod' => 'GET',
'uri' => 'payments',
'responseModel' => 'GenericModel',
'data' => [
'root_key' => 'payment',
],
'parameters' => [
'created_at_min' => [
'location' => 'query',
'type' => 'string',
'format' => 'date-time',
'required' => false,
],
'created_at_max' => [
'location' => 'query',
'type' => 'string',
'format' => 'date-time',
'required' => false,
],
'updated_at_min' => [
'location' => 'query',
'type' => 'string',
'format' => 'date-time',
'required' => false,
],
'updated_at_max' => [
'location' => 'query',
'type' => 'string',
'format' => 'date-time',
'required' => false,
],
'limit' => [
'location' => 'query',
'type' => 'integer',
'min' => 1,
'max' => 250,
'required' => false,
],
'page' => [
'location' => 'query',
'type' => 'integer',
'min' => 1,
'required' => false,
],
'order' => [
'location' => 'query',
'type' => 'string',
'required' => false
],
'invoice_id' => [
'location' => 'query',
'type' => ['integer', 'array'],
'required' => false,
],
'ids' => [
'location' => 'query',
'type' => ['integer', 'array'],
'required' => false,
],
],
],

'GetPayment' => [
'httpMethod' => 'GET',
'uri' => 'payments/{id}',
'responseModel' => 'GenericModel',
'data' => [
'root_key' => 'payment',
],
'parameters' => [
'id' => [
'location' => 'uri',
'type' => 'integer',
'required' => true,
],
],
],

'CreatePayment' => [
'httpMethod' => 'POST',
'uri' => 'payments',
'responseModel' => 'GenericModel',
'data' => [
'root_key' => 'payment',
],
'parameters' => [
'invoice_id' => [
'location' => 'json',
'type' => 'integer',
'required' => true,
],
'amount' => [
'location' => 'json',
'type' => 'string',
'required' => true,
],
'order_id' => [
'location' => 'json',
'type' => 'integer',
'required' => false,
],
'payment_method_id' => [
'location' => 'json',
'type' => 'integer',
'required' => false,
],
'reference' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'paid_at' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'status' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'exchange_rate' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
],
],

'UpdatePayment' => [
'httpMethod' => 'PUT',
'uri' => 'payments/{id}',
'responseModel' => 'GenericModel',
'data' => [
'root_key' => 'payment',
],
'parameters' => [
'amount' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'payment_method_id' => [
'location' => 'json',
'type' => 'integer',
'required' => false,
],
'reference' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'paid_at' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'status' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
'exchange_rate' => [
'location' => 'json',
'type' => 'string',
'required' => false,
],
],
],

'DeletePayment' => [
'httpMethod' => 'DELETE',
'uri' => 'payments/{id}',
'responseModel' => 'GenericModel',
'data' => [
'root_key' => 'payment',
],
'parameters' => [
'id' => [
'location' => 'uri',
'type' => 'integer',
'required' => true,
],
],
],
],

'models' => [
Expand Down
8 changes: 8 additions & 0 deletions src/TradeGeckoClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@
* @method array updateWebhook(array $args = []) {@command TradeGecko UpdateWebhook}
* @method array deleteWebhook(array $args = []) {@command TradeGecko DeleteWebhook}
*
* PAYMENT RELATED METHODS:
*
* @method array getPayments(array $args = []) {@command TradeGecko GetPayments}
* @method array getPayment(array $args = []) {@command TradeGecko GetPayment}
* @method array createPayment(array $args = []) {@command TradeGecko CreatePayment}
* @method array updatePayment(array $args = []) {@command TradeGecko UpdatePayment}
* @method array deletePayment(array $args = []) {@command TradeGecko DeletePayment}
*
* ITERATOR METHODS:
*
* @method \Traversable getAccountsIterator(array $commandArgs = [], array $iteratorArgs = []) {@command TradeGecko GetAccounts}
Expand Down

0 comments on commit f5eb829

Please sign in to comment.