Skip to content

Commit

Permalink
1.7.0 update (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerhunter authored Apr 16, 2021
1 parent 63d4149 commit ed0f4de
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Additionally, temporary PHP 7.4 support was added using these replaces:

## Version

1.6.0
1.7.0

## Installation

Expand Down Expand Up @@ -166,6 +166,9 @@ Each model represents the different kinds of requests and responses that can be

## Changelog

1.7.0
* New `getCustomerCardToken` method added to `CustomersAPI` for creating a card funding sources token for a customer.

1.6.0
* New `TokenApi` adding support for application access token and client token requests.

Expand Down
2 changes: 1 addition & 1 deletion lib/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ApiClient {
/*
* @var string user agent of the HTTP request, set to "PHP-Swagger" by default
*/
protected $user_agent = "php-swagger-1.6.0";
protected $user_agent = "php-swagger-1.7.0";

/**
* @param string $host Base url of the API server (optional)
Expand Down
69 changes: 69 additions & 0 deletions lib/CustomersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,75 @@ public function createFundingSourcesTokenForCustomer($id, $headers = null) {
return $response[0] == 201 ? $response[1] : $this->apiClient->deserialize($response[1],'CustomerOAuthToken');
}

/**
* getCustomerCardToken
*
* Create a token that is capable of adding a debit card for the given customer.
*
* @param string $id ID of customer. (required)
* @return CustomerOAuthToken
*/
public function getCustomerCardToken($id, $headers = null) {

// verify the required parameter 'id' is set
if ($id === null) {
throw new \InvalidArgumentException('Missing the required parameter $id when calling getCustomerCardToken');
}


// parse inputs
$resourcePath = "/customers/{id}/card-funding-sources-token";
$resourcePath = str_replace("{format}", "json", $resourcePath);
$method = "POST";
$httpBody = '';
$queryParams = array();
$headerParams = array();
$formParams = array();
$_header_accept = $this->apiClient->selectHeaderAccept(array('application/vnd.dwolla.v1.hal+json'));
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());

if (!is_null($headers)){
$headerParams = array_merge($headerParams, $headers);
}



// Entire URL for ID
if (filter_var($id, FILTER_VALIDATE_URL)) {
$split = explode('/', $id);
$id = end($split);
}
// path params
if($id !== null) {
$resourcePath = str_replace("{" . "id" . "}",
$this->apiClient->toPathValue($id), $resourcePath);
}



// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} else if (count($formParams) > 0) {
// for HTTP post (form)
$httpBody = $formParams;
}

// make the API Call
$response = $this->apiClient->callAPI($resourcePath, $method,
$queryParams, $httpBody,
$headerParams, $this->authSettings);

if(!$response[1]) {
return null;
}

return $response[0] == 201 ? $response[1] : $this->apiClient->deserialize($response[1],'CustomerOAuthToken');
}

/**
* getCustomerIavToken
*
Expand Down

0 comments on commit ed0f4de

Please sign in to comment.