Skip to content

Commit

Permalink
Merge pull request #6 from MONEI/feat/update-recurring-payments
Browse files Browse the repository at this point in the history
feat: update recurring payments
  • Loading branch information
jimmyn authored Nov 20, 2020
2 parents d359e74 + edb8357 commit fafa7e4
Show file tree
Hide file tree
Showing 12 changed files with 967 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Or add the following to `composer.json`:
```json
{
"require": {
"monei/monei-php-sdk": "^0.1.4"
"monei/monei-php-sdk": "^0.1.5"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion build/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packageName": "MONEI PHP SDK",
"packageVersion": "0.1.4",
"packageVersion": "0.1.5",
"gitHost": "github.com",
"gitUserId": "monei",
"gitRepoId": "monei-php-sdk"
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monei-php-sdk",
"version": "0.1.4",
"version": "0.1.5",
"description": "MONEI PHP SDK",
"author": "monei",
"scripts": {
Expand Down
42 changes: 21 additions & 21 deletions lib/Api/PaymentsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1529,16 +1529,16 @@ protected function getRequest($id)
*
* Recurring Payment
*
* @param string $id The payment ID (required)
* @param string $sequence_id The sequence ID (required)
* @param \OpenAPI\Client\Model\RecurringPaymentRequest $recurring_payment_request recurring_payment_request (optional)
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \OpenAPI\Client\Model\Payment
*/
public function recurring($id, $recurring_payment_request = null)
public function recurring($sequence_id, $recurring_payment_request = null)
{
list($response) = $this->recurringWithHttpInfo($id, $recurring_payment_request);
list($response) = $this->recurringWithHttpInfo($sequence_id, $recurring_payment_request);
return $response;
}

Expand All @@ -1547,16 +1547,16 @@ public function recurring($id, $recurring_payment_request = null)
*
* Recurring Payment
*
* @param string $id The payment ID (required)
* @param string $sequence_id The sequence ID (required)
* @param \OpenAPI\Client\Model\RecurringPaymentRequest $recurring_payment_request (optional)
*
* @throws \OpenAPI\Client\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \OpenAPI\Client\Model\Payment, HTTP status code, HTTP response headers (array of strings)
*/
public function recurringWithHttpInfo($id, $recurring_payment_request = null)
public function recurringWithHttpInfo($sequence_id, $recurring_payment_request = null)
{
$request = $this->recurringRequest($id, $recurring_payment_request);
$request = $this->recurringRequest($sequence_id, $recurring_payment_request);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -1636,15 +1636,15 @@ public function recurringWithHttpInfo($id, $recurring_payment_request = null)
*
* Recurring Payment
*
* @param string $id The payment ID (required)
* @param string $sequence_id The sequence ID (required)
* @param \OpenAPI\Client\Model\RecurringPaymentRequest $recurring_payment_request (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function recurringAsync($id, $recurring_payment_request = null)
public function recurringAsync($sequence_id, $recurring_payment_request = null)
{
return $this->recurringAsyncWithHttpInfo($id, $recurring_payment_request)
return $this->recurringAsyncWithHttpInfo($sequence_id, $recurring_payment_request)
->then(
function ($response) {
return $response[0];
Expand All @@ -1657,16 +1657,16 @@ function ($response) {
*
* Recurring Payment
*
* @param string $id The payment ID (required)
* @param string $sequence_id The sequence ID (required)
* @param \OpenAPI\Client\Model\RecurringPaymentRequest $recurring_payment_request (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function recurringAsyncWithHttpInfo($id, $recurring_payment_request = null)
public function recurringAsyncWithHttpInfo($sequence_id, $recurring_payment_request = null)
{
$returnType = '\OpenAPI\Client\Model\Payment';
$request = $this->recurringRequest($id, $recurring_payment_request);
$request = $this->recurringRequest($sequence_id, $recurring_payment_request);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -1705,22 +1705,22 @@ function ($exception) {
/**
* Create request for operation 'recurring'
*
* @param string $id The payment ID (required)
* @param string $sequence_id The sequence ID (required)
* @param \OpenAPI\Client\Model\RecurringPaymentRequest $recurring_payment_request (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
protected function recurringRequest($id, $recurring_payment_request = null)
protected function recurringRequest($sequence_id, $recurring_payment_request = null)
{
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
// verify the required parameter 'sequence_id' is set
if ($sequence_id === null || (is_array($sequence_id) && count($sequence_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling recurring'
'Missing the required parameter $sequence_id when calling recurring'
);
}

$resourcePath = '/payments/{id}/recurring';
$resourcePath = '/payments/{sequenceId}/recurring';
$formParams = [];
$queryParams = [];
$headerParams = [];
Expand All @@ -1730,10 +1730,10 @@ protected function recurringRequest($id, $recurring_payment_request = null)


// path params
if ($id !== null) {
if ($sequence_id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
'{' . 'sequenceId' . '}',
ObjectSerializer::toPathValue($sequence_id),
$resourcePath
);
}
Expand Down
28 changes: 14 additions & 14 deletions lib/Model/CreatePaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CreatePaymentRequest implements ModelInterface, ArrayAccess
'payment_method' => '\OpenAPI\Client\Model\PaymentPaymentMethodInput',
'allowed_payment_methods' => '\OpenAPI\Client\Model\PaymentPaymentMethods',
'transaction_type' => '\OpenAPI\Client\Model\PaymentTransactionType',
'recurring' => '\OpenAPI\Client\Model\PaymentRecurring',
'sequence' => '\OpenAPI\Client\Model\PaymentSequence',
'description' => 'string',
'customer' => '\OpenAPI\Client\Model\PaymentCustomer',
'billing_details' => '\OpenAPI\Client\Model\PaymentBillingDetails',
Expand All @@ -97,7 +97,7 @@ class CreatePaymentRequest implements ModelInterface, ArrayAccess
'payment_method' => null,
'allowed_payment_methods' => null,
'transaction_type' => null,
'recurring' => null,
'sequence' => null,
'description' => null,
'customer' => null,
'billing_details' => null,
Expand Down Expand Up @@ -145,7 +145,7 @@ public static function openAPIFormats()
'payment_method' => 'paymentMethod',
'allowed_payment_methods' => 'allowedPaymentMethods',
'transaction_type' => 'transactionType',
'recurring' => 'recurring',
'sequence' => 'sequence',
'description' => 'description',
'customer' => 'customer',
'billing_details' => 'billingDetails',
Expand All @@ -172,7 +172,7 @@ public static function openAPIFormats()
'payment_method' => 'setPaymentMethod',
'allowed_payment_methods' => 'setAllowedPaymentMethods',
'transaction_type' => 'setTransactionType',
'recurring' => 'setRecurring',
'sequence' => 'setSequence',
'description' => 'setDescription',
'customer' => 'setCustomer',
'billing_details' => 'setBillingDetails',
Expand All @@ -199,7 +199,7 @@ public static function openAPIFormats()
'payment_method' => 'getPaymentMethod',
'allowed_payment_methods' => 'getAllowedPaymentMethods',
'transaction_type' => 'getTransactionType',
'recurring' => 'getRecurring',
'sequence' => 'getSequence',
'description' => 'getDescription',
'customer' => 'getCustomer',
'billing_details' => 'getBillingDetails',
Expand Down Expand Up @@ -280,7 +280,7 @@ public function __construct(array $data = null)
$this->container['payment_method'] = isset($data['payment_method']) ? $data['payment_method'] : null;
$this->container['allowed_payment_methods'] = isset($data['allowed_payment_methods']) ? $data['allowed_payment_methods'] : null;
$this->container['transaction_type'] = isset($data['transaction_type']) ? $data['transaction_type'] : null;
$this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null;
$this->container['sequence'] = isset($data['sequence']) ? $data['sequence'] : null;
$this->container['description'] = isset($data['description']) ? $data['description'] : null;
$this->container['customer'] = isset($data['customer']) ? $data['customer'] : null;
$this->container['billing_details'] = isset($data['billing_details']) ? $data['billing_details'] : null;
Expand Down Expand Up @@ -640,25 +640,25 @@ public function setTransactionType($transaction_type)
}

/**
* Gets recurring
* Gets sequence
*
* @return \OpenAPI\Client\Model\PaymentRecurring|null
* @return \OpenAPI\Client\Model\PaymentSequence|null
*/
public function getRecurring()
public function getSequence()
{
return $this->container['recurring'];
return $this->container['sequence'];
}

/**
* Sets recurring
* Sets sequence
*
* @param \OpenAPI\Client\Model\PaymentRecurring|null $recurring recurring
* @param \OpenAPI\Client\Model\PaymentSequence|null $sequence sequence
*
* @return $this
*/
public function setRecurring($recurring)
public function setSequence($sequence)
{
$this->container['recurring'] = $recurring;
$this->container['sequence'] = $sequence;

return $this;
}
Expand Down
Loading

0 comments on commit fafa7e4

Please sign in to comment.