Skip to content

Commit

Permalink
Merge pull request #131 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
bekundayo authored Dec 31, 2021
2 parents 62aa57d + 641b289 commit ff6e8f4
Show file tree
Hide file tree
Showing 48 changed files with 754 additions and 925 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gocardless/gocardless-pro",
"description": "GoCardless Pro PHP Client Library",
"version": "4.14.0",
"version": "4.15.0",
"keywords": [
"gocardless",
"direct debit",
Expand Down
18 changes: 16 additions & 2 deletions lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct($config)
'Content-Type' => 'application/json',
'Authorization' => "Bearer " . $access_token,
'GoCardless-Client-Library' => 'gocardless-pro-php',
'GoCardless-Client-Version' => '4.14.0',
'GoCardless-Client-Version' => '4.15.0',
'User-Agent' => $this->getUserAgent()
),
'http_errors' => false,
Expand Down Expand Up @@ -141,6 +141,20 @@ public function billingRequestTemplates()
return $this->billing_request_templates;
}

/**
* Service for interacting with blocks
*
* @return Services\BlocksService
*/
public function blocks()
{
if (!isset($this->blocks)) {
$this->blocks = new Services\BlocksService($this->api_client);
}

return $this->blocks;
}

/**
* Service for interacting with creditors
*
Expand Down Expand Up @@ -512,7 +526,7 @@ private function getUserAgent()
{
$curlinfo = curl_version();
$uagent = array();
$uagent[] = 'gocardless-pro-php/4.14.0';
$uagent[] = 'gocardless-pro-php/4.15.0';
$uagent[] = 'schema-version/2015-07-06';
if (defined('\GuzzleHttp\Client::MAJOR_VERSION')) {
$uagent[] = 'GuzzleHttp/' . \GuzzleHttp\Client::MAJOR_VERSION;
Expand Down
17 changes: 14 additions & 3 deletions lib/Resources/BillingRequestFlow.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @property-read $authorisation_url
* @property-read $auto_fulfil
* @property-read $created_at
* @property-read $exit_uri
* @property-read $expires_at
* @property-read $id
* @property-read $links
Expand All @@ -33,7 +34,9 @@ class BillingRequestFlow extends BaseResource
protected $authorisation_url;

/**
* Fulfil the Billing Request on completion of the flow (true by default)
* (Experimental feature) Fulfil the Billing Request on completion of the
* flow (true by default). Disabling the auto_fulfil is not allowed
* currently.
*/
protected $auto_fulfil;

Expand All @@ -42,6 +45,12 @@ class BillingRequestFlow extends BaseResource
*/
protected $created_at;

/**
* URL that the payer can be taken to if there isn't a way to progress ahead
* in flow.
*/
protected $exit_uri;

/**
* Timestamp when the flow will expire. Each flow currently lasts for 7
* days.
Expand All @@ -60,13 +69,15 @@ class BillingRequestFlow extends BaseResource

/**
* If true, the payer will not be able to change their bank account within
* the flow
* the flow. If the bank_account details are collected as part of
* bank_authorisation then GC will set this value to true mid flow
*/
protected $lock_bank_account;

/**
* If true, the payer will not be able to edit their customer details within
* the flow
* the flow. If the customer details are collected as part of
* bank_authorisation then GC will set this value to true mid flow
*/
protected $lock_customer_details;

Expand Down
14 changes: 6 additions & 8 deletions lib/Resources/BillingRequestTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class BillingRequestTemplate extends BaseResource

/**
* [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
* code. Currently only "GBP" is supported as we only have one scheme that
* is per_payment_authorised.
* code.
*/
protected $mandate_request_currency;

Expand All @@ -64,8 +63,8 @@ class BillingRequestTemplate extends BaseResource
protected $mandate_request_metadata;

/**
* A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
* "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
* A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
* "betalingsservice", "pad" and "sepa_core" are supported.
*/
protected $mandate_request_scheme;

Expand Down Expand Up @@ -105,8 +104,7 @@ class BillingRequestTemplate extends BaseResource

/**
* [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
* code. Currently only "GBP" is supported as we only have one scheme that
* is per_payment_authorised.
* code.
*/
protected $payment_request_currency;

Expand All @@ -124,8 +122,8 @@ class BillingRequestTemplate extends BaseResource
protected $payment_request_metadata;

/**
* A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
* "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
* A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
* "betalingsservice", "pad" and "sepa_core" are supported.
*/
protected $payment_request_scheme;

Expand Down
90 changes: 90 additions & 0 deletions lib/Resources/Block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/**
* WARNING: Do not edit by hand, this file was generated by Crank:
*
* https://github.com/gocardless/crank
*/

namespace GoCardlessPro\Resources;

/**
* A thin wrapper around a block, providing access to its
* attributes
*
* @property-read $active
* @property-read $block_type
* @property-read $created_at
* @property-read $id
* @property-read $reason_description
* @property-read $reason_type
* @property-read $resource_reference
* @property-read $updated_at
*/
class Block extends BaseResource
{
protected $model_name = "Block";

/**
* Shows if the block is active or disabled. Only active blocks will be used
* when deciding
* if a mandate should be blocked.
*/
protected $active;

/**
* Type of entity we will seek to match against when blocking the mandate.
* This
* can currently be one of 'email', 'email_domain', or 'bank_account'.
*/
protected $block_type;

/**
* Fixed [timestamp](#api-usage-time-zones--dates), recording when this
* resource was created.
*/
protected $created_at;

/**
* Unique identifier, beginning with "BLC".
*/
protected $id;

/**
* This field is required if the reason_type is other. It should be a
* description of
* the reason for why you wish to block this payer and why it does not align
* with the
* given reason_types. This is intended to help us improve our knowledge of
* types of
* fraud.
*/
protected $reason_description;

/**
* The reason you wish to block this payer, can currently be one of
* 'identity_fraud',
* 'no_intent_to_pay', 'unfair_chargeback'. If the reason isn't captured by
* one of the
* above then 'other' can be selected but you must provide a reason
* description.
*/
protected $reason_type;

/**
* This field is a reference to the value you wish to block. This may be the
* raw value
* (in the case of emails or email domains) or the ID of the resource (in
* the case of
* bank accounts). This means in order to block a specific bank account it
* must already
* have been created as a resource.
*/
protected $resource_reference;

/**
* Fixed [timestamp](#api-usage-time-zones--dates), recording when this
* resource was updated.
*/
protected $updated_at;

}
8 changes: 8 additions & 0 deletions lib/Resources/Institution.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* A thin wrapper around a institution, providing access to its
* attributes
*
* @property-read $country_code
* @property-read $icon_url
* @property-read $id
* @property-read $logo_url
Expand All @@ -20,6 +21,13 @@ class Institution extends BaseResource
{
protected $model_name = "Institution";

/**
* [ISO
* 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
* alpha-2 code. The country code of the institution.
*/
protected $country_code;

/**
* A URL pointing to the icon for this institution
*/
Expand Down
Loading

0 comments on commit ff6e8f4

Please sign in to comment.