Skip to content

Commit

Permalink
Merge pull request #19 from Dwolla/1.0.16
Browse files Browse the repository at this point in the history
1.0.16 update
  • Loading branch information
spencerhunter authored Nov 10, 2017
2 parents 2241b4f + 1eb5bda commit 5f22c0f
Show file tree
Hide file tree
Showing 19 changed files with 586 additions and 24 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The new Dwolla API V2 SDK, as generated by [this fork of swagger-codegen](https:

## Version

1.0.15
1.0.16

## Installation

Expand Down Expand Up @@ -91,7 +91,11 @@ Each API module is named in accordance to ([Dwolla's API Spec](http://docsv2.dwo
* `DocumentsApi`
* `EventsApi`
* `FundingsourcesApi`
* `MasspaymentitemsApi`
* `MasspaymentsApi`
* `OndemandauthorizationsApi`
* `RootApi`
* `SandboxApi`
* `TransfersApi`
* `WebhooksApi`
* `WebhooksubscriptionsApi`
Expand Down Expand Up @@ -147,6 +151,12 @@ Each model represents the different kinds of requests and responses that can be

## Changelog

1.0.16
* API schema updated, `FundingsourcesApi` updated to support update a funding source. `MasspaymentsApi` and `MasspaymentitemsApi` updated to support filtering by correlationId.
* New `SandboxApi` which is used to simulate bank transfer processing in the Sandbox.
* Existing `CreateFundingSourceRequest`, `FundingSource`, `MassPayment`, `MassPaymentItem`, `MassPaymentItemRequestBody`, `MassPaymentRequestBody`, `Transfer`, `TransferFailure`, and `TransferRequestBody` models updated.
* New `ProcessResult`, `UpdateBankRequest`, and `UpdateJobRequestBody` models.

1.0.15
* Optional parameters set to null.

Expand Down
18 changes: 17 additions & 1 deletion lib/CustomersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,15 @@ public function getCustomerDocuments($id) {
*
* Upload a verification document.
*
* @param string $id ID of customer. (required)
* @return Unit
*/
public function uploadDocument() {
public function uploadDocument($id) {

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


// parse inputs
Expand All @@ -404,6 +410,16 @@ public function uploadDocument() {



// 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);
}



Expand Down
73 changes: 72 additions & 1 deletion lib/FundingsourcesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,78 @@ public function id($id) {

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


/**
* update
*
* Update a funding source.
*
* @param UpdateBankRequest $body request body to update a funding source (required)
* @param string $id Funding source ID to update. (required)
* @return FundingSource
*/
public function update($body, $id) {

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


// parse inputs
$resourcePath = "/funding-sources/{id}";
$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());




// 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);
}

// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}

// 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],'FundingSource');
}

/**
* softDelete
*
Expand Down
6 changes: 5 additions & 1 deletion lib/MasspaymentitemsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ public function byId($id) {
* @param int $limit How many results to return. (optional)
* @param int $offset How many results to skip. (optional)
* @param string $status What status to filter by. (optional)
* @param string $correlation_id Correlation ID to search by. (optional)
* @return MassPaymentItemListResponse
*/
public function getMassPaymentItems($id, $limit = null, $offset = null, $status = null) {
public function getMassPaymentItems($id, $limit = null, $offset = null, $status = null, $correlation_id = null) {

// verify the required parameter 'id' is set
if ($id === null) {
Expand Down Expand Up @@ -165,6 +166,9 @@ public function getMassPaymentItems($id, $limit = null, $offset = null, $status
}// query params
if($status !== null) {
$queryParams['status'] = $this->apiClient->toQueryValue($status);
}// query params
if($correlation_id !== null) {
$queryParams['correlationId'] = $this->apiClient->toQueryValue($correlation_id);
}


Expand Down
83 changes: 81 additions & 2 deletions lib/MasspaymentsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ public function setApiClient($apiClient) {
* @param string $id Account ID (required)
* @param int $limit How many results to return. (optional)
* @param int $offset How many results to skip. (optional)
* @param string $correlation_id Correlation ID to search by. (optional)
* @return MassPaymentListResponse
*/
public function getByAccount($id, $limit = null, $offset = null) {
public function getByAccount($id, $limit = null, $offset = null, $correlation_id = null) {

// verify the required parameter 'id' is set
if ($id === null) {
Expand Down Expand Up @@ -95,6 +96,9 @@ public function getByAccount($id, $limit = null, $offset = null) {
}// query params
if($offset !== null) {
$queryParams['offset'] = $this->apiClient->toQueryValue($offset);
}// query params
if($correlation_id !== null) {
$queryParams['correlationId'] = $this->apiClient->toQueryValue($correlation_id);
}


Expand Down Expand Up @@ -139,9 +143,10 @@ public function getByAccount($id, $limit = null, $offset = null) {
* @param string $id Customer ID (required)
* @param int $limit How many results to return. (optional)
* @param int $offset How many results to skip. (optional)
* @param string $correlation_id Correlation ID to search by. (required)
* @return MassPaymentListResponse
*/
public function getByCustomer($id, $limit = null, $offset = null) {
public function getByCustomer($id, $limit = null, $offset = null, $correlation_id = null) {

// verify the required parameter 'id' is set
if ($id === null) {
Expand Down Expand Up @@ -169,6 +174,9 @@ public function getByCustomer($id, $limit = null, $offset = null) {
}// query params
if($offset !== null) {
$queryParams['offset'] = $this->apiClient->toQueryValue($offset);
}// query params
if($correlation_id !== null) {
$queryParams['correlationId'] = $this->apiClient->toQueryValue($correlation_id);
}


Expand Down Expand Up @@ -326,5 +334,76 @@ public function byId($id) {
return $response[0] == 201 ? $response[1] : $this->apiClient->deserialize($response[1],'MassPayment');
}

/**
* update
*
* Update a mass-payment.
*
* @param UpdateJobRequestBody $body Mass-payment to update. (required)
* @param string $id ID of mass-payment to update (required)
* @return MassPayment
*/
public function update($body, $id) {

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


// parse inputs
$resourcePath = "/mass-payments/{id}";
$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('application/vnd.dwolla.v1.hal+json'));




// 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);
}

// body params
$_tempBody = null;
if (isset($body)) {
$_tempBody = $body;
}

// 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],'MassPayment');
}


}
Loading

0 comments on commit 5f22c0f

Please sign in to comment.