Skip to content

Commit

Permalink
Merge pull request #153 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Release v4.25.0
  • Loading branch information
jjholmes927 authored Jan 31, 2023
2 parents 908639d + e275c4b commit ebaed83
Show file tree
Hide file tree
Showing 40 changed files with 859 additions and 68 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.24.0",
"version": "4.25.0",
"keywords": [
"gocardless",
"direct debit",
Expand Down
32 changes: 30 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.24.0',
'GoCardless-Client-Version' => '4.25.0',
'User-Agent' => $this->getUserAgent()
),
'http_errors' => false,
Expand Down Expand Up @@ -435,6 +435,20 @@ public function scenarioSimulators()
return $this->scenario_simulators;
}

/**
* Service for interacting with scheme identifiers
*
* @return Services\SchemeIdentifiersService
*/
public function schemeIdentifiers()
{
if (!isset($this->scheme_identifiers)) {
$this->scheme_identifiers = new Services\SchemeIdentifiersService($this->api_client);
}

return $this->scheme_identifiers;
}

/**
* Service for interacting with subscriptions
*
Expand Down Expand Up @@ -463,6 +477,20 @@ public function taxRates()
return $this->tax_rates;
}

/**
* Service for interacting with verification details
*
* @return Services\VerificationDetailsService
*/
public function verificationDetails()
{
if (!isset($this->verification_details)) {
$this->verification_details = new Services\VerificationDetailsService($this->api_client);
}

return $this->verification_details;
}

/**
* Service for interacting with webhooks
*
Expand Down Expand Up @@ -526,7 +554,7 @@ private function getUserAgent()
{
$curlinfo = curl_version();
$uagent = array();
$uagent[] = 'gocardless-pro-php/4.24.0';
$uagent[] = 'gocardless-pro-php/4.25.0';
$uagent[] = 'schema-version/2015-07-06';
if (defined('\GuzzleHttp\Client::MAJOR_VERSION')) {
$uagent[] = 'GuzzleHttp/' . \GuzzleHttp\Client::MAJOR_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion lib/Resources/Creditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Creditor extends BaseResource
protected $merchant_responsible_for_notifications;

/**
* The creditor's name.
* The creditor's trading name.
*/
protected $name;

Expand Down
7 changes: 7 additions & 0 deletions lib/Resources/Mandate.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @property-read $reference
* @property-read $scheme
* @property-read $status
* @property-read $verified_at
*/
class Mandate extends BaseResource
{
Expand Down Expand Up @@ -119,4 +120,10 @@ class Mandate extends BaseResource
*/
protected $status;

/**
* [Timestamp](#api-usage-time-zones--dates) recording when this mandate was
* verified.
*/
protected $verified_at;

}
138 changes: 138 additions & 0 deletions lib/Resources/SchemeIdentifier.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?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 scheme_identifier, providing access to its
* attributes
*
* @property-read $address_line1
* @property-read $address_line2
* @property-read $address_line3
* @property-read $can_specify_mandate_reference
* @property-read $city
* @property-read $country_code
* @property-read $created_at
* @property-read $currency
* @property-read $email
* @property-read $id
* @property-read $minimum_advance_notice
* @property-read $name
* @property-read $phone_number
* @property-read $postal_code
* @property-read $reference
* @property-read $region
* @property-read $scheme
* @property-read $status
*/
class SchemeIdentifier extends BaseResource
{
protected $model_name = "SchemeIdentifier";

/**
* The first line of the scheme identifier's support address.
*/
protected $address_line1;

/**
* The second line of the scheme identifier's support address.
*/
protected $address_line2;

/**
* The third line of the scheme identifier's support address.
*/
protected $address_line3;

/**
* Whether a custom reference can be submitted for mandates using this
* scheme identifier.
*/
protected $can_specify_mandate_reference;

/**
* The city of the scheme identifier's support address.
*/
protected $city;

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

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

/**
* The currency of the scheme identifier.
*/
protected $currency;

/**
* Scheme identifier's support email address.
*/
protected $email;

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

/**
* The minimum interval, in working days, between the sending of a
* pre-notification to the customer, and the charge date of a payment using
* this scheme identifier.
*
* By default, GoCardless sends these notifications automatically. Please
* see our [compliance requirements](#appendix-compliance-requirements) for
* more details.
*/
protected $minimum_advance_notice;

/**
* The name which appears on customers' bank statements. This should usually
* be the merchant's trading name.
*/
protected $name;

/**
* Scheme identifier's support phone number.
*/
protected $phone_number;

/**
* The scheme identifier's support postal code.
*/
protected $postal_code;

/**
* The scheme-unique identifier against which payments are submitted.
*/
protected $reference;

/**
* The scheme identifier's support address region, county or department.
*/
protected $region;

/**
* The scheme which this scheme identifier applies to.
*/
protected $scheme;

/**
* The status of the scheme identifier. Only `active` scheme identifiers
* will be applied to a creditor and used against payments.
*/
protected $status;

}
73 changes: 73 additions & 0 deletions lib/Resources/VerificationDetail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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 verification_detail, providing access to its
* attributes
*
* @property-read $address_line1
* @property-read $address_line2
* @property-read $address_line3
* @property-read $city
* @property-read $company_number
* @property-read $description
* @property-read $directors
* @property-read $links
* @property-read $postal_code
*/
class VerificationDetail extends BaseResource
{
protected $model_name = "VerificationDetail";

/**
* The first line of the company's address.
*/
protected $address_line1;

/**
* The second line of the company's address.
*/
protected $address_line2;

/**
* The third line of the company's address.
*/
protected $address_line3;

/**
* The city of the company's address.
*/
protected $city;

/**
* The company's registration number.
*/
protected $company_number;

/**
* A summary describing what the company does.
*/
protected $description;

/**
* The company's directors.
*/
protected $directors;

/**
*
*/
protected $links;

/**
* The company's postal code.
*/
protected $postal_code;

}
43 changes: 43 additions & 0 deletions lib/Services/CreditorsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* @method list()
* @method get()
* @method update()
* @method applySchemeIdentifier()
*/
class CreditorsService extends BaseService
{
Expand Down Expand Up @@ -147,6 +148,48 @@ public function update($identity, $params = array())
return $this->getResourceForResponse($response);
}

/**
* Apply a scheme identifier
*
* Example URL: /creditors/:identity/actions/apply_scheme_identifier
*
* @param string $identity Unique identifier, beginning with "CR".
* @param string[mixed] $params An associative array for any params
* @return Creditor
**/
public function applySchemeIdentifier($identity, $params = array())
{
$path = Util::subUrl(
'/creditors/:identity/actions/apply_scheme_identifier',
array(

'identity' => $identity
)
);
if(isset($params['params'])) {
$params['body'] = json_encode(array("data" => (object)$params['params']));

unset($params['params']);
}


try {
$response = $this->api_client->post($path, $params);
} catch(InvalidStateException $e) {
if ($e->isIdempotentCreationConflict()) {
if ($this->api_client->error_on_idempotency_conflict) {
throw $e;
}
return $this->get($e->getConflictingResourceId());
}

throw $e;
}


return $this->getResourceForResponse($response);
}

/**
* List creditors
*
Expand Down
Loading

0 comments on commit ebaed83

Please sign in to comment.