diff --git a/README.md b/README.md index 460028a..a0f053e 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ To run your project, right click on your PHP file inside your Test project and c ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/client.md) The following parameters are configurable for the API Client: @@ -138,31 +138,31 @@ Here is the list of errors that the API might throw. | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 400 | Invalid request | [`ErrorException`](doc/models/error-exception.md) | -| 401 | Invalid API key | [`ErrorException`](doc/models/error-exception.md) | -| 404 | An informed resource was not found | [`ErrorException`](doc/models/error-exception.md) | -| 412 | Business validation error | [`ErrorException`](doc/models/error-exception.md) | -| 422 | Contract validation error | [`ErrorException`](doc/models/error-exception.md) | -| 500 | Internal server error | [`ErrorException`](doc/models/error-exception.md) | +| 400 | Invalid request | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | +| 401 | Invalid API key | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | +| 404 | An informed resource was not found | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | +| 412 | Business validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | +| 422 | Contract validation error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | +| 500 | Internal server error | [`ErrorException`](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/models/error-exception.md) | ## List of APIs -* [Subscriptions](doc/controllers/subscriptions.md) -* [Orders](doc/controllers/orders.md) -* [Plans](doc/controllers/plans.md) -* [Invoices](doc/controllers/invoices.md) -* [Customers](doc/controllers/customers.md) -* [Charges](doc/controllers/charges.md) -* [Recipients](doc/controllers/recipients.md) -* [Tokens](doc/controllers/tokens.md) -* [Transactions](doc/controllers/transactions.md) -* [Transfers](doc/controllers/transfers.md) -* [Payables](doc/controllers/payables.md) -* [Balance Operations](doc/controllers/balance-operations.md) +* [Subscriptions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/subscriptions.md) +* [Orders](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/orders.md) +* [Plans](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/plans.md) +* [Invoices](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/invoices.md) +* [Customers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/customers.md) +* [Charges](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/charges.md) +* [Recipients](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/recipients.md) +* [Tokens](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/tokens.md) +* [Transactions](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/transactions.md) +* [Transfers](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/transfers.md) +* [Payables](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/payables.md) +* [Balance Operations](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/controllers/balance-operations.md) ## Classes Documentation -* [ApiException](doc/api-exception.md) -* [HttpRequest](doc/http-request.md) -* [HttpResponse](doc/http-response.md) +* [ApiException](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/api-exception.md) +* [HttpRequest](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/http-request.md) +* [HttpResponse](https://www.github.com/pagarme/pagarme-php-sdk/tree/6.8.1/doc/http-response.md) diff --git a/doc/client.md b/doc/client.md index eb5596b..d437a11 100644 --- a/doc/client.md +++ b/doc/client.md @@ -36,16 +36,16 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | Name | Description | | --- | --- | +| getSubscriptionsController() | Gets SubscriptionsController | | getOrdersController() | Gets OrdersController | | getPlansController() | Gets PlansController | -| getSubscriptionsController() | Gets SubscriptionsController | | getInvoicesController() | Gets InvoicesController | | getCustomersController() | Gets CustomersController | -| getRecipientsController() | Gets RecipientsController | | getChargesController() | Gets ChargesController | +| getRecipientsController() | Gets RecipientsController | | getTokensController() | Gets TokensController | -| getTransfersController() | Gets TransfersController | | getTransactionsController() | Gets TransactionsController | +| getTransfersController() | Gets TransfersController | | getPayablesController() | Gets PayablesController | | getBalanceOperationsController() | Gets BalanceOperationsController | diff --git a/doc/controllers/balance-operations.md b/doc/controllers/balance-operations.md index 42d1457..c397f2f 100644 --- a/doc/controllers/balance-operations.md +++ b/doc/controllers/balance-operations.md @@ -20,7 +20,8 @@ $balanceOperationsController = $client->getBalanceOperationsController(); function getBalanceOperations( ?string $status = null, ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null + ?\DateTime $createdUntil = null, + ?string $recipientId = null ): ListBalanceOperationResponse ``` @@ -31,6 +32,7 @@ function getBalanceOperations( | `status` | `?string` | Query, Optional | - | | `createdSince` | `?DateTime` | Query, Optional | - | | `createdUntil` | `?DateTime` | Query, Optional | - | +| `recipientId` | `?string` | Query, Optional | - | ## Response Type diff --git a/doc/controllers/charges.md b/doc/controllers/charges.md index 8111d14..525cdd3 100644 --- a/doc/controllers/charges.md +++ b/doc/controllers/charges.md @@ -12,17 +12,17 @@ $chargesController = $client->getChargesController(); * [Update Charge Metadata](../../doc/controllers/charges.md#update-charge-metadata) * [Update Charge Payment Method](../../doc/controllers/charges.md#update-charge-payment-method) -* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card) -* [Get Charges Summary](../../doc/controllers/charges.md#get-charges-summary) -* [Create Charge](../../doc/controllers/charges.md#create-charge) * [Get Charge Transactions](../../doc/controllers/charges.md#get-charge-transactions) +* [Update Charge Due Date](../../doc/controllers/charges.md#update-charge-due-date) +* [Get Charges](../../doc/controllers/charges.md#get-charges) * [Capture Charge](../../doc/controllers/charges.md#capture-charge) +* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card) * [Get Charge](../../doc/controllers/charges.md#get-charge) +* [Get Charges Summary](../../doc/controllers/charges.md#get-charges-summary) +* [Retry Charge](../../doc/controllers/charges.md#retry-charge) * [Cancel Charge](../../doc/controllers/charges.md#cancel-charge) -* [Get Charges](../../doc/controllers/charges.md#get-charges) +* [Create Charge](../../doc/controllers/charges.md#create-charge) * [Confirm Payment](../../doc/controllers/charges.md#confirm-payment) -* [Update Charge Due Date](../../doc/controllers/charges.md#update-charge-due-date) -* [Retry Charge](../../doc/controllers/charges.md#retry-charge) # Update Charge Metadata @@ -106,8 +106,8 @@ $request = UpdateChargePaymentMethodRequestBuilder::init( ->build(), CreateDebitCardPaymentRequestBuilder::init()->build(), CreateBoletoPaymentRequestBuilder::init( - 10, - 'instructions4', + 226, + 'instructions2', CreateAddressRequestBuilder::init( 'street8', 'number4', @@ -120,19 +120,19 @@ $request = UpdateChargePaymentMethodRequestBuilder::init( 'line_18', 'line_26' )->build(), - 'document_number0', - 'statement_descriptor6' + 'document_number6', + 'statement_descriptor0' )->build(), CreateVoucherPaymentRequestBuilder::init() ->recurrencyCycle('"first" or "subsequent"') ->build(), CreateCashPaymentRequestBuilder::init( - 'description6', + 'description0', false )->build(), CreateBankTransferPaymentRequestBuilder::init( - 'bank4', - 204 + 'bank0', + 236 )->build(), CreatePrivateLabelPaymentRequestBuilder::init() ->installments(1) @@ -148,155 +148,159 @@ $result = $chargesController->updateChargePaymentMethod( ``` -# Update Charge Card - -Updates the card from a charge +# Get Charge Transactions ```php -function updateChargeCard( +function getChargeTransactions( string $chargeId, - UpdateChargeCardRequest $request, - ?string $idempotencyKey = null -): GetChargeResponse + ?int $page = null, + ?int $size = null +): ListChargeTransactionsResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `chargeId` | `string` | Template, Required | Charge Id | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | ## Response Type -[`GetChargeResponse`](../../doc/models/get-charge-response.md) +[`ListChargeTransactionsResponse`](../../doc/models/list-charge-transactions-response.md) ## Example Usage ```php $chargeId = 'charge_id8'; -$request = UpdateChargeCardRequestBuilder::init( - false, - 'card_id2', - CreateCardRequestBuilder::init() - ->type('credit') - ->build(), - false -)->build(); - -$result = $chargesController->updateChargeCard( - $chargeId, - $request -); +$result = $chargesController->getChargeTransactions($chargeId); ``` -# Get Charges Summary +# Update Charge Due Date + +Updates the due date from a charge ```php -function getChargesSummary( - string $status, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): GetChargesSummaryResponse +function updateChargeDueDate( + string $chargeId, + UpdateChargeDueDateRequest $request, + ?string $idempotencyKey = null +): GetChargeResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `status` | `string` | Query, Required | - | -| `createdSince` | `?DateTime` | Query, Optional | - | -| `createdUntil` | `?DateTime` | Query, Optional | - | +| `chargeId` | `string` | Template, Required | Charge Id | +| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetChargesSummaryResponse`](../../doc/models/get-charges-summary-response.md) +[`GetChargeResponse`](../../doc/models/get-charge-response.md) ## Example Usage ```php -$status = 'status8'; +$chargeId = 'charge_id8'; -$result = $chargesController->getChargesSummary($status); +$request = UpdateChargeDueDateRequestBuilder::init()->build(); + +$result = $chargesController->updateChargeDueDate( + $chargeId, + $request +); ``` -# Create Charge +# Get Charges -Creates a new charge +Lists all charges ```php -function createCharge(CreateChargeRequest $request, ?string $idempotencyKey = null): GetChargeResponse +function getCharges( + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $status = null, + ?string $paymentMethod = null, + ?string $customerId = null, + ?string $orderId = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null +): ListChargesResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `code` | `?string` | Query, Optional | Filter for charge's code | +| `status` | `?string` | Query, Optional | Filter for charge's status | +| `paymentMethod` | `?string` | Query, Optional | Filter for charge's payment method | +| `customerId` | `?string` | Query, Optional | Filter for charge's customer id | +| `orderId` | `?string` | Query, Optional | Filter for charge's order id | +| `createdSince` | `?DateTime` | Query, Optional | Filter for the beginning of the range for charge's creation | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for the end of the range for charge's creation | ## Response Type -[`GetChargeResponse`](../../doc/models/get-charge-response.md) +[`ListChargesResponse`](../../doc/models/list-charges-response.md) ## Example Usage ```php -$request = CreateChargeRequestBuilder::init( - 242, - CreatePaymentRequestBuilder::init( - 'payment_method2' - )->build(), - 'order_id0' -)->build(); - -$result = $chargesController->createCharge($request); +$result = $chargesController->getCharges(); ``` -# Get Charge Transactions +# Capture Charge + +Captures a charge ```php -function getChargeTransactions( +function captureCharge( string $chargeId, - ?int $page = null, - ?int $size = null -): ListChargeTransactionsResponse + ?CreateCaptureChargeRequest $request = null, + ?string $idempotencyKey = null +): GetChargeResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge Id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | +| `chargeId` | `string` | Template, Required | Charge id | +| `request` | [`?CreateCaptureChargeRequest`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListChargeTransactionsResponse`](../../doc/models/list-charge-transactions-response.md) +[`GetChargeResponse`](../../doc/models/get-charge-response.md) ## Example Usage ```php $chargeId = 'charge_id8'; -$result = $chargesController->getChargeTransactions($chargeId); +$result = $chargesController->captureCharge($chargeId); ``` -# Capture Charge +# Update Charge Card -Captures a charge +Updates the card from a charge ```php -function captureCharge( +function updateChargeCard( string $chargeId, - ?CreateCaptureChargeRequest $request = null, + UpdateChargeCardRequest $request, ?string $idempotencyKey = null ): GetChargeResponse ``` @@ -306,7 +310,7 @@ function captureCharge( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`?CreateCaptureChargeRequest`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge | +| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -318,7 +322,19 @@ function captureCharge( ```php $chargeId = 'charge_id8'; -$result = $chargesController->captureCharge($chargeId); +$request = UpdateChargeCardRequestBuilder::init( + false, + 'card_id2', + CreateCardRequestBuilder::init() + ->type('credit') + ->build(), + false +)->build(); + +$result = $chargesController->updateChargeCard( + $chargeId, + $request +); ``` @@ -349,88 +365,73 @@ $result = $chargesController->getCharge($chargeId); ``` -# Cancel Charge - -Cancel a charge +# Get Charges Summary ```php -function cancelCharge( - string $chargeId, - ?CreateCancelChargeRequest $request = null, - ?string $idempotencyKey = null -): GetChargeResponse +function getChargesSummary( + string $status, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null +): GetChargesSummaryResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge id | -| `request` | [`?CreateCancelChargeRequest`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `status` | `string` | Query, Required | - | +| `createdSince` | `?DateTime` | Query, Optional | - | +| `createdUntil` | `?DateTime` | Query, Optional | - | ## Response Type -[`GetChargeResponse`](../../doc/models/get-charge-response.md) +[`GetChargesSummaryResponse`](../../doc/models/get-charges-summary-response.md) ## Example Usage ```php -$chargeId = 'charge_id8'; +$status = 'status8'; -$result = $chargesController->cancelCharge($chargeId); +$result = $chargesController->getChargesSummary($status); ``` -# Get Charges +# Retry Charge -Lists all charges +Retries a charge ```php -function getCharges( - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $status = null, - ?string $paymentMethod = null, - ?string $customerId = null, - ?string $orderId = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): ListChargesResponse +function retryCharge(string $chargeId, ?string $idempotencyKey = null): GetChargeResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `code` | `?string` | Query, Optional | Filter for charge's code | -| `status` | `?string` | Query, Optional | Filter for charge's status | -| `paymentMethod` | `?string` | Query, Optional | Filter for charge's payment method | -| `customerId` | `?string` | Query, Optional | Filter for charge's customer id | -| `orderId` | `?string` | Query, Optional | Filter for charge's order id | -| `createdSince` | `?DateTime` | Query, Optional | Filter for the beginning of the range for charge's creation | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for the end of the range for charge's creation | +| `chargeId` | `string` | Template, Required | Charge id | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListChargesResponse`](../../doc/models/list-charges-response.md) +[`GetChargeResponse`](../../doc/models/get-charge-response.md) ## Example Usage ```php -$result = $chargesController->getCharges(); +$chargeId = 'charge_id8'; + +$result = $chargesController->retryCharge($chargeId); ``` -# Confirm Payment +# Cancel Charge + +Cancel a charge ```php -function confirmPayment( +function cancelCharge( string $chargeId, - ?CreateConfirmPaymentRequest $request = null, + ?CreateCancelChargeRequest $request = null, ?string $idempotencyKey = null ): GetChargeResponse ``` @@ -439,8 +440,8 @@ function confirmPayment( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | - | -| `request` | [`?CreateConfirmPaymentRequest`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment | +| `chargeId` | `string` | Template, Required | Charge id | +| `request` | [`?CreateCancelChargeRequest`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -452,28 +453,23 @@ function confirmPayment( ```php $chargeId = 'charge_id8'; -$result = $chargesController->confirmPayment($chargeId); +$result = $chargesController->cancelCharge($chargeId); ``` -# Update Charge Due Date +# Create Charge -Updates the due date from a charge +Creates a new charge ```php -function updateChargeDueDate( - string $chargeId, - UpdateChargeDueDateRequest $request, - ?string $idempotencyKey = null -): GetChargeResponse +function createCharge(CreateChargeRequest $request, ?string $idempotencyKey = null): GetChargeResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge Id | -| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date | +| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -483,30 +479,34 @@ function updateChargeDueDate( ## Example Usage ```php -$chargeId = 'charge_id8'; - -$request = UpdateChargeDueDateRequestBuilder::init()->build(); +$request = CreateChargeRequestBuilder::init( + 242, + CreatePaymentRequestBuilder::init( + 'payment_method4' + )->build(), + 'order_id0' +)->build(); -$result = $chargesController->updateChargeDueDate( - $chargeId, - $request -); +$result = $chargesController->createCharge($request); ``` -# Retry Charge - -Retries a charge +# Confirm Payment ```php -function retryCharge(string $chargeId, ?string $idempotencyKey = null): GetChargeResponse +function confirmPayment( + string $chargeId, + ?CreateConfirmPaymentRequest $request = null, + ?string $idempotencyKey = null +): GetChargeResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `chargeId` | `string` | Template, Required | Charge id | +| `chargeId` | `string` | Template, Required | - | +| `request` | [`?CreateConfirmPaymentRequest`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -518,6 +518,6 @@ function retryCharge(string $chargeId, ?string $idempotencyKey = null): GetCharg ```php $chargeId = 'charge_id8'; -$result = $chargesController->retryCharge($chargeId); +$result = $chargesController->confirmPayment($chargeId); ``` diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 4d71f1e..999461d 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -13,24 +13,24 @@ $customersController = $client->getCustomersController(); * [Update Card](../../doc/controllers/customers.md#update-card) * [Update Address](../../doc/controllers/customers.md#update-address) * [Delete Access Token](../../doc/controllers/customers.md#delete-access-token) -* [Create Address](../../doc/controllers/customers.md#create-address) * [Create Customer](../../doc/controllers/customers.md#create-customer) +* [Create Address](../../doc/controllers/customers.md#create-address) +* [Delete Access Tokens](../../doc/controllers/customers.md#delete-access-tokens) +* [Get Address](../../doc/controllers/customers.md#get-address) +* [Delete Address](../../doc/controllers/customers.md#delete-address) * [Create Card](../../doc/controllers/customers.md#create-card) +* [Get Customers](../../doc/controllers/customers.md#get-customers) +* [Update Customer](../../doc/controllers/customers.md#update-customer) +* [Create Access Token](../../doc/controllers/customers.md#create-access-token) +* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens) * [Get Cards](../../doc/controllers/customers.md#get-cards) * [Renew Card](../../doc/controllers/customers.md#renew-card) -* [Get Address](../../doc/controllers/customers.md#get-address) -* [Delete Address](../../doc/controllers/customers.md#delete-address) * [Get Access Token](../../doc/controllers/customers.md#get-access-token) * [Update Customer Metadata](../../doc/controllers/customers.md#update-customer-metadata) -* [Get Card](../../doc/controllers/customers.md#get-card) -* [Delete Access Tokens](../../doc/controllers/customers.md#delete-access-tokens) -* [Create Access Token](../../doc/controllers/customers.md#create-access-token) -* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens) -* [Get Customers](../../doc/controllers/customers.md#get-customers) -* [Update Customer](../../doc/controllers/customers.md#update-customer) * [Delete Card](../../doc/controllers/customers.md#delete-card) * [Get Addresses](../../doc/controllers/customers.md#get-addresses) * [Get Customer](../../doc/controllers/customers.md#get-customer) +* [Get Card](../../doc/controllers/customers.md#get-card) # Update Card @@ -75,8 +75,8 @@ $request = UpdateCardRequestBuilder::init( 'number4', 'zip_code2', 'neighborhood4', - 'city8', - 'state4', + 'city2', + 'state6', 'country2', 'complement6', 'line_18', @@ -184,55 +184,6 @@ $result = $customersController->deleteAccessToken( ``` -# Create Address - -Creates a new address for a customer - -```php -function createAddress( - string $customerId, - CreateAddressRequest $request, - ?string $idempotencyKey = null -): GetAddressResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetAddressResponse`](../../doc/models/get-address-response.md) - -## Example Usage - -```php -$customerId = 'customer_id8'; - -$request = CreateAddressRequestBuilder::init( - 'street6', - 'number4', - 'zip_code0', - 'neighborhood2', - 'city6', - 'state2', - 'country0', - 'complement2', - 'line_10', - 'line_24' -)->build(); - -$result = $customersController->createAddress( - $customerId, - $request -); -``` - - # Create Customer Creates a new customer @@ -263,16 +214,16 @@ $request = CreateCustomerRequestBuilder::init( 'document0', 'type4', CreateAddressRequestBuilder::init( - 'street2', - 'number0', - 'zip_code6', - 'neighborhood8', - 'city2', - 'state8', - 'country6', - 'complement8', - 'line_16', - 'line_20' + 'street6', + 'number4', + 'zip_code0', + 'neighborhood2', + 'city6', + 'state2', + 'country0', + 'complement2', + 'line_10', + 'line_24' )->build(), [ 'key0' => 'metadata3' @@ -285,52 +236,61 @@ $result = $customersController->createCustomer($request); ``` -# Create Card +# Create Address -Creates a new card for a customer +Creates a new address for a customer ```php -function createCard( +function createAddress( string $customerId, - CreateCardRequest $request, + CreateAddressRequest $request, ?string $idempotencyKey = null -): GetCardResponse +): GetAddressResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card | +| `customerId` | `string` | Template, Required | Customer Id | +| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetCardResponse`](../../doc/models/get-card-response.md) +[`GetAddressResponse`](../../doc/models/get-address-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$request = CreateCardRequestBuilder::init() - ->type('credit') - ->build(); +$request = CreateAddressRequestBuilder::init( + 'street6', + 'number4', + 'zip_code0', + 'neighborhood2', + 'city6', + 'state2', + 'country0', + 'complement2', + 'line_10', + 'line_24' +)->build(); -$result = $customersController->createCard( +$result = $customersController->createAddress( $customerId, $request ); ``` -# Get Cards +# Delete Access Tokens -Get all cards from a customer +Delete a Customer's access tokens ```php -function getCards(string $customerId, ?int $page = null, ?int $size = null): ListCardsResponse +function deleteAccessTokens(string $customerId): ListAccessTokensResponse ``` ## Parameters @@ -338,28 +298,26 @@ function getCards(string $customerId, ?int $page = null, ?int $size = null): Lis | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | ## Response Type -[`ListCardsResponse`](../../doc/models/list-cards-response.md) +[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$result = $customersController->getCards($customerId); +$result = $customersController->deleteAccessTokens($customerId); ``` -# Renew Card +# Get Address -Renew a card +Get a customer's address ```php -function renewCard(string $customerId, string $cardId, ?string $idempotencyKey = null): GetCardResponse +function getAddress(string $customerId, string $addressId): GetAddressResponse ``` ## Parameters @@ -367,41 +325,45 @@ function renewCard(string $customerId, string $cardId, ?string $idempotencyKey = | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer id | -| `cardId` | `string` | Template, Required | Card Id | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `addressId` | `string` | Template, Required | Address Id | ## Response Type -[`GetCardResponse`](../../doc/models/get-card-response.md) +[`GetAddressResponse`](../../doc/models/get-address-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$cardId = 'card_id4'; +$addressId = 'address_id0'; -$result = $customersController->renewCard( +$result = $customersController->getAddress( $customerId, - $cardId + $addressId ); ``` -# Get Address +# Delete Address -Get a customer's address +Delete a Customer's address ```php -function getAddress(string $customerId, string $addressId): GetAddressResponse +function deleteAddress( + string $customerId, + string $addressId, + ?string $idempotencyKey = null +): GetAddressResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | +| `customerId` | `string` | Template, Required | Customer Id | | `addressId` | `string` | Template, Required | Address Id | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -414,92 +376,107 @@ $customerId = 'customer_id8'; $addressId = 'address_id0'; -$result = $customersController->getAddress( +$result = $customersController->deleteAddress( $customerId, $addressId ); ``` -# Delete Address +# Create Card -Delete a Customer's address +Creates a new card for a customer ```php -function deleteAddress( +function createCard( string $customerId, - string $addressId, + CreateCardRequest $request, ?string $idempotencyKey = null -): GetAddressResponse +): GetCardResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `addressId` | `string` | Template, Required | Address Id | +| `customerId` | `string` | Template, Required | Customer id | +| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetAddressResponse`](../../doc/models/get-address-response.md) +[`GetCardResponse`](../../doc/models/get-card-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$addressId = 'address_id0'; +$request = CreateCardRequestBuilder::init() + ->type('credit') + ->build(); -$result = $customersController->deleteAddress( +$result = $customersController->createCard( $customerId, - $addressId + $request ); ``` -# Get Access Token +# Get Customers -Get a Customer's access token +Get all Customers ```php -function getAccessToken(string $customerId, string $tokenId): GetAccessTokenResponse +function getCustomers( + ?string $name = null, + ?string $document = null, + ?int $page = 1, + ?int $size = 10, + ?string $email = null, + ?string $code = null +): ListCustomersResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `tokenId` | `string` | Template, Required | Token Id | +| `name` | `?string` | Query, Optional | Name of the Customer | +| `document` | `?string` | Query, Optional | Document of the Customer | +| `page` | `?int` | Query, Optional | Current page the the search
**Default**: `1` | +| `size` | `?int` | Query, Optional | Quantity pages of the search
**Default**: `10` | +| `email` | `?string` | Query, Optional | Customer's email | +| `code` | `?string` | Query, Optional | Customer's code | ## Response Type -[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md) +[`ListCustomersResponse`](../../doc/models/list-customers-response.md) ## Example Usage ```php -$customerId = 'customer_id8'; +$page = 1; -$tokenId = 'token_id6'; +$size = 10; -$result = $customersController->getAccessToken( - $customerId, - $tokenId +$result = $customersController->getCustomers( + null, + null, + $page, + $size ); ``` -# Update Customer Metadata +# Update Customer -Updates the metadata a customer +Updates a customer ```php -function updateCustomerMetadata( +function updateCustomer( string $customerId, - UpdateMetadataRequest $request, + UpdateCustomerRequest $request, ?string $idempotencyKey = null ): GetCustomerResponse ``` @@ -508,8 +485,8 @@ function updateCustomerMetadata( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | The customer id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata | +| `customerId` | `string` | Template, Required | Customer id | +| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -521,58 +498,59 @@ function updateCustomerMetadata( ```php $customerId = 'customer_id8'; -$request = UpdateMetadataRequestBuilder::init( - [ - 'key0' => 'metadata3' - ] -)->build(); +$request = UpdateCustomerRequestBuilder::init()->build(); -$result = $customersController->updateCustomerMetadata( +$result = $customersController->updateCustomer( $customerId, $request ); ``` -# Get Card +# Create Access Token -Get a customer's card +Creates a access token for a customer ```php -function getCard(string $customerId, string $cardId): GetCardResponse +function createAccessToken( + string $customerId, + CreateAccessTokenRequest $request, + ?string $idempotencyKey = null +): GetAccessTokenResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `cardId` | `string` | Template, Required | Card id | +| `customerId` | `string` | Template, Required | Customer Id | +| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetCardResponse`](../../doc/models/get-card-response.md) +[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$cardId = 'card_id4'; +$request = CreateAccessTokenRequestBuilder::init()->build(); -$result = $customersController->getCard( +$result = $customersController->createAccessToken( $customerId, - $cardId + $request ); ``` -# Delete Access Tokens +# Get Access Tokens -Delete a Customer's access tokens +Get all access tokens from a customer ```php -function deleteAccessTokens(string $customerId): ListAccessTokensResponse +function getAccessTokens(string $customerId, ?int $page = null, ?int $size = null): ListAccessTokensResponse ``` ## Parameters @@ -580,6 +558,8 @@ function deleteAccessTokens(string $customerId): ListAccessTokensResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | ## Response Type @@ -590,20 +570,16 @@ function deleteAccessTokens(string $customerId): ListAccessTokensResponse ```php $customerId = 'customer_id8'; -$result = $customersController->deleteAccessTokens($customerId); +$result = $customersController->getAccessTokens($customerId); ``` -# Create Access Token +# Get Cards -Creates a access token for a customer +Get all cards from a customer ```php -function createAccessToken( - string $customerId, - CreateAccessTokenRequest $request, - ?string $idempotencyKey = null -): GetAccessTokenResponse +function getCards(string $customerId, ?int $page = null, ?int $size = null): ListCardsResponse ``` ## Parameters @@ -611,108 +587,97 @@ function createAccessToken( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | Customer Id | -| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | ## Response Type -[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md) +[`ListCardsResponse`](../../doc/models/list-cards-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$request = CreateAccessTokenRequestBuilder::init()->build(); - -$result = $customersController->createAccessToken( - $customerId, - $request -); +$result = $customersController->getCards($customerId); ``` -# Get Access Tokens +# Renew Card -Get all access tokens from a customer +Renew a card ```php -function getAccessTokens(string $customerId, ?int $page = null, ?int $size = null): ListAccessTokensResponse +function renewCard(string $customerId, string $cardId, ?string $idempotencyKey = null): GetCardResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer Id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | +| `customerId` | `string` | Template, Required | Customer id | +| `cardId` | `string` | Template, Required | Card Id | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md) +[`GetCardResponse`](../../doc/models/get-card-response.md) ## Example Usage ```php $customerId = 'customer_id8'; -$result = $customersController->getAccessTokens($customerId); +$cardId = 'card_id4'; + +$result = $customersController->renewCard( + $customerId, + $cardId +); ``` -# Get Customers +# Get Access Token -Get all Customers +Get a Customer's access token ```php -function getCustomers( - ?string $name = null, - ?string $document = null, - ?int $page = 1, - ?int $size = 10, - ?string $email = null, - ?string $code = null -): ListCustomersResponse +function getAccessToken(string $customerId, string $tokenId): GetAccessTokenResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `?string` | Query, Optional | Name of the Customer | -| `document` | `?string` | Query, Optional | Document of the Customer | -| `page` | `?int` | Query, Optional | Current page the the search
**Default**: `1` | -| `size` | `?int` | Query, Optional | Quantity pages of the search
**Default**: `10` | -| `email` | `?string` | Query, Optional | Customer's email | -| `code` | `?string` | Query, Optional | Customer's code | +| `customerId` | `string` | Template, Required | Customer Id | +| `tokenId` | `string` | Template, Required | Token Id | ## Response Type -[`ListCustomersResponse`](../../doc/models/list-customers-response.md) +[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md) ## Example Usage ```php -$page = 1; +$customerId = 'customer_id8'; -$size = 10; +$tokenId = 'token_id6'; -$result = $customersController->getCustomers( - $page, - $size +$result = $customersController->getAccessToken( + $customerId, + $tokenId ); ``` -# Update Customer +# Update Customer Metadata -Updates a customer +Updates the metadata a customer ```php -function updateCustomer( +function updateCustomerMetadata( string $customerId, - UpdateCustomerRequest $request, + UpdateMetadataRequest $request, ?string $idempotencyKey = null ): GetCustomerResponse ``` @@ -721,8 +686,8 @@ function updateCustomer( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `customerId` | `string` | Template, Required | Customer id | -| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer | +| `customerId` | `string` | Template, Required | The customer id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -734,9 +699,13 @@ function updateCustomer( ```php $customerId = 'customer_id8'; -$request = UpdateCustomerRequestBuilder::init()->build(); +$request = UpdateMetadataRequestBuilder::init( + [ + 'key0' => 'metadata3' + ] +)->build(); -$result = $customersController->updateCustomer( +$result = $customersController->updateCustomerMetadata( $customerId, $request ); @@ -832,3 +801,36 @@ $customerId = 'customer_id8'; $result = $customersController->getCustomer($customerId); ``` + +# Get Card + +Get a customer's card + +```php +function getCard(string $customerId, string $cardId): GetCardResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | Customer id | +| `cardId` | `string` | Template, Required | Card id | + +## Response Type + +[`GetCardResponse`](../../doc/models/get-card-response.md) + +## Example Usage + +```php +$customerId = 'customer_id8'; + +$cardId = 'card_id4'; + +$result = $customersController->getCard( + $customerId, + $cardId +); +``` + diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 147c228..4400978 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -10,24 +10,23 @@ $invoicesController = $client->getInvoicesController(); ## Methods -* [Create Invoice](../../doc/controllers/invoices.md#create-invoice) -* [Get Invoices](../../doc/controllers/invoices.md#get-invoices) -* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice) * [Update Invoice Metadata](../../doc/controllers/invoices.md#update-invoice-metadata) * [Get Partial Invoice](../../doc/controllers/invoices.md#get-partial-invoice) -* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status) +* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice) +* [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Get Invoices](../../doc/controllers/invoices.md#get-invoices) * [Get Invoice](../../doc/controllers/invoices.md#get-invoice) +* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status) -# Create Invoice +# Update Invoice Metadata -Create an Invoice +Updates the metadata from an invoice ```php -function createInvoice( - string $subscriptionId, - string $cycleId, - ?CreateInvoiceRequest $request = null, +function updateInvoiceMetadata( + string $invoiceId, + UpdateMetadataRequest $request, ?string $idempotencyKey = null ): GetInvoiceResponse ``` @@ -36,9 +35,8 @@ function createInvoice( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `cycleId` | `string` | Template, Required | Cycle Id | -| `request` | [`?CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | +| `invoiceId` | `string` | Template, Required | The invoice id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -48,61 +46,43 @@ function createInvoice( ## Example Usage ```php -$subscriptionId = 'subscription_id0'; +$invoiceId = 'invoice_id0'; -$cycleId = 'cycle_id6'; +$request = UpdateMetadataRequestBuilder::init( + [ + 'key0' => 'metadata3' + ] +)->build(); -$result = $invoicesController->createInvoice( - $subscriptionId, - $cycleId +$result = $invoicesController->updateInvoiceMetadata( + $invoiceId, + $request ); ``` -# Get Invoices - -Gets all invoices +# Get Partial Invoice ```php -function getInvoices( - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $customerId = null, - ?string $subscriptionId = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null, - ?string $status = null, - ?\DateTime $dueSince = null, - ?\DateTime $dueUntil = null, - ?string $customerDocument = null -): ListInvoicesResponse +function getPartialInvoice(string $subscriptionId): GetInvoiceResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `code` | `?string` | Query, Optional | Filter for Invoice's code | -| `customerId` | `?string` | Query, Optional | Filter for Invoice's customer id | -| `subscriptionId` | `?string` | Query, Optional | Filter for Invoice's subscription id | -| `createdSince` | `?DateTime` | Query, Optional | Filter for Invoice's creation date start range | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for Invoices creation date end range | -| `status` | `?string` | Query, Optional | Filter for Invoice's status | -| `dueSince` | `?DateTime` | Query, Optional | Filter for Invoice's due date start range | -| `dueUntil` | `?DateTime` | Query, Optional | Filter for Invoice's due date end range | -| `customerDocument` | `?string` | Query, Optional | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | ## Response Type -[`ListInvoicesResponse`](../../doc/models/list-invoices-response.md) +[`GetInvoiceResponse`](../../doc/models/get-invoice-response.md) ## Example Usage ```php -$result = $invoicesController->getInvoices(); +$subscriptionId = 'subscription_id0'; + +$result = $invoicesController->getPartialInvoice($subscriptionId); ``` @@ -134,14 +114,15 @@ $result = $invoicesController->cancelInvoice($invoiceId); ``` -# Update Invoice Metadata +# Create Invoice -Updates the metadata from an invoice +Create an Invoice ```php -function updateInvoiceMetadata( - string $invoiceId, - UpdateMetadataRequest $request, +function createInvoice( + string $subscriptionId, + string $cycleId, + ?CreateInvoiceRequest $request = null, ?string $idempotencyKey = null ): GetInvoiceResponse ``` @@ -150,8 +131,9 @@ function updateInvoiceMetadata( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The invoice id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `cycleId` | `string` | Template, Required | Cycle Id | +| `request` | [`?CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Optional | - | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -161,56 +143,70 @@ function updateInvoiceMetadata( ## Example Usage ```php -$invoiceId = 'invoice_id0'; +$subscriptionId = 'subscription_id0'; -$request = UpdateMetadataRequestBuilder::init( - [ - 'key0' => 'metadata3' - ] -)->build(); +$cycleId = 'cycle_id6'; -$result = $invoicesController->updateInvoiceMetadata( - $invoiceId, - $request +$result = $invoicesController->createInvoice( + $subscriptionId, + $cycleId ); ``` -# Get Partial Invoice +# Get Invoices + +Gets all invoices ```php -function getPartialInvoice(string $subscriptionId): GetInvoiceResponse +function getInvoices( + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $customerId = null, + ?string $subscriptionId = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null, + ?string $status = null, + ?\DateTime $dueSince = null, + ?\DateTime $dueUntil = null, + ?string $customerDocument = null +): ListInvoicesResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `code` | `?string` | Query, Optional | Filter for Invoice's code | +| `customerId` | `?string` | Query, Optional | Filter for Invoice's customer id | +| `subscriptionId` | `?string` | Query, Optional | Filter for Invoice's subscription id | +| `createdSince` | `?DateTime` | Query, Optional | Filter for Invoice's creation date start range | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for Invoices creation date end range | +| `status` | `?string` | Query, Optional | Filter for Invoice's status | +| `dueSince` | `?DateTime` | Query, Optional | Filter for Invoice's due date start range | +| `dueUntil` | `?DateTime` | Query, Optional | Filter for Invoice's due date end range | +| `customerDocument` | `?string` | Query, Optional | - | ## Response Type -[`GetInvoiceResponse`](../../doc/models/get-invoice-response.md) +[`ListInvoicesResponse`](../../doc/models/list-invoices-response.md) ## Example Usage ```php -$subscriptionId = 'subscription_id0'; - -$result = $invoicesController->getPartialInvoice($subscriptionId); +$result = $invoicesController->getInvoices(); ``` -# Update Invoice Status +# Get Invoice -Updates the status from an invoice +Gets an invoice ```php -function updateInvoiceStatus( - string $invoiceId, - UpdateInvoiceStatusRequest $request, - ?string $idempotencyKey = null -): GetInvoiceResponse +function getInvoice(string $invoiceId): GetInvoiceResponse ``` ## Parameters @@ -218,8 +214,6 @@ function updateInvoiceStatus( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoiceId` | `string` | Template, Required | Invoice Id | -| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status | -| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -230,23 +224,20 @@ function updateInvoiceStatus( ```php $invoiceId = 'invoice_id0'; -$request = UpdateInvoiceStatusRequestBuilder::init( - 'status8' -)->build(); - -$result = $invoicesController->updateInvoiceStatus( - $invoiceId, - $request -); +$result = $invoicesController->getInvoice($invoiceId); ``` -# Get Invoice +# Update Invoice Status -Gets an invoice +Updates the status from an invoice ```php -function getInvoice(string $invoiceId): GetInvoiceResponse +function updateInvoiceStatus( + string $invoiceId, + UpdateInvoiceStatusRequest $request, + ?string $idempotencyKey = null +): GetInvoiceResponse ``` ## Parameters @@ -254,6 +245,8 @@ function getInvoice(string $invoiceId): GetInvoiceResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoiceId` | `string` | Template, Required | Invoice Id | +| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -264,6 +257,13 @@ function getInvoice(string $invoiceId): GetInvoiceResponse ```php $invoiceId = 'invoice_id0'; -$result = $invoicesController->getInvoice($invoiceId); +$request = UpdateInvoiceStatusRequestBuilder::init( + 'status8' +)->build(); + +$result = $invoicesController->updateInvoiceStatus( + $invoiceId, + $request +); ``` diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md index 4dd09c7..17c7232 100644 --- a/doc/controllers/orders.md +++ b/doc/controllers/orders.md @@ -11,15 +11,15 @@ $ordersController = $client->getOrdersController(); ## Methods * [Get Orders](../../doc/controllers/orders.md#get-orders) -* [Get Order Item](../../doc/controllers/orders.md#get-order-item) -* [Get Order](../../doc/controllers/orders.md#get-order) -* [Close Order](../../doc/controllers/orders.md#close-order) -* [Create Order](../../doc/controllers/orders.md#create-order) * [Update Order Item](../../doc/controllers/orders.md#update-order-item) * [Delete All Order Items](../../doc/controllers/orders.md#delete-all-order-items) -* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata) * [Delete Order Item](../../doc/controllers/orders.md#delete-order-item) +* [Close Order](../../doc/controllers/orders.md#close-order) +* [Create Order](../../doc/controllers/orders.md#create-order) * [Create Order Item](../../doc/controllers/orders.md#create-order-item) +* [Get Order Item](../../doc/controllers/orders.md#get-order-item) +* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata) +* [Get Order](../../doc/controllers/orders.md#get-order) # Get Orders @@ -61,10 +61,15 @@ $result = $ordersController->getOrders(); ``` -# Get Order Item +# Update Order Item ```php -function getOrderItem(string $orderId, string $itemId): GetOrderItemResponse +function updateOrderItem( + string $orderId, + string $itemId, + UpdateOrderItemRequest $request, + ?string $idempotencyKey = null +): GetOrderItemResponse ``` ## Parameters @@ -73,6 +78,8 @@ function getOrderItem(string $orderId, string $itemId): GetOrderItemResponse | --- | --- | --- | --- | | `orderId` | `string` | Template, Required | Order Id | | `itemId` | `string` | Template, Required | Item Id | +| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -85,26 +92,33 @@ $orderId = 'orderId2'; $itemId = 'itemId8'; -$result = $ordersController->getOrderItem( +$request = UpdateOrderItemRequestBuilder::init( + 242, + 'description6', + 100, + 'category4' +)->build(); + +$result = $ordersController->updateOrderItem( $orderId, - $itemId + $itemId, + $request ); ``` -# Get Order - -Gets an order +# Delete All Order Items ```php -function getOrder(string $orderId): GetOrderResponse +function deleteAllOrderItems(string $orderId, ?string $idempotencyKey = null): GetOrderResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order id | +| `orderId` | `string` | Template, Required | Order Id | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -113,9 +127,41 @@ function getOrder(string $orderId): GetOrderResponse ## Example Usage ```php -$orderId = 'order_id6'; +$orderId = 'orderId2'; -$result = $ordersController->getOrder($orderId); +$result = $ordersController->deleteAllOrderItems($orderId); +``` + + +# Delete Order Item + +```php +function deleteOrderItem(string $orderId, string $itemId, ?string $idempotencyKey = null): GetOrderItemResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | Order Id | +| `itemId` | `string` | Template, Required | Item Id | +| `idempotencyKey` | `?string` | Header, Optional | - | + +## Response Type + +[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md) + +## Example Usage + +```php +$orderId = 'orderId2'; + +$itemId = 'itemId8'; + +$result = $ordersController->deleteOrderItem( + $orderId, + $itemId +); ``` @@ -182,41 +228,40 @@ function createOrder(CreateOrderRequest $body, ?string $idempotencyKey = null): $body = CreateOrderRequestBuilder::init( [ CreateOrderItemRequestBuilder::init( - 101, - 'description3', - 215, - 'category1' + 164, + 'description2', + 22, + 'category6' )->build() ], CreateCustomerRequestBuilder::init( '{ "name": "Tony Stark" }', - 'email2', - 'document2', - 'type6', + 'email6', + 'document6', + 'type0', CreateAddressRequestBuilder::init( - 'street0', - 'number8', - 'zip_code4', - 'neighborhood6', - 'city0', - 'state6', - 'country4', - 'complement6', - 'line_16', - 'line_28' + 'street6', + 'number4', + 'zip_code0', + 'neighborhood2', + 'city6', + 'state2', + 'country0', + 'complement2', + 'line_10', + 'line_24' )->build(), [ - 'key0' => 'metadata9', - 'key1' => 'metadata0' + 'key0' => 'metadata3' ], CreatePhonesRequestBuilder::init()->build(), - 'code2' + 'code8' )->build(), [ CreatePaymentRequestBuilder::init( - 'payment_method0' + 'payment_method8' )->build() ], 'code4', @@ -227,13 +272,12 @@ $result = $ordersController->createOrder($body); ``` -# Update Order Item +# Create Order Item ```php -function updateOrderItem( +function createOrderItem( string $orderId, - string $itemId, - UpdateOrderItemRequest $request, + CreateOrderItemRequest $request, ?string $idempotencyKey = null ): GetOrderItemResponse ``` @@ -243,8 +287,7 @@ function updateOrderItem( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `orderId` | `string` | Template, Required | Order Id | -| `itemId` | `string` | Template, Required | Item Id | -| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model | +| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -256,27 +299,24 @@ function updateOrderItem( ```php $orderId = 'orderId2'; -$itemId = 'itemId8'; - -$request = UpdateOrderItemRequestBuilder::init( +$request = CreateOrderItemRequestBuilder::init( 242, 'description6', 100, 'category4' )->build(); -$result = $ordersController->updateOrderItem( +$result = $ordersController->createOrderItem( $orderId, - $itemId, $request ); ``` -# Delete All Order Items +# Get Order Item ```php -function deleteAllOrderItems(string $orderId, ?string $idempotencyKey = null): GetOrderResponse +function getOrderItem(string $orderId, string $itemId): GetOrderItemResponse ``` ## Parameters @@ -284,18 +324,23 @@ function deleteAllOrderItems(string $orderId, ?string $idempotencyKey = null): G | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `orderId` | `string` | Template, Required | Order Id | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `itemId` | `string` | Template, Required | Item Id | ## Response Type -[`GetOrderResponse`](../../doc/models/get-order-response.md) +[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md) ## Example Usage ```php $orderId = 'orderId2'; -$result = $ordersController->deleteAllOrderItems($orderId); +$itemId = 'itemId8'; + +$result = $ordersController->getOrderItem( + $orderId, + $itemId +); ``` @@ -341,75 +386,29 @@ $result = $ordersController->updateOrderMetadata( ``` -# Delete Order Item - -```php -function deleteOrderItem(string $orderId, string $itemId, ?string $idempotencyKey = null): GetOrderItemResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order Id | -| `itemId` | `string` | Template, Required | Item Id | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md) - -## Example Usage - -```php -$orderId = 'orderId2'; - -$itemId = 'itemId8'; - -$result = $ordersController->deleteOrderItem( - $orderId, - $itemId -); -``` - +# Get Order -# Create Order Item +Gets an order ```php -function createOrderItem( - string $orderId, - CreateOrderItemRequest $request, - ?string $idempotencyKey = null -): GetOrderItemResponse +function getOrder(string $orderId): GetOrderResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `orderId` | `string` | Template, Required | Order Id | -| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `orderId` | `string` | Template, Required | Order id | ## Response Type -[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md) +[`GetOrderResponse`](../../doc/models/get-order-response.md) ## Example Usage ```php -$orderId = 'orderId2'; - -$request = CreateOrderItemRequestBuilder::init( - 242, - 'description6', - 100, - 'category4' -)->build(); +$orderId = 'order_id6'; -$result = $ordersController->createOrderItem( - $orderId, - $request -); +$result = $ordersController->getOrder($orderId); ``` diff --git a/doc/controllers/plans.md b/doc/controllers/plans.md index 2a759db..f2be784 100644 --- a/doc/controllers/plans.md +++ b/doc/controllers/plans.md @@ -11,15 +11,15 @@ $plansController = $client->getPlansController(); ## Methods * [Get Plan](../../doc/controllers/plans.md#get-plan) -* [Update Plan](../../doc/controllers/plans.md#update-plan) -* [Update Plan Metadata](../../doc/controllers/plans.md#update-plan-metadata) -* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item) -* [Get Plans](../../doc/controllers/plans.md#get-plans) -* [Get Plan Item](../../doc/controllers/plans.md#get-plan-item) * [Delete Plan](../../doc/controllers/plans.md#delete-plan) +* [Update Plan Metadata](../../doc/controllers/plans.md#update-plan-metadata) * [Update Plan Item](../../doc/controllers/plans.md#update-plan-item) * [Create Plan Item](../../doc/controllers/plans.md#create-plan-item) +* [Get Plan Item](../../doc/controllers/plans.md#get-plan-item) * [Create Plan](../../doc/controllers/plans.md#create-plan) +* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item) +* [Get Plans](../../doc/controllers/plans.md#get-plans) +* [Update Plan](../../doc/controllers/plans.md#update-plan) # Get Plan @@ -49,12 +49,12 @@ $result = $plansController->getPlan($planId); ``` -# Update Plan +# Delete Plan -Updates a plan +Deletes a plan ```php -function updatePlan(string $planId, UpdatePlanRequest $request, ?string $idempotencyKey = null): GetPlanResponse +function deletePlan(string $planId, ?string $idempotencyKey = null): GetPlanResponse ``` ## Parameters @@ -62,7 +62,6 @@ function updatePlan(string $planId, UpdatePlanRequest $request, ?string $idempot | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | -| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -74,37 +73,7 @@ function updatePlan(string $planId, UpdatePlanRequest $request, ?string $idempot ```php $planId = 'plan_id8'; -$request = UpdatePlanRequestBuilder::init( - 'name6', - 'description6', - [ - 151, - 152 - ], - 'statement_descriptor6', - 'currency6', - 'interval4', - 114, - [ - 'payment_methods1', - 'payment_methods0', - 'payment_methods9' - ], - 'billing_type0', - 'status8', - false, - [ - 115 - ], - [ - 'key0' => 'metadata3' - ] -)->build(); - -$result = $plansController->updatePlan( - $planId, - $request -); +$result = $plansController->deletePlan($planId); ``` @@ -150,12 +119,17 @@ $result = $plansController->updatePlanMetadata( ``` -# Delete Plan Item +# Update Plan Item -Removes an item from a plan +Updates a plan item ```php -function deletePlanItem(string $planId, string $planItemId, ?string $idempotencyKey = null): GetPlanItemResponse +function updatePlanItem( + string $planId, + string $planItemId, + UpdatePlanItemRequest $body, + ?string $idempotencyKey = null +): GetPlanItemResponse ``` ## Parameters @@ -164,6 +138,7 @@ function deletePlanItem(string $planId, string $planItemId, ?string $idempotency | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | | `planItemId` | `string` | Template, Required | Plan item id | +| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -177,49 +152,71 @@ $planId = 'plan_id8'; $planItemId = 'plan_item_id0'; -$result = $plansController->deletePlanItem( +$body = UpdatePlanItemRequestBuilder::init( + 'name6', + 'description4', + 'status2', + UpdatePricingSchemeRequestBuilder::init( + 'scheme_type8', + [ + UpdatePriceBracketRequestBuilder::init( + 144, + 174 + )->build() + ] + )->build() +)->build(); + +$result = $plansController->updatePlanItem( $planId, - $planItemId + $planItemId, + $body ); ``` -# Get Plans +# Create Plan Item -Gets all plans +Adds a new item to a plan ```php -function getPlans( - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $status = null, - ?string $billingType = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): ListPlansResponse +function createPlanItem( + string $planId, + CreatePlanItemRequest $request, + ?string $idempotencyKey = null +): GetPlanItemResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `name` | `?string` | Query, Optional | Filter for Plan's name | -| `status` | `?string` | Query, Optional | Filter for Plan's status | -| `billingType` | `?string` | Query, Optional | Filter for plan's billing type | -| `createdSince` | `?DateTime` | Query, Optional | Filter for plan's creation date start range | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for plan's creation date end range | +| `planId` | `string` | Template, Required | Plan id | +| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListPlansResponse`](../../doc/models/list-plans-response.md) +[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md) ## Example Usage ```php -$result = $plansController->getPlans(); +$planId = 'plan_id8'; + +$request = CreatePlanItemRequestBuilder::init( + 'name6', + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + 'id6', + 'description6' +)->build(); + +$result = $plansController->createPlanItem( + $planId, + $request +); ``` @@ -256,19 +253,19 @@ $result = $plansController->getPlanItem( ``` -# Delete Plan +# Create Plan -Deletes a plan +Creates a new plan ```php -function deletePlan(string $planId, ?string $idempotencyKey = null): GetPlanResponse +function createPlan(CreatePlanRequest $body, ?string $idempotencyKey = null): GetPlanResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `planId` | `string` | Template, Required | Plan id | +| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -278,23 +275,54 @@ function deletePlan(string $planId, ?string $idempotencyKey = null): GetPlanResp ## Example Usage ```php -$planId = 'plan_id8'; +$body = CreatePlanRequestBuilder::init( + 'name6', + 'description4', + 'statement_descriptor6', + [ + CreatePlanItemRequestBuilder::init( + 'name8', + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + 'id8', + 'description2' + )->build() + ], + false, + [ + 'payment_methods9' + ], + [ + 207 + ], + 'currency6', + 'interval6', + 170, + [ + 201, + 200 + ], + 'billing_type0', + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + [ + 'key0' => 'metadata7', + 'key1' => 'metadata8' + ] +)->build(); -$result = $plansController->deletePlan($planId); +$result = $plansController->createPlan($body); ``` -# Update Plan Item +# Delete Plan Item -Updates a plan item +Removes an item from a plan ```php -function updatePlanItem( - string $planId, - string $planItemId, - UpdatePlanItemRequest $body, - ?string $idempotencyKey = null -): GetPlanItemResponse +function deletePlanItem(string $planId, string $planItemId, ?string $idempotencyKey = null): GetPlanItemResponse ``` ## Parameters @@ -303,7 +331,6 @@ function updatePlanItem( | --- | --- | --- | --- | | `planId` | `string` | Template, Required | Plan id | | `planItemId` | `string` | Template, Required | Plan item id | -| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -317,87 +344,66 @@ $planId = 'plan_id8'; $planItemId = 'plan_item_id0'; -$body = UpdatePlanItemRequestBuilder::init( - 'name6', - 'description4', - 'status2', - UpdatePricingSchemeRequestBuilder::init( - 'scheme_type2', - [ - UpdatePriceBracketRequestBuilder::init( - 31, - 225 - )->build() - ] - )->build() -)->build(); - -$result = $plansController->updatePlanItem( +$result = $plansController->deletePlanItem( $planId, - $planItemId, - $body + $planItemId ); ``` -# Create Plan Item +# Get Plans -Adds a new item to a plan +Gets all plans ```php -function createPlanItem( - string $planId, - CreatePlanItemRequest $request, - ?string $idempotencyKey = null -): GetPlanItemResponse +function getPlans( + ?int $page = null, + ?int $size = null, + ?string $name = null, + ?string $status = null, + ?string $billingType = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null +): ListPlansResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `planId` | `string` | Template, Required | Plan id | -| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `name` | `?string` | Query, Optional | Filter for Plan's name | +| `status` | `?string` | Query, Optional | Filter for Plan's status | +| `billingType` | `?string` | Query, Optional | Filter for plan's billing type | +| `createdSince` | `?DateTime` | Query, Optional | Filter for plan's creation date start range | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for plan's creation date end range | ## Response Type -[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md) +[`ListPlansResponse`](../../doc/models/list-plans-response.md) ## Example Usage ```php -$planId = 'plan_id8'; - -$request = CreatePlanItemRequestBuilder::init( - 'name6', - CreatePricingSchemeRequestBuilder::init( - 'scheme_type2' - )->build(), - 'id6', - 'description6' -)->build(); - -$result = $plansController->createPlanItem( - $planId, - $request -); +$result = $plansController->getPlans(); ``` -# Create Plan +# Update Plan -Creates a new plan +Updates a plan ```php -function createPlan(CreatePlanRequest $body, ?string $idempotencyKey = null): GetPlanResponse +function updatePlan(string $planId, UpdatePlanRequest $request, ?string $idempotencyKey = null): GetPlanResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan | +| `planId` | `string` | Template, Required | Plan id | +| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -407,44 +413,38 @@ function createPlan(CreatePlanRequest $body, ?string $idempotencyKey = null): Ge ## Example Usage ```php -$body = CreatePlanRequestBuilder::init( +$planId = 'plan_id8'; + +$request = UpdatePlanRequestBuilder::init( 'name6', - 'description4', - 'statement_descriptor6', + 'description6', [ - CreatePlanItemRequestBuilder::init( - 'name3', - CreatePricingSchemeRequestBuilder::init( - 'scheme_type5' - )->build(), - 'id3', - 'description3' - )->build() + 151, + 152 ], - false, + 'statement_descriptor6', + 'currency6', + 'interval4', + 114, [ + 'payment_methods1', + 'payment_methods0', 'payment_methods9' ], + 'billing_type0', + 'status8', + false, [ - 207 - ], - 'currency6', - 'interval6', - 170, - [ - 201, - 200 + 115 ], - 'billing_type0', - CreatePricingSchemeRequestBuilder::init( - 'scheme_type2' - )->build(), [ - 'key0' => 'metadata7', - 'key1' => 'metadata8' + 'key0' => 'metadata3' ] )->build(); -$result = $plansController->createPlan($body); +$result = $plansController->updatePlan( + $planId, + $request +); ``` diff --git a/doc/controllers/recipients.md b/doc/controllers/recipients.md index 6dce06e..80d0f40 100644 --- a/doc/controllers/recipients.md +++ b/doc/controllers/recipients.md @@ -14,21 +14,21 @@ $recipientsController = $client->getRecipientsController(); * [Create Anticipation](../../doc/controllers/recipients.md#create-anticipation) * [Get Anticipation Limits](../../doc/controllers/recipients.md#get-anticipation-limits) * [Get Recipients](../../doc/controllers/recipients.md#get-recipients) +* [Get Withdraw by Id](../../doc/controllers/recipients.md#get-withdraw-by-id) +* [Update Recipient Default Bank Account](../../doc/controllers/recipients.md#update-recipient-default-bank-account) * [Update Recipient Metadata](../../doc/controllers/recipients.md#update-recipient-metadata) +* [Get Transfers](../../doc/controllers/recipients.md#get-transfers) * [Get Transfer](../../doc/controllers/recipients.md#get-transfer) +* [Create Withdraw](../../doc/controllers/recipients.md#create-withdraw) +* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings) * [Get Anticipation](../../doc/controllers/recipients.md#get-anticipation) * [Update Recipient Transfer Settings](../../doc/controllers/recipients.md#update-recipient-transfer-settings) * [Get Anticipations](../../doc/controllers/recipients.md#get-anticipations) -* [Update Recipient Default Bank Account](../../doc/controllers/recipients.md#update-recipient-default-bank-account) -* [Create Withdraw](../../doc/controllers/recipients.md#create-withdraw) +* [Get Recipient](../../doc/controllers/recipients.md#get-recipient) * [Get Balance](../../doc/controllers/recipients.md#get-balance) +* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals) * [Create Transfer](../../doc/controllers/recipients.md#create-transfer) * [Create Recipient](../../doc/controllers/recipients.md#create-recipient) -* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings) -* [Get Recipient](../../doc/controllers/recipients.md#get-recipient) -* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals) -* [Get Withdraw by Id](../../doc/controllers/recipients.md#get-withdraw-by-id) -* [Get Transfers](../../doc/controllers/recipients.md#get-transfers) * [Get Recipient by Code](../../doc/controllers/recipients.md#get-recipient-by-code) * [Get Default Recipient](../../doc/controllers/recipients.md#get-default-recipient) @@ -189,54 +189,47 @@ $result = $recipientsController->getRecipients(); ``` -# Update Recipient Metadata - -Updates recipient metadata +# Get Withdraw by Id ```php -function updateRecipientMetadata( - string $recipientId, - UpdateMetadataRequest $request, - ?string $idempotencyKey = null -): GetRecipientResponse +function getWithdrawById(string $recipientId, string $withdrawalId): GetWithdrawResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `recipientId` | `string` | Template, Required | - | +| `withdrawalId` | `string` | Template, Required | - | ## Response Type -[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) +[`GetWithdrawResponse`](../../doc/models/get-withdraw-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$request = UpdateMetadataRequestBuilder::init( - [ - 'key0' => 'metadata3' - ] -)->build(); +$withdrawalId = 'withdrawal_id2'; -$result = $recipientsController->updateRecipientMetadata( +$result = $recipientsController->getWithdrawById( $recipientId, - $request + $withdrawalId ); ``` -# Get Transfer +# Update Recipient Default Bank Account -Gets a transfer +Updates the default bank account from a recipient ```php -function getTransfer(string $recipientId, string $transferId): GetTransferResponse +function updateRecipientDefaultBankAccount( + string $recipientId, + UpdateRecipientBankAccountRequest $request, + ?string $idempotencyKey = null +): GetRecipientResponse ``` ## Parameters @@ -244,65 +237,51 @@ function getTransfer(string $recipientId, string $transferId): GetTransferRespon | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `recipientId` | `string` | Template, Required | Recipient id | -| `transferId` | `string` | Template, Required | Transfer id | +| `request` | [`UpdateRecipientBankAccountRequest`](../../doc/models/update-recipient-bank-account-request.md) | Body, Required | Bank account data | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetTransferResponse`](../../doc/models/get-transfer-response.md) +[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$transferId = 'transfer_id6'; +$request = UpdateRecipientBankAccountRequestBuilder::init( + CreateBankAccountRequestBuilder::init( + 'holder_name0', + 'holder_type6', + 'holder_document8', + 'bank2', + 'branch_number0', + 'account_number4', + 'account_check_digit0', + 'type6', + [ + 'key0' => 'metadata1', + 'key1' => 'metadata0' + ] + )->build(), + 'bank_transfer' +)->build(); -$result = $recipientsController->getTransfer( +$result = $recipientsController->updateRecipientDefaultBankAccount( $recipientId, - $transferId + $request ); ``` -# Get Anticipation - -Gets an anticipation - -```php -function getAnticipation(string $recipientId, string $anticipationId): GetAnticipationResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `anticipationId` | `string` | Template, Required | Anticipation id | - -## Response Type - -[`GetAnticipationResponse`](../../doc/models/get-anticipation-response.md) - -## Example Usage - -```php -$recipientId = 'recipient_id0'; - -$anticipationId = 'anticipation_id0'; - -$result = $recipientsController->getAnticipation( - $recipientId, - $anticipationId -); -``` - +# Update Recipient Metadata -# Update Recipient Transfer Settings +Updates recipient metadata ```php -function updateRecipientTransferSettings( +function updateRecipientMetadata( string $recipientId, - UpdateTransferSettingsRequest $request, + UpdateMetadataRequest $request, ?string $idempotencyKey = null ): GetRecipientResponse ``` @@ -311,8 +290,8 @@ function updateRecipientTransferSettings( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient Identificator | -| `request` | [`UpdateTransferSettingsRequest`](../../doc/models/update-transfer-settings-request.md) | Body, Required | - | +| `recipientId` | `string` | Template, Required | Recipient id | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -324,35 +303,32 @@ function updateRecipientTransferSettings( ```php $recipientId = 'recipient_id0'; -$request = UpdateTransferSettingsRequestBuilder::init( - 'transfer_enabled2', - 'transfer_interval6', - 'transfer_day6' +$request = UpdateMetadataRequestBuilder::init( + [ + 'key0' => 'metadata3' + ] )->build(); -$result = $recipientsController->updateRecipientTransferSettings( +$result = $recipientsController->updateRecipientMetadata( $recipientId, $request ); ``` -# Get Anticipations +# Get Transfers -Retrieves a paginated list of anticipations from a recipient +Gets a paginated list of transfers for the recipient ```php -function getAnticipations( +function getTransfers( string $recipientId, ?int $page = null, ?int $size = null, ?string $status = null, - ?string $timeframe = null, - ?\DateTime $paymentDateSince = null, - ?\DateTime $paymentDateUntil = null, ?\DateTime $createdSince = null, ?\DateTime $createdUntil = null -): ListAnticipationResponse +): ListTransferResponse ``` ## Parameters @@ -362,36 +338,29 @@ function getAnticipations( | `recipientId` | `string` | Template, Required | Recipient id | | `page` | `?int` | Query, Optional | Page number | | `size` | `?int` | Query, Optional | Page size | -| `status` | `?string` | Query, Optional | Filter for anticipation status | -| `timeframe` | `?string` | Query, Optional | Filter for anticipation timeframe | -| `paymentDateSince` | `?DateTime` | Query, Optional | Filter for start range for anticipation payment date | -| `paymentDateUntil` | `?DateTime` | Query, Optional | Filter for end range for anticipation payment date | -| `createdSince` | `?DateTime` | Query, Optional | Filter for start range for anticipation creation date | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for end range for anticipation creation date | +| `status` | `?string` | Query, Optional | Filter for transfer status | +| `createdSince` | `?DateTime` | Query, Optional | Filter for start range of transfer creation date | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for end range of transfer creation date | ## Response Type -[`ListAnticipationResponse`](../../doc/models/list-anticipation-response.md) +[`ListTransferResponse`](../../doc/models/list-transfer-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$result = $recipientsController->getAnticipations($recipientId); +$result = $recipientsController->getTransfers($recipientId); ``` -# Update Recipient Default Bank Account +# Get Transfer -Updates the default bank account from a recipient +Gets a transfer ```php -function updateRecipientDefaultBankAccount( - string $recipientId, - UpdateRecipientBankAccountRequest $request, - ?string $idempotencyKey = null -): GetRecipientResponse +function getTransfer(string $recipientId, string $transferId): GetTransferResponse ``` ## Parameters @@ -399,39 +368,22 @@ function updateRecipientDefaultBankAccount( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`UpdateRecipientBankAccountRequest`](../../doc/models/update-recipient-bank-account-request.md) | Body, Required | Bank account data | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `transferId` | `string` | Template, Required | Transfer id | ## Response Type -[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) +[`GetTransferResponse`](../../doc/models/get-transfer-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$request = UpdateRecipientBankAccountRequestBuilder::init( - CreateBankAccountRequestBuilder::init( - 'holder_name6', - 'holder_type2', - 'holder_document4', - 'bank8', - 'branch_number6', - 'account_number0', - 'account_check_digit6', - 'type0', - [ - 'key0' => 'metadata9', - 'key1' => 'metadata8' - ] - )->build(), - 'bank_transfer' -)->build(); +$transferId = 'transfer_id6'; -$result = $recipientsController->updateRecipientDefaultBankAccount( +$result = $recipientsController->getTransfer( $recipientId, - $request + $transferId ); ``` @@ -469,12 +421,16 @@ $result = $recipientsController->createWithdraw( ``` -# Get Balance +# Update Automatic Anticipation Settings -Get balance information for a recipient +Updates recipient metadata ```php -function getBalance(string $recipientId): GetBalanceResponse +function updateAutomaticAnticipationSettings( + string $recipientId, + UpdateAutomaticAnticipationSettingsRequest $request, + ?string $idempotencyKey = null +): GetRecipientResponse ``` ## Parameters @@ -482,76 +438,76 @@ function getBalance(string $recipientId): GetBalanceResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `recipientId` | `string` | Template, Required | Recipient id | +| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetBalanceResponse`](../../doc/models/get-balance-response.md) +[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$result = $recipientsController->getBalance($recipientId); +$request = UpdateAutomaticAnticipationSettingsRequestBuilder::init()->build(); + +$result = $recipientsController->updateAutomaticAnticipationSettings( + $recipientId, + $request +); ``` -# Create Transfer +# Get Anticipation -Creates a transfer for a recipient +Gets an anticipation ```php -function createTransfer( - string $recipientId, - CreateTransferRequest $request, - ?string $idempotencyKey = null -): GetTransferResponse +function getAnticipation(string $recipientId, string $anticipationId): GetAnticipationResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient Id | -| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `recipientId` | `string` | Template, Required | Recipient id | +| `anticipationId` | `string` | Template, Required | Anticipation id | ## Response Type -[`GetTransferResponse`](../../doc/models/get-transfer-response.md) +[`GetAnticipationResponse`](../../doc/models/get-anticipation-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$request = CreateTransferRequestBuilder::init( - 242, - [ - 'key0' => 'metadata3' - ] -)->build(); +$anticipationId = 'anticipation_id0'; -$result = $recipientsController->createTransfer( +$result = $recipientsController->getAnticipation( $recipientId, - $request + $anticipationId ); ``` -# Create Recipient - -Creates a new recipient +# Update Recipient Transfer Settings ```php -function createRecipient(CreateRecipientRequest $request, ?string $idempotencyKey = null): GetRecipientResponse +function updateRecipientTransferSettings( + string $recipientId, + UpdateTransferSettingsRequest $request, + ?string $idempotencyKey = null +): GetRecipientResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data | +| `recipientId` | `string` | Template, Required | Recipient Identificator | +| `request` | [`UpdateTransferSettingsRequest`](../../doc/models/update-transfer-settings-request.md) | Body, Required | - | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -561,46 +517,37 @@ function createRecipient(CreateRecipientRequest $request, ?string $idempotencyKe ## Example Usage ```php -$request = CreateRecipientRequestBuilder::init( - 'name6', - 'email0', - 'description6', - 'document0', - 'type4', - CreateBankAccountRequestBuilder::init( - 'holder_name0', - 'holder_type6', - 'holder_document8', - 'bank2', - 'branch_number0', - 'account_number4', - 'account_check_digit0', - 'type4', - [ - 'key0' => 'metadata5' - ] - )->build(), - [ - 'key0' => 'metadata3' - ], - 'code4', - 'bank_transfer' +$recipientId = 'recipient_id0'; + +$request = UpdateTransferSettingsRequestBuilder::init( + 'transfer_enabled2', + 'transfer_interval6', + 'transfer_day6' )->build(); -$result = $recipientsController->createRecipient($request); +$result = $recipientsController->updateRecipientTransferSettings( + $recipientId, + $request +); ``` -# Update Automatic Anticipation Settings +# Get Anticipations -Updates recipient metadata +Retrieves a paginated list of anticipations from a recipient ```php -function updateAutomaticAnticipationSettings( +function getAnticipations( string $recipientId, - UpdateAutomaticAnticipationSettingsRequest $request, - ?string $idempotencyKey = null -): GetRecipientResponse + ?int $page = null, + ?int $size = null, + ?string $status = null, + ?string $timeframe = null, + ?\DateTime $paymentDateSince = null, + ?\DateTime $paymentDateUntil = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null +): ListAnticipationResponse ``` ## Parameters @@ -608,24 +555,25 @@ function updateAutomaticAnticipationSettings( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `recipientId` | `string` | Template, Required | Recipient id | -| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `status` | `?string` | Query, Optional | Filter for anticipation status | +| `timeframe` | `?string` | Query, Optional | Filter for anticipation timeframe | +| `paymentDateSince` | `?DateTime` | Query, Optional | Filter for start range for anticipation payment date | +| `paymentDateUntil` | `?DateTime` | Query, Optional | Filter for end range for anticipation payment date | +| `createdSince` | `?DateTime` | Query, Optional | Filter for start range for anticipation creation date | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for end range for anticipation creation date | ## Response Type -[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) +[`ListAnticipationResponse`](../../doc/models/list-anticipation-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$request = UpdateAutomaticAnticipationSettingsRequestBuilder::init()->build(); - -$result = $recipientsController->updateAutomaticAnticipationSettings( - $recipientId, - $request -); +$result = $recipientsController->getAnticipations($recipientId); ``` @@ -656,6 +604,33 @@ $result = $recipientsController->getRecipient($recipientId); ``` +# Get Balance + +Get balance information for a recipient + +```php +function getBalance(string $recipientId): GetBalanceResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipientId` | `string` | Template, Required | Recipient id | + +## Response Type + +[`GetBalanceResponse`](../../doc/models/get-balance-response.md) + +## Example Usage + +```php +$recipientId = 'recipient_id0'; + +$result = $recipientsController->getBalance($recipientId); +``` + + # Get Withdrawals Gets a paginated list of transfers for the recipient @@ -695,73 +670,100 @@ $result = $recipientsController->getWithdrawals($recipientId); ``` -# Get Withdraw by Id +# Create Transfer + +Creates a transfer for a recipient ```php -function getWithdrawById(string $recipientId, string $withdrawalId): GetWithdrawResponse +function createTransfer( + string $recipientId, + CreateTransferRequest $request, + ?string $idempotencyKey = null +): GetTransferResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | - | -| `withdrawalId` | `string` | Template, Required | - | +| `recipientId` | `string` | Template, Required | Recipient Id | +| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetWithdrawResponse`](../../doc/models/get-withdraw-response.md) +[`GetTransferResponse`](../../doc/models/get-transfer-response.md) ## Example Usage ```php $recipientId = 'recipient_id0'; -$withdrawalId = 'withdrawal_id2'; +$request = CreateTransferRequestBuilder::init( + 242, + [ + 'key0' => 'metadata3' + ] +)->build(); -$result = $recipientsController->getWithdrawById( +$result = $recipientsController->createTransfer( $recipientId, - $withdrawalId + $request ); ``` -# Get Transfers +# Create Recipient -Gets a paginated list of transfers for the recipient +Creates a new recipient ```php -function getTransfers( - string $recipientId, - ?int $page = null, - ?int $size = null, - ?string $status = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): ListTransferResponse +function createRecipient(CreateRecipientRequest $request, ?string $idempotencyKey = null): GetRecipientResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `recipientId` | `string` | Template, Required | Recipient id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `status` | `?string` | Query, Optional | Filter for transfer status | -| `createdSince` | `?DateTime` | Query, Optional | Filter for start range of transfer creation date | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for end range of transfer creation date | +| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListTransferResponse`](../../doc/models/list-transfer-response.md) +[`GetRecipientResponse`](../../doc/models/get-recipient-response.md) ## Example Usage ```php -$recipientId = 'recipient_id0'; +$request = CreateRecipientRequestBuilder::init( + 'name6', + 'email0', + 'description6', + 'document0', + 'type4', + CreateBankAccountRequestBuilder::init( + 'holder_name4', + 'holder_type0', + 'holder_document2', + 'bank6', + 'branch_number4', + 'account_number8', + 'account_check_digit4', + 'type2', + [ + 'key0' => 'metadata5', + 'key1' => 'metadata4', + 'key2' => 'metadata3' + ] + )->build(), + [ + 'key0' => 'metadata3' + ], + 'code4', + 'bank_transfer' +)->build(); -$result = $recipientsController->getTransfers($recipientId); +$result = $recipientsController->createRecipient($request); ``` diff --git a/doc/controllers/sellers.md b/doc/controllers/sellers.md deleted file mode 100644 index b6de5cf..0000000 --- a/doc/controllers/sellers.md +++ /dev/null @@ -1,249 +0,0 @@ -# Sellers - -```php -$sellersController = $client->getSellersController(); -``` - -## Class Name - -`SellersController` - -## Methods - -* [Create Seller](/doc/controllers/sellers.md#create-seller) -* [Update Seller Metadata](/doc/controllers/sellers.md#update-seller-metadata) -* [Update Seller](/doc/controllers/sellers.md#update-seller) -* [Delete Seller](/doc/controllers/sellers.md#delete-seller) -* [Get Seller by Id](/doc/controllers/sellers.md#get-seller-by-id) -* [Get Sellers](/doc/controllers/sellers.md#get-sellers) - - -# Create Seller - -```php -function createSeller(CreateSellerRequest $request, ?string $idempotencyKey = null): GetSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `request` | [`CreateSellerRequest`](/doc/models/create-seller-request.md) | Body, Required | Seller Model | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetSellerResponse`](/doc/models/get-seller-response.md) - -## Example Usage - -```php -$request_name = 'name6'; -$request_metadata = ['key0' => 'metadata3']; -$request = new Models\CreateSellerRequest( - $request_name, - $request_metadata -); - -$result = $sellersController->createSeller($request); -``` - - -# Update Seller Metadata - -```php -function updateSellerMetadata( - string $sellerId, - UpdateMetadataRequest $request, - ?string $idempotencyKey = null -): GetSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sellerId` | `string` | Template, Required | Seller Id | -| `request` | [`UpdateMetadataRequest`](/doc/models/update-metadata-request.md) | Body, Required | Request for updating the charge metadata | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetSellerResponse`](/doc/models/get-seller-response.md) - -## Example Usage - -```php -$sellerId = 'seller_id8'; -$request_metadata = ['key0' => 'metadata3']; -$request = new Models\UpdateMetadataRequest( - $request_metadata -); - -$result = $sellersController->updateSellerMetadata($sellerId, $request); -``` - - -# Update Seller - -```php -function updateSeller( - string $id, - UpdateSellerRequest $request, - ?string $idempotencyKey = null -): GetSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | - | -| `request` | [`UpdateSellerRequest`](/doc/models/update-seller-request.md) | Body, Required | Update Seller model | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetSellerResponse`](/doc/models/get-seller-response.md) - -## Example Usage - -```php -$id = 'id0'; -$request_name = 'name6'; -$request_code = 'code4'; -$request_description = 'description6'; -$request_document = 'document0'; -$request_status = 'status8'; -$request_type = 'type4'; -$request_address_street = 'street2'; -$request_address_number = 'number0'; -$request_address_zipCode = 'zip_code6'; -$request_address_neighborhood = 'neighborhood8'; -$request_address_city = 'city2'; -$request_address_state = 'state8'; -$request_address_country = 'country6'; -$request_address_complement = 'complement8'; -$request_address_metadata = ['key0' => 'metadata7']; -$request_address_line1 = 'line_16'; -$request_address_line2 = 'line_20'; -$request_address = new Models\CreateAddressRequest( - $request_address_street, - $request_address_number, - $request_address_zipCode, - $request_address_neighborhood, - $request_address_city, - $request_address_state, - $request_address_country, - $request_address_complement, - $request_address_metadata, - $request_address_line1, - $request_address_line2 -); -$request_metadata = ['key0' => 'metadata3']; -$request = new Models\UpdateSellerRequest( - $request_name, - $request_code, - $request_description, - $request_document, - $request_status, - $request_type, - $request_address, - $request_metadata -); - -$result = $sellersController->updateSeller($id, $request); -``` - - -# Delete Seller - -```php -function deleteSeller(string $sellerId, ?string $idempotencyKey = null): GetSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `sellerId` | `string` | Template, Required | Seller Id | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetSellerResponse`](/doc/models/get-seller-response.md) - -## Example Usage - -```php -$sellerId = 'sellerId4'; - -$result = $sellersController->deleteSeller($sellerId); -``` - - -# Get Seller by Id - -```php -function getSellerById(string $id): GetSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `string` | Template, Required | Seller Id | - -## Response Type - -[`GetSellerResponse`](/doc/models/get-seller-response.md) - -## Example Usage - -```php -$id = 'id0'; - -$result = $sellersController->getSellerById($id); -``` - - -# Get Sellers - -```php -function getSellers( - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $document = null, - ?string $code = null, - ?string $status = null, - ?string $type = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): ListSellerResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `name` | `?string` | Query, Optional | - | -| `document` | `?string` | Query, Optional | - | -| `code` | `?string` | Query, Optional | - | -| `status` | `?string` | Query, Optional | - | -| `type` | `?string` | Query, Optional | - | -| `createdSince` | `?\DateTime` | Query, Optional | - | -| `createdUntil` | `?\DateTime` | Query, Optional | - | - -## Response Type - -[`ListSellerResponse`](/doc/models/list-seller-response.md) - -## Example Usage - -```php -$result = $sellersController->getSellers(); -``` - diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 085877f..c1883f8 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -11,39 +11,39 @@ $subscriptionsController = $client->getSubscriptionsController(); ## Methods * [Renew Subscription](../../doc/controllers/subscriptions.md#renew-subscription) +* [Update Subscription Card](../../doc/controllers/subscriptions.md#update-subscription-card) +* [Delete Usage](../../doc/controllers/subscriptions.md#delete-usage) +* [Create Discount](../../doc/controllers/subscriptions.md#create-discount) +* [Create an Usage](../../doc/controllers/subscriptions.md#create-an-usage) +* [Update Current Cycle Status](../../doc/controllers/subscriptions.md#update-current-cycle-status) * [Delete Discount](../../doc/controllers/subscriptions.md#delete-discount) +* [Get Subscription Items](../../doc/controllers/subscriptions.md#get-subscription-items) +* [Update Subscription Payment Method](../../doc/controllers/subscriptions.md#update-subscription-payment-method) +* [Get Subscription Item](../../doc/controllers/subscriptions.md#get-subscription-item) * [Get Subscriptions](../../doc/controllers/subscriptions.md#get-subscriptions) +* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) +* [Create Increment](../../doc/controllers/subscriptions.md#create-increment) +* [Create Usage](../../doc/controllers/subscriptions.md#create-usage) * [Get Discount by Id](../../doc/controllers/subscriptions.md#get-discount-by-id) * [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription) * [Get Increment by Id](../../doc/controllers/subscriptions.md#get-increment-by-id) +* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id) * [Update Subscription Metadata](../../doc/controllers/subscriptions.md#update-subscription-metadata) * [Delete Increment](../../doc/controllers/subscriptions.md#delete-increment) -* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) -* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at) -* [Update Current Cycle Status](../../doc/controllers/subscriptions.md#update-current-cycle-status) -* [Get Subscription Items](../../doc/controllers/subscriptions.md#get-subscription-items) -* [Get Subscription Item](../../doc/controllers/subscriptions.md#get-subscription-item) -* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id) +* [Get Subscription Cycles](../../doc/controllers/subscriptions.md#get-subscription-cycles) * [Get Discounts](../../doc/controllers/subscriptions.md#get-discounts) +* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date) +* [Delete Subscription Item](../../doc/controllers/subscriptions.md#delete-subscription-item) +* [Get Increments](../../doc/controllers/subscriptions.md#get-increments) +* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days) +* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at) * [Update Subscription Item](../../doc/controllers/subscriptions.md#update-subscription-item) * [Create Subscription Item](../../doc/controllers/subscriptions.md#create-subscription-item) +* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription) * [Get Usages](../../doc/controllers/subscriptions.md#get-usages) +* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at) * [Update Subscription Minium Price](../../doc/controllers/subscriptions.md#update-subscription-minium-price) * [Get Subscription Cycle by Id](../../doc/controllers/subscriptions.md#get-subscription-cycle-by-id) -* [Create an Usage](../../doc/controllers/subscriptions.md#create-an-usage) -* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription) -* [Delete Subscription Item](../../doc/controllers/subscriptions.md#delete-subscription-item) -* [Get Increments](../../doc/controllers/subscriptions.md#get-increments) -* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days) -* [Update Subscription Card](../../doc/controllers/subscriptions.md#update-subscription-card) -* [Delete Usage](../../doc/controllers/subscriptions.md#delete-usage) -* [Create Discount](../../doc/controllers/subscriptions.md#create-discount) -* [Update Subscription Payment Method](../../doc/controllers/subscriptions.md#update-subscription-payment-method) -* [Create Increment](../../doc/controllers/subscriptions.md#create-increment) -* [Create Usage](../../doc/controllers/subscriptions.md#create-usage) -* [Get Subscription Cycles](../../doc/controllers/subscriptions.md#get-subscription-cycles) -* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date) -* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at) * [Get Usage Report](../../doc/controllers/subscriptions.md#get-usage-report) * [Update Split Subscription](../../doc/controllers/subscriptions.md#update-split-subscription) @@ -74,16 +74,16 @@ $result = $subscriptionsController->renewSubscription($subscriptionId); ``` -# Delete Discount +# Update Subscription Card -Deletes a discount +Updates the credit card from a subscription ```php -function deleteDiscount( +function updateSubscriptionCard( string $subscriptionId, - string $discountId, + UpdateSubscriptionCardRequest $request, ?string $idempotencyKey = null -): GetDiscountResponse +): GetSubscriptionResponse ``` ## Parameters @@ -91,88 +91,94 @@ function deleteDiscount( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | -| `discountId` | `string` | Template, Required | Discount Id | +| `request` | [`UpdateSubscriptionCardRequest`](../../doc/models/update-subscription-card-request.md) | Body, Required | Request for updating a card | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetDiscountResponse`](../../doc/models/get-discount-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$discountId = 'discount_id8'; +$request = UpdateSubscriptionCardRequestBuilder::init( + CreateCardRequestBuilder::init() + ->type('credit') + ->build(), + 'card_id2' +)->build(); -$result = $subscriptionsController->deleteDiscount( +$result = $subscriptionsController->updateSubscriptionCard( $subscriptionId, - $discountId + $request ); ``` -# Get Subscriptions +# Delete Usage -Gets all subscriptions +Deletes a usage ```php -function getSubscriptions( - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $billingType = null, - ?string $customerId = null, - ?string $planId = null, - ?string $cardId = null, - ?string $status = null, - ?\DateTime $nextBillingSince = null, - ?\DateTime $nextBillingUntil = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null -): ListSubscriptionsResponse +function deleteUsage( + string $subscriptionId, + string $itemId, + string $usageId, + ?string $idempotencyKey = null +): GetUsageResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `code` | `?string` | Query, Optional | Filter for subscription's code | -| `billingType` | `?string` | Query, Optional | Filter for subscription's billing type | -| `customerId` | `?string` | Query, Optional | Filter for subscription's customer id | -| `planId` | `?string` | Query, Optional | Filter for subscription's plan id | -| `cardId` | `?string` | Query, Optional | Filter for subscription's card id | -| `status` | `?string` | Query, Optional | Filter for subscription's status | -| `nextBillingSince` | `?DateTime` | Query, Optional | Filter for subscription's next billing date start range | -| `nextBillingUntil` | `?DateTime` | Query, Optional | Filter for subscription's next billing date end range | -| `createdSince` | `?DateTime` | Query, Optional | Filter for subscription's creation date start range | -| `createdUntil` | `?DateTime` | Query, Optional | Filter for subscriptions creation date end range | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `itemId` | `string` | Template, Required | The subscription item id | +| `usageId` | `string` | Template, Required | The usage id | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListSubscriptionsResponse`](../../doc/models/list-subscriptions-response.md) +[`GetUsageResponse`](../../doc/models/get-usage-response.md) ## Example Usage ```php -$result = $subscriptionsController->getSubscriptions(); +$subscriptionId = 'subscription_id0'; + +$itemId = 'item_id0'; + +$usageId = 'usage_id0'; + +$result = $subscriptionsController->deleteUsage( + $subscriptionId, + $itemId, + $usageId +); ``` -# Get Discount by Id +# Create Discount + +Creates a discount ```php -function getDiscountById(string $subscriptionId, string $discountId): GetDiscountResponse +function createDiscount( + string $subscriptionId, + CreateDiscountRequest $request, + ?string $idempotencyKey = null +): GetDiscountResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `discountId` | `string` | Template, Required | - | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `request` | [`CreateDiscountRequest`](../../doc/models/create-discount-request.md) | Body, Required | Request for creating a discount | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -183,260 +189,184 @@ function getDiscountById(string $subscriptionId, string $discountId): GetDiscoun ```php $subscriptionId = 'subscription_id0'; -$discountId = 'discountId0'; +$request = CreateDiscountRequestBuilder::init( + 185.28, + 'discount_type4', + 'item_id6' +)->build(); -$result = $subscriptionsController->getDiscountById( +$result = $subscriptionsController->createDiscount( $subscriptionId, - $discountId + $request ); ``` -# Create Subscription +# Create an Usage -Creates a new subscription +Create Usage ```php -function createSubscription( - CreateSubscriptionRequest $body, - ?string $idempotencyKey = null -): GetSubscriptionResponse +function createAnUsage(string $subscriptionId, string $itemId, ?string $idempotencyKey = null): GetUsageResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | Request for creating a subscription | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `itemId` | `string` | Template, Required | Item id | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetUsageResponse`](../../doc/models/get-usage-response.md) ## Example Usage ```php -$body = CreateSubscriptionRequestBuilder::init( - CreateCustomerRequestBuilder::init( - '{ - "name": "Tony Stark" -}', - 'email2', - 'document2', - 'type6', - CreateAddressRequestBuilder::init( - 'street0', - 'number8', - 'zip_code4', - 'neighborhood6', - 'city0', - 'state6', - 'country4', - 'complement6', - 'line_16', - 'line_28' - )->build(), - [ - 'key0' => 'metadata9', - 'key1' => 'metadata0' - ], - CreatePhonesRequestBuilder::init()->build(), - 'code2' - )->build(), - CreateCardRequestBuilder::init() - ->type('credit') - ->build(), - 'code4', - 'payment_method4', - 'billing_type0', - 'statement_descriptor6', - 'description4', - 'currency6', - 'interval6', - 170, - CreatePricingSchemeRequestBuilder::init( - 'scheme_type2' - )->build(), - [ - CreateSubscriptionItemRequestBuilder::init( - 'description3', - CreatePricingSchemeRequestBuilder::init( - 'scheme_type5' - )->build(), - 'id3', - 'plan_item_id3', - [ - CreateDiscountRequestBuilder::init( - 65.46, - 'discount_type2', - 'item_id4' - )->build() - ], - 'name3' - )->build() - ], - CreateShippingRequestBuilder::init( - 140, - 'description0', - 'recipient_name8', - 'recipient_phone2', - 'address_id0', - CreateAddressRequestBuilder::init( - 'street6', - 'number4', - 'zip_code0', - 'neighborhood2', - 'city6', - 'state2', - 'country0', - 'complement2', - 'line_10', - 'line_24' - )->build(), - 'type0' - )->build(), - [ - CreateDiscountRequestBuilder::init( - 95.59, - 'discount_type5', - 'item_id7' - )->build() - ], - [ - 'key0' => 'metadata7', - 'key1' => 'metadata8' - ], - [ - CreateIncrementRequestBuilder::init( - 38.83, - 'increment_type3', - 'item_id9' - )->build() - ] -)->build(); +$subscriptionId = 'subscription_id0'; -$result = $subscriptionsController->createSubscription($body); +$itemId = 'item_id0'; + +$result = $subscriptionsController->createAnUsage( + $subscriptionId, + $itemId +); ``` -# Get Increment by Id +# Update Current Cycle Status ```php -function getIncrementById(string $subscriptionId, string $incrementId): GetIncrementResponse +function updateCurrentCycleStatus( + string $subscriptionId, + UpdateCurrentCycleStatusRequest $request, + ?string $idempotencyKey = null +): void ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription Id | -| `incrementId` | `string` | Template, Required | The increment Id | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetIncrementResponse`](../../doc/models/get-increment-response.md) +`void` ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$incrementId = 'increment_id8'; +$request = UpdateCurrentCycleStatusRequestBuilder::init( + 'status8' +)->build(); -$result = $subscriptionsController->getIncrementById( +$subscriptionsController->updateCurrentCycleStatus( $subscriptionId, - $incrementId + $request ); ``` -# Update Subscription Metadata +# Delete Discount -Updates the metadata from a subscription +Deletes a discount ```php -function updateSubscriptionMetadata( +function deleteDiscount( string $subscriptionId, - UpdateMetadataRequest $request, + string $discountId, ?string $idempotencyKey = null -): GetSubscriptionResponse +): GetDiscountResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `discountId` | `string` | Template, Required | Discount Id | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetDiscountResponse`](../../doc/models/get-discount-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateMetadataRequestBuilder::init( - [ - 'key0' => 'metadata3' - ] -)->build(); +$discountId = 'discount_id8'; -$result = $subscriptionsController->updateSubscriptionMetadata( +$result = $subscriptionsController->deleteDiscount( $subscriptionId, - $request + $discountId ); ``` -# Delete Increment +# Get Subscription Items -Deletes a increment +Get Subscription Items ```php -function deleteIncrement( +function getSubscriptionItems( string $subscriptionId, - string $incrementId, - ?string $idempotencyKey = null -): GetIncrementResponse + ?int $page = null, + ?int $size = null, + ?string $name = null, + ?string $code = null, + ?string $status = null, + ?string $description = null, + ?string $createdSince = null, + ?string $createdUntil = null +): ListSubscriptionItemsResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `incrementId` | `string` | Template, Required | Increment id | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `name` | `?string` | Query, Optional | The item name | +| `code` | `?string` | Query, Optional | Identification code in the client system | +| `status` | `?string` | Query, Optional | The item statis | +| `description` | `?string` | Query, Optional | The item description | +| `createdSince` | `?string` | Query, Optional | Filter for item's creation date start range | +| `createdUntil` | `?string` | Query, Optional | Filter for item's creation date end range | ## Response Type -[`GetIncrementResponse`](../../doc/models/get-increment-response.md) +[`ListSubscriptionItemsResponse`](../../doc/models/list-subscription-items-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$incrementId = 'increment_id8'; - -$result = $subscriptionsController->deleteIncrement( - $subscriptionId, - $incrementId -); +$result = $subscriptionsController->getSubscriptionItems($subscriptionId); ``` -# Get Subscription +# Update Subscription Payment Method -Gets a subscription +Updates the payment method from a subscription ```php -function getSubscription(string $subscriptionId): GetSubscriptionResponse +function updateSubscriptionPaymentMethod( + string $subscriptionId, + UpdateSubscriptionPaymentMethodRequest $request, + ?string $idempotencyKey = null +): GetSubscriptionResponse ``` ## Parameters @@ -444,6 +374,8 @@ function getSubscription(string $subscriptionId): GetSubscriptionResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | +| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -454,135 +386,196 @@ function getSubscription(string $subscriptionId): GetSubscriptionResponse ```php $subscriptionId = 'subscription_id0'; -$result = $subscriptionsController->getSubscription($subscriptionId); +$request = UpdateSubscriptionPaymentMethodRequestBuilder::init( + 'payment_method4', + 'card_id2', + CreateCardRequestBuilder::init() + ->type('credit') + ->build() +)->build(); + +$result = $subscriptionsController->updateSubscriptionPaymentMethod( + $subscriptionId, + $request +); ``` -# Update Latest Period End At +# Get Subscription Item + +Get Subscription Item ```php -function updateLatestPeriodEndAt( - string $subscriptionId, - UpdateCurrentCycleEndDateRequest $request, - ?string $idempotencyKey = null -): GetSubscriptionResponse +function getSubscriptionItem(string $subscriptionId, string $itemId): GetSubscriptionItemResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | - | -| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `itemId` | `string` | Template, Required | Item id | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateCurrentCycleEndDateRequestBuilder::init()->build(); +$itemId = 'item_id0'; -$result = $subscriptionsController->updateLatestPeriodEndAt( +$result = $subscriptionsController->getSubscriptionItem( $subscriptionId, - $request + $itemId ); ``` -# Update Current Cycle Status +# Get Subscriptions + +Gets all subscriptions ```php -function updateCurrentCycleStatus( +function getSubscriptions( + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $billingType = null, + ?string $customerId = null, + ?string $planId = null, + ?string $cardId = null, + ?string $status = null, + ?\DateTime $nextBillingSince = null, + ?\DateTime $nextBillingUntil = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null +): ListSubscriptionsResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `code` | `?string` | Query, Optional | Filter for subscription's code | +| `billingType` | `?string` | Query, Optional | Filter for subscription's billing type | +| `customerId` | `?string` | Query, Optional | Filter for subscription's customer id | +| `planId` | `?string` | Query, Optional | Filter for subscription's plan id | +| `cardId` | `?string` | Query, Optional | Filter for subscription's card id | +| `status` | `?string` | Query, Optional | Filter for subscription's status | +| `nextBillingSince` | `?DateTime` | Query, Optional | Filter for subscription's next billing date start range | +| `nextBillingUntil` | `?DateTime` | Query, Optional | Filter for subscription's next billing date end range | +| `createdSince` | `?DateTime` | Query, Optional | Filter for subscription's creation date start range | +| `createdUntil` | `?DateTime` | Query, Optional | Filter for subscriptions creation date end range | + +## Response Type + +[`ListSubscriptionsResponse`](../../doc/models/list-subscriptions-response.md) + +## Example Usage + +```php +$result = $subscriptionsController->getSubscriptions(); +``` + + +# Cancel Subscription + +Cancels a subscription + +```php +function cancelSubscription( string $subscriptionId, - UpdateCurrentCycleStatusRequest $request, + ?CreateCancelSubscriptionRequest $request = null, ?string $idempotencyKey = null -): void +): GetSubscriptionResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `request` | [`?CreateCancelSubscriptionRequest`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -`void` +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateCurrentCycleStatusRequestBuilder::init( - 'status8' +$request = CreateCancelSubscriptionRequestBuilder::init( + true )->build(); -$subscriptionsController->updateCurrentCycleStatus( +$result = $subscriptionsController->cancelSubscription( $subscriptionId, $request ); ``` -# Get Subscription Items +# Create Increment -Get Subscription Items +Creates a increment ```php -function getSubscriptionItems( +function createIncrement( string $subscriptionId, - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $code = null, - ?string $status = null, - ?string $description = null, - ?string $createdSince = null, - ?string $createdUntil = null -): ListSubscriptionItemsResponse + CreateIncrementRequest $request, + ?string $idempotencyKey = null +): GetIncrementResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `name` | `?string` | Query, Optional | The item name | -| `code` | `?string` | Query, Optional | Identification code in the client system | -| `status` | `?string` | Query, Optional | The item statis | -| `description` | `?string` | Query, Optional | The item description | -| `createdSince` | `?string` | Query, Optional | Filter for item's creation date start range | -| `createdUntil` | `?string` | Query, Optional | Filter for item's creation date end range | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `request` | [`CreateIncrementRequest`](../../doc/models/create-increment-request.md) | Body, Required | Request for creating a increment | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListSubscriptionItemsResponse`](../../doc/models/list-subscription-items-response.md) +[`GetIncrementResponse`](../../doc/models/get-increment-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$result = $subscriptionsController->getSubscriptionItems($subscriptionId); +$request = CreateIncrementRequestBuilder::init( + 185.28, + 'increment_type8', + 'item_id6' +)->build(); + +$result = $subscriptionsController->createIncrement( + $subscriptionId, + $request +); ``` -# Get Subscription Item +# Create Usage -Get Subscription Item +Creates a usage ```php -function getSubscriptionItem(string $subscriptionId, string $itemId): GetSubscriptionItemResponse +function createUsage( + string $subscriptionId, + string $itemId, + CreateUsageRequest $body, + ?string $idempotencyKey = null +): GetUsageResponse ``` ## Parameters @@ -591,10 +584,12 @@ function getSubscriptionItem(string $subscriptionId, string $itemId): GetSubscri | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription Id | | `itemId` | `string` | Template, Required | Item id | +| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) +[`GetUsageResponse`](../../doc/models/get-usage-response.md) ## Example Usage @@ -603,210 +598,257 @@ $subscriptionId = 'subscription_id0'; $itemId = 'item_id0'; -$result = $subscriptionsController->getSubscriptionItem( +$body = CreateUsageRequestBuilder::init( + 156, + 'description4', + DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') +)->build(); + +$result = $subscriptionsController->createUsage( $subscriptionId, - $itemId + $itemId, + $body ); ``` -# Update Subscription Affiliation Id +# Get Discount by Id ```php -function updateSubscriptionAffiliationId( - string $subscriptionId, - UpdateSubscriptionAffiliationIdRequest $request, - ?string $idempotencyKey = null -): GetSubscriptionResponse +function getDiscountById(string $subscriptionId, string $discountId): GetDiscountResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | - | -| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `discountId` | `string` | Template, Required | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetDiscountResponse`](../../doc/models/get-discount-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionAffiliationIdRequestBuilder::init( - 'gateway_affiliation_id2' -)->build(); +$discountId = 'discountId0'; -$result = $subscriptionsController->updateSubscriptionAffiliationId( +$result = $subscriptionsController->getDiscountById( $subscriptionId, - $request + $discountId ); ``` -# Get Discounts +# Create Subscription + +Creates a new subscription ```php -function getDiscounts(string $subscriptionId, int $page, int $size): ListDiscountsResponse +function createSubscription( + CreateSubscriptionRequest $body, + ?string $idempotencyKey = null +): GetSubscriptionResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `page` | `int` | Query, Required | Page number | -| `size` | `int` | Query, Required | Page size | +| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | Request for creating a subscription | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListDiscountsResponse`](../../doc/models/list-discounts-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php -$subscriptionId = 'subscription_id0'; - -$page = 30; - -$size = 18; +$body = CreateSubscriptionRequestBuilder::init( + CreateCustomerRequestBuilder::init( + '{ + "name": "Tony Stark" +}', + 'email6', + 'document6', + 'type0', + CreateAddressRequestBuilder::init( + 'street6', + 'number4', + 'zip_code0', + 'neighborhood2', + 'city6', + 'state2', + 'country0', + 'complement2', + 'line_10', + 'line_24' + )->build(), + [ + 'key0' => 'metadata3' + ], + CreatePhonesRequestBuilder::init()->build(), + 'code8' + )->build(), + CreateCardRequestBuilder::init() + ->type('credit') + ->build(), + 'code4', + 'payment_method4', + 'billing_type0', + 'statement_descriptor6', + 'description4', + 'currency6', + 'interval6', + 170, + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + [ + CreateSubscriptionItemRequestBuilder::init( + 'description2', + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + 'id8', + 'plan_item_id8', + [ + CreateDiscountRequestBuilder::init( + 90.66, + 'discount_type2', + 'item_id4' + )->build() + ], + 'name8' + )->build() + ], + CreateShippingRequestBuilder::init( + 52, + 'description6', + 'recipient_name2', + 'recipient_phone6', + 'address_id6', + CreateAddressRequestBuilder::init( + 'street6', + 'number4', + 'zip_code0', + 'neighborhood2', + 'city6', + 'state2', + 'country0', + 'complement2', + 'line_10', + 'line_24' + )->build(), + 'type6' + )->build(), + [ + CreateDiscountRequestBuilder::init( + 90.66, + 'discount_type2', + 'item_id4' + )->build() + ], + [ + 'key0' => 'metadata7', + 'key1' => 'metadata8' + ], + [ + CreateIncrementRequestBuilder::init( + 252.86, + 'increment_type6', + 'item_id6' + )->build() + ] +)->build(); -$result = $subscriptionsController->getDiscounts( - $subscriptionId, - $page, - $size -); +$result = $subscriptionsController->createSubscription($body); ``` -# Update Subscription Item - -Updates a subscription item +# Get Increment by Id ```php -function updateSubscriptionItem( - string $subscriptionId, - string $itemId, - UpdateSubscriptionItemRequest $body, - ?string $idempotencyKey = null -): GetSubscriptionItemResponse +function getIncrementById(string $subscriptionId, string $incrementId): GetIncrementResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `itemId` | `string` | Template, Required | Item id | -| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription Id | +| `incrementId` | `string` | Template, Required | The increment Id | ## Response Type -[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) +[`GetIncrementResponse`](../../doc/models/get-increment-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$itemId = 'item_id0'; - -$body = UpdateSubscriptionItemRequestBuilder::init( - 'description4', - 'status2', - UpdatePricingSchemeRequestBuilder::init( - 'scheme_type2', - [ - UpdatePriceBracketRequestBuilder::init( - 31, - 225 - )->build() - ] - )->build(), - 'name6' -)->build(); +$incrementId = 'increment_id8'; -$result = $subscriptionsController->updateSubscriptionItem( +$result = $subscriptionsController->getIncrementById( $subscriptionId, - $itemId, - $body + $incrementId ); ``` -# Create Subscription Item - -Creates a new Subscription item +# Update Subscription Affiliation Id ```php -function createSubscriptionItem( +function updateSubscriptionAffiliationId( string $subscriptionId, - CreateSubscriptionItemRequest $request, + UpdateSubscriptionAffiliationIdRequest $request, ?string $idempotencyKey = null -): GetSubscriptionItemResponse +): GetSubscriptionResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`CreateSubscriptionItemRequest`](../../doc/models/create-subscription-item-request.md) | Body, Required | Request for creating a subscription item | +| `subscriptionId` | `string` | Template, Required | - | +| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = CreateSubscriptionItemRequestBuilder::init( - 'description6', - CreatePricingSchemeRequestBuilder::init( - 'scheme_type2' - )->build(), - 'id6', - 'plan_item_id6', - [ - CreateDiscountRequestBuilder::init( - 199.99, - 'discount_type5', - 'item_id7' - )->build() - ], - 'name6' +$request = UpdateSubscriptionAffiliationIdRequestBuilder::init( + 'gateway_affiliation_id2' )->build(); -$result = $subscriptionsController->createSubscriptionItem( +$result = $subscriptionsController->updateSubscriptionAffiliationId( $subscriptionId, $request ); ``` -# Get Usages +# Update Subscription Metadata -Lists all usages from a subscription item +Updates the metadata from a subscription ```php -function getUsages( +function updateSubscriptionMetadata( string $subscriptionId, - string $itemId, - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $group = null, - ?\DateTime $usedSince = null, - ?\DateTime $usedUntil = null -): ListUsagesResponse + UpdateMetadataRequest $request, + ?string $idempotencyKey = null +): GetSubscriptionResponse ``` ## Parameters @@ -814,143 +856,147 @@ function getUsages( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `itemId` | `string` | Template, Required | The subscription item id | -| `page` | `?int` | Query, Optional | Page number | -| `size` | `?int` | Query, Optional | Page size | -| `code` | `?string` | Query, Optional | Identification code in the client system | -| `group` | `?string` | Query, Optional | Identification group in the client system | -| `usedSince` | `?DateTime` | Query, Optional | - | -| `usedUntil` | `?DateTime` | Query, Optional | - | +| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListUsagesResponse`](../../doc/models/list-usages-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$itemId = 'item_id0'; +$request = UpdateMetadataRequestBuilder::init( + [ + 'key0' => 'metadata3' + ] +)->build(); -$result = $subscriptionsController->getUsages( +$result = $subscriptionsController->updateSubscriptionMetadata( $subscriptionId, - $itemId + $request ); ``` -# Update Subscription Minium Price +# Delete Increment -Atualização do valor mínimo da assinatura +Deletes a increment ```php -function updateSubscriptionMiniumPrice( +function deleteIncrement( string $subscriptionId, - UpdateSubscriptionMinimumPriceRequest $request, + string $incrementId, ?string $idempotencyKey = null -): GetSubscriptionResponse +): GetIncrementResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado | +| `subscriptionId` | `string` | Template, Required | Subscription id | +| `incrementId` | `string` | Template, Required | Increment id | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetIncrementResponse`](../../doc/models/get-increment-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionMinimumPriceRequestBuilder::init()->build(); +$incrementId = 'increment_id8'; -$result = $subscriptionsController->updateSubscriptionMiniumPrice( +$result = $subscriptionsController->deleteIncrement( $subscriptionId, - $request + $incrementId ); ``` -# Get Subscription Cycle by Id +# Get Subscription Cycles ```php -function getSubscriptionCycleById(string $subscriptionId, string $cycleId): GetPeriodResponse +function getSubscriptionCycles(string $subscriptionId, string $page, string $size): ListCyclesResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `cycleId` | `string` | Template, Required | - | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `page` | `string` | Query, Required | Page number | +| `size` | `string` | Query, Required | Page size | ## Response Type -[`GetPeriodResponse`](../../doc/models/get-period-response.md) +[`ListCyclesResponse`](../../doc/models/list-cycles-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$cycleId = 'cycleId0'; +$page = 'page8'; -$result = $subscriptionsController->getSubscriptionCycleById( +$size = 'size0'; + +$result = $subscriptionsController->getSubscriptionCycles( $subscriptionId, - $cycleId + $page, + $size ); ``` -# Create an Usage - -Create Usage +# Get Discounts ```php -function createAnUsage(string $subscriptionId, string $itemId, ?string $idempotencyKey = null): GetUsageResponse +function getDiscounts(string $subscriptionId, int $page, int $size): ListDiscountsResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `itemId` | `string` | Template, Required | Item id | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `page` | `int` | Query, Required | Page number | +| `size` | `int` | Query, Required | Page size | ## Response Type -[`GetUsageResponse`](../../doc/models/get-usage-response.md) +[`ListDiscountsResponse`](../../doc/models/list-discounts-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$itemId = 'item_id0'; +$page = 30; -$result = $subscriptionsController->createAnUsage( +$size = 18; + +$result = $subscriptionsController->getDiscounts( $subscriptionId, - $itemId + $page, + $size ); ``` -# Cancel Subscription +# Update Subscription Billing Date -Cancels a subscription +Updates the billing date from a subscription ```php -function cancelSubscription( +function updateSubscriptionBillingDate( string $subscriptionId, - ?CreateCancelSubscriptionRequest $request = null, + UpdateSubscriptionBillingDateRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse ``` @@ -959,8 +1005,8 @@ function cancelSubscription( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`?CreateCancelSubscriptionRequest`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -972,11 +1018,11 @@ function cancelSubscription( ```php $subscriptionId = 'subscription_id0'; -$request = CreateCancelSubscriptionRequestBuilder::init( - true +$request = UpdateSubscriptionBillingDateRequestBuilder::init( + DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') )->build(); -$result = $subscriptionsController->cancelSubscription( +$result = $subscriptionsController->updateSubscriptionBillingDate( $subscriptionId, $request ); @@ -1041,61 +1087,21 @@ function getIncrements(string $subscriptionId, ?int $page = null, ?int $size = n ## Example Usage -```php -$subscriptionId = 'subscription_id0'; - -$result = $subscriptionsController->getIncrements($subscriptionId); -``` - - -# Update Subscription Due Days - -Updates the boleto due days from a subscription - -```php -function updateSubscriptionDueDays( - string $subscriptionId, - UpdateSubscriptionDueDaysRequest $request, - ?string $idempotencyKey = null -): GetSubscriptionResponse -``` - -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - | -| `idempotencyKey` | `?string` | Header, Optional | - | - -## Response Type - -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) - -## Example Usage - -```php -$subscriptionId = 'subscription_id0'; - -$request = UpdateSubscriptionDueDaysRequestBuilder::init( - 226 -)->build(); - -$result = $subscriptionsController->updateSubscriptionDueDays( - $subscriptionId, - $request -); +```php +$subscriptionId = 'subscription_id0'; + +$result = $subscriptionsController->getIncrements($subscriptionId); ``` -# Update Subscription Card +# Update Subscription Due Days -Updates the credit card from a subscription +Updates the boleto due days from a subscription ```php -function updateSubscriptionCard( +function updateSubscriptionDueDays( string $subscriptionId, - UpdateSubscriptionCardRequest $request, + UpdateSubscriptionDueDaysRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse ``` @@ -1104,8 +1110,8 @@ function updateSubscriptionCard( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`UpdateSubscriptionCardRequest`](../../doc/models/update-subscription-card-request.md) | Body, Required | Request for updating a card | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -1117,31 +1123,27 @@ function updateSubscriptionCard( ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionCardRequestBuilder::init( - CreateCardRequestBuilder::init() - ->type('credit') - ->build(), - 'card_id2' +$request = UpdateSubscriptionDueDaysRequestBuilder::init( + 226 )->build(); -$result = $subscriptionsController->updateSubscriptionCard( +$result = $subscriptionsController->updateSubscriptionDueDays( $subscriptionId, $request ); ``` -# Delete Usage +# Update Subscription Start At -Deletes a usage +Updates the start at date from a subscription ```php -function deleteUsage( +function updateSubscriptionStartAt( string $subscriptionId, - string $itemId, - string $usageId, + UpdateSubscriptionStartAtRequest $request, ?string $idempotencyKey = null -): GetUsageResponse +): GetSubscriptionResponse ``` ## Parameters @@ -1149,83 +1151,95 @@ function deleteUsage( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `itemId` | `string` | Template, Required | The subscription item id | -| `usageId` | `string` | Template, Required | The usage id | +| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetUsageResponse`](../../doc/models/get-usage-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$itemId = 'item_id0'; - -$usageId = 'usage_id0'; +$request = UpdateSubscriptionStartAtRequestBuilder::init( + DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') +)->build(); -$result = $subscriptionsController->deleteUsage( +$result = $subscriptionsController->updateSubscriptionStartAt( $subscriptionId, - $itemId, - $usageId + $request ); ``` -# Create Discount +# Update Subscription Item -Creates a discount +Updates a subscription item ```php -function createDiscount( +function updateSubscriptionItem( string $subscriptionId, - CreateDiscountRequest $request, + string $itemId, + UpdateSubscriptionItemRequest $body, ?string $idempotencyKey = null -): GetDiscountResponse +): GetSubscriptionItemResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`CreateDiscountRequest`](../../doc/models/create-discount-request.md) | Body, Required | Request for creating a discount | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `itemId` | `string` | Template, Required | Item id | +| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetDiscountResponse`](../../doc/models/get-discount-response.md) +[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = CreateDiscountRequestBuilder::init( - 185.28, - 'discount_type4', - 'item_id6' +$itemId = 'item_id0'; + +$body = UpdateSubscriptionItemRequestBuilder::init( + 'description4', + 'status2', + UpdatePricingSchemeRequestBuilder::init( + 'scheme_type8', + [ + UpdatePriceBracketRequestBuilder::init( + 144, + 174 + )->build() + ] + )->build(), + 'name6' )->build(); -$result = $subscriptionsController->createDiscount( +$result = $subscriptionsController->updateSubscriptionItem( $subscriptionId, - $request + $itemId, + $body ); ``` -# Update Subscription Payment Method +# Create Subscription Item -Updates the payment method from a subscription +Creates a new Subscription item ```php -function updateSubscriptionPaymentMethod( +function createSubscriptionItem( string $subscriptionId, - UpdateSubscriptionPaymentMethodRequest $request, + CreateSubscriptionItemRequest $request, ?string $idempotencyKey = null -): GetSubscriptionResponse +): GetSubscriptionItemResponse ``` ## Parameters @@ -1233,43 +1247,48 @@ function updateSubscriptionPaymentMethod( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription | +| `request` | [`CreateSubscriptionItemRequest`](../../doc/models/create-subscription-item-request.md) | Body, Required | Request for creating a subscription item | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionPaymentMethodRequestBuilder::init( - 'payment_method4', - 'card_id2', - CreateCardRequestBuilder::init() - ->type('credit') - ->build() +$request = CreateSubscriptionItemRequestBuilder::init( + 'description6', + CreatePricingSchemeRequestBuilder::init( + 'scheme_type8' + )->build(), + 'id6', + 'plan_item_id6', + [ + CreateDiscountRequestBuilder::init( + 90.66, + 'discount_type2', + 'item_id4' + )->build() + ], + 'name6' )->build(); -$result = $subscriptionsController->updateSubscriptionPaymentMethod( +$result = $subscriptionsController->createSubscriptionItem( $subscriptionId, $request ); ``` -# Create Increment +# Get Subscription -Creates a increment +Gets a subscription ```php -function createIncrement( - string $subscriptionId, - CreateIncrementRequest $request, - ?string $idempotencyKey = null -): GetIncrementResponse +function getSubscription(string $subscriptionId): GetSubscriptionResponse ``` ## Parameters @@ -1277,56 +1296,53 @@ function createIncrement( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | Subscription id | -| `request` | [`CreateIncrementRequest`](../../doc/models/create-increment-request.md) | Body, Required | Request for creating a increment | -| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`GetIncrementResponse`](../../doc/models/get-increment-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = CreateIncrementRequestBuilder::init( - 185.28, - 'increment_type8', - 'item_id6' -)->build(); - -$result = $subscriptionsController->createIncrement( - $subscriptionId, - $request -); +$result = $subscriptionsController->getSubscription($subscriptionId); ``` -# Create Usage +# Get Usages -Creates a usage +Lists all usages from a subscription item ```php -function createUsage( +function getUsages( string $subscriptionId, string $itemId, - CreateUsageRequest $body, - ?string $idempotencyKey = null -): GetUsageResponse + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $group = null, + ?\DateTime $usedSince = null, + ?\DateTime $usedUntil = null +): ListUsagesResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `itemId` | `string` | Template, Required | Item id | -| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `subscriptionId` | `string` | Template, Required | The subscription id | +| `itemId` | `string` | Template, Required | The subscription item id | +| `page` | `?int` | Query, Optional | Page number | +| `size` | `?int` | Query, Optional | Page size | +| `code` | `?string` | Query, Optional | Identification code in the client system | +| `group` | `?string` | Query, Optional | Identification group in the client system | +| `usedSince` | `?DateTime` | Query, Optional | - | +| `usedUntil` | `?DateTime` | Query, Optional | - | ## Response Type -[`GetUsageResponse`](../../doc/models/get-usage-response.md) +[`ListUsagesResponse`](../../doc/models/list-usages-response.md) ## Example Usage @@ -1335,63 +1351,57 @@ $subscriptionId = 'subscription_id0'; $itemId = 'item_id0'; -$body = CreateUsageRequestBuilder::init( - 156, - 'description4', - DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') -)->build(); - -$result = $subscriptionsController->createUsage( +$result = $subscriptionsController->getUsages( $subscriptionId, - $itemId, - $body + $itemId ); ``` -# Get Subscription Cycles +# Update Latest Period End At ```php -function getSubscriptionCycles(string $subscriptionId, string $page, string $size): ListCyclesResponse +function updateLatestPeriodEndAt( + string $subscriptionId, + UpdateCurrentCycleEndDateRequest $request, + ?string $idempotencyKey = null +): GetSubscriptionResponse ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | Subscription Id | -| `page` | `string` | Query, Required | Page number | -| `size` | `string` | Query, Required | Page size | +| `subscriptionId` | `string` | Template, Required | - | +| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle | +| `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type -[`ListCyclesResponse`](../../doc/models/list-cycles-response.md) +[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$page = 'page8'; - -$size = 'size0'; +$request = UpdateCurrentCycleEndDateRequestBuilder::init()->build(); -$result = $subscriptionsController->getSubscriptionCycles( +$result = $subscriptionsController->updateLatestPeriodEndAt( $subscriptionId, - $page, - $size + $request ); ``` -# Update Subscription Billing Date +# Update Subscription Minium Price -Updates the billing date from a subscription +Atualização do valor mínimo da assinatura ```php -function updateSubscriptionBillingDate( +function updateSubscriptionMiniumPrice( string $subscriptionId, - UpdateSubscriptionBillingDateRequest $request, + UpdateSubscriptionMinimumPriceRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse ``` @@ -1400,8 +1410,8 @@ function updateSubscriptionBillingDate( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date | +| `subscriptionId` | `string` | Template, Required | Subscription Id | +| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado | | `idempotencyKey` | `?string` | Header, Optional | - | ## Response Type @@ -1413,27 +1423,19 @@ function updateSubscriptionBillingDate( ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionBillingDateRequestBuilder::init( - DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') -)->build(); +$request = UpdateSubscriptionMinimumPriceRequestBuilder::init()->build(); -$result = $subscriptionsController->updateSubscriptionBillingDate( +$result = $subscriptionsController->updateSubscriptionMiniumPrice( $subscriptionId, $request ); ``` -# Update Subscription Start At - -Updates the start at date from a subscription +# Get Subscription Cycle by Id ```php -function updateSubscriptionStartAt( - string $subscriptionId, - UpdateSubscriptionStartAtRequest $request, - ?string $idempotencyKey = null -): GetSubscriptionResponse +function getSubscriptionCycleById(string $subscriptionId, string $cycleId): GetPeriodResponse ``` ## Parameters @@ -1441,25 +1443,22 @@ function updateSubscriptionStartAt( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The subscription id | -| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date | -| `idempotencyKey` | `?string` | Header, Optional | - | +| `cycleId` | `string` | Template, Required | - | ## Response Type -[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md) +[`GetPeriodResponse`](../../doc/models/get-period-response.md) ## Example Usage ```php $subscriptionId = 'subscription_id0'; -$request = UpdateSubscriptionStartAtRequestBuilder::init( - DateTimeHelper::fromRfc3339DateTimeRequired('2016-03-13T12:52:32.123Z') -)->build(); +$cycleId = 'cycleId0'; -$result = $subscriptionsController->updateSubscriptionStartAt( +$result = $subscriptionsController->getSubscriptionCycleById( $subscriptionId, - $request + $cycleId ); ``` @@ -1521,9 +1520,9 @@ $request = UpdateSubscriptionSplitRequestBuilder::init( false, [ CreateSplitRequestBuilder::init( - 'type6', - 222, - 'recipient_id6' + 'type2', + 118, + 'recipient_id2' )->build() ] )->build(); diff --git a/doc/controllers/tokens.md b/doc/controllers/tokens.md index 4812c49..732e7a7 100644 --- a/doc/controllers/tokens.md +++ b/doc/controllers/tokens.md @@ -46,13 +46,13 @@ $publicKey = 'public_key6'; $request = CreateTokenRequestBuilder::init( 'card', CreateCardTokenRequestBuilder::init( - 'number2', - 'holder_name6', - 80, - 216, - 'cvv8', - 'brand4', - 'label0' + 'number6', + 'holder_name2', + 228, + 68, + 'cvv4', + 'brand0', + 'label6' )->build() )->build(); diff --git a/doc/controllers/transfers.md b/doc/controllers/transfers.md index 306c6bf..36eb1cb 100644 --- a/doc/controllers/transfers.md +++ b/doc/controllers/transfers.md @@ -10,28 +10,9 @@ $transfersController = $client->getTransfersController(); ## Methods -* [Get Transfers](../../doc/controllers/transfers.md#get-transfers) * [Get Transfer by Id](../../doc/controllers/transfers.md#get-transfer-by-id) * [Create Transfer](../../doc/controllers/transfers.md#create-transfer) - - -# Get Transfers - -Gets all transfers - -```php -function getTransfers(): ListTransfers -``` - -## Response Type - -[`ListTransfers`](../../doc/models/list-transfers.md) - -## Example Usage - -```php -$result = $transfersController->getTransfers(); -``` +* [Get Transfers](../../doc/controllers/transfers.md#get-transfers) # Get Transfer by Id @@ -87,3 +68,22 @@ $request = CreateTransferBuilder::init( $result = $transfersController->createTransfer($request); ``` + +# Get Transfers + +Gets all transfers + +```php +function getTransfers(): ListTransfers +``` + +## Response Type + +[`ListTransfers`](../../doc/models/list-transfers.md) + +## Example Usage + +```php +$result = $transfersController->getTransfers(); +``` + diff --git a/doc/models/cancel-split-request.md b/doc/models/cancel-split-request.md deleted file mode 100644 index 0b13cf5..0000000 --- a/doc/models/cancel-split-request.md +++ /dev/null @@ -1,31 +0,0 @@ - -# Cancel Split Request - -Split - -## Structure - -`CancelSplitRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `type` | `string` | Required | Split type | getType(): string | setType(string type): void | -| `amount` | `int` | Required | Amount | getAmount(): int | setAmount(int amount): void | -| `recipientId` | `string` | Required | Recipient id | getRecipientId(): string | setRecipientId(string recipientId): void | -| `options` | [`?CreateSplitOptionsRequest`](/doc/models/create-split-options-request.md) | Optional | The split options request | getOptions(): ?CreateSplitOptionsRequest | setOptions(?CreateSplitOptionsRequest options): void | -| `splitRuleID` | `?string` | Optional | Rule id | getSplitRuleID(): ?string | setSplitRuleID(?string splitRuleID): void | - -## Example (as JSON) - -```json -{ - "type": "type0", - "amount": 46, - "recipient_id": "recipient_id0", - "options": null, - "Split_Rule_ID": null -} -``` - diff --git a/doc/models/create-access-token-request.md b/doc/models/create-access-token-request.md index dae4860..594616b 100644 --- a/doc/models/create-access-token-request.md +++ b/doc/models/create-access-token-request.md @@ -17,7 +17,7 @@ Request for creating a new Access Token ```json { - "expires_in": 226 + "expires_in": 86 } ``` diff --git a/doc/models/create-address-request.md b/doc/models/create-address-request.md index be972fb..e37584a 100644 --- a/doc/models/create-address-request.md +++ b/doc/models/create-address-request.md @@ -27,21 +27,19 @@ Request for creating a new Address ```json { - "street": "street0", - "number": "number2", - "zip_code": "zip_code4", - "neighborhood": "neighborhood6", - "city": "city0", - "state": "state4", - "country": "country4", - "complement": "complement4", + "street": "street6", + "number": "number6", + "zip_code": "zip_code0", + "neighborhood": "neighborhood2", + "city": "city6", + "state": "state8", + "country": "country0", + "complement": "complement8", "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7" }, - "line_1": "line_16", - "line_2": "line_28" + "line_1": "line_10", + "line_2": "line_24" } ``` diff --git a/doc/models/create-anticipation-request.md b/doc/models/create-anticipation-request.md index f441602..9ac5773 100644 --- a/doc/models/create-anticipation-request.md +++ b/doc/models/create-anticipation-request.md @@ -19,7 +19,7 @@ Request for creating an anticipation ```json { - "amount": 46, + "amount": 68, "timeframe": "timeframe2", "payment_date": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/create-apple-pay-request.md b/doc/models/create-apple-pay-request.md index 3133922..58abb7c 100644 --- a/doc/models/create-apple-pay-request.md +++ b/doc/models/create-apple-pay-request.md @@ -21,7 +21,7 @@ The ApplePay Token Payment Request ```json { - "version": "version4", + "version": "version6", "data": "data0", "header": { "public_key_hash": "public_key_hash4", diff --git a/doc/models/create-automatic-anticipation-settings-request.md b/doc/models/create-automatic-anticipation-settings-request.md index 0caddba..300dcea 100644 --- a/doc/models/create-automatic-anticipation-settings-request.md +++ b/doc/models/create-automatic-anticipation-settings-request.md @@ -20,13 +20,12 @@ ```json { "enabled": false, - "type": "type0", - "volume_percentage": 62, - "delay": 228, + "type": "type8", + "volume_percentage": 208, + "delay": 82, "days": [ - 188, - 189, - 190 + 58, + 59 ] } ``` diff --git a/doc/models/create-bank-account-refunding-dto.md b/doc/models/create-bank-account-refunding-dto.md index cebab96..0674f93 100644 --- a/doc/models/create-bank-account-refunding-dto.md +++ b/doc/models/create-bank-account-refunding-dto.md @@ -25,15 +25,15 @@ Bank Account ```json { - "holder_name": "holder_name4", - "holder_type": "holder_type2", - "holder_document": "holder_document6", - "bank": "bank8", - "branch_number": "branch_number6", - "branch_check_digit": "branch_check_digit4", - "account_number": "account_number0", - "account_check_digit": "account_check_digit6", - "type": "type0" + "holder_name": "holder_name2", + "holder_type": "holder_type8", + "holder_document": "holder_document0", + "bank": "bank4", + "branch_number": "branch_number2", + "branch_check_digit": "branch_check_digit2", + "account_number": "account_number6", + "account_check_digit": "account_check_digit2", + "type": "type4" } ``` diff --git a/doc/models/create-bank-account-request.md b/doc/models/create-bank-account-request.md index 305e762..3477d91 100644 --- a/doc/models/create-bank-account-request.md +++ b/doc/models/create-bank-account-request.md @@ -28,20 +28,20 @@ Request for creating a bank account ```json { "holder_name": "holder_name4", - "holder_type": "holder_type2", - "holder_document": "holder_document6", - "bank": "bank8", - "branch_number": "branch_number6", + "holder_type": "holder_type0", + "holder_document": "holder_document8", + "bank": "bank6", + "branch_number": "branch_number4", "branch_check_digit": "branch_check_digit4", - "account_number": "account_number0", - "account_check_digit": "account_check_digit6", - "type": "type0", + "account_number": "account_number8", + "account_check_digit": "account_check_digit4", + "type": "type2", "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata5", + "key1": "metadata6", + "key2": "metadata7" }, - "pix_key": "pix_key6" + "pix_key": "pix_key8" } ``` diff --git a/doc/models/create-bank-transfer-payment-request.md b/doc/models/create-bank-transfer-payment-request.md index eb339c5..83efbc4 100644 --- a/doc/models/create-bank-transfer-payment-request.md +++ b/doc/models/create-bank-transfer-payment-request.md @@ -18,8 +18,8 @@ Request for creating a bank transfer payment ```json { - "bank": "bank8", - "retries": 230 + "bank": "bank4", + "retries": 188 } ``` diff --git a/doc/models/create-boleto-payment-request.md b/doc/models/create-boleto-payment-request.md index 788e5dd..23f5693 100644 --- a/doc/models/create-boleto-payment-request.md +++ b/doc/models/create-boleto-payment-request.md @@ -28,9 +28,9 @@ Contains the settings for creating a boleto payment ```json { - "retries": 230, + "retries": 14, "bank": "bank8", - "instructions": "instructions2", + "instructions": "instructions8", "due_at": "2016-03-13T12:52:32.123Z", "billing_address": { "street": "street8", @@ -50,7 +50,7 @@ Contains the settings for creating a boleto payment }, "billing_address_id": "billing_address_id6", "nosso_numero": "nosso_numero0", - "document_number": "document_number6", + "document_number": "document_number4", "statement_descriptor": "statement_descriptor0", "interest": { "days": 156, diff --git a/doc/models/create-cancel-charge-request.md b/doc/models/create-cancel-charge-request.md index 5fe3207..9c8785f 100644 --- a/doc/models/create-cancel-charge-request.md +++ b/doc/models/create-cancel-charge-request.md @@ -21,60 +21,28 @@ Request for canceling a charge. ```json { - "amount": 46, + "amount": 244, "split_rules": [ { - "id": "id6", - "Amount": 172, - "type": "type4" - }, - { - "id": "id7", - "Amount": 173, - "type": "type3" - }, - { - "id": "id8", - "Amount": 174, - "type": "type2" + "id": "id2", + "Amount": 244, + "type": "type8" } ], "split": [ { - "type": "type6", - "amount": 28, - "recipient_id": "recipient_id6", - "options": { - "liable": false, - "charge_processing_fee": false, - "charge_remainder_fee": false - }, - "split_rule_id": "split_rule_id6" - }, - { - "type": "type5", - "amount": 27, - "recipient_id": "recipient_id5", - "options": { - "liable": true, - "charge_processing_fee": true, - "charge_remainder_fee": true - }, - "split_rule_id": "split_rule_id7" - }, - { - "type": "type4", - "amount": 26, - "recipient_id": "recipient_id4", + "type": "type2", + "amount": 10, + "recipient_id": "recipient_id2", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id8" + "split_rule_id": "split_rule_id0" } ], - "operation_reference": "operation_reference0", + "operation_reference": "operation_reference8", "bank_account": { "holder_name": "holder_name0", "holder_type": "holder_type6", diff --git a/doc/models/create-cancel-charge-split-rules-request.md b/doc/models/create-cancel-charge-split-rules-request.md index 4f739f6..3ee4d09 100644 --- a/doc/models/create-cancel-charge-split-rules-request.md +++ b/doc/models/create-cancel-charge-split-rules-request.md @@ -19,9 +19,9 @@ Creates a refund with split rules ```json { - "id": "id0", - "Amount": 156, - "type": "type0" + "id": "id6", + "Amount": 222, + "type": "type6" } ``` diff --git a/doc/models/create-capture-charge-request.md b/doc/models/create-capture-charge-request.md index d178c04..9f01971 100644 --- a/doc/models/create-capture-charge-request.md +++ b/doc/models/create-capture-charge-request.md @@ -21,40 +21,29 @@ Request for capturing a charge ```json { "code": "code8", - "amount": 46, + "amount": 96, "split": [ { - "type": "type6", - "amount": 28, - "recipient_id": "recipient_id6", + "type": "type2", + "amount": 10, + "recipient_id": "recipient_id2", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id6" + "split_rule_id": "split_rule_id0" }, { - "type": "type5", - "amount": 27, - "recipient_id": "recipient_id5", - "options": { - "liable": true, - "charge_processing_fee": true, - "charge_remainder_fee": true - }, - "split_rule_id": "split_rule_id7" - }, - { - "type": "type4", - "amount": 26, - "recipient_id": "recipient_id4", + "type": "type2", + "amount": 10, + "recipient_id": "recipient_id2", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id8" + "split_rule_id": "split_rule_id0" } ], "operation_reference": "operation_reference0" diff --git a/doc/models/create-card-payload-request.md b/doc/models/create-card-payload-request.md new file mode 100644 index 0000000..2ff73c9 --- /dev/null +++ b/doc/models/create-card-payload-request.md @@ -0,0 +1,36 @@ + +# Create Card Payload Request + +## Structure + +`CreateCardPayloadRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `type` | `?string` | Optional | - | getType(): ?string | setType(?string type): void | +| `googlePay` | [`?CreateGooglePayRequest`](../../doc/models/create-google-pay-request.md) | Optional | - | getGooglePay(): ?CreateGooglePayRequest | setGooglePay(?CreateGooglePayRequest googlePay): void | + +## Example (as JSON) + +```json +{ + "type": "type6", + "google_pay": { + "version": "version4", + "data": "data8", + "intermediate_signing_key": { + "signed_key": "signed_key0", + "signatures": [ + "signatures2", + "signatures3", + "signatures4" + ] + }, + "signature": "signature6", + "signed_message": "signed_message4" + } +} +``` + diff --git a/doc/models/create-card-payment-contactless-poi-request.md b/doc/models/create-card-payment-contactless-poi-request.md index 3106118..3e78356 100644 --- a/doc/models/create-card-payment-contactless-poi-request.md +++ b/doc/models/create-card-payment-contactless-poi-request.md @@ -20,9 +20,9 @@ ```json { "system_name": "system_name0", - "model": "model2", - "provider": "provider8", - "serial_number": "serial_number6", + "model": "model8", + "provider": "provider2", + "serial_number": "serial_number4", "version_number": "version_number0" } ``` diff --git a/doc/models/create-card-payment-contactless-request.md b/doc/models/create-card-payment-contactless-request.md index 653368a..38b231a 100644 --- a/doc/models/create-card-payment-contactless-request.md +++ b/doc/models/create-card-payment-contactless-request.md @@ -20,7 +20,7 @@ The card payment contactless request ```json { - "type": "type0", + "type": "type4", "apple_pay": { "version": "version6", "data": "data0", @@ -35,34 +35,49 @@ The card payment contactless request "google_pay": { "version": "version4", "data": "data8", - "header": { - "ephemeral_public_key": "ephemeral_public_key2" + "intermediate_signing_key": { + "signed_key": "signed_key0", + "signatures": [ + "signatures2", + "signatures3", + "signatures4" + ] }, "signature": "signature6", - "merchant_identifier": "merchant_identifier2" + "signed_message": "signed_message4" }, "emv": { "icc_data": "icc_data8", "card_sequence_number": "card_sequence_number4", "data": { - "cipher": "cipher8", + "cipher": "cipher4", "dukpt": { - "ksn": "ksn4" + "ksn": "ksn0" }, "tags": [ { - "tag": "tag3", - "lenght": "lenght1", - "value": "value1" + "tag": "tag4", + "lenght": "lenght2", + "value": "value2" + }, + { + "tag": "tag4", + "lenght": "lenght2", + "value": "value2" + }, + { + "tag": "tag4", + "lenght": "lenght2", + "value": "value2" } ] }, "poi": { - "system_name": "system_name0", - "model": "model8", - "provider": "provider8", - "serial_number": "serial_number4", - "version_number": "version_number0" + "system_name": "system_name4", + "model": "model2", + "provider": "provider4", + "serial_number": "serial_number2", + "version_number": "version_number6" } } } diff --git a/doc/models/create-card-request.md b/doc/models/create-card-request.md index 5fbe1bd..217649b 100644 --- a/doc/models/create-card-request.md +++ b/doc/models/create-card-request.md @@ -33,11 +33,11 @@ Card data ```json { "type": "credit", - "number": "number2", - "holder_name": "holder_name4", - "exp_month": 42, - "exp_year": 254, - "cvv": "cvv2" + "number": "number0", + "holder_name": "holder_name8", + "exp_month": 92, + "exp_year": 204, + "cvv": "cvv0" } ``` diff --git a/doc/models/create-card-token-request.md b/doc/models/create-card-token-request.md index c823e48..34e560d 100644 --- a/doc/models/create-card-token-request.md +++ b/doc/models/create-card-token-request.md @@ -23,11 +23,11 @@ Card token data ```json { - "number": "number2", - "holder_name": "holder_name4", - "exp_month": 42, - "exp_year": 254, - "cvv": "cvv2", + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 168, + "exp_year": 208, + "cvv": "cvv8", "brand": "brand4", "label": "label0" } diff --git a/doc/models/create-cash-payment-request.md b/doc/models/create-cash-payment-request.md index 7567eec..05e6aeb 100644 --- a/doc/models/create-cash-payment-request.md +++ b/doc/models/create-cash-payment-request.md @@ -16,7 +16,7 @@ ```json { - "description": "description0", + "description": "description8", "confirm": false } ``` diff --git a/doc/models/create-charge-request.md b/doc/models/create-charge-request.md index 11d53e0..f66b0a6 100644 --- a/doc/models/create-charge-request.md +++ b/doc/models/create-charge-request.md @@ -25,9 +25,9 @@ Request for creating a new charge ```json { - "code": "code8", - "amount": 46, - "customer_id": "customer_id8", + "code": "code2", + "amount": 228, + "customer_id": "customer_id2", "customer": { "name": "name0", "email": "email6", @@ -43,7 +43,9 @@ Request for creating a new charge "country": "country0", "complement": "complement2", "metadata": { - "key0": "metadata3" + "key0": "metadata3", + "key1": "metadata2", + "key2": "metadata1" }, "line_1": "line_10", "line_2": "line_24" @@ -53,14 +55,16 @@ Request for creating a new charge }, "phones": { "home_phone": { - "country_code": "country_code2", - "number": "number0", - "area_code": "area_code2" + "country_code": "country_code0", + "number": "number2", + "area_code": "area_code0", + "Type": "Type0" }, "mobile_phone": { - "country_code": "country_code8", - "number": "number4", - "area_code": "area_code8" + "country_code": "country_code0", + "number": "number8", + "area_code": "area_code0", + "Type": "Type0" } }, "code": "code8", @@ -70,35 +74,35 @@ Request for creating a new charge "payment": { "payment_method": "payment_method4", "credit_card": { - "installments": 36, - "statement_descriptor": "statement_descriptor4", + "installments": 52, + "statement_descriptor": "statement_descriptor8", "card": { "number": "number6", - "holder_name": "holder_name4", - "exp_month": 70, - "exp_year": 226, - "cvv": "cvv6" + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id0", - "card_token": "card_token4" + "card_id": "card_id4", + "card_token": "card_token2" }, "debit_card": { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor4", "card": { - "number": "number8", - "holder_name": "holder_name0", - "exp_month": 252, - "exp_year": 44, - "cvv": "cvv2" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id6", - "card_token": "card_token0", + "card_id": "card_id0", + "card_token": "card_token6", "recurrence": false }, "boleto": { - "retries": 218, - "bank": "bank4", - "instructions": "instructions4", + "retries": 226, + "bank": "bank8", + "instructions": "instructions2", "due_at": "2016-03-13T12:52:32.123Z", "billing_address": { "street": "street8", @@ -116,38 +120,38 @@ Request for creating a new charge "line_1": "line_18", "line_2": "line_26" }, - "billing_address_id": "billing_address_id2", - "nosso_numero": "nosso_numero6", - "document_number": "document_number0", - "statement_descriptor": "statement_descriptor6", + "billing_address_id": "billing_address_id6", + "nosso_numero": "nosso_numero0", + "document_number": "document_number6", + "statement_descriptor": "statement_descriptor0", "interest": { - "days": 168, - "type": "type6", - "amount": 242 + "days": 156, + "type": "type0", + "amount": 230 } }, "currency": "currency6", "voucher": { - "statement_descriptor": "statement_descriptor6", + "statement_descriptor": "statement_descriptor2", "card_id": "card_id8", - "card_token": "card_token4", + "card_token": "card_token8", "Card": { - "number": "number4", - "holder_name": "holder_name2", - "exp_month": 214, - "exp_year": 254, - "cvv": "cvv4" + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 240, + "exp_year": 56, + "cvv": "cvv8" }, - "recurrency_cycle": "recurrency_cycle0" + "recurrency_cycle": "recurrency_cycle6" } }, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata1", + "key1": "metadata0", + "key2": "metadata9" }, "due_at": "2016-03-13T12:52:32.123Z", - "order_id": "order_id6" + "order_id": "order_id8" } ``` diff --git a/doc/models/create-checkout-bank-transfer-request.md b/doc/models/create-checkout-bank-transfer-request.md index 9634373..1e3308d 100644 --- a/doc/models/create-checkout-bank-transfer-request.md +++ b/doc/models/create-checkout-bank-transfer-request.md @@ -19,9 +19,11 @@ Checkout bank transfer payment request ```json { "bank": [ - "bank7" + "bank7", + "bank8", + "bank9" ], - "retries": 230 + "retries": 56 } ``` diff --git a/doc/models/create-checkout-boleto-payment-request.md b/doc/models/create-checkout-boleto-payment-request.md index d908419..4ccb410 100644 --- a/doc/models/create-checkout-boleto-payment-request.md +++ b/doc/models/create-checkout-boleto-payment-request.md @@ -17,8 +17,8 @@ ```json { - "bank": "bank8", - "instructions": "instructions2", + "bank": "bank4", + "instructions": "instructions4", "due_at": "2016-03-13T12:52:32.123Z" } ``` diff --git a/doc/models/create-checkout-card-installment-option-request.md b/doc/models/create-checkout-card-installment-option-request.md index ad3625b..360a55a 100644 --- a/doc/models/create-checkout-card-installment-option-request.md +++ b/doc/models/create-checkout-card-installment-option-request.md @@ -18,8 +18,8 @@ Options for card installment ```json { - "number": 158, - "total": 10 + "number": 154, + "total": 46 } ``` diff --git a/doc/models/create-checkout-credit-card-payment-request.md b/doc/models/create-checkout-credit-card-payment-request.md index eb1242e..c66e5f6 100644 --- a/doc/models/create-checkout-credit-card-payment-request.md +++ b/doc/models/create-checkout-credit-card-payment-request.md @@ -23,27 +23,19 @@ Checkout card payment request "statement_descriptor": "statement_descriptor0", "installments": [ { - "number": 217, - "total": 109 - }, - { - "number": 218, - "total": 110 - }, - { - "number": 219, - "total": 111 + "number": 164, + "total": 16 } ], "authentication": { "type": "type2", "threed_secure": { - "mpi": "mpi6", - "cavv": "cavv2", - "eci": "eci6", - "transaction_id": "transaction_id4", - "success_url": "success_url8", - "ds_transaction_id": "ds_transaction_id4" + "mpi": "mpi0", + "cavv": "cavv8", + "eci": "eci2", + "transaction_id": "transaction_id0", + "success_url": "success_url4", + "ds_transaction_id": "ds_transaction_id0" } }, "capture": false diff --git a/doc/models/create-checkout-debit-card-payment-request.md b/doc/models/create-checkout-debit-card-payment-request.md index 5df1f2b..837c634 100644 --- a/doc/models/create-checkout-debit-card-payment-request.md +++ b/doc/models/create-checkout-debit-card-payment-request.md @@ -18,16 +18,16 @@ Checkout credit card payment request ```json { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor4", "authentication": { "type": "type2", "threed_secure": { - "mpi": "mpi6", - "cavv": "cavv2", - "eci": "eci6", - "transaction_id": "transaction_id4", - "success_url": "success_url8", - "ds_transaction_id": "ds_transaction_id4" + "mpi": "mpi0", + "cavv": "cavv8", + "eci": "eci2", + "transaction_id": "transaction_id0", + "success_url": "success_url4", + "ds_transaction_id": "ds_transaction_id0" } } } diff --git a/doc/models/create-checkout-payment-request.md b/doc/models/create-checkout-payment-request.md index f4a92db..63f0d28 100644 --- a/doc/models/create-checkout-payment-request.md +++ b/doc/models/create-checkout-payment-request.md @@ -33,9 +33,8 @@ Checkout payment request ```json { "accepted_payment_methods": [ - "accepted_payment_methods3", - "accepted_payment_methods4", - "accepted_payment_methods5" + "accepted_payment_methods9", + "accepted_payment_methods0" ], "accepted_multi_payment_methods": [ { @@ -47,19 +46,19 @@ Checkout payment request "key2": "val2" } ], - "success_url": "success_url2", - "default_payment_method": "default_payment_method0", - "gateway_affiliation_id": "gateway_affiliation_id4", + "success_url": "success_url8", + "default_payment_method": "default_payment_method6", + "gateway_affiliation_id": "gateway_affiliation_id2", "credit_card": { "statement_descriptor": "statement_descriptor8", "installments": [ { - "number": 19, - "total": 167 + "number": 164, + "total": 16 } ], "authentication": { - "type": "type0", + "type": "type2", "threed_secure": { "mpi": "mpi0", "cavv": "cavv8", @@ -74,10 +73,10 @@ Checkout payment request "debit_card": { "statement_descriptor": "statement_descriptor4", "authentication": { - "type": "type6", + "type": "type2", "threed_secure": { "mpi": "mpi0", - "cavv": "cavv2", + "cavv": "cavv8", "eci": "eci2", "transaction_id": "transaction_id0", "success_url": "success_url4", @@ -109,8 +108,8 @@ Checkout payment request "line_2": "line_26" }, "accepted_brands": [ - "accepted_brands8", - "accepted_brands9" + "accepted_brands2", + "accepted_brands3" ] } ``` diff --git a/doc/models/create-checkout-pix-payment-request.md b/doc/models/create-checkout-pix-payment-request.md index 912ad48..31bfddd 100644 --- a/doc/models/create-checkout-pix-payment-request.md +++ b/doc/models/create-checkout-pix-payment-request.md @@ -20,15 +20,11 @@ Checkout pix payment request ```json { "expires_at": "2016-03-13T12:52:32.123Z", - "expires_in": 226, + "expires_in": 4, "additional_information": [ { - "Name": "Name5", - "Value": "Value7" - }, - { - "Name": "Name6", - "Value": "Value6" + "Name": "Name0", + "Value": "Value2" } ] } diff --git a/doc/models/create-clear-sale-request.md b/doc/models/create-clear-sale-request.md index b1a6d21..ba5de9a 100644 --- a/doc/models/create-clear-sale-request.md +++ b/doc/models/create-clear-sale-request.md @@ -15,7 +15,7 @@ ```json { - "custom_sla": 224 + "custom_sla": 150 } ``` diff --git a/doc/models/create-confirm-payment-request.md b/doc/models/create-confirm-payment-request.md index 8f04315..976d70d 100644 --- a/doc/models/create-confirm-payment-request.md +++ b/doc/models/create-confirm-payment-request.md @@ -18,7 +18,7 @@ ```json { "description": "description0", - "Amount": 156, + "Amount": 178, "Code": "Code0" } ``` diff --git a/doc/models/create-credit-card-payment-request.md b/doc/models/create-credit-card-payment-request.md index 415f905..a724174 100644 --- a/doc/models/create-credit-card-payment-request.md +++ b/doc/models/create-credit-card-payment-request.md @@ -26,6 +26,7 @@ The settings for creating a credit card payment | `autoRecovery` | `?bool` | Optional | Indicates whether a particular payment will enter the offline retry flow | getAutoRecovery(): ?bool | setAutoRecovery(?bool autoRecovery): void | | `operationType` | `?string` | Optional | AuthOnly, AuthAndCapture, PreAuth | getOperationType(): ?string | setOperationType(?string operationType): void | | `recurrencyCycle` | `?string` | Optional | Defines whether the card has been used one or more times. | getRecurrencyCycle(): ?string | setRecurrencyCycle(?string recurrencyCycle): void | +| `payload` | [`?CreateCardPayloadRequest`](../../doc/models/create-card-payload-request.md) | Optional | - | getPayload(): ?CreateCardPayloadRequest | setPayload(?CreateCardPayloadRequest payload): void | ## Example (as JSON) @@ -42,7 +43,7 @@ The settings for creating a credit card payment "exp_year": 68, "cvv": "cvv4" }, - "card_id": "card_id4", + "card_id": "card_id6", "card_token": "card_token0" } ``` diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index 08982bb..b92488d 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -27,9 +27,9 @@ Request for creating a new customer ```json { "name": "{\n \"name\": \"Tony Stark\"\n}", - "email": "email6", - "document": "document6", - "type": "type0", + "email": "email8", + "document": "document8", + "type": "type2", "address": { "street": "street6", "number": "number4", @@ -48,25 +48,25 @@ Request for creating a new customer "line_2": "line_24" }, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata5" }, "phones": { "home_phone": { - "country_code": "country_code8", - "number": "number0", - "area_code": "area_code2" + "country_code": "country_code0", + "number": "number2", + "area_code": "area_code0", + "Type": "Type0" }, "mobile_phone": { - "country_code": "country_code8", - "number": "number4", - "area_code": "area_code8" + "country_code": "country_code0", + "number": "number8", + "area_code": "area_code0", + "Type": "Type0" } }, - "code": "code8", - "gender": "gender6", - "document_type": "document_type8" + "code": "code6", + "gender": "gender8", + "document_type": "document_type6" } ``` diff --git a/doc/models/create-debit-card-payment-request.md b/doc/models/create-debit-card-payment-request.md index c9c44e7..09e8037 100644 --- a/doc/models/create-debit-card-payment-request.md +++ b/doc/models/create-debit-card-payment-request.md @@ -23,7 +23,7 @@ The settings for creating a debit card payment ```json { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor8", "card": { "number": "number6", "holder_name": "holder_name2", @@ -32,7 +32,7 @@ The settings for creating a debit card payment "cvv": "cvv4" }, "card_id": "card_id4", - "card_token": "card_token0", + "card_token": "card_token2", "recurrence": false } ``` diff --git a/doc/models/create-device-request.md b/doc/models/create-device-request.md index f80e3c8..5aded9a 100644 --- a/doc/models/create-device-request.md +++ b/doc/models/create-device-request.md @@ -17,7 +17,7 @@ Request for creating a device ```json { - "platform": "platform6" + "platform": "platform8" } ``` diff --git a/doc/models/create-discount-request.md b/doc/models/create-discount-request.md index d19098d..c5578c4 100644 --- a/doc/models/create-discount-request.md +++ b/doc/models/create-discount-request.md @@ -21,11 +21,11 @@ Request for creating a new discount ```json { - "value": 251.52, - "discount_type": "discount_type8", - "item_id": "item_id0", - "cycles": 168, - "description": "description0" + "value": 146.6, + "discount_type": "discount_type6", + "item_id": "item_id2", + "cycles": 164, + "description": "description2" } ``` diff --git a/doc/models/create-emv-data-decrypt-request.md b/doc/models/create-emv-data-decrypt-request.md index 0c9b789..865816f 100644 --- a/doc/models/create-emv-data-decrypt-request.md +++ b/doc/models/create-emv-data-decrypt-request.md @@ -17,12 +17,12 @@ ```json { - "cipher": "cipher4", + "cipher": "cipher2", "tags": [ { - "tag": "tag9", - "lenght": "lenght7", - "value": "value7" + "tag": "tag4", + "lenght": "lenght2", + "value": "value2" } ], "dukpt": { diff --git a/doc/models/create-emv-data-dukpt-decrypt-request.md b/doc/models/create-emv-data-dukpt-decrypt-request.md index edf9fd9..1346878 100644 --- a/doc/models/create-emv-data-dukpt-decrypt-request.md +++ b/doc/models/create-emv-data-dukpt-decrypt-request.md @@ -15,7 +15,7 @@ ```json { - "ksn": "ksn4" + "ksn": "ksn8" } ``` diff --git a/doc/models/create-emv-data-tlv-decrypt-request.md b/doc/models/create-emv-data-tlv-decrypt-request.md index f7b7c97..9bc1acf 100644 --- a/doc/models/create-emv-data-tlv-decrypt-request.md +++ b/doc/models/create-emv-data-tlv-decrypt-request.md @@ -18,8 +18,8 @@ ```json { "tag": "tag6", - "lenght": "lenght8", - "value": "value2" + "lenght": "lenght6", + "value": "value4" } ``` diff --git a/doc/models/create-emv-decrypt-request.md b/doc/models/create-emv-decrypt-request.md index 281c2ed..a62b7ce 100644 --- a/doc/models/create-emv-decrypt-request.md +++ b/doc/models/create-emv-decrypt-request.md @@ -18,15 +18,15 @@ ```json { - "icc_data": "icc_data6", - "card_sequence_number": "card_sequence_number0", + "icc_data": "icc_data4", + "card_sequence_number": "card_sequence_number2", "data": { "cipher": "cipher4", "tags": [ { - "tag": "tag9", - "lenght": "lenght7", - "value": "value7" + "tag": "tag4", + "lenght": "lenght2", + "value": "value2" } ], "dukpt": { diff --git a/doc/models/create-fine-request.md b/doc/models/create-fine-request.md index 80b0f5d..2fdab1c 100644 --- a/doc/models/create-fine-request.md +++ b/doc/models/create-fine-request.md @@ -19,9 +19,9 @@ Fine Request ```json { - "days": 120, + "days": 218, "type": "\"percentage\" or \"flat\"", - "amount": 46 + "amount": 220 } ``` diff --git a/doc/models/create-google-pay-header-request.md b/doc/models/create-google-pay-header-request.md index c6bc971..fd4bd60 100644 --- a/doc/models/create-google-pay-header-request.md +++ b/doc/models/create-google-pay-header-request.md @@ -17,7 +17,7 @@ The GooglePay header request ```json { - "ephemeral_public_key": "ephemeral_public_key0" + "ephemeral_public_key": "ephemeral_public_key2" } ``` diff --git a/doc/models/create-google-pay-intermediate-signing-key-request.md b/doc/models/create-google-pay-intermediate-signing-key-request.md new file mode 100644 index 0000000..17c83c3 --- /dev/null +++ b/doc/models/create-google-pay-intermediate-signing-key-request.md @@ -0,0 +1,29 @@ + +# Create Google Pay Intermediate Signing Key Request + +The GooglePay Intermediate Signing Key Request + +## Structure + +`CreateGooglePayIntermediateSigningKeyRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `signedKey` | `?string` | Optional | Uma mensagem codificada em Base64 com a descrição de pagamento da chave. | getSignedKey(): ?string | setSignedKey(?string signedKey): void | +| `signatures` | `?(string[])` | Optional | Verifica se a origem da chave de assinatura intermediária é o Google. É codificada em Base64 e criada usando o ECDSA. | getSignatures(): ?array | setSignatures(?array signatures): void | + +## Example (as JSON) + +```json +{ + "signed_key": "signed_key2", + "signatures": [ + "signatures0", + "signatures1", + "signatures2" + ] +} +``` + diff --git a/doc/models/create-google-pay-request.md b/doc/models/create-google-pay-request.md index 12e5de1..96e06f9 100644 --- a/doc/models/create-google-pay-request.md +++ b/doc/models/create-google-pay-request.md @@ -11,23 +11,29 @@ The GooglePay Token Payment Request | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `version` | `string` | Required | The token version | getVersion(): string | setVersion(string version): void | -| `data` | `string` | Required | The cryptography data | getData(): string | setData(string data): void | -| `header` | [`CreateGooglePayHeaderRequest`](../../doc/models/create-google-pay-header-request.md) | Required | The GooglePay header request | getHeader(): CreateGooglePayHeaderRequest | setHeader(CreateGooglePayHeaderRequest header): void | -| `signature` | `string` | Required | Detached PKCS #7 signature, Base64 encoded as string | getSignature(): string | setSignature(string signature): void | -| `merchantIdentifier` | `string` | Required | GooglePay Merchant identifier | getMerchantIdentifier(): string | setMerchantIdentifier(string merchantIdentifier): void | +| `version` | `?string` | Optional | Informação sobre a versão do token. Único valor aceito é EC_v2 | getVersion(): ?string | setVersion(?string version): void | +| `data` | `?string` | Optional | Dados de pagamento criptografados. Corresponde ao encryptedMessage do token Google. | getData(): ?string | setData(?string data): void | +| `intermediateSigningKey` | [`?CreateGooglePayIntermediateSigningKeyRequest`](../../doc/models/create-google-pay-intermediate-signing-key-request.md) | Optional | The GooglePay intermediate signing key request | getIntermediateSigningKey(): ?CreateGooglePayIntermediateSigningKeyRequest | setIntermediateSigningKey(?CreateGooglePayIntermediateSigningKeyRequest intermediateSigningKey): void | +| `signature` | `?string` | Optional | Assinatura dos dados de pagamento. Verifica se a origem da mensagem é o Google. Corresponde ao signature do token Google. | getSignature(): ?string | setSignature(?string signature): void | +| `signedMessage` | `?string` | Optional | - | getSignedMessage(): ?string | setSignedMessage(?string signedMessage): void | +| `merchantIdentifier` | `?string` | Optional | - | getMerchantIdentifier(): ?string | setMerchantIdentifier(?string merchantIdentifier): void | ## Example (as JSON) ```json { - "version": "version4", + "version": "version6", "data": "data0", - "header": { - "ephemeral_public_key": "ephemeral_public_key6" + "intermediate_signing_key": { + "signed_key": "signed_key0", + "signatures": [ + "signatures2", + "signatures3", + "signatures4" + ] }, "signature": "signature8", - "merchant_identifier": "merchant_identifier4" + "signed_message": "signed_message6" } ``` diff --git a/doc/models/create-increment-request.md b/doc/models/create-increment-request.md index 6ca3b86..5bffd34 100644 --- a/doc/models/create-increment-request.md +++ b/doc/models/create-increment-request.md @@ -21,11 +21,11 @@ Request for creating a new increment ```json { - "value": 251.52, - "increment_type": "increment_type8", - "item_id": "item_id0", - "cycles": 168, - "description": "description0" + "value": 72.04, + "increment_type": "increment_type4", + "item_id": "item_id8", + "cycles": 196, + "description": "description8" } ``` diff --git a/doc/models/create-interest-request.md b/doc/models/create-interest-request.md index b0b8b8c..e79ec5c 100644 --- a/doc/models/create-interest-request.md +++ b/doc/models/create-interest-request.md @@ -19,9 +19,9 @@ Interest Request ```json { - "days": 120, + "days": 4, "type": "\"percentage\" or \"flat\"", - "amount": 46 + "amount": 78 } ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index 343bb1e..b93c7c4 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -18,9 +18,7 @@ Request for creating a new Invoice ```json { "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata9" } } ``` diff --git a/doc/models/create-location-request.md b/doc/models/create-location-request.md index 50dd4f6..0b4251d 100644 --- a/doc/models/create-location-request.md +++ b/doc/models/create-location-request.md @@ -18,8 +18,8 @@ Request for creating a location ```json { - "latitude": "latitude6", - "longitude": "longitude4" + "latitude": "latitude0", + "longitude": "longitude0" } ``` diff --git a/doc/models/create-order-item-request.md b/doc/models/create-order-item-request.md index 76c6d8a..14d9044 100644 --- a/doc/models/create-order-item-request.md +++ b/doc/models/create-order-item-request.md @@ -21,11 +21,11 @@ Request for creating an order item ```json { - "amount": 46, - "description": "description0", - "quantity": 68, - "category": "category2", - "code": "code8" + "amount": 102, + "description": "description4", + "quantity": 216, + "category": "category4", + "code": "code4" } ``` diff --git a/doc/models/create-order-request.md b/doc/models/create-order-request.md index 5a68886..2c7e0ea 100644 --- a/doc/models/create-order-request.md +++ b/doc/models/create-order-request.md @@ -34,11 +34,11 @@ Request for creating an order { "items": [ { - "amount": 13, - "description": "description7", - "quantity": 127, - "category": "category5", - "code": "code5" + "amount": 164, + "description": "description2", + "quantity": 22, + "category": "category6", + "code": "code6" } ], "customer": { @@ -56,7 +56,9 @@ Request for creating an order "country": "country0", "complement": "complement2", "metadata": { - "key0": "metadata3" + "key0": "metadata3", + "key1": "metadata2", + "key2": "metadata1" }, "line_1": "line_10", "line_2": "line_24" @@ -66,14 +68,16 @@ Request for creating an order }, "phones": { "home_phone": { - "country_code": "country_code2", - "number": "number0", - "area_code": "area_code2" + "country_code": "country_code0", + "number": "number2", + "area_code": "area_code0", + "Type": "Type0" }, "mobile_phone": { - "country_code": "country_code8", - "number": "number4", - "area_code": "area_code8" + "country_code": "country_code0", + "number": "number8", + "area_code": "area_code0", + "Type": "Type0" } }, "code": "code8", @@ -82,82 +86,83 @@ Request for creating an order }, "payments": [ { - "payment_method": "payment_method4", + "payment_method": "payment_method8", "credit_card": { - "installments": 176, - "statement_descriptor": "statement_descriptor4", + "installments": 52, + "statement_descriptor": "statement_descriptor8", "card": { - "number": "number4", - "holder_name": "holder_name4", - "exp_month": 186, - "exp_year": 110, - "cvv": "cvv6" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id0", - "card_token": "card_token6" + "card_id": "card_id4", + "card_token": "card_token2" }, "debit_card": { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor4", "card": { - "number": "number8", - "holder_name": "holder_name0", - "exp_month": 112, - "exp_year": 184, - "cvv": "cvv8" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id4", - "card_token": "card_token0", + "card_id": "card_id0", + "card_token": "card_token6", "recurrence": false }, "boleto": { - "retries": 102, - "bank": "bank4", - "instructions": "instructions6", + "retries": 226, + "bank": "bank8", + "instructions": "instructions2", "due_at": "2016-03-13T12:52:32.123Z", "billing_address": { - "street": "street2", - "number": "number0", - "zip_code": "zip_code6", - "neighborhood": "neighborhood8", - "city": "city8", - "state": "state2", - "country": "country6", - "complement": "complement2", + "street": "street8", + "number": "number4", + "zip_code": "zip_code2", + "neighborhood": "neighborhood4", + "city": "city2", + "state": "state6", + "country": "country2", + "complement": "complement6", "metadata": { - "key0": "metadata1" + "key0": "metadata5", + "key1": "metadata6" }, - "line_1": "line_14", - "line_2": "line_20" + "line_1": "line_18", + "line_2": "line_26" }, - "billing_address_id": "billing_address_id2", - "nosso_numero": "nosso_numero6", - "document_number": "document_number0", - "statement_descriptor": "statement_descriptor6", + "billing_address_id": "billing_address_id6", + "nosso_numero": "nosso_numero0", + "document_number": "document_number6", + "statement_descriptor": "statement_descriptor0", "interest": { - "days": 28, - "type": "type4", - "amount": 102 + "days": 156, + "type": "type0", + "amount": 230 } }, - "currency": "currency6", + "currency": "currency2", "voucher": { - "statement_descriptor": "statement_descriptor6", - "card_id": "card_id2", - "card_token": "card_token4", + "statement_descriptor": "statement_descriptor2", + "card_id": "card_id8", + "card_token": "card_token8", "Card": { - "number": "number4", - "holder_name": "holder_name2", - "exp_month": 74, - "exp_year": 114, - "cvv": "cvv4" + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 240, + "exp_year": 56, + "cvv": "cvv8" }, - "recurrency_cycle": "recurrency_cycle0" + "recurrency_cycle": "recurrency_cycle6" } } ], - "code": "code8", + "code": "code6", "closed": true, - "customer_id": "customer_id8", + "customer_id": "customer_id6", "shipping": { "amount": 52, "description": "description6", @@ -165,31 +170,31 @@ Request for creating an order "recipient_phone": "recipient_phone6", "address_id": "address_id6", "address": { - "street": "street0", - "number": "number8", - "zip_code": "zip_code4", - "neighborhood": "neighborhood6", - "city": "city0", - "state": "state6", - "country": "country4", - "complement": "complement6", + "street": "street6", + "number": "number4", + "zip_code": "zip_code0", + "neighborhood": "neighborhood2", + "city": "city6", + "state": "state2", + "country": "country0", + "complement": "complement2", "metadata": { - "key0": "metadata7" + "key0": "metadata3", + "key1": "metadata2", + "key2": "metadata1" }, - "line_1": "line_14", - "line_2": "line_28" + "line_1": "line_10", + "line_2": "line_24" }, "max_delivery_date": "2016-03-13T12:52:32.123Z", "estimated_delivery_date": "2016-03-13T12:52:32.123Z", "type": "type6" }, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata5" }, "antifraud_enabled": false, - "ip": "ip4" + "ip": "ip2" } ``` diff --git a/doc/models/create-payment-authentication-request.md b/doc/models/create-payment-authentication-request.md index 3092475..660bd83 100644 --- a/doc/models/create-payment-authentication-request.md +++ b/doc/models/create-payment-authentication-request.md @@ -18,7 +18,7 @@ The payment authentication request ```json { - "type": "type0", + "type": "type8", "threed_secure": { "mpi": "mpi0", "cavv": "cavv8", diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 40e8835..2590c35 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -33,16 +33,16 @@ Payment data ```json { - "payment_method": "payment_method0", + "payment_method": "payment_method6", "credit_card": { "installments": 52, "statement_descriptor": "statement_descriptor8", "card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 54, - "exp_year": 242, - "cvv": "cvv0" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, "card_id": "card_id4", "card_token": "card_token2" @@ -50,11 +50,11 @@ Payment data "debit_card": { "statement_descriptor": "statement_descriptor4", "card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 104, - "exp_year": 192, - "cvv": "cvv0" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, "card_id": "card_id0", "card_token": "card_token6", @@ -75,7 +75,8 @@ Payment data "country": "country2", "complement": "complement6", "metadata": { - "key0": "metadata5" + "key0": "metadata5", + "key1": "metadata6" }, "line_1": "line_18", "line_2": "line_26" @@ -85,22 +86,22 @@ Payment data "document_number": "document_number6", "statement_descriptor": "statement_descriptor0", "interest": { - "days": 160, + "days": 156, "type": "type0", - "amount": 234 + "amount": 230 } }, - "currency": "currency0", + "currency": "currency6", "voucher": { "statement_descriptor": "statement_descriptor2", "card_id": "card_id8", "card_token": "card_token8", "Card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 198, - "exp_year": 238, - "cvv": "cvv0" + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 240, + "exp_year": 56, + "cvv": "cvv8" }, "recurrency_cycle": "recurrency_cycle6" } diff --git a/doc/models/create-phone-request.md b/doc/models/create-phone-request.md index 2546362..3b33c24 100644 --- a/doc/models/create-phone-request.md +++ b/doc/models/create-phone-request.md @@ -12,6 +12,7 @@ | `countryCode` | `?string` | Optional | - | getCountryCode(): ?string | setCountryCode(?string countryCode): void | | `number` | `?string` | Optional | - | getNumber(): ?string | setNumber(?string number): void | | `areaCode` | `?string` | Optional | - | getAreaCode(): ?string | setAreaCode(?string areaCode): void | +| `type` | `?string` | Optional | - | getType(): ?string | setType(?string type): void | ## Example (as JSON) @@ -19,7 +20,8 @@ { "country_code": "country_code0", "number": "number2", - "area_code": "area_code0" + "area_code": "area_code0", + "Type": "Type0" } ``` diff --git a/doc/models/create-phones-request.md b/doc/models/create-phones-request.md index 152a82e..0e6a2d6 100644 --- a/doc/models/create-phones-request.md +++ b/doc/models/create-phones-request.md @@ -19,12 +19,14 @@ "home_phone": { "country_code": "country_code0", "number": "number2", - "area_code": "area_code0" + "area_code": "area_code0", + "Type": "Type0" }, "mobile_phone": { "country_code": "country_code0", "number": "number8", - "area_code": "area_code0" + "area_code": "area_code0", + "Type": "Type0" } } ``` diff --git a/doc/models/create-pix-payment-request.md b/doc/models/create-pix-payment-request.md index 62dedfb..8e06bc7 100644 --- a/doc/models/create-pix-payment-request.md +++ b/doc/models/create-pix-payment-request.md @@ -20,15 +20,15 @@ Contains information to create a pix payment ```json { "expires_at": "2016-03-13T12:52:32.123Z", - "expires_in": 226, + "expires_in": 216, "additional_information": [ { - "Name": "Name5", - "Value": "Value7" + "Name": "Name0", + "Value": "Value2" }, { - "Name": "Name6", - "Value": "Value6" + "Name": "Name0", + "Value": "Value2" } ] } diff --git a/doc/models/create-plan-item-request.md b/doc/models/create-plan-item-request.md index e9101db..26c611b 100644 --- a/doc/models/create-plan-item-request.md +++ b/doc/models/create-plan-item-request.md @@ -27,22 +27,22 @@ Request for creating a plan item "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 120, - "price": 58, - "end_quantity": 128, - "overage_price": 142 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 121, - "price": 59, - "end_quantity": 129, - "overage_price": 143 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, @@ -51,8 +51,8 @@ Request for creating a plan item }, "id": "id0", "description": "description0", - "cycles": 168, - "quantity": 68 + "cycles": 52, + "quantity": 184 } ``` diff --git a/doc/models/create-plan-request.md b/doc/models/create-plan-request.md index 43e7070..96de1e5 100644 --- a/doc/models/create-plan-request.md +++ b/doc/models/create-plan-request.md @@ -39,78 +39,75 @@ Request for creating a plan "statement_descriptor": "statement_descriptor0", "items": [ { - "name": "name7", + "name": "name8", "pricing_scheme": { - "scheme_type": "scheme_type1", + "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 60, - "price": 2, - "end_quantity": 68, - "overage_price": 82 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 61, - "price": 1, - "end_quantity": 69, - "overage_price": 83 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 62, - "price": 0, - "end_quantity": 70, - "overage_price": 84 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], - "price": 149, - "minimum_price": 53, - "percentage": 25.89 + "price": 166, + "minimum_price": 6, + "percentage": 251.76 }, - "id": "id7", - "description": "description7", - "cycles": 109, - "quantity": 127 + "id": "id8", + "description": "description2", + "cycles": 214, + "quantity": 22 } ], "shippable": false, "payment_methods": [ "payment_methods5", - "payment_methods6" + "payment_methods4" ], "installments": [ - 119, - 120, - 121 + 195, + 196 ], "currency": "currency0", - "interval": "interval2", - "interval_count": 82, + "interval": "interval8", + "interval_count": 158, "billing_days": [ - 143, - 144, - 145 + 159 ], - "billing_type": "billing_type6", + "billing_type": "billing_type4", "pricing_scheme": { "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 120, - "price": 58, - "end_quantity": 128, - "overage_price": 142 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 121, - "price": 59, - "end_quantity": 129, - "overage_price": 143 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, @@ -118,14 +115,12 @@ Request for creating a plan "percentage": 251.76 }, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7" }, - "minimum_price": 176, - "cycles": 168, - "quantity": 68, - "trial_period_days": 54 + "minimum_price": 156, + "cycles": 164, + "quantity": 144, + "trial_period_days": 130 } ``` diff --git a/doc/models/create-price-bracket-request.md b/doc/models/create-price-bracket-request.md index 6e6006d..d41e18e 100644 --- a/doc/models/create-price-bracket-request.md +++ b/doc/models/create-price-bracket-request.md @@ -20,10 +20,10 @@ Request for creating a price bracket ```json { - "start_quantity": 46, - "price": 16, - "end_quantity": 54, - "overage_price": 68 + "start_quantity": 154, + "price": 164, + "end_quantity": 162, + "overage_price": 176 } ``` diff --git a/doc/models/create-pricing-scheme-request.md b/doc/models/create-pricing-scheme-request.md index 462f548..75a3e12 100644 --- a/doc/models/create-pricing-scheme-request.md +++ b/doc/models/create-pricing-scheme-request.md @@ -21,30 +21,24 @@ Request for creating a pricing scheme ```json { - "scheme_type": "scheme_type0", + "scheme_type": "scheme_type2", "price_brackets": [ { - "start_quantity": 193, - "price": 125, - "end_quantity": 201, - "overage_price": 215 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 194, - "price": 124, - "end_quantity": 202, - "overage_price": 216 - }, - { - "start_quantity": 195, - "price": 123, - "end_quantity": 203, - "overage_price": 217 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], - "price": 16, - "minimum_price": 176, - "percentage": 4.18 + "price": 84, + "minimum_price": 12, + "percentage": 157.1 } ``` diff --git a/doc/models/create-private-label-payment-request.md b/doc/models/create-private-label-payment-request.md index 0a13c1c..0358e29 100644 --- a/doc/models/create-private-label-payment-request.md +++ b/doc/models/create-private-label-payment-request.md @@ -29,7 +29,7 @@ The settings for creating a private label payment "installments": 1, "capture": true, "recurrency_cycle": "\"first\" or \"subsequent\"", - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor8", "card": { "number": "number6", "holder_name": "holder_name2", @@ -38,7 +38,7 @@ The settings for creating a private label payment "cvv": "cvv4" }, "card_id": "card_id4", - "card_token": "card_token0" + "card_token": "card_token2" } ``` diff --git a/doc/models/create-recipient-request.md b/doc/models/create-recipient-request.md index 60e46a2..7e8cdc7 100644 --- a/doc/models/create-recipient-request.md +++ b/doc/models/create-recipient-request.md @@ -26,11 +26,11 @@ Request for creating a recipient ```json { - "name": "name0", - "email": "email6", - "description": "description0", - "document": "document6", - "type": "type0", + "name": "name6", + "email": "email0", + "description": "description6", + "document": "document0", + "type": "type4", "default_bank_account": { "holder_name": "holder_name4", "holder_type": "holder_type0", @@ -49,11 +49,9 @@ Request for creating a recipient "pix_key": "pix_key8" }, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata3" }, - "code": "code8", + "code": "code4", "payment_mode": "bank_transfer", "transfer_settings": { "transfer_enabled": false, diff --git a/doc/models/create-seller-request.md b/doc/models/create-seller-request.md deleted file mode 100644 index 5572d3b..0000000 --- a/doc/models/create-seller-request.md +++ /dev/null @@ -1,37 +0,0 @@ - -# Create Seller Request - -## Structure - -`CreateSellerRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | Name | getName(): string | setName(string name): void | -| `code` | `?string` | Optional | Seller's code identification | getCode(): ?string | setCode(?string code): void | -| `description` | `?string` | Optional | Description | getDescription(): ?string | setDescription(?string description): void | -| `document` | `?string` | Optional | Document number (individual / company) | getDocument(): ?string | setDocument(?string document): void | -| `address` | [`?CreateAddressRequest`](/doc/models/create-address-request.md) | Optional | Address | getAddress(): ?CreateAddressRequest | setAddress(?CreateAddressRequest address): void | -| `type` | `?string` | Optional | Person type (individual / company) | getType(): ?string | setType(?string type): void | -| `metadata` | `array` | Required | Metadata | getMetadata(): array | setMetadata(array metadata): void | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": null, - "description": null, - "document": null, - "address": null, - "type": null, - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } -} -``` - diff --git a/doc/models/create-setup-request.md b/doc/models/create-setup-request.md index 3c59c5d..4906bc8 100644 --- a/doc/models/create-setup-request.md +++ b/doc/models/create-setup-request.md @@ -19,40 +19,40 @@ Request for creating a Setup for a subscription. The setup is an order that will ```json { - "amount": 46, - "description": "description0", + "amount": 160, + "description": "description8", "payment": { "payment_method": "payment_method4", "credit_card": { - "installments": 36, - "statement_descriptor": "statement_descriptor4", + "installments": 52, + "statement_descriptor": "statement_descriptor8", "card": { "number": "number6", - "holder_name": "holder_name4", - "exp_month": 70, - "exp_year": 226, - "cvv": "cvv6" + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id0", - "card_token": "card_token4" + "card_id": "card_id4", + "card_token": "card_token2" }, "debit_card": { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor4", "card": { - "number": "number8", - "holder_name": "holder_name0", - "exp_month": 252, - "exp_year": 44, - "cvv": "cvv2" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id6", - "card_token": "card_token0", + "card_id": "card_id0", + "card_token": "card_token6", "recurrence": false }, "boleto": { - "retries": 218, - "bank": "bank4", - "instructions": "instructions4", + "retries": 226, + "bank": "bank8", + "instructions": "instructions2", "due_at": "2016-03-13T12:52:32.123Z", "billing_address": { "street": "street8", @@ -70,29 +70,29 @@ Request for creating a Setup for a subscription. The setup is an order that will "line_1": "line_18", "line_2": "line_26" }, - "billing_address_id": "billing_address_id2", - "nosso_numero": "nosso_numero6", - "document_number": "document_number0", - "statement_descriptor": "statement_descriptor6", + "billing_address_id": "billing_address_id6", + "nosso_numero": "nosso_numero0", + "document_number": "document_number6", + "statement_descriptor": "statement_descriptor0", "interest": { - "days": 168, - "type": "type6", - "amount": 242 + "days": 156, + "type": "type0", + "amount": 230 } }, "currency": "currency6", "voucher": { - "statement_descriptor": "statement_descriptor6", + "statement_descriptor": "statement_descriptor2", "card_id": "card_id8", - "card_token": "card_token4", + "card_token": "card_token8", "Card": { - "number": "number4", - "holder_name": "holder_name2", - "exp_month": 214, - "exp_year": 254, - "cvv": "cvv4" + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 240, + "exp_year": 56, + "cvv": "cvv8" }, - "recurrency_cycle": "recurrency_cycle0" + "recurrency_cycle": "recurrency_cycle6" } } } diff --git a/doc/models/create-shipping-request.md b/doc/models/create-shipping-request.md index c13e8ab..e182fc4 100644 --- a/doc/models/create-shipping-request.md +++ b/doc/models/create-shipping-request.md @@ -25,11 +25,11 @@ Shipping data ```json { - "amount": 46, - "description": "description0", - "recipient_name": "recipient_name8", - "recipient_phone": "recipient_phone2", - "address_id": "address_id0", + "amount": 136, + "description": "description4", + "recipient_name": "recipient_name4", + "recipient_phone": "recipient_phone8", + "address_id": "address_id4", "address": { "street": "street6", "number": "number4", @@ -49,7 +49,7 @@ Shipping data }, "max_delivery_date": "2016-03-13T12:52:32.123Z", "estimated_delivery_date": "2016-03-13T12:52:32.123Z", - "type": "type0" + "type": "type4" } ``` diff --git a/doc/models/create-split-request.md b/doc/models/create-split-request.md index c14a11b..c803157 100644 --- a/doc/models/create-split-request.md +++ b/doc/models/create-split-request.md @@ -21,15 +21,15 @@ Split ```json { - "type": "type0", - "amount": 46, - "recipient_id": "recipient_id0", + "type": "type6", + "amount": 100, + "recipient_id": "recipient_id6", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id2" + "split_rule_id": "split_rule_id8" } ``` diff --git a/doc/models/create-sub-merchant-request.md b/doc/models/create-sub-merchant-request.md index 7839aca..02a6135 100644 --- a/doc/models/create-sub-merchant-request.md +++ b/doc/models/create-sub-merchant-request.md @@ -24,16 +24,17 @@ SubMerchant ```json { - "payment_facilitator_code": "payment_facilitator_code6", - "code": "code8", - "name": "name0", - "merchant_category_code": "merchant_category_code0", - "document": "document6", - "type": "type0", + "payment_facilitator_code": "payment_facilitator_code2", + "code": "code2", + "name": "name4", + "merchant_category_code": "merchant_category_code6", + "document": "document2", + "type": "type6", "phone": { "country_code": "country_code0", "number": "number8", - "area_code": "area_code0" + "area_code": "area_code0", + "Type": "Type0" }, "address": { "street": "street6", diff --git a/doc/models/create-subscription-boleto-request.md b/doc/models/create-subscription-boleto-request.md index 9fa52dc..dea592d 100644 --- a/doc/models/create-subscription-boleto-request.md +++ b/doc/models/create-subscription-boleto-request.md @@ -29,7 +29,7 @@ Information about fines and interest on the "boleto" used from payment "type": "type2", "amount": 212 }, - "max_days_to_pay_past_due": 122 + "max_days_to_pay_past_due": 22 } ``` diff --git a/doc/models/create-subscription-item-request.md b/doc/models/create-subscription-item-request.md index cf3a611..9076fc2 100644 --- a/doc/models/create-subscription-item-request.md +++ b/doc/models/create-subscription-item-request.md @@ -30,22 +30,22 @@ Request for creating a new subscription item "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 120, - "price": 58, - "end_quantity": 128, - "overage_price": 142 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 121, - "price": 59, - "end_quantity": 129, - "overage_price": 143 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, @@ -56,17 +56,17 @@ Request for creating a new subscription item "plan_item_id": "plan_item_id0", "discounts": [ { - "value": 10.23, - "discount_type": "discount_type9", - "item_id": "item_id1", - "cycles": 233, - "description": "description1" + "value": 90.66, + "discount_type": "discount_type2", + "item_id": "item_id4", + "cycles": 126, + "description": "description4" } ], "name": "name0", - "cycles": 168, - "quantity": 68, - "minimum_price": 176 + "cycles": 106, + "quantity": 130, + "minimum_price": 114 } ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 40873d6..cc1e234 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -64,7 +64,9 @@ Request for creating a subcription "country": "country0", "complement": "complement2", "metadata": { - "key0": "metadata3" + "key0": "metadata3", + "key1": "metadata2", + "key2": "metadata1" }, "line_1": "line_10", "line_2": "line_24" @@ -74,14 +76,16 @@ Request for creating a subcription }, "phones": { "home_phone": { - "country_code": "country_code2", - "number": "number0", - "area_code": "area_code2" + "country_code": "country_code0", + "number": "number2", + "area_code": "area_code0", + "Type": "Type0" }, "mobile_phone": { - "country_code": "country_code8", - "number": "number4", - "area_code": "area_code8" + "country_code": "country_code0", + "number": "number8", + "area_code": "area_code0", + "Type": "Type0" } }, "code": "code8", @@ -96,34 +100,34 @@ Request for creating a subcription "exp_year": 68, "cvv": "cvv4" }, - "code": "code8", - "payment_method": "payment_method0", - "billing_type": "billing_type6", - "statement_descriptor": "statement_descriptor0", - "description": "description0", - "currency": "currency0", - "interval": "interval2", - "interval_count": 82, + "code": "code0", + "payment_method": "payment_method8", + "billing_type": "billing_type4", + "statement_descriptor": "statement_descriptor2", + "description": "description8", + "currency": "currency2", + "interval": "interval0", + "interval_count": 220, "pricing_scheme": { "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 120, - "price": 58, - "end_quantity": 128, - "overage_price": 142 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 121, - "price": 59, - "end_quantity": 129, - "overage_price": 143 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, @@ -132,48 +136,48 @@ Request for creating a subcription }, "items": [ { - "description": "description7", + "description": "description2", "pricing_scheme": { - "scheme_type": "scheme_type1", + "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 60, - "price": 2, - "end_quantity": 68, - "overage_price": 82 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 61, - "price": 1, - "end_quantity": 69, - "overage_price": 83 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 62, - "price": 0, - "end_quantity": 70, - "overage_price": 84 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], - "price": 149, - "minimum_price": 53, - "percentage": 25.89 + "price": 166, + "minimum_price": 6, + "percentage": 251.76 }, - "id": "id7", - "plan_item_id": "plan_item_id7", + "id": "id8", + "plan_item_id": "plan_item_id8", "discounts": [ { - "value": 236.1, - "discount_type": "discount_type6", - "item_id": "item_id8", - "cycles": 82, - "description": "description8" + "value": 90.66, + "discount_type": "discount_type2", + "item_id": "item_id4", + "cycles": 126, + "description": "description4" } ], - "name": "name7", - "cycles": 109, - "quantity": 127, - "minimum_price": 117 + "name": "name8", + "cycles": 214, + "quantity": 22, + "minimum_price": 222 } ], "shipping": { @@ -183,19 +187,21 @@ Request for creating a subcription "recipient_phone": "recipient_phone6", "address_id": "address_id6", "address": { - "street": "street0", - "number": "number8", - "zip_code": "zip_code4", - "neighborhood": "neighborhood6", - "city": "city0", - "state": "state6", - "country": "country4", - "complement": "complement6", + "street": "street6", + "number": "number4", + "zip_code": "zip_code0", + "neighborhood": "neighborhood2", + "city": "city6", + "state": "state2", + "country": "country0", + "complement": "complement2", "metadata": { - "key0": "metadata7" + "key0": "metadata3", + "key1": "metadata2", + "key2": "metadata1" }, - "line_1": "line_14", - "line_2": "line_28" + "line_1": "line_10", + "line_2": "line_24" }, "max_delivery_date": "2016-03-13T12:52:32.123Z", "estimated_delivery_date": "2016-03-13T12:52:32.123Z", @@ -203,110 +209,107 @@ Request for creating a subcription }, "discounts": [ { - "value": 10.23, - "discount_type": "discount_type9", - "item_id": "item_id1", - "cycles": 233, - "description": "description1" + "value": 90.66, + "discount_type": "discount_type2", + "item_id": "item_id4", + "cycles": 126, + "description": "description4" } ], "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata1" }, "increments": [ { - "value": 124.19, - "increment_type": "increment_type9", - "item_id": "item_id3", - "cycles": 101, - "description": "description3" + "value": 252.86, + "increment_type": "increment_type6", + "item_id": "item_id6", + "cycles": 34, + "description": "description4" } ], "setup": { "amount": 110, "description": "description4", "payment": { - "payment_method": "payment_method8", + "payment_method": "payment_method4", "credit_card": { - "installments": 228, - "statement_descriptor": "statement_descriptor0", + "installments": 52, + "statement_descriptor": "statement_descriptor8", "card": { - "number": "number2", - "holder_name": "holder_name0", - "exp_month": 134, - "exp_year": 162, - "cvv": "cvv2" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id6", - "card_token": "card_token0" + "card_id": "card_id4", + "card_token": "card_token2" }, "debit_card": { - "statement_descriptor": "statement_descriptor6", + "statement_descriptor": "statement_descriptor4", "card": { - "number": "number2", - "holder_name": "holder_name6", - "exp_month": 60, - "exp_year": 236, - "cvv": "cvv8" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, - "card_id": "card_id2", - "card_token": "card_token4", + "card_id": "card_id0", + "card_token": "card_token6", "recurrence": false }, "boleto": { - "retries": 154, - "bank": "bank0", - "instructions": "instructions0", + "retries": 226, + "bank": "bank8", + "instructions": "instructions2", "due_at": "2016-03-13T12:52:32.123Z", "billing_address": { - "street": "street4", - "number": "number8", - "zip_code": "zip_code8", - "neighborhood": "neighborhood0", - "city": "city6", - "state": "state0", - "country": "country8", - "complement": "complement0", + "street": "street8", + "number": "number4", + "zip_code": "zip_code2", + "neighborhood": "neighborhood4", + "city": "city2", + "state": "state6", + "country": "country2", + "complement": "complement6", "metadata": { - "key0": "metadata9", - "key1": "metadata0", - "key2": "metadata1" + "key0": "metadata5", + "key1": "metadata6" }, - "line_1": "line_12", - "line_2": "line_22" + "line_1": "line_18", + "line_2": "line_26" }, - "billing_address_id": "billing_address_id8", - "nosso_numero": "nosso_numero2", - "document_number": "document_number4", - "statement_descriptor": "statement_descriptor2", + "billing_address_id": "billing_address_id6", + "nosso_numero": "nosso_numero0", + "document_number": "document_number6", + "statement_descriptor": "statement_descriptor0", "interest": { - "days": 232, - "type": "type2", - "amount": 50 + "days": 156, + "type": "type0", + "amount": 230 } }, - "currency": "currency2", + "currency": "currency6", "voucher": { - "statement_descriptor": "statement_descriptor0", - "card_id": "card_id4", - "card_token": "card_token0", + "statement_descriptor": "statement_descriptor2", + "card_id": "card_id8", + "card_token": "card_token8", "Card": { "number": "number8", "holder_name": "holder_name6", - "exp_month": 22, - "exp_year": 62, + "exp_month": 240, + "exp_year": 56, "cvv": "cvv8" }, - "recurrency_cycle": "recurrency_cycle4" + "recurrency_cycle": "recurrency_cycle6" } } }, - "plan_id": "plan_id8", - "customer_id": "customer_id8", - "card_id": "card_id4", - "billing_day": 34 + "plan_id": "plan_id4", + "customer_id": "customer_id0", + "card_id": "card_id2", + "billing_day": 152 } ``` diff --git a/doc/models/create-subscription-split-request.md b/doc/models/create-subscription-split-request.md index c88a945..727840d 100644 --- a/doc/models/create-subscription-split-request.md +++ b/doc/models/create-subscription-split-request.md @@ -19,15 +19,15 @@ "enabled": false, "rules": [ { - "type": "type6", - "amount": 210, - "recipient_id": "recipient_id6", + "type": "type2", + "amount": 118, + "recipient_id": "recipient_id2", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id6" + "split_rule_id": "split_rule_id0" } ] } diff --git a/doc/models/create-three-d-secure-request.md b/doc/models/create-three-d-secure-request.md index 0e57819..01cd6b0 100644 --- a/doc/models/create-three-d-secure-request.md +++ b/doc/models/create-three-d-secure-request.md @@ -23,12 +23,12 @@ Creates a 3D-S authentication payment ```json { - "mpi": "mpi2", - "cavv": "cavv4", - "eci": "eci0", - "transaction_id": "transaction_id8", - "success_url": "success_url2", - "ds_transaction_id": "ds_transaction_id8" + "mpi": "mpi4", + "cavv": "cavv2", + "eci": "eci6", + "transaction_id": "transaction_id4", + "success_url": "success_url8", + "ds_transaction_id": "ds_transaction_id4" } ``` diff --git a/doc/models/create-transaction-report-file-request.md b/doc/models/create-transaction-report-file-request.md index 99980bc..58c76bd 100644 --- a/doc/models/create-transaction-report-file-request.md +++ b/doc/models/create-transaction-report-file-request.md @@ -17,9 +17,9 @@ ```json { - "name": "name0", + "name": "name6", "start_at": "2016-03-13T12:52:32.123Z", - "end_at": "end_at0" + "end_at": "end_at6" } ``` diff --git a/doc/models/create-transfer-request.md b/doc/models/create-transfer-request.md index d05ecec..d6b8ec0 100644 --- a/doc/models/create-transfer-request.md +++ b/doc/models/create-transfer-request.md @@ -18,11 +18,11 @@ Request for creating a transfer ```json { - "amount": 46, + "amount": 148, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7", + "key1": "metadata8", + "key2": "metadata9" } } ``` diff --git a/doc/models/create-transfer-settings-request.md b/doc/models/create-transfer-settings-request.md index 320c5c0..9a173aa 100644 --- a/doc/models/create-transfer-settings-request.md +++ b/doc/models/create-transfer-settings-request.md @@ -20,8 +20,8 @@ Informações de transferência do recebedor ```json { "transfer_enabled": false, - "transfer_interval": "transfer_interval0", - "transfer_day": 18 + "transfer_interval": "transfer_interval4", + "transfer_day": 82 } ``` diff --git a/doc/models/create-transfer.md b/doc/models/create-transfer.md index a0adff9..d7e0470 100644 --- a/doc/models/create-transfer.md +++ b/doc/models/create-transfer.md @@ -18,13 +18,12 @@ ```json { - "amount": 46, + "amount": 252, "source_id": "source_id6", - "target_id": "target_id0", + "target_id": "target_id8", "metadata": [ - "metadata3", - "metadata4", - "metadata5" + "metadata1", + "metadata2" ] } ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 1fc49fa..93cf123 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -22,12 +22,12 @@ Request for creating a usage ```json { - "quantity": 68, - "description": "description0", + "quantity": 224, + "description": "description8", "used_at": "2016-03-13T12:52:32.123Z", - "code": "code8", - "group": "group8", - "amount": 46 + "code": "code0", + "group": "group0", + "amount": 110 } ``` diff --git a/doc/models/create-voucher-payment-request.md b/doc/models/create-voucher-payment-request.md index 75e22cd..7894f40 100644 --- a/doc/models/create-voucher-payment-request.md +++ b/doc/models/create-voucher-payment-request.md @@ -23,7 +23,7 @@ The settings for creating a voucher payment { "recurrency_cycle": "\"first\" or \"subsequent\"", "statement_descriptor": "statement_descriptor0", - "card_id": "card_id4", + "card_id": "card_id6", "card_token": "card_token0", "Card": { "number": "number8", diff --git a/doc/models/create-withdraw-request.md b/doc/models/create-withdraw-request.md index d15d3bb..9e23301 100644 --- a/doc/models/create-withdraw-request.md +++ b/doc/models/create-withdraw-request.md @@ -16,11 +16,10 @@ ```json { - "amount": 46, + "amount": 204, "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7", + "key1": "metadata6" } } ``` diff --git a/doc/models/error-exception.md b/doc/models/error-exception.md index f2af59e..048ac51 100644 --- a/doc/models/error-exception.md +++ b/doc/models/error-exception.md @@ -19,7 +19,7 @@ Api Error Exception ```json { - "message": "message0", + "message": "message4", "errors": { "key1": "val1", "key2": "val2" diff --git a/doc/models/get-access-token-response.md b/doc/models/get-access-token-response.md index ce89d00..e60e492 100644 --- a/doc/models/get-access-token-response.md +++ b/doc/models/get-access-token-response.md @@ -23,7 +23,7 @@ Response object for getting a access token { "id": "id0", "code": "code8", - "status": "status8", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "customer": { "id": "id0", diff --git a/doc/models/get-address-response.md b/doc/models/get-address-response.md index e93aade..4d662a3 100644 --- a/doc/models/get-address-response.md +++ b/doc/models/get-address-response.md @@ -33,11 +33,11 @@ Response object for getting an Address ```json { - "id": "id0", - "street": "street0", - "number": "number2", - "complement": "complement4", - "zip_code": "zip_code4" + "id": "id2", + "street": "street2", + "number": "number0", + "complement": "complement8", + "zip_code": "zip_code6" } ``` diff --git a/doc/models/get-anticipation-limit-response.md b/doc/models/get-anticipation-limit-response.md index 28ce968..d55e2a8 100644 --- a/doc/models/get-anticipation-limit-response.md +++ b/doc/models/get-anticipation-limit-response.md @@ -18,8 +18,8 @@ Anticipation limit ```json { - "amount": 46, - "anticipation_fee": 140 + "amount": 6, + "anticipation_fee": 88 } ``` diff --git a/doc/models/get-anticipation-response.md b/doc/models/get-anticipation-response.md index c55ddd0..ff6c710 100644 --- a/doc/models/get-anticipation-response.md +++ b/doc/models/get-anticipation-response.md @@ -26,9 +26,9 @@ Anticipation ```json { - "id": "id0", - "requested_amount": 246, - "approved_amount": 212, + "id": "id8", + "requested_amount": 130, + "approved_amount": 184, "recipient": { "id": "id8", "name": "name8", diff --git a/doc/models/get-antifraud-response.md b/doc/models/get-antifraud-response.md index f7b41cb..57d410d 100644 --- a/doc/models/get-antifraud-response.md +++ b/doc/models/get-antifraud-response.md @@ -19,11 +19,11 @@ ```json { - "status": "status8", - "return_code": "return_code0", - "return_message": "return_message2", - "provider_name": "provider_name2", - "score": "score0" + "status": "status0", + "return_code": "return_code8", + "return_message": "return_message6", + "provider_name": "provider_name6", + "score": "score8" } ``` diff --git a/doc/models/get-automatic-anticipation-response.md b/doc/models/get-automatic-anticipation-response.md index c85017f..74b49ab 100644 --- a/doc/models/get-automatic-anticipation-response.md +++ b/doc/models/get-automatic-anticipation-response.md @@ -20,13 +20,11 @@ ```json { "enabled": false, - "type": "type0", - "volume_percentage": 62, - "delay": 228, + "type": "type8", + "volume_percentage": 178, + "delay": 112, "days": [ - 188, - 189, - 190 + 88 ] } ``` diff --git a/doc/models/get-balance-operation-response.md b/doc/models/get-balance-operation-response.md index b00732d..5e701ed 100644 --- a/doc/models/get-balance-operation-response.md +++ b/doc/models/get-balance-operation-response.md @@ -26,9 +26,9 @@ Generic response object for getting a BalanceOperation. ```json { "id": "id0", - "status": "status8", + "status": "status2", "balance_amount": "balance_amount0", - "balance_old_amount": "balance_old_amount2", + "balance_old_amount": "balance_old_amount8", "type": "type0" } ``` diff --git a/doc/models/get-balance-response.md b/doc/models/get-balance-response.md index fbbdf40..22c05bd 100644 --- a/doc/models/get-balance-response.md +++ b/doc/models/get-balance-response.md @@ -21,8 +21,8 @@ Balance ```json { - "currency": "currency0", - "available_amount": 182, + "currency": "currency2", + "available_amount": 96, "recipient": { "id": "id8", "name": "name8", @@ -30,8 +30,8 @@ Balance "document": "document8", "description": "description2" }, - "transferred_amount": 228, - "waiting_funds_amount": 252 + "transferred_amount": 142, + "waiting_funds_amount": 174 } ``` diff --git a/doc/models/get-bank-account-response.md b/doc/models/get-bank-account-response.md index daab231..1a6744d 100644 --- a/doc/models/get-bank-account-response.md +++ b/doc/models/get-bank-account-response.md @@ -30,11 +30,11 @@ ```json { - "id": "id0", - "holder_name": "holder_name4", - "holder_type": "holder_type2", - "bank": "bank8", - "branch_number": "branch_number6" + "id": "id6", + "holder_name": "holder_name2", + "holder_type": "holder_type8", + "bank": "bank4", + "branch_number": "branch_number2" } ``` diff --git a/doc/models/get-bank-transfer-transaction-response.md b/doc/models/get-bank-transfer-transaction-response.md index 8fe9370..87dec06 100644 --- a/doc/models/get-bank-transfer-transaction-response.md +++ b/doc/models/get-bank-transfer-transaction-response.md @@ -25,17 +25,16 @@ Response object for getting a bank transfer transaction ```json { - "gateway_id": "gateway_id2", - "amount": 244, - "status": "status0", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "bank_transfer", - "url": "url4", - "bank_tid": "bank_tid4", - "bank": "bank8", + "url": "url2", + "bank_tid": "bank_tid2", + "bank": "bank6", "paid_at": "2016-03-13T12:52:32.123Z", - "paid_amount": 210 + "paid_amount": 176 } ``` diff --git a/doc/models/get-billing-address-response.md b/doc/models/get-billing-address-response.md index 265522f..41e239a 100644 --- a/doc/models/get-billing-address-response.md +++ b/doc/models/get-billing-address-response.md @@ -26,11 +26,11 @@ Response object for getting a billing address ```json { - "street": "street0", + "street": "street4", "number": "number2", - "zip_code": "zip_code4", - "neighborhood": "neighborhood6", - "city": "city0" + "zip_code": "zip_code8", + "neighborhood": "neighborhood0", + "city": "city4" } ``` diff --git a/doc/models/get-boleto-transaction-response.md b/doc/models/get-boleto-transaction-response.md index 199f602..a55ebe3 100644 --- a/doc/models/get-boleto-transaction-response.md +++ b/doc/models/get-boleto-transaction-response.md @@ -37,17 +37,16 @@ Response object for getting a boleto transaction ```json { - "gateway_id": "gateway_id4", - "amount": 250, - "status": "status2", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "boleto", - "url": "url4", - "barcode": "barcode0", - "nosso_numero": "nosso_numero0", - "bank": "bank8", - "document_number": "document_number6" + "url": "url0", + "barcode": "barcode4", + "nosso_numero": "nosso_numero6", + "bank": "bank4", + "document_number": "document_number0" } ``` diff --git a/doc/models/get-card-response.md b/doc/models/get-card-response.md index a6faf90..dc5249b 100644 --- a/doc/models/get-card-response.md +++ b/doc/models/get-card-response.md @@ -33,11 +33,11 @@ Response object for getting a credit card ```json { - "id": "id0", - "last_four_digits": "last_four_digits6", - "brand": "brand4", - "holder_name": "holder_name4", - "exp_month": 42 + "id": "id4", + "last_four_digits": "last_four_digits0", + "brand": "brand8", + "holder_name": "holder_name0", + "exp_month": 52 } ``` diff --git a/doc/models/get-card-token-response.md b/doc/models/get-card-token-response.md index d40c3fc..38cf862 100644 --- a/doc/models/get-card-token-response.md +++ b/doc/models/get-card-token-response.md @@ -24,11 +24,11 @@ Card token data ```json { - "last_four_digits": "last_four_digits6", - "holder_name": "holder_name4", + "last_four_digits": "last_four_digits8", + "holder_name": "holder_name8", "holder_document": "holder_document6", - "exp_month": 42, - "exp_year": 254 + "exp_month": 168, + "exp_year": 128 } ``` diff --git a/doc/models/get-cash-transaction-response.md b/doc/models/get-cash-transaction-response.md index e3b8098..4116d43 100644 --- a/doc/models/get-cash-transaction-response.md +++ b/doc/models/get-cash-transaction-response.md @@ -21,12 +21,11 @@ Response object for getting a cash transaction ```json { - "gateway_id": "gateway_id0", - "amount": 226, - "status": "status2", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "cash", "description": "description0" } ``` diff --git a/doc/models/get-charge-response.md b/doc/models/get-charge-response.md index 09528a6..b1dd0de 100644 --- a/doc/models/get-charge-response.md +++ b/doc/models/get-charge-response.md @@ -41,8 +41,8 @@ Response object for getting a charge "id": "id0", "code": "code8", "gateway_id": "gateway_id0", - "amount": 46, - "status": "status8" + "amount": 164, + "status": "status2" } ``` diff --git a/doc/models/get-charges-summary-response.md b/doc/models/get-charges-summary-response.md index 14f1fb9..6a01377 100644 --- a/doc/models/get-charges-summary-response.md +++ b/doc/models/get-charges-summary-response.md @@ -15,7 +15,7 @@ ```json { - "total": 10 + "total": 150 } ``` diff --git a/doc/models/get-checkout-bank-transfer-payment-response.md b/doc/models/get-checkout-bank-transfer-payment-response.md index 283cdb1..a25e785 100644 --- a/doc/models/get-checkout-bank-transfer-payment-response.md +++ b/doc/models/get-checkout-bank-transfer-payment-response.md @@ -18,7 +18,8 @@ Bank transfer checkout response ```json { "bank": [ - "bank7" + "bank3", + "bank4" ] } ``` diff --git a/doc/models/get-checkout-boleto-payment-response.md b/doc/models/get-checkout-boleto-payment-response.md index eb732ba..8256ba6 100644 --- a/doc/models/get-checkout-boleto-payment-response.md +++ b/doc/models/get-checkout-boleto-payment-response.md @@ -17,7 +17,7 @@ ```json { "due_at": "2016-03-13T12:52:32.123Z", - "instructions": "instructions2" + "instructions": "instructions8" } ``` diff --git a/doc/models/get-checkout-card-installment-options-response.md b/doc/models/get-checkout-card-installment-options-response.md index 6ba1fb1..32b2e31 100644 --- a/doc/models/get-checkout-card-installment-options-response.md +++ b/doc/models/get-checkout-card-installment-options-response.md @@ -16,8 +16,8 @@ ```json { - "number": "number2", - "total": 10 + "number": "number0", + "total": 188 } ``` diff --git a/doc/models/get-checkout-credit-card-payment-response.md b/doc/models/get-checkout-credit-card-payment-response.md index 559aed5..6b21837 100644 --- a/doc/models/get-checkout-credit-card-payment-response.md +++ b/doc/models/get-checkout-credit-card-payment-response.md @@ -17,29 +17,21 @@ ```json { - "statementDescriptor": "statementDescriptor6", + "statementDescriptor": "statementDescriptor8", "installments": [ { - "number": "number3", - "total": 109 - }, - { - "number": "number4", - "total": 110 - }, - { - "number": "number5", - "total": 111 + "number": "number2", + "total": 16 } ], "authentication": { "type": "type2", "threed_secure": { - "mpi": "mpi6", - "eci": "eci6", - "cavv": "cavv2", - "transaction_Id": "transaction_Id8", - "success_url": "success_url8" + "mpi": "mpi0", + "eci": "eci2", + "cavv": "cavv8", + "transaction_Id": "transaction_Id2", + "success_url": "success_url4" } } } diff --git a/doc/models/get-checkout-debit-card-payment-response.md b/doc/models/get-checkout-debit-card-payment-response.md index 441856d..689529b 100644 --- a/doc/models/get-checkout-debit-card-payment-response.md +++ b/doc/models/get-checkout-debit-card-payment-response.md @@ -16,15 +16,15 @@ ```json { - "statement_descriptor": "statement_descriptor0", + "statement_descriptor": "statement_descriptor6", "authentication": { "type": "type2", "threed_secure": { - "mpi": "mpi6", - "eci": "eci6", - "cavv": "cavv2", - "transaction_Id": "transaction_Id8", - "success_url": "success_url8" + "mpi": "mpi0", + "eci": "eci2", + "cavv": "cavv8", + "transaction_Id": "transaction_Id2", + "success_url": "success_url4" } } } diff --git a/doc/models/get-checkout-payment-response.md b/doc/models/get-checkout-payment-response.md index e666c17..b7f9ddb 100644 --- a/doc/models/get-checkout-payment-response.md +++ b/doc/models/get-checkout-payment-response.md @@ -43,11 +43,11 @@ Resposta das configurações de pagamento do checkout ```json { - "id": "id0", - "amount": 46, - "default_payment_method": "default_payment_method0", - "success_url": "success_url2", - "payment_url": "payment_url6" + "id": "id6", + "amount": 148, + "default_payment_method": "default_payment_method6", + "success_url": "success_url8", + "payment_url": "payment_url0" } ``` diff --git a/doc/models/get-checkout-payment-settings-response.md b/doc/models/get-checkout-payment-settings-response.md index 15c1420..5629d82 100644 --- a/doc/models/get-checkout-payment-settings-response.md +++ b/doc/models/get-checkout-payment-settings-response.md @@ -24,14 +24,13 @@ Checkout Payment Settings Response ```json { - "success_url": "success_url2", - "payment_url": "payment_url6", + "success_url": "success_url0", + "payment_url": "payment_url8", "accepted_payment_methods": [ - "accepted_payment_methods3", - "accepted_payment_methods4", - "accepted_payment_methods5" + "accepted_payment_methods1", + "accepted_payment_methods2" ], - "status": "status8", + "status": "status0", "customer": { "id": "id0", "name": "name0", diff --git a/doc/models/get-checkout-pix-payment-response.md b/doc/models/get-checkout-pix-payment-response.md index af65733..da4d9b6 100644 --- a/doc/models/get-checkout-pix-payment-response.md +++ b/doc/models/get-checkout-pix-payment-response.md @@ -21,12 +21,16 @@ Checkout pix payment response "expires_at": "2016-03-13T12:52:32.123Z", "additional_information": [ { - "Name": "Name5", - "Value": "Value7" + "Name": "Name0", + "Value": "Value2" }, { - "Name": "Name6", - "Value": "Value6" + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" } ] } diff --git a/doc/models/get-credit-card-transaction-response.md b/doc/models/get-credit-card-transaction-response.md index f0b0aae..a445c68 100644 --- a/doc/models/get-credit-card-transaction-response.md +++ b/doc/models/get-credit-card-transaction-response.md @@ -34,16 +34,15 @@ Response object for getting a credit card transaction ```json { "gateway_id": "gateway_id8", - "amount": 0, + "amount": 40, "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "credit_card", - "statement_descriptor": "statement_descriptor0", - "acquirer_name": "acquirer_name4", - "acquirer_affiliation_code": "acquirer_affiliation_code8", - "acquirer_tid": "acquirer_tid0", - "acquirer_nsu": "acquirer_nsu0" + "statement_descriptor": "statement_descriptor2", + "acquirer_name": "acquirer_name6", + "acquirer_affiliation_code": "acquirer_affiliation_code6", + "acquirer_tid": "acquirer_tid8", + "acquirer_nsu": "acquirer_nsu8" } ``` diff --git a/doc/models/get-customer-response.md b/doc/models/get-customer-response.md index 25e761f..9155276 100644 --- a/doc/models/get-customer-response.md +++ b/doc/models/get-customer-response.md @@ -31,9 +31,9 @@ Response object for getting a customer ```json { - "id": "id0", - "name": "name0", - "email": "email6", + "id": "id4", + "name": "name4", + "email": "email2", "delinquent": false, "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-debit-card-transaction-response.md b/doc/models/get-debit-card-transaction-response.md index 42ba249..4cb5695 100644 --- a/doc/models/get-debit-card-transaction-response.md +++ b/doc/models/get-debit-card-transaction-response.md @@ -35,12 +35,11 @@ Response object for getting a debit card transaction ```json { - "gateway_id": "gateway_id0", - "amount": 86, - "status": "status8", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "debit_card", "statement_descriptor": "statement_descriptor0", "acquirer_name": "acquirer_name4", "acquirer_affiliation_code": "acquirer_affiliation_code8", diff --git a/doc/models/get-device-response.md b/doc/models/get-device-response.md index 67d3672..788d15b 100644 --- a/doc/models/get-device-response.md +++ b/doc/models/get-device-response.md @@ -17,7 +17,7 @@ Response object for geetting an order device ```json { - "platform": "platform6" + "platform": "platform8" } ``` diff --git a/doc/models/get-discount-response.md b/doc/models/get-discount-response.md index 17163fa..5b9dca1 100644 --- a/doc/models/get-discount-response.md +++ b/doc/models/get-discount-response.md @@ -26,10 +26,10 @@ Response object for getting a discount ```json { - "id": "id0", - "value": 251.52, - "discount_type": "discount_type8", - "status": "status8", + "id": "id4", + "value": 139.66, + "discount_type": "discount_type2", + "status": "status6", "created_at": "2016-03-13T12:52:32.123Z" } ``` diff --git a/doc/models/get-fine-response.md b/doc/models/get-fine-response.md index 369af39..5f0a914 100644 --- a/doc/models/get-fine-response.md +++ b/doc/models/get-fine-response.md @@ -20,8 +20,8 @@ Fine Response ```json { "type": "\"percentage\" or \"flat\"", - "days": 120, - "amount": 46 + "days": 112, + "amount": 186 } ``` diff --git a/doc/models/get-gateway-error-response.md b/doc/models/get-gateway-error-response.md index 748804d..12c0d04 100644 --- a/doc/models/get-gateway-error-response.md +++ b/doc/models/get-gateway-error-response.md @@ -17,7 +17,7 @@ Gateway Response ```json { - "message": "message0" + "message": "message4" } ``` diff --git a/doc/models/get-gateway-recipient-response.md b/doc/models/get-gateway-recipient-response.md index cd5df5b..5279cdf 100644 --- a/doc/models/get-gateway-recipient-response.md +++ b/doc/models/get-gateway-recipient-response.md @@ -21,11 +21,11 @@ Information about the recipient on the gateway ```json { - "gateway": "gateway0", - "status": "status8", - "pgid": "pgid4", - "created_at": "created_at2", - "updated_at": "updated_at4" + "gateway": "gateway2", + "status": "status4", + "pgid": "pgid8", + "created_at": "created_at0", + "updated_at": "updated_at8" } ``` diff --git a/doc/models/get-gateway-response-response.md b/doc/models/get-gateway-response-response.md index 7f34156..1cf7194 100644 --- a/doc/models/get-gateway-response-response.md +++ b/doc/models/get-gateway-response-response.md @@ -18,16 +18,13 @@ The Transaction Gateway Response ```json { - "code": "code8", + "code": "code6", "errors": [ { - "message": "message5" + "message": "message0" }, { - "message": "message6" - }, - { - "message": "message7" + "message": "message0" } ] } diff --git a/doc/models/get-increment-response.md b/doc/models/get-increment-response.md index 4c9d8b2..16607a7 100644 --- a/doc/models/get-increment-response.md +++ b/doc/models/get-increment-response.md @@ -27,9 +27,9 @@ Response object for getting a increment ```json { "id": "id0", - "value": 251.52, - "increment_type": "increment_type8", - "status": "status8", + "value": 167.72, + "increment_type": "increment_type2", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z" } ``` diff --git a/doc/models/get-interest-response.md b/doc/models/get-interest-response.md index 27bb0f7..d95e2e9 100644 --- a/doc/models/get-interest-response.md +++ b/doc/models/get-interest-response.md @@ -20,8 +20,8 @@ Interest Response ```json { "type": "\"percentage\" or \"flat\"", - "days": 120, - "amount": 46 + "days": 114, + "amount": 188 } ``` diff --git a/doc/models/get-invoice-item-response.md b/doc/models/get-invoice-item-response.md index ff0cd3f..c57d7c5 100644 --- a/doc/models/get-invoice-item-response.md +++ b/doc/models/get-invoice-item-response.md @@ -23,29 +23,29 @@ Response object for getting an invoice item ```json { - "amount": 46, - "description": "description0", + "amount": 212, + "description": "description6", "pricing_scheme": { "price": 166, "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 120, - "price": 58, - "end_quantity": 128, - "overage_price": 142 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 }, { - "start_quantity": 121, - "price": 59, - "end_quantity": 129, - "overage_price": 143 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "minimum_price": 6, @@ -57,7 +57,7 @@ Response object for getting an invoice item "end_quantity": 172, "overage_price": 186 }, - "quantity": 68 + "quantity": 70 } ``` diff --git a/doc/models/get-invoice-response.md b/doc/models/get-invoice-response.md index d9b91f9..7a4f967 100644 --- a/doc/models/get-invoice-response.md +++ b/doc/models/get-invoice-response.md @@ -42,7 +42,7 @@ Response object for getting an invoice "id": "id0", "code": "code8", "url": "url4", - "amount": 46, + "amount": 168, "status": "status8" } ``` diff --git a/doc/models/get-movement-object-base-response.md b/doc/models/get-movement-object-base-response.md index f4ea1e4..266d386 100644 --- a/doc/models/get-movement-object-base-response.md +++ b/doc/models/get-movement-object-base-response.md @@ -24,11 +24,15 @@ Generic response object for getting a MovementObjectBase. ```json { - "object": "MovementObject", - "id": "id0", - "status": "status8", - "amount": "amount8", - "created_at": "created_at2" + "id": "id2", + "status": "status4", + "amount": "amount4", + "created_at": "created_at0", + "source_type": "source_type6", + "source_id": "source_id0", + "target_type": "target_type8", + "target_id": "target_id4", + "fee": "fee8" } ``` diff --git a/doc/models/get-movement-object-fee-collection-response.md b/doc/models/get-movement-object-fee-collection-response.md index 542885d..91436ed 100644 --- a/doc/models/get-movement-object-fee-collection-response.md +++ b/doc/models/get-movement-object-fee-collection-response.md @@ -23,14 +23,13 @@ Generic response object for getting a MovementObjectFeeCollection. ```json { - "object": "feeCollection", - "id": "id4", + "id": "id2", "status": "status4", - "amount": "amount6", - "created_at": "created_at2", - "description": "description0", - "payment_date": "payment_date8", - "recipient_id": "recipient_id0" + "amount": "amount4", + "created_at": "created_at0", + "description": "description4", + "payment_date": "payment_date4", + "recipient_id": "recipient_id6" } ``` diff --git a/doc/models/get-movement-object-payable-response.md b/doc/models/get-movement-object-payable-response.md index a4a5d24..b2d92ea 100644 --- a/doc/models/get-movement-object-payable-response.md +++ b/doc/models/get-movement-object-payable-response.md @@ -33,26 +33,25 @@ ```json { - "object": "payable", - "id": "id0", - "status": "status2", - "amount": "amount2", - "created_at": "created_at8", + "id": "id2", + "status": "status4", + "amount": "amount4", + "created_at": "created_at0", "fee": "fee2", - "anticipation_fee": "anticipation_fee8", - "fraud_coverage_fee": "fraud_coverage_fee2", + "anticipation_fee": "anticipation_fee2", + "fraud_coverage_fee": "fraud_coverage_fee8", "installment": "installment8", "split_id": "split_id2", - "bulk_anticipation_id": "bulk_anticipation_id4", + "bulk_anticipation_id": "bulk_anticipation_id6", "anticipation_id": "anticipation_id0", "recipient_id": "recipient_id0", - "originator_model": "originator_model4", - "originator_model_id": "originator_model_id4", - "payment_date": "payment_date8", - "original_payment_date": "original_payment_date8", + "originator_model": "originator_model6", + "originator_model_id": "originator_model_id6", + "payment_date": "payment_date2", + "original_payment_date": "original_payment_date2", "payment_method": "payment_method0", - "accrual_at": "accrual_at8", - "liquidation_arrangement_id": "liquidation_arrangement_id6" + "accrual_at": "accrual_at2", + "liquidation_arrangement_id": "liquidation_arrangement_id4" } ``` diff --git a/doc/models/get-movement-object-refund-response.md b/doc/models/get-movement-object-refund-response.md index 15e4397..96b6f71 100644 --- a/doc/models/get-movement-object-refund-response.md +++ b/doc/models/get-movement-object-refund-response.md @@ -25,16 +25,15 @@ Generic response object for getting a MovementObjectRefund. ```json { - "object": "refund", "id": "id2", "status": "status4", "amount": "amount4", "created_at": "created_at0", - "fraud_coverage_fee": "fraud_coverage_fee2", - "charge_fee_recipient_id": "charge_fee_recipient_id4", - "bank_account_id": "bank_account_id0", - "local_transaction_id": "local_transaction_id6", - "updated_at": "updated_at4" + "fraud_coverage_fee": "fraud_coverage_fee0", + "charge_fee_recipient_id": "charge_fee_recipient_id2", + "bank_account_id": "bank_account_id2", + "local_transaction_id": "local_transaction_id8", + "updated_at": "updated_at8" } ``` diff --git a/doc/models/get-movement-object-transfer-response.md b/doc/models/get-movement-object-transfer-response.md index 933cc11..4a06034 100644 --- a/doc/models/get-movement-object-transfer-response.md +++ b/doc/models/get-movement-object-transfer-response.md @@ -26,16 +26,15 @@ ```json { - "object": "transfer", - "id": "id6", - "status": "status2", - "amount": "amount8", - "created_at": "created_at4", - "source_type": "source_type0", - "source_id": "source_id6", - "target_type": "target_type2", - "target_id": "target_id0", - "fee": "fee2" + "id": "id2", + "status": "status4", + "amount": "amount4", + "created_at": "created_at0", + "source_type": "source_type6", + "source_id": "source_id0", + "target_type": "target_type8", + "target_id": "target_id4", + "fee": "fee8" } ``` diff --git a/doc/models/get-order-item-response.md b/doc/models/get-order-item-response.md index 7f5a663..5549893 100644 --- a/doc/models/get-order-item-response.md +++ b/doc/models/get-order-item-response.md @@ -12,21 +12,25 @@ Response object for getting an order item | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | Id | getId(): ?string | setId(?string id): void | -| `amount` | `?int` | Optional | - | getAmount(): ?int | setAmount(?int amount): void | +| `type` | `?string` | Optional | - | getType(): ?string | setType(?string type): void | | `description` | `?string` | Optional | - | getDescription(): ?string | setDescription(?string description): void | +| `amount` | `?int` | Optional | - | getAmount(): ?int | setAmount(?int amount): void | | `quantity` | `?int` | Optional | - | getQuantity(): ?int | setQuantity(?int quantity): void | | `category` | `?string` | Optional | Category | getCategory(): ?string | setCategory(?string category): void | | `code` | `?string` | Optional | Code | getCode(): ?string | setCode(?string code): void | +| `status` | `?string` | Optional | - | getStatus(): ?string | setStatus(?string status): void | +| `createdAt` | `?DateTime` | Optional | - | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | +| `updatedAt` | `?DateTime` | Optional | - | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | ## Example (as JSON) ```json { - "id": "id0", - "amount": 46, - "description": "description0", - "quantity": 68, - "category": "category2" + "id": "id8", + "type": "type8", + "description": "description8", + "amount": 224, + "quantity": 82 } ``` diff --git a/doc/models/get-order-response.md b/doc/models/get-order-response.md index 0e2be25..7640c6c 100644 --- a/doc/models/get-order-response.md +++ b/doc/models/get-order-response.md @@ -13,12 +13,15 @@ Response object for getting an Order | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | - | getId(): ?string | setId(?string id): void | | `code` | `?string` | Optional | - | getCode(): ?string | setCode(?string code): void | +| `amount` | `?int` | Optional | - | getAmount(): ?int | setAmount(?int amount): void | | `currency` | `?string` | Optional | - | getCurrency(): ?string | setCurrency(?string currency): void | +| `closed` | `?bool` | Optional | Indicates whether the order is closed | getClosed(): ?bool | setClosed(?bool closed): void | | `items` | [`?(GetOrderItemResponse[])`](../../doc/models/get-order-item-response.md) | Optional | - | getItems(): ?array | setItems(?array items): void | | `customer` | [`?GetCustomerResponse`](../../doc/models/get-customer-response.md) | Optional | - | getCustomer(): ?GetCustomerResponse | setCustomer(?GetCustomerResponse customer): void | | `status` | `?string` | Optional | - | getStatus(): ?string | setStatus(?string status): void | | `createdAt` | `?DateTime` | Optional | - | getCreatedAt(): ?\DateTime | setCreatedAt(?\DateTime createdAt): void | | `updatedAt` | `?DateTime` | Optional | - | getUpdatedAt(): ?\DateTime | setUpdatedAt(?\DateTime updatedAt): void | +| `closedAt` | `?DateTime` | Optional | - | getClosedAt(): ?\DateTime | setClosedAt(?\DateTime closedAt): void | | `charges` | [`?(GetChargeResponse[])`](../../doc/models/get-charge-response.md) | Optional | - | getCharges(): ?array | setCharges(?array charges): void | | `invoiceUrl` | `?string` | Optional | - | getInvoiceUrl(): ?string | setInvoiceUrl(?string invoiceUrl): void | | `shipping` | [`?GetShippingResponse`](../../doc/models/get-shipping-response.md) | Optional | - | getShipping(): ?GetShippingResponse | setShipping(?GetShippingResponse shipping): void | @@ -28,38 +31,16 @@ Response object for getting an Order | `sessionId` | `?string` | Optional | Session id | getSessionId(): ?string | setSessionId(?string sessionId): void | | `location` | [`?GetLocationResponse`](../../doc/models/get-location-response.md) | Optional | Location | getLocation(): ?GetLocationResponse | setLocation(?GetLocationResponse location): void | | `device` | [`?GetDeviceResponse`](../../doc/models/get-device-response.md) | Optional | Device's informations | getDevice(): ?GetDeviceResponse | setDevice(?GetDeviceResponse device): void | -| `closed` | `?bool` | Optional | Indicates whether the order is closed | getClosed(): ?bool | setClosed(?bool closed): void | ## Example (as JSON) ```json { - "id": "id0", - "code": "code8", - "currency": "currency0", - "items": [ - { - "id": "id7", - "amount": 13, - "description": "description7", - "quantity": 127, - "category": "category5" - }, - { - "id": "id8", - "amount": 14, - "description": "description8", - "quantity": 128, - "category": "category6" - } - ], - "customer": { - "id": "id0", - "name": "name0", - "email": "email6", - "delinquent": false, - "created_at": "2016-03-13T12:52:32.123Z" - } + "id": "id6", + "code": "code4", + "amount": 64, + "currency": "currency6", + "closed": false } ``` diff --git a/doc/models/get-payable-response.md b/doc/models/get-payable-response.md index afccee7..6dd2ad1 100644 --- a/doc/models/get-payable-response.md +++ b/doc/models/get-payable-response.md @@ -38,11 +38,11 @@ Response object for getting an payable ```json { - "id": 112, + "id": 134, "status": "status8", - "amount": 46, - "fee": 168, - "anticipation_fee": 140 + "amount": 24, + "fee": 190, + "anticipation_fee": 118 } ``` diff --git a/doc/models/get-payment-authentication-response.md b/doc/models/get-payment-authentication-response.md index aad2d1d..3e8930b 100644 --- a/doc/models/get-payment-authentication-response.md +++ b/doc/models/get-payment-authentication-response.md @@ -18,7 +18,7 @@ Payment Authentication response ```json { - "type": "type0", + "type": "type2", "threed_secure": { "mpi": "mpi0", "eci": "eci2", diff --git a/doc/models/get-phone-response.md b/doc/models/get-phone-response.md index 7f08a15..5062cc5 100644 --- a/doc/models/get-phone-response.md +++ b/doc/models/get-phone-response.md @@ -17,9 +17,9 @@ ```json { - "country_code": "country_code0", - "number": "number2", - "area_code": "area_code0" + "country_code": "country_code6", + "number": "number4", + "area_code": "area_code6" } ``` diff --git a/doc/models/get-pix-bank-account-response.md b/doc/models/get-pix-bank-account-response.md index a330220..8ecb5d6 100644 --- a/doc/models/get-pix-bank-account-response.md +++ b/doc/models/get-pix-bank-account-response.md @@ -20,10 +20,10 @@ Payer's bank details. ```json { - "bank_name": "bank_name4", - "ispb": "ispb4", - "branch_code": "branch_code8", - "account_number": "account_number0" + "bank_name": "bank_name0", + "ispb": "ispb8", + "branch_code": "branch_code2", + "account_number": "account_number4" } ``` diff --git a/doc/models/get-pix-payer-response.md b/doc/models/get-pix-payer-response.md index c93a8da..46fe9d3 100644 --- a/doc/models/get-pix-payer-response.md +++ b/doc/models/get-pix-payer-response.md @@ -21,7 +21,7 @@ Pix payer data. ```json { "name": "name0", - "document": "document6", + "document": "document4", "document_type": "document_type8", "bank_account": { "bank_name": "bank_name0", diff --git a/doc/models/get-pix-transaction-response.md b/doc/models/get-pix-transaction-response.md index 9ed29aa..ddb4ab5 100644 --- a/doc/models/get-pix-transaction-response.md +++ b/doc/models/get-pix-transaction-response.md @@ -27,26 +27,25 @@ Response object when getting a pix transaction ```json { - "gateway_id": "gateway_id6", - "amount": 190, - "status": "status4", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "pix", - "qr_code": "qr_code6", - "qr_code_url": "qr_code_url2", + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", "expires_at": "2016-03-13T12:52:32.123Z", "additional_information": [ { - "Name": "Name5", - "Value": "Value7" + "Name": "Name0", + "Value": "Value2" }, { - "Name": "Name6", - "Value": "Value6" + "Name": "Name0", + "Value": "Value2" } ], - "end_to_end_id": "end_to_end_id0" + "end_to_end_id": "end_to_end_id6" } ``` diff --git a/doc/models/get-plan-item-response.md b/doc/models/get-plan-item-response.md index 29b39a2..4345b98 100644 --- a/doc/models/get-plan-item-response.md +++ b/doc/models/get-plan-item-response.md @@ -27,9 +27,9 @@ Response object for getting a plan item ```json { - "id": "id0", - "name": "name0", - "status": "status8", + "id": "id8", + "name": "name8", + "status": "status0", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-price-bracket-response.md b/doc/models/get-price-bracket-response.md index ae36812..267bac9 100644 --- a/doc/models/get-price-bracket-response.md +++ b/doc/models/get-price-bracket-response.md @@ -20,10 +20,10 @@ Response object for getting a price bracket ```json { - "start_quantity": 46, - "price": 16, - "end_quantity": 54, - "overage_price": 68 + "start_quantity": 186, + "price": 124, + "end_quantity": 194, + "overage_price": 208 } ``` diff --git a/doc/models/get-pricing-scheme-response.md b/doc/models/get-pricing-scheme-response.md index b40fa4c..9de0977 100644 --- a/doc/models/get-pricing-scheme-response.md +++ b/doc/models/get-pricing-scheme-response.md @@ -21,30 +21,18 @@ Response object for getting a pricing scheme ```json { - "price": 16, - "scheme_type": "scheme_type0", + "price": 182, + "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 193, - "price": 125, - "end_quantity": 201, - "overage_price": 215 - }, - { - "start_quantity": 194, - "price": 124, - "end_quantity": 202, - "overage_price": 216 - }, - { - "start_quantity": 195, - "price": 123, - "end_quantity": 203, - "overage_price": 217 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], - "minimum_price": 176, - "percentage": 4.18 + "minimum_price": 170, + "percentage": 166.36 } ``` diff --git a/doc/models/get-private-label-transaction-response.md b/doc/models/get-private-label-transaction-response.md index 9ddcd44..ca144e4 100644 --- a/doc/models/get-private-label-transaction-response.md +++ b/doc/models/get-private-label-transaction-response.md @@ -31,17 +31,16 @@ Response object for getting a private label transaction ```json { - "gateway_id": "gateway_id6", - "amount": 20, + "gateway_id": "gateway_id8", + "amount": 40, "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "private_label", - "statement_descriptor": "statement_descriptor0", - "acquirer_name": "acquirer_name4", - "acquirer_affiliation_code": "acquirer_affiliation_code8", - "acquirer_tid": "acquirer_tid0", - "acquirer_nsu": "acquirer_nsu0" + "statement_descriptor": "statement_descriptor4", + "acquirer_name": "acquirer_name8", + "acquirer_affiliation_code": "acquirer_affiliation_code6", + "acquirer_tid": "acquirer_tid6", + "acquirer_nsu": "acquirer_nsu6" } ``` diff --git a/doc/models/get-recipient-response.md b/doc/models/get-recipient-response.md index f031c68..6f1363c 100644 --- a/doc/models/get-recipient-response.md +++ b/doc/models/get-recipient-response.md @@ -34,11 +34,11 @@ Recipient response ```json { "payment_mode": "bank_transfer", - "id": "id0", - "name": "name0", - "email": "email6", - "document": "document6", - "description": "description0" + "id": "id4", + "name": "name4", + "email": "email2", + "document": "document2", + "description": "description6" } ``` diff --git a/doc/models/get-safety-pay-transaction-response.md b/doc/models/get-safety-pay-transaction-response.md index 1f2dedd..ceddc97 100644 --- a/doc/models/get-safety-pay-transaction-response.md +++ b/doc/models/get-safety-pay-transaction-response.md @@ -24,16 +24,15 @@ Response object for getting a safety pay transaction ```json { - "gateway_id": "gateway_id6", - "amount": 62, + "gateway_id": "gateway_id8", + "amount": 40, "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "safetypay", - "url": "url4", - "bank_tid": "bank_tid4", + "url": "url8", + "bank_tid": "bank_tid8", "paid_at": "2016-03-13T12:52:32.123Z", - "paid_amount": 210 + "paid_amount": 154 } ``` diff --git a/doc/models/get-seller-response.md b/doc/models/get-seller-response.md deleted file mode 100644 index 3c9d765..0000000 --- a/doc/models/get-seller-response.md +++ /dev/null @@ -1,65 +0,0 @@ - -# Get Seller Response - -## Structure - -`GetSellerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | Identification | getId(): string | setId(string id): void | -| `name` | `string` | Required | - | getName(): string | setName(string name): void | -| `code` | `string` | Required | - | getCode(): string | setCode(string code): void | -| `document` | `string` | Required | - | getDocument(): string | setDocument(string document): void | -| `description` | `string` | Required | Description | getDescription(): string | setDescription(string description): void | -| `status` | `string` | Required | Status | getStatus(): string | setStatus(string status): void | -| `createdAt` | `string` | Required | Creation date | getCreatedAt(): string | setCreatedAt(string createdAt): void | -| `updatedAt` | `string` | Required | Updated date | getUpdatedAt(): string | setUpdatedAt(string updatedAt): void | -| `address` | [`GetAddressResponse`](/doc/models/get-address-response.md) | Required | Address | getAddress(): GetAddressResponse | setAddress(GetAddressResponse address): void | -| `metadata` | `array` | Required | Metadata | getMetadata(): array | setMetadata(array metadata): void | -| `deletedAt` | `?string` | Optional | Deleted date | getDeletedAt(): ?string | setDeletedAt(?string deletedAt): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "name": "name0", - "code": "code8", - "document": "document6", - "description": "description0", - "Status": "Status8", - "CreatedAt": "CreatedAt2", - "UpdatedAt": "UpdatedAt6", - "Address": { - "id": "id8", - "street": "street8", - "number": "number6", - "complement": "complement4", - "zip_code": "zip_code2", - "neighborhood": "neighborhood4", - "city": "city8", - "state": "state4", - "country": "country2", - "status": "status0", - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z", - "customer": null, - "metadata": { - "key0": "metadata5", - "key1": "metadata4" - }, - "line_1": "line_12", - "line_2": "line_26", - "deleted_at": null - }, - "Metadata": { - "key0": "Metadata2", - "key1": "Metadata3" - }, - "DeletedAt": null -} -``` - diff --git a/doc/models/get-sellers-request.md b/doc/models/get-sellers-request.md deleted file mode 100644 index 2f4a70f..0000000 --- a/doc/models/get-sellers-request.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Get Sellers Request - -## Structure - -`GetSellersRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | - | getName(): string | setName(string name): void | -| `document` | `string` | Required | - | getDocument(): string | setDocument(string document): void | -| `code` | `string` | Required | - | getCode(): string | setCode(string code): void | -| `status` | `string` | Required | - | getStatus(): string | setStatus(string status): void | -| `type` | `string` | Required | - | getType(): string | setType(string type): void | -| `createdSince` | `?string` | Optional | - | getCreatedSince(): ?string | setCreatedSince(?string createdSince): void | -| `createdUntil` | `?string` | Optional | - | getCreatedUntil(): ?string | setCreatedUntil(?string createdUntil): void | - -## Example (as JSON) - -```json -{ - "name": "name0", - "document": "document6", - "code": "code8", - "status": "status8", - "type": "type0", - "created_Since": null, - "created_Until": null -} -``` - diff --git a/doc/models/get-setup-response.md b/doc/models/get-setup-response.md index 19dc0b8..4fb2201 100644 --- a/doc/models/get-setup-response.md +++ b/doc/models/get-setup-response.md @@ -20,10 +20,10 @@ Response object for getting the setup from a subscription ```json { - "id": "id0", - "description": "description0", - "amount": 46, - "status": "status8" + "id": "id6", + "description": "description4", + "amount": 152, + "status": "status2" } ``` diff --git a/doc/models/get-shipping-response.md b/doc/models/get-shipping-response.md index d00670f..189db37 100644 --- a/doc/models/get-shipping-response.md +++ b/doc/models/get-shipping-response.md @@ -24,10 +24,10 @@ Response object for getting the shipping data ```json { - "amount": 46, - "description": "description0", - "recipient_name": "recipient_name8", - "recipient_phone": "recipient_phone2", + "amount": 214, + "description": "description8", + "recipient_name": "recipient_name6", + "recipient_phone": "recipient_phone0", "address": { "id": "id6", "street": "street6", diff --git a/doc/models/get-split-options-response.md b/doc/models/get-split-options-response.md index f6bc282..f9993e1 100644 --- a/doc/models/get-split-options-response.md +++ b/doc/models/get-split-options-response.md @@ -19,7 +19,7 @@ { "liable": false, "charge_processing_fee": false, - "charge_remainder_fee": "charge_remainder_fee8" + "charge_remainder_fee": "charge_remainder_fee6" } ``` diff --git a/doc/models/get-split-response.md b/doc/models/get-split-response.md index d220cc4..697ef34 100644 --- a/doc/models/get-split-response.md +++ b/doc/models/get-split-response.md @@ -23,7 +23,7 @@ Split response ```json { "type": "type0", - "amount": 46, + "amount": 252, "recipient": { "id": "id8", "name": "name8", diff --git a/doc/models/get-subscription-item-response.md b/doc/models/get-subscription-item-response.md index f8aca58..7f91483 100644 --- a/doc/models/get-subscription-item-response.md +++ b/doc/models/get-subscription-item-response.md @@ -27,9 +27,9 @@ ```json { - "id": "id0", - "description": "description0", - "status": "status8", + "id": "id2", + "description": "description8", + "status": "status6", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-subscription-response.md b/doc/models/get-subscription-response.md index 5086e3d..76ce53c 100644 --- a/doc/models/get-subscription-response.md +++ b/doc/models/get-subscription-response.md @@ -57,11 +57,11 @@ }, "max_days_to_pay_past_due": 2 }, - "id": "id0", - "code": "code8", + "id": "id4", + "code": "code2", "start_at": "2016-03-13T12:52:32.123Z", "interval": "interval2", - "interval_count": 82 + "interval_count": 224 } ``` diff --git a/doc/models/get-subscription-split-response.md b/doc/models/get-subscription-split-response.md index f68e508..2ca9c32 100644 --- a/doc/models/get-subscription-split-response.md +++ b/doc/models/get-subscription-split-response.md @@ -19,20 +19,54 @@ "enabled": false, "rules": [ { - "type": "type6", - "amount": 210, + "type": "type2", + "amount": 118, "recipient": { - "id": "id4", - "name": "name4", - "email": "email2", - "document": "document2", - "description": "description6" + "id": "id8", + "name": "name8", + "email": "email8", + "document": "document8", + "description": "description2" }, - "gateway_id": "gateway_id6", + "gateway_id": "gateway_id2", "options": { "liable": false, "charge_processing_fee": false, - "charge_remainder_fee": "charge_remainder_fee6" + "charge_remainder_fee": "charge_remainder_fee0" + } + }, + { + "type": "type2", + "amount": 118, + "recipient": { + "id": "id8", + "name": "name8", + "email": "email8", + "document": "document8", + "description": "description2" + }, + "gateway_id": "gateway_id2", + "options": { + "liable": false, + "charge_processing_fee": false, + "charge_remainder_fee": "charge_remainder_fee0" + } + }, + { + "type": "type2", + "amount": 118, + "recipient": { + "id": "id8", + "name": "name8", + "email": "email8", + "document": "document8", + "description": "description2" + }, + "gateway_id": "gateway_id2", + "options": { + "liable": false, + "charge_processing_fee": false, + "charge_remainder_fee": "charge_remainder_fee0" } } ] diff --git a/doc/models/get-three-d-secure-response.md b/doc/models/get-three-d-secure-response.md index 2c4292b..b217bf1 100644 --- a/doc/models/get-three-d-secure-response.md +++ b/doc/models/get-three-d-secure-response.md @@ -22,10 +22,10 @@ ```json { "mpi": "mpi2", - "eci": "eci0", - "cavv": "cavv4", - "transaction_Id": "transaction_Id4", - "success_url": "success_url2" + "eci": "eci4", + "cavv": "cavv0", + "transaction_Id": "transaction_Id0", + "success_url": "success_url6" } ``` diff --git a/doc/models/get-token-response.md b/doc/models/get-token-response.md index 93438c0..4366e6a 100644 --- a/doc/models/get-token-response.md +++ b/doc/models/get-token-response.md @@ -21,10 +21,10 @@ Token data ```json { - "id": "id0", - "type": "type0", + "id": "id8", + "type": "type2", "created_at": "2016-03-13T12:52:32.123Z", - "expires_at": "expires_at6", + "expires_at": "expires_at2", "card": { "last_four_digits": "last_four_digits2", "holder_name": "holder_name2", diff --git a/doc/models/get-transaction-report-file-response.md b/doc/models/get-transaction-report-file-response.md index 05b043a..2afcb97 100644 --- a/doc/models/get-transaction-report-file-response.md +++ b/doc/models/get-transaction-report-file-response.md @@ -16,7 +16,7 @@ ```json { - "name": "name0", + "name": "name8", "date": "2016-03-13T12:52:32.123Z" } ``` diff --git a/doc/models/get-transaction-response.md b/doc/models/get-transaction-response.md index b8b60f7..54189f5 100644 --- a/doc/models/get-transaction-response.md +++ b/doc/models/get-transaction-response.md @@ -35,12 +35,25 @@ Generic response object for getting a transaction. ```json { - "gateway_id": "gateway_id0", - "amount": 46, - "status": "status8", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "transaction" + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" } ``` diff --git a/doc/models/get-transfer-response.md b/doc/models/get-transfer-response.md index 08afde0..60a820a 100644 --- a/doc/models/get-transfer-response.md +++ b/doc/models/get-transfer-response.md @@ -23,9 +23,9 @@ Transfer response ```json { - "id": "id0", - "amount": 46, - "status": "status8", + "id": "id2", + "amount": 146, + "status": "status4", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-transfer-settings-response.md b/doc/models/get-transfer-settings-response.md index 93d6bcf..86c7624 100644 --- a/doc/models/get-transfer-settings-response.md +++ b/doc/models/get-transfer-settings-response.md @@ -19,7 +19,7 @@ { "transfer_enabled": false, "transfer_interval": "transfer_interval0", - "transfer_day": 18 + "transfer_day": 52 } ``` diff --git a/doc/models/get-transfer-source-response.md b/doc/models/get-transfer-source-response.md index 89796d6..452678b 100644 --- a/doc/models/get-transfer-source-response.md +++ b/doc/models/get-transfer-source-response.md @@ -16,8 +16,8 @@ ```json { - "source_id": "source_id6", - "type": "type0" + "source_id": "source_id0", + "type": "type4" } ``` diff --git a/doc/models/get-transfer.md b/doc/models/get-transfer.md index ab9cad1..a704c82 100644 --- a/doc/models/get-transfer.md +++ b/doc/models/get-transfer.md @@ -27,21 +27,19 @@ ```json { - "id": "id0", - "gateway_id": "gateway_id0", - "amount": 46, - "status": "status8", + "id": "id8", + "gateway_id": "gateway_id8", + "amount": 122, + "status": "status0", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z", "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata5" }, - "fee": 168, + "fee": 80, "funding_date": "2016-03-13T12:52:32.123Z", "funding_estimated_date": "2016-03-13T12:52:32.123Z", - "type": "type0", + "type": "type8", "source": { "source_id": "source_id8", "type": "type6" diff --git a/doc/models/get-usage-report-response.md b/doc/models/get-usage-report-response.md index 04d1bbe..053f0ea 100644 --- a/doc/models/get-usage-report-response.md +++ b/doc/models/get-usage-report-response.md @@ -17,9 +17,9 @@ ```json { - "url": "url4", - "usage_report_url": "usage_report_url2", - "grouped_report_url": "grouped_report_url2" + "url": "url2", + "usage_report_url": "usage_report_url0", + "grouped_report_url": "grouped_report_url0" } ``` diff --git a/doc/models/get-usage-response.md b/doc/models/get-usage-response.md index 02a4be4..5351fe5 100644 --- a/doc/models/get-usage-response.md +++ b/doc/models/get-usage-response.md @@ -27,9 +27,9 @@ Response object for getting a usage ```json { - "id": "id0", - "quantity": 68, - "description": "description0", + "id": "id2", + "quantity": 34, + "description": "description2", "used_at": "2016-03-13T12:52:32.123Z", "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-voucher-transaction-response.md b/doc/models/get-voucher-transaction-response.md index ca4343a..c1fe5ab 100644 --- a/doc/models/get-voucher-transaction-response.md +++ b/doc/models/get-voucher-transaction-response.md @@ -30,17 +30,16 @@ Response for voucher transactions ```json { - "gateway_id": "gateway_id4", - "amount": 24, - "status": "status2", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "voucher", - "statement_descriptor": "statement_descriptor0", - "acquirer_name": "acquirer_name4", - "acquirer_affiliation_code": "acquirer_affiliation_code8", - "acquirer_tid": "acquirer_tid0", - "acquirer_nsu": "acquirer_nsu0" + "statement_descriptor": "statement_descriptor6", + "acquirer_name": "acquirer_name0", + "acquirer_affiliation_code": "acquirer_affiliation_code2", + "acquirer_tid": "acquirer_tid4", + "acquirer_nsu": "acquirer_nsu4" } ``` diff --git a/doc/models/get-withdraw-response.md b/doc/models/get-withdraw-response.md index 94395d0..0174fbe 100644 --- a/doc/models/get-withdraw-response.md +++ b/doc/models/get-withdraw-response.md @@ -27,9 +27,9 @@ ```json { - "id": "id0", - "gateway_id": "gateway_id0", - "amount": 46, + "id": "id6", + "gateway_id": "gateway_id4", + "amount": 78, "status": "status8", "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/get-withdraw-source-response.md b/doc/models/get-withdraw-source-response.md index e4249a0..c24a995 100644 --- a/doc/models/get-withdraw-source-response.md +++ b/doc/models/get-withdraw-source-response.md @@ -16,8 +16,8 @@ ```json { - "source_id": "source_id6", - "type": "type0" + "source_id": "source_id2", + "type": "type8" } ``` diff --git a/doc/models/get-withdraw-target-response.md b/doc/models/get-withdraw-target-response.md index 0e156f8..0012b09 100644 --- a/doc/models/get-withdraw-target-response.md +++ b/doc/models/get-withdraw-target-response.md @@ -16,8 +16,8 @@ ```json { - "target_id": "target_id0", - "type": "type0" + "target_id": "target_id4", + "type": "type6" } ``` diff --git a/doc/models/list-access-tokens-response.md b/doc/models/list-access-tokens-response.md index f5061c3..ecd9b39 100644 --- a/doc/models/list-access-tokens-response.md +++ b/doc/models/list-access-tokens-response.md @@ -20,27 +20,14 @@ Response object for listing access tokens { "data": [ { - "id": "id5", - "code": "code3", - "status": "status7", + "id": "id0", + "code": "code8", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "customer": { - "id": "id5", - "name": "name5", - "email": "email9", - "delinquent": true, - "created_at": "2016-03-13T12:52:32.123Z" - } - }, - { - "id": "id6", - "code": "code4", - "status": "status8", - "created_at": "2016-03-13T12:52:32.123Z", - "customer": { - "id": "id6", - "name": "name6", - "email": "email0", + "id": "id0", + "name": "name0", + "email": "email6", "delinquent": false, "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/list-addresses-response.md b/doc/models/list-addresses-response.md index 42bb64d..efeb515 100644 --- a/doc/models/list-addresses-response.md +++ b/doc/models/list-addresses-response.md @@ -20,18 +20,25 @@ Response object for listing addresses { "data": [ { - "id": "id5", - "street": "street5", - "number": "number3", - "complement": "complement1", - "zip_code": "zip_code9" + "id": "id0", + "street": "street0", + "number": "number8", + "complement": "complement6", + "zip_code": "zip_code4" }, { - "id": "id6", - "street": "street6", - "number": "number4", - "complement": "complement2", - "zip_code": "zip_code0" + "id": "id0", + "street": "street0", + "number": "number8", + "complement": "complement6", + "zip_code": "zip_code4" + }, + { + "id": "id0", + "street": "street0", + "number": "number8", + "complement": "complement6", + "zip_code": "zip_code4" } ], "paging": { diff --git a/doc/models/list-anticipation-response.md b/doc/models/list-anticipation-response.md index b97bfc6..f420c1d 100644 --- a/doc/models/list-anticipation-response.md +++ b/doc/models/list-anticipation-response.md @@ -20,30 +20,17 @@ Anticipations { "data": [ { - "id": "id5", - "requested_amount": 157, - "approved_amount": 211, - "recipient": { - "id": "id7", - "name": "name7", - "email": "email1", - "document": "document1", - "description": "description7" - }, - "pgid": "pgid1" - }, - { - "id": "id6", - "requested_amount": 158, - "approved_amount": 212, + "id": "id0", + "requested_amount": 16, + "approved_amount": 70, "recipient": { "id": "id8", "name": "name8", - "email": "email2", - "document": "document2", - "description": "description8" + "email": "email8", + "document": "document8", + "description": "description2" }, - "pgid": "pgid2" + "pgid": "pgid6" } ], "paging": { diff --git a/doc/models/list-balance-operation-response.md b/doc/models/list-balance-operation-response.md index fb55ab8..1ee53d7 100644 --- a/doc/models/list-balance-operation-response.md +++ b/doc/models/list-balance-operation-response.md @@ -20,18 +20,25 @@ Response object for listing BalanceOperation objects { "data": [ { - "id": "id5", - "status": "status7", - "balance_amount": "balance_amount5", - "balance_old_amount": "balance_old_amount3", - "type": "type5" + "id": "id0", + "status": "status2", + "balance_amount": "balance_amount0", + "balance_old_amount": "balance_old_amount8", + "type": "type0" }, { - "id": "id6", - "status": "status8", - "balance_amount": "balance_amount6", - "balance_old_amount": "balance_old_amount4", - "type": "type6" + "id": "id0", + "status": "status2", + "balance_amount": "balance_amount0", + "balance_old_amount": "balance_old_amount8", + "type": "type0" + }, + { + "id": "id0", + "status": "status2", + "balance_amount": "balance_amount0", + "balance_old_amount": "balance_old_amount8", + "type": "type0" } ], "paging": { diff --git a/doc/models/list-cards-response.md b/doc/models/list-cards-response.md index 63b604d..4a96166 100644 --- a/doc/models/list-cards-response.md +++ b/doc/models/list-cards-response.md @@ -20,18 +20,25 @@ Response object for listing cards { "data": [ { - "id": "id5", - "last_four_digits": "last_four_digits1", - "brand": "brand9", - "holder_name": "holder_name1", - "exp_month": 125 + "id": "id0", + "last_four_digits": "last_four_digits6", + "brand": "brand4", + "holder_name": "holder_name6", + "exp_month": 240 }, { - "id": "id6", - "last_four_digits": "last_four_digits2", - "brand": "brand0", - "holder_name": "holder_name2", - "exp_month": 126 + "id": "id0", + "last_four_digits": "last_four_digits6", + "brand": "brand4", + "holder_name": "holder_name6", + "exp_month": 240 + }, + { + "id": "id0", + "last_four_digits": "last_four_digits6", + "brand": "brand4", + "holder_name": "holder_name6", + "exp_month": 240 } ], "paging": { diff --git a/doc/models/list-charge-transactions-response.md b/doc/models/list-charge-transactions-response.md index ac34c9d..84f7b68 100644 --- a/doc/models/list-charge-transactions-response.md +++ b/doc/models/list-charge-transactions-response.md @@ -20,20 +20,46 @@ Response object for listing charge transactions { "data": [ { - "gateway_id": "gateway_id5", - "amount": 121, - "status": "status7", - "success": true, + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", + "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "transaction" + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" }, { - "gateway_id": "gateway_id6", - "amount": 122, - "status": "status8", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "transaction" + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" } ], "paging": { diff --git a/doc/models/list-charges-response.md b/doc/models/list-charges-response.md index c0dae88..e3f1426 100644 --- a/doc/models/list-charges-response.md +++ b/doc/models/list-charges-response.md @@ -20,18 +20,25 @@ Response object for listing charges { "data": [ { - "id": "id5", - "code": "code3", - "gateway_id": "gateway_id5", - "amount": 121, - "status": "status7" + "id": "id0", + "code": "code8", + "gateway_id": "gateway_id0", + "amount": 236, + "status": "status2" }, { - "id": "id6", - "code": "code4", - "gateway_id": "gateway_id6", - "amount": 122, - "status": "status8" + "id": "id0", + "code": "code8", + "gateway_id": "gateway_id0", + "amount": 236, + "status": "status2" + }, + { + "id": "id0", + "code": "code8", + "gateway_id": "gateway_id0", + "amount": 236, + "status": "status2" } ], "paging": { diff --git a/doc/models/list-customers-response.md b/doc/models/list-customers-response.md index 8f0efb1..4316776 100644 --- a/doc/models/list-customers-response.md +++ b/doc/models/list-customers-response.md @@ -20,16 +20,16 @@ Response for listing the customers { "data": [ { - "id": "id5", - "name": "name5", - "email": "email9", - "delinquent": true, + "id": "id0", + "name": "name0", + "email": "email6", + "delinquent": false, "created_at": "2016-03-13T12:52:32.123Z" }, { - "id": "id6", - "name": "name6", - "email": "email0", + "id": "id0", + "name": "name0", + "email": "email6", "delinquent": false, "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/list-cycles-response.md b/doc/models/list-cycles-response.md index 0097927..9eb28bd 100644 --- a/doc/models/list-cycles-response.md +++ b/doc/models/list-cycles-response.md @@ -22,27 +22,27 @@ Response object for listing subscription cycles { "start_at": "2016-03-13T12:52:32.123Z", "end_at": "2016-03-13T12:52:32.123Z", - "id": "id5", + "id": "id0", "billing_at": "2016-03-13T12:52:32.123Z", "subscription": { - "id": "id1", - "code": "code9", + "id": "id4", + "code": "code2", "start_at": "2016-03-13T12:52:32.123Z", - "interval": "interval9", - "interval_count": 97 + "interval": "interval2", + "interval_count": 234 } }, { "start_at": "2016-03-13T12:52:32.123Z", "end_at": "2016-03-13T12:52:32.123Z", - "id": "id6", + "id": "id0", "billing_at": "2016-03-13T12:52:32.123Z", "subscription": { - "id": "id2", - "code": "code0", + "id": "id4", + "code": "code2", "start_at": "2016-03-13T12:52:32.123Z", - "interval": "interval0", - "interval_count": 98 + "interval": "interval2", + "interval_count": 234 } } ], diff --git a/doc/models/list-discounts-response.md b/doc/models/list-discounts-response.md index c968ace..792005d 100644 --- a/doc/models/list-discounts-response.md +++ b/doc/models/list-discounts-response.md @@ -18,17 +18,17 @@ { "data": [ { - "id": "id5", - "value": 145.67, - "discount_type": "discount_type3", - "status": "status7", + "id": "id0", + "value": 95.62, + "discount_type": "discount_type8", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z" }, { - "id": "id6", - "value": 145.68, - "discount_type": "discount_type4", - "status": "status8", + "id": "id0", + "value": 95.62, + "discount_type": "discount_type8", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z" } ], diff --git a/doc/models/list-increments-response.md b/doc/models/list-increments-response.md index ebcad55..6a62a5d 100644 --- a/doc/models/list-increments-response.md +++ b/doc/models/list-increments-response.md @@ -18,17 +18,10 @@ { "data": [ { - "id": "id5", - "value": 145.67, - "increment_type": "increment_type7", - "status": "status7", - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": "id6", - "value": 145.68, - "increment_type": "increment_type8", - "status": "status8", + "id": "id0", + "value": 95.62, + "increment_type": "increment_type2", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z" } ], diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 90e58d6..6630ffb 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -20,18 +20,25 @@ Response object for listing invoices { "data": [ { - "id": "id5", - "code": "code3", - "url": "url9", - "amount": 121, - "status": "status7" + "id": "id0", + "code": "code8", + "url": "url4", + "amount": 236, + "status": "status2" }, { - "id": "id6", - "code": "code4", - "url": "url0", - "amount": 122, - "status": "status8" + "id": "id0", + "code": "code8", + "url": "url4", + "amount": 236, + "status": "status2" + }, + { + "id": "id0", + "code": "code8", + "url": "url4", + "amount": 236, + "status": "status2" } ], "paging": { diff --git a/doc/models/list-order-response.md b/doc/models/list-order-response.md index 80894f2..96d381b 100644 --- a/doc/models/list-order-response.md +++ b/doc/models/list-order-response.md @@ -20,67 +20,25 @@ Response object for listing order objects { "data": [ { - "id": "id5", - "code": "code3", - "currency": "currency5", - "items": [ - { - "id": "id2", - "amount": 180, - "description": "description2", - "quantity": 38, - "category": "category0" - }, - { - "id": "id3", - "amount": 181, - "description": "description3", - "quantity": 39, - "category": "category1" - } - ], - "customer": { - "id": "id5", - "name": "name5", - "email": "email9", - "delinquent": true, - "created_at": "2016-03-13T12:52:32.123Z" - } + "id": "id0", + "code": "code8", + "amount": 236, + "currency": "currency0", + "closed": false }, { - "id": "id6", - "code": "code4", - "currency": "currency6", - "items": [ - { - "id": "id3", - "amount": 181, - "description": "description3", - "quantity": 39, - "category": "category1" - }, - { - "id": "id4", - "amount": 182, - "description": "description4", - "quantity": 40, - "category": "category2" - }, - { - "id": "id5", - "amount": 183, - "description": "description5", - "quantity": 41, - "category": "category3" - } - ], - "customer": { - "id": "id6", - "name": "name6", - "email": "email0", - "delinquent": false, - "created_at": "2016-03-13T12:52:32.123Z" - } + "id": "id0", + "code": "code8", + "amount": 236, + "currency": "currency0", + "closed": false + }, + { + "id": "id0", + "code": "code8", + "amount": 236, + "currency": "currency0", + "closed": false } ], "paging": { diff --git a/doc/models/list-payables-response.md b/doc/models/list-payables-response.md index e8384d9..c7f0134 100644 --- a/doc/models/list-payables-response.md +++ b/doc/models/list-payables-response.md @@ -20,18 +20,11 @@ Response object for listing payable objects { "data": [ { - "id": 23, - "status": "status7", - "amount": 121, - "fee": 79, - "anticipation_fee": 27 - }, - { - "id": 24, - "status": "status8", - "amount": 122, - "fee": 80, - "anticipation_fee": 28 + "id": 138, + "status": "status2", + "amount": 236, + "fee": 194, + "anticipation_fee": 142 } ], "paging": { diff --git a/doc/models/list-plans-response.md b/doc/models/list-plans-response.md index ed31c3a..8c4a463 100644 --- a/doc/models/list-plans-response.md +++ b/doc/models/list-plans-response.md @@ -20,18 +20,25 @@ Response object for listing plans { "data": [ { - "id": "id5", - "name": "name5", - "description": "description5", - "url": "url9", - "statement_descriptor": "statement_descriptor5" + "id": "id0", + "name": "name0", + "description": "description0", + "url": "url4", + "statement_descriptor": "statement_descriptor0" }, { - "id": "id6", - "name": "name6", - "description": "description6", - "url": "url0", - "statement_descriptor": "statement_descriptor6" + "id": "id0", + "name": "name0", + "description": "description0", + "url": "url4", + "statement_descriptor": "statement_descriptor0" + }, + { + "id": "id0", + "name": "name0", + "description": "description0", + "url": "url4", + "statement_descriptor": "statement_descriptor0" } ], "paging": { diff --git a/doc/models/list-recipient-response.md b/doc/models/list-recipient-response.md index 49ea281..c3ef229 100644 --- a/doc/models/list-recipient-response.md +++ b/doc/models/list-recipient-response.md @@ -20,18 +20,25 @@ Response for the listing recipient method { "data": [ { - "id": "id5", - "name": "name5", - "email": "email9", - "document": "document9", - "description": "description5" + "id": "id0", + "name": "name0", + "email": "email6", + "document": "document4", + "description": "description0" }, { - "id": "id6", - "name": "name6", - "email": "email0", - "document": "document0", - "description": "description6" + "id": "id0", + "name": "name0", + "email": "email6", + "document": "document4", + "description": "description0" + }, + { + "id": "id0", + "name": "name0", + "email": "email6", + "document": "document4", + "description": "description0" } ], "paging": { diff --git a/doc/models/list-seller-response.md b/doc/models/list-seller-response.md deleted file mode 100644 index 3b85957..0000000 --- a/doc/models/list-seller-response.md +++ /dev/null @@ -1,103 +0,0 @@ - -# List Seller Response - -## Structure - -`ListSellerResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `data` | [`GetSellerResponse[]`](/doc/models/get-seller-response.md) | Required | The order object | getData(): array | setData(array data): void | -| `paging` | [`PagingResponse`](/doc/models/paging-response.md) | Required | Paging object | getPaging(): PagingResponse | setPaging(PagingResponse paging): void | - -## Example (as JSON) - -```json -{ - "data": [ - { - "id": "id5", - "name": "name5", - "code": "code3", - "document": "document9", - "description": "description5", - "Status": "Status3", - "CreatedAt": "CreatedAt3", - "UpdatedAt": "UpdatedAt1", - "Address": { - "id": "id3", - "street": "street3", - "number": "number1", - "complement": "complement9", - "zip_code": "zip_code7", - "neighborhood": "neighborhood9", - "city": "city3", - "state": "state9", - "country": "country7", - "status": "status5", - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z", - "customer": null, - "metadata": { - "key0": "metadata4", - "key1": "metadata5", - "key2": "metadata6" - }, - "line_1": "line_17", - "line_2": "line_21", - "deleted_at": null - }, - "Metadata": { - "key0": "Metadata7", - "key1": "Metadata8" - }, - "DeletedAt": null - }, - { - "id": "id6", - "name": "name6", - "code": "code4", - "document": "document0", - "description": "description6", - "Status": "Status4", - "CreatedAt": "CreatedAt4", - "UpdatedAt": "UpdatedAt2", - "Address": { - "id": "id4", - "street": "street4", - "number": "number2", - "complement": "complement0", - "zip_code": "zip_code8", - "neighborhood": "neighborhood0", - "city": "city4", - "state": "state0", - "country": "country8", - "status": "status6", - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z", - "customer": null, - "metadata": { - "key0": "metadata5" - }, - "line_1": "line_18", - "line_2": "line_22", - "deleted_at": null - }, - "Metadata": { - "key0": "Metadata8", - "key1": "Metadata9", - "key2": "Metadata0" - }, - "DeletedAt": null - } - ], - "paging": { - "total": 6, - "previous": "previous2", - "next": "next8" - } -} -``` - diff --git a/doc/models/list-subscription-items-response.md b/doc/models/list-subscription-items-response.md index 0d341bd..5bb0f93 100644 --- a/doc/models/list-subscription-items-response.md +++ b/doc/models/list-subscription-items-response.md @@ -20,16 +20,23 @@ Response model for listing subscription items { "data": [ { - "id": "id5", - "description": "description5", - "status": "status7", + "id": "id0", + "description": "description0", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" }, { - "id": "id6", - "description": "description6", - "status": "status8", + "id": "id0", + "description": "description0", + "status": "status2", + "created_at": "2016-03-13T12:52:32.123Z", + "updated_at": "2016-03-13T12:52:32.123Z" + }, + { + "id": "id0", + "description": "description0", + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/list-subscriptions-response.md b/doc/models/list-subscriptions-response.md index 2d3751d..ee84235 100644 --- a/doc/models/list-subscriptions-response.md +++ b/doc/models/list-subscriptions-response.md @@ -20,18 +20,25 @@ Response object for listing subscriptions { "data": [ { - "id": "id5", - "code": "code3", + "id": "id0", + "code": "code8", "start_at": "2016-03-13T12:52:32.123Z", - "interval": "interval3", - "interval_count": 249 + "interval": "interval8", + "interval_count": 108 }, { - "id": "id6", - "code": "code4", + "id": "id0", + "code": "code8", "start_at": "2016-03-13T12:52:32.123Z", - "interval": "interval4", - "interval_count": 250 + "interval": "interval8", + "interval_count": 108 + }, + { + "id": "id0", + "code": "code8", + "start_at": "2016-03-13T12:52:32.123Z", + "interval": "interval8", + "interval_count": 108 } ], "paging": { diff --git a/doc/models/list-transactions-files-response.md b/doc/models/list-transactions-files-response.md index c3ef7f8..0f60081 100644 --- a/doc/models/list-transactions-files-response.md +++ b/doc/models/list-transactions-files-response.md @@ -20,11 +20,15 @@ Response object for listing of transactions files { "data": [ { - "name": "name5", + "name": "name0", "date": "2016-03-13T12:52:32.123Z" }, { - "name": "name6", + "name": "name0", + "date": "2016-03-13T12:52:32.123Z" + }, + { + "name": "name0", "date": "2016-03-13T12:52:32.123Z" } ], diff --git a/doc/models/list-transactions-response.md b/doc/models/list-transactions-response.md index dcc20fa..563a573 100644 --- a/doc/models/list-transactions-response.md +++ b/doc/models/list-transactions-response.md @@ -20,20 +20,67 @@ Response object for listing transactions { "data": [ { - "gateway_id": "gateway_id5", - "amount": 121, - "status": "status7", - "success": true, + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", + "success": false, + "created_at": "2016-03-13T12:52:32.123Z", + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" + }, + { + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", + "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "transaction" + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" }, { - "gateway_id": "gateway_id6", - "amount": 122, - "status": "status8", + "gateway_id": "gateway_id8", + "amount": 40, + "status": "status6", "success": false, "created_at": "2016-03-13T12:52:32.123Z", - "transaction_type": "transaction" + "qr_code": "qr_code0", + "qr_code_url": "qr_code_url6", + "expires_at": "2016-03-13T12:52:32.123Z", + "additional_information": [ + { + "Name": "Name0", + "Value": "Value2" + }, + { + "Name": "Name0", + "Value": "Value2" + } + ], + "end_to_end_id": "end_to_end_id6" } ], "paging": { diff --git a/doc/models/list-transfer-response.md b/doc/models/list-transfer-response.md index 89e4a32..ffb01fc 100644 --- a/doc/models/list-transfer-response.md +++ b/doc/models/list-transfer-response.md @@ -20,16 +20,23 @@ List of paginated transfer objects { "data": [ { - "id": "id5", - "amount": 121, - "status": "status7", + "id": "id0", + "amount": 236, + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" }, { - "id": "id6", - "amount": 122, - "status": "status8", + "id": "id0", + "amount": 236, + "status": "status2", + "created_at": "2016-03-13T12:52:32.123Z", + "updated_at": "2016-03-13T12:52:32.123Z" + }, + { + "id": "id0", + "amount": 236, + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/list-transfers.md b/doc/models/list-transfers.md index 1c010a7..1531025 100644 --- a/doc/models/list-transfers.md +++ b/doc/models/list-transfers.md @@ -18,27 +18,27 @@ { "data": [ { - "id": "id5", - "gateway_id": "gateway_id5", - "amount": 121, - "status": "status7", + "id": "id0", + "gateway_id": "gateway_id0", + "amount": 236, + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z", "updated_at": "2016-03-13T12:52:32.123Z", "metadata": { - "key0": "metadata4", - "key1": "metadata3" + "key0": "metadata7", + "key1": "metadata6" }, - "fee": 79, + "fee": 194, "funding_date": "2016-03-13T12:52:32.123Z", "funding_estimated_date": "2016-03-13T12:52:32.123Z", - "type": "type5", + "type": "type0", "source": { - "source_id": "source_id5", - "type": "type1" + "source_id": "source_id8", + "type": "type6" }, "target": { - "target_id": "target_id3", - "type": "type7" + "target_id": "target_id2", + "type": "type8" } } ], diff --git a/doc/models/list-usages-response.md b/doc/models/list-usages-response.md index a699344..6d79bcd 100644 --- a/doc/models/list-usages-response.md +++ b/doc/models/list-usages-response.md @@ -20,16 +20,9 @@ Response model for listing the usages from a subscription item { "data": [ { - "id": "id5", - "quantity": 235, - "description": "description5", - "used_at": "2016-03-13T12:52:32.123Z", - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": "id6", - "quantity": 236, - "description": "description6", + "id": "id0", + "quantity": 94, + "description": "description0", "used_at": "2016-03-13T12:52:32.123Z", "created_at": "2016-03-13T12:52:32.123Z" } diff --git a/doc/models/list-withdrawals.md b/doc/models/list-withdrawals.md index 02c455f..08bebef 100644 --- a/doc/models/list-withdrawals.md +++ b/doc/models/list-withdrawals.md @@ -18,10 +18,10 @@ { "data": [ { - "id": "id5", - "gateway_id": "gateway_id5", - "amount": 121, - "status": "status7", + "id": "id0", + "gateway_id": "gateway_id0", + "amount": 236, + "status": "status2", "created_at": "2016-03-13T12:52:32.123Z" } ], diff --git a/doc/models/paging-response.md b/doc/models/paging-response.md index 257a3e1..20ac0ad 100644 --- a/doc/models/paging-response.md +++ b/doc/models/paging-response.md @@ -19,8 +19,8 @@ Object used for returning lists of objects with pagination ```json { - "total": 10, - "previous": "previous8", + "total": 80, + "previous": "previous2", "next": "next2" } ``` diff --git a/doc/models/pix-additional-information.md b/doc/models/pix-additional-information.md index 28549de..2bb20dd 100644 --- a/doc/models/pix-additional-information.md +++ b/doc/models/pix-additional-information.md @@ -18,8 +18,8 @@ Pix Additional Information ```json { - "Name": "Name0", - "Value": "Value2" + "Name": "Name6", + "Value": "Value6" } ``` diff --git a/doc/models/update-address-request.md b/doc/models/update-address-request.md index 9da1744..5fc165c 100644 --- a/doc/models/update-address-request.md +++ b/doc/models/update-address-request.md @@ -20,14 +20,13 @@ Request for updating an address ```json { - "number": "number2", - "complement": "complement4", + "number": "number6", + "complement": "complement8", "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7", + "key1": "metadata8" }, - "line_2": "line_28" + "line_2": "line_24" } ``` diff --git a/doc/models/update-automatic-anticipation-settings-request.md b/doc/models/update-automatic-anticipation-settings-request.md index 36dfeab..c3f6207 100644 --- a/doc/models/update-automatic-anticipation-settings-request.md +++ b/doc/models/update-automatic-anticipation-settings-request.md @@ -20,10 +20,10 @@ ```json { "enabled": false, - "type": "type0", - "volume_percentage": 62, - "delay": 228, - "days": 120 + "type": "type8", + "volume_percentage": 132, + "delay": 158, + "days": 66 } ``` diff --git a/doc/models/update-card-request.md b/doc/models/update-card-request.md index 1a3ef46..7b13a46 100644 --- a/doc/models/update-card-request.md +++ b/doc/models/update-card-request.md @@ -23,9 +23,9 @@ Request for updating a card ```json { - "holder_name": "holder_name4", - "exp_month": 42, - "exp_year": 254, + "holder_name": "holder_name6", + "exp_month": 236, + "exp_year": 60, "billing_address_id": "billing_address_id6", "billing_address": { "street": "street8", diff --git a/doc/models/update-charge-card-request.md b/doc/models/update-charge-card-request.md index 72f8a08..509b6aa 100644 --- a/doc/models/update-charge-card-request.md +++ b/doc/models/update-charge-card-request.md @@ -21,7 +21,7 @@ Request for updating card data ```json { "update_subscription": false, - "card_id": "card_id4", + "card_id": "card_id2", "card": { "type": "credit", "number": "number6", diff --git a/doc/models/update-charge-payment-method-request.md b/doc/models/update-charge-payment-method-request.md index b4465f2..9d1e745 100644 --- a/doc/models/update-charge-payment-method-request.md +++ b/doc/models/update-charge-payment-method-request.md @@ -26,18 +26,18 @@ Request for updating the payment method of a charge ```json { "update_subscription": false, - "payment_method": "payment_method0", + "payment_method": "payment_method4", "credit_card": { "installments": 1, "capture": true, "recurrency_cycle": "\"first\" or \"subsequent\"", "statement_descriptor": "statement_descriptor8", "card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 54, - "exp_year": 242, - "cvv": "cvv0" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, "card_id": "card_id4", "card_token": "card_token2" @@ -45,11 +45,11 @@ Request for updating the payment method of a charge "debit_card": { "statement_descriptor": "statement_descriptor4", "card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 104, - "exp_year": 192, - "cvv": "cvv0" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, "card_id": "card_id0", "card_token": "card_token6", @@ -70,7 +70,8 @@ Request for updating the payment method of a charge "country": "country2", "complement": "complement6", "metadata": { - "key0": "metadata5" + "key0": "metadata5", + "key1": "metadata6" }, "line_1": "line_18", "line_2": "line_26" @@ -80,9 +81,9 @@ Request for updating the payment method of a charge "document_number": "document_number6", "statement_descriptor": "statement_descriptor0", "interest": { - "days": 160, + "days": 156, "type": "type0", - "amount": 234 + "amount": 230 } }, "voucher": { @@ -91,11 +92,11 @@ Request for updating the payment method of a charge "card_id": "card_id8", "card_token": "card_token8", "Card": { - "number": "number0", - "holder_name": "holder_name8", - "exp_month": 198, - "exp_year": 238, - "cvv": "cvv0" + "number": "number8", + "holder_name": "holder_name6", + "exp_month": 240, + "exp_year": 56, + "cvv": "cvv8" } }, "cash": { @@ -112,11 +113,11 @@ Request for updating the payment method of a charge "recurrency_cycle": "\"first\" or \"subsequent\"", "statement_descriptor": "statement_descriptor0", "card": { - "number": "number2", - "holder_name": "holder_name0", - "exp_month": 116, - "exp_year": 180, - "cvv": "cvv2" + "number": "number6", + "holder_name": "holder_name2", + "exp_month": 228, + "exp_year": 68, + "cvv": "cvv4" }, "card_id": "card_id6", "card_token": "card_token0" diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 219b5ab..fb682dd 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -26,10 +26,10 @@ Request for updating a customer ```json { - "name": "name0", - "email": "email6", - "document": "document6", - "type": "type0", + "name": "name8", + "email": "email8", + "document": "document2", + "type": "type2", "address": { "street": "street6", "number": "number4", diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index 4641b8e..5a67bfa 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -18,9 +18,8 @@ Request for updating an metadata ```json { "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key0": "metadata7", + "key1": "metadata6" } } ``` diff --git a/doc/models/update-order-item-request.md b/doc/models/update-order-item-request.md index 00496ee..37a3456 100644 --- a/doc/models/update-order-item-request.md +++ b/doc/models/update-order-item-request.md @@ -20,9 +20,9 @@ Update Order item Request ```json { - "amount": 46, - "description": "description0", - "quantity": 68, + "amount": 130, + "description": "description4", + "quantity": 244, "category": "category2" } ``` diff --git a/doc/models/update-order-status-request.md b/doc/models/update-order-status-request.md index 1ab0ca7..a594641 100644 --- a/doc/models/update-order-status-request.md +++ b/doc/models/update-order-status-request.md @@ -15,7 +15,7 @@ ```json { - "status": "status8" + "status": "status6" } ``` diff --git a/doc/models/update-plan-item-request.md b/doc/models/update-plan-item-request.md index 62e1e1c..2dc48cc 100644 --- a/doc/models/update-plan-item-request.md +++ b/doc/models/update-plan-item-request.md @@ -22,25 +22,25 @@ Request for updating a plan item ```json { - "name": "name0", - "description": "description0", + "name": "name6", + "description": "description6", "status": "status8", "pricing_scheme": { "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, "minimum_price": 6, "percentage": 251.76 }, - "quantity": 68, - "cycles": 168 + "quantity": 200, + "cycles": 36 } ``` diff --git a/doc/models/update-plan-request.md b/doc/models/update-plan-request.md index 1727293..f1e3cee 100644 --- a/doc/models/update-plan-request.md +++ b/doc/models/update-plan-request.md @@ -34,14 +34,14 @@ Request for updating a plan "name": "name0", "description": "description0", "installments": [ - 119, - 120, - 121 + 121, + 122, + 123 ], "statement_descriptor": "statement_descriptor0", "currency": "currency0", - "interval": "interval2", - "interval_count": 82, + "interval": "interval8", + "interval_count": 84, "payment_methods": [ "payment_methods5", "payment_methods6" @@ -50,17 +50,16 @@ Request for updating a plan "status": "status8", "shippable": false, "billing_days": [ - 143, - 144, - 145 + 171, + 170 ], "metadata": { "key0": "metadata3", "key1": "metadata4", "key2": "metadata5" }, - "minimum_price": 176, - "trial_period_days": 54 + "minimum_price": 174, + "trial_period_days": 56 } ``` diff --git a/doc/models/update-price-bracket-request.md b/doc/models/update-price-bracket-request.md index 73aaac4..fcd80da 100644 --- a/doc/models/update-price-bracket-request.md +++ b/doc/models/update-price-bracket-request.md @@ -20,10 +20,10 @@ Request for updating a price bracket ```json { - "start_quantity": 46, - "price": 16, - "end_quantity": 54, - "overage_price": 68 + "start_quantity": 154, + "price": 164, + "end_quantity": 162, + "overage_price": 176 } ``` diff --git a/doc/models/update-pricing-scheme-request.md b/doc/models/update-pricing-scheme-request.md index b3050b8..acf4feb 100644 --- a/doc/models/update-pricing-scheme-request.md +++ b/doc/models/update-pricing-scheme-request.md @@ -24,15 +24,15 @@ Request for updating a pricing scheme "scheme_type": "scheme_type0", "price_brackets": [ { - "start_quantity": 193, - "price": 125, - "end_quantity": 201, - "overage_price": 215 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], - "price": 16, - "minimum_price": 176, - "percentage": 4.18 + "price": 162, + "minimum_price": 2, + "percentage": 62.28 } ``` diff --git a/doc/models/update-recipient-request.md b/doc/models/update-recipient-request.md index c1ca30b..7e125d4 100644 --- a/doc/models/update-recipient-request.md +++ b/doc/models/update-recipient-request.md @@ -29,8 +29,7 @@ Request for updating a Recipient "status": "status8", "metadata": { "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" + "key1": "metadata4" } } ``` diff --git a/doc/models/update-seller-request.md b/doc/models/update-seller-request.md deleted file mode 100644 index e1befbb..0000000 --- a/doc/models/update-seller-request.md +++ /dev/null @@ -1,55 +0,0 @@ - -# Update Seller Request - -## Structure - -`UpdateSellerRequest` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `name` | `string` | Required | Seller name | getName(): string | setName(string name): void | -| `code` | `string` | Required | Seller code | getCode(): string | setCode(string code): void | -| `description` | `string` | Required | Seller description | getDescription(): string | setDescription(string description): void | -| `document` | `string` | Required | Seller document CPF or CNPJ | getDocument(): string | setDocument(string document): void | -| `status` | `string` | Required | - | getStatus(): string | setStatus(string status): void | -| `type` | `string` | Required | - | getType(): string | setType(string type): void | -| `address` | [`CreateAddressRequest`](/doc/models/create-address-request.md) | Required | - | getAddress(): CreateAddressRequest | setAddress(CreateAddressRequest address): void | -| `metadata` | `array` | Required | - | getMetadata(): array | setMetadata(array metadata): void | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": "code8", - "description": "description0", - "document": "document6", - "status": "status8", - "type": "type0", - "address": { - "street": "street6", - "number": "number4", - "zip_code": "zip_code0", - "neighborhood": "neighborhood2", - "city": "city6", - "state": "state2", - "country": "country0", - "complement": "complement2", - "metadata": { - "key0": "metadata3", - "key1": "metadata2", - "key2": "metadata1" - }, - "line_1": "line_10", - "line_2": "line_24" - }, - "metadata": { - "key0": "metadata3", - "key1": "metadata4", - "key2": "metadata5" - } -} -``` - diff --git a/doc/models/update-subscription-affiliation-id-request.md b/doc/models/update-subscription-affiliation-id-request.md index 01a71a3..667e4dd 100644 --- a/doc/models/update-subscription-affiliation-id-request.md +++ b/doc/models/update-subscription-affiliation-id-request.md @@ -17,7 +17,7 @@ Request for updating a Subscription Affiliation Id ```json { - "gateway_affiliation_id": "gateway_affiliation_id4" + "gateway_affiliation_id": "gateway_affiliation_id8" } ``` diff --git a/doc/models/update-subscription-card-request.md b/doc/models/update-subscription-card-request.md index 7cbd9ac..142eae7 100644 --- a/doc/models/update-subscription-card-request.md +++ b/doc/models/update-subscription-card-request.md @@ -26,7 +26,7 @@ Request for updating the card from a subscription "exp_year": 68, "cvv": "cvv4" }, - "card_id": "card_id4" + "card_id": "card_id0" } ``` diff --git a/doc/models/update-subscription-due-days-request.md b/doc/models/update-subscription-due-days-request.md index 6129bc8..e22b80b 100644 --- a/doc/models/update-subscription-due-days-request.md +++ b/doc/models/update-subscription-due-days-request.md @@ -15,7 +15,7 @@ ```json { - "boleto_due_days": 194 + "boleto_due_days": 56 } ``` diff --git a/doc/models/update-subscription-item-request.md b/doc/models/update-subscription-item-request.md index 6989b07..8fb8b28 100644 --- a/doc/models/update-subscription-item-request.md +++ b/doc/models/update-subscription-item-request.md @@ -23,26 +23,26 @@ Request for updating a subscription item ```json { - "description": "description0", - "status": "status8", + "description": "description2", + "status": "status4", "pricing_scheme": { "scheme_type": "scheme_type8", "price_brackets": [ { - "start_quantity": 119, - "price": 57, - "end_quantity": 127, - "overage_price": 141 + "start_quantity": 144, + "price": 174, + "end_quantity": 152, + "overage_price": 166 } ], "price": 166, "minimum_price": 6, "percentage": 251.76 }, - "name": "name0", - "cycles": 168, - "quantity": 68, - "minimum_price": 176 + "name": "name2", + "cycles": 108, + "quantity": 128, + "minimum_price": 140 } ``` diff --git a/doc/models/update-subscription-minimum-price-request.md b/doc/models/update-subscription-minimum-price-request.md index 10eabc1..7e4ec20 100644 --- a/doc/models/update-subscription-minimum-price-request.md +++ b/doc/models/update-subscription-minimum-price-request.md @@ -17,7 +17,7 @@ Atualização do valor mínimo da assinatura ```json { - "minimum_price": 176 + "minimum_price": 212 } ``` diff --git a/doc/models/update-subscription-payment-method-request.md b/doc/models/update-subscription-payment-method-request.md index 1d85357..95b5d61 100644 --- a/doc/models/update-subscription-payment-method-request.md +++ b/doc/models/update-subscription-payment-method-request.md @@ -21,8 +21,8 @@ Request for updating a subscription's payment method ```json { - "payment_method": "payment_method0", - "card_id": "card_id4", + "payment_method": "payment_method4", + "card_id": "card_id2", "card": { "type": "credit", "number": "number6", @@ -31,17 +31,17 @@ Request for updating a subscription's payment method "exp_year": 68, "cvv": "cvv4" }, - "card_token": "card_token0", + "card_token": "card_token4", "boleto": { "interest": { - "days": 160, + "days": 156, "type": "type0", - "amount": 234 + "amount": 230 }, "fine": { - "days": 130, - "type": "type8", - "amount": 52 + "days": 138, + "type": "type2", + "amount": 212 }, "max_days_to_pay_past_due": 118 } diff --git a/doc/models/update-subscription-split-request.md b/doc/models/update-subscription-split-request.md index e5417d8..3979d8a 100644 --- a/doc/models/update-subscription-split-request.md +++ b/doc/models/update-subscription-split-request.md @@ -19,15 +19,15 @@ "enabled": false, "rules": [ { - "type": "type6", - "amount": 210, - "recipient_id": "recipient_id6", + "type": "type2", + "amount": 118, + "recipient_id": "recipient_id2", "options": { "liable": false, "charge_processing_fee": false, "charge_remainder_fee": false }, - "split_rule_id": "split_rule_id6" + "split_rule_id": "split_rule_id0" } ] } diff --git a/doc/utility-classes.md b/doc/utility-classes.md deleted file mode 100644 index 3d2ff80..0000000 --- a/doc/utility-classes.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Utility Classes Documentation - -## FileWrapper - -Thrown when there is a network error or HTTP response status code is not okay. - -## Constructor Args - -| Name | Type | Description | -| --- | --- | --- | -| $realFilePath | string | The path of the file to wrap. | -| $mimeType | ?mimeType | The mime-type to be sent with the file. | -| $filename | ?string | The name to be used when sending the file. | - -## Methods - -| Name | Type | Description | -| --- | --- | --- | -| getFilename() | ?string | Get name of the file to be used in the upload data. | -| getMimeType() | ?string | Get the mime-type to be sent with the file. | - diff --git a/examples/address/CreateAddress.php b/examples/address/CreateAddress.php deleted file mode 100644 index bb8073b..0000000 --- a/examples/address/CreateAddress.php +++ /dev/null @@ -1,34 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customerId = "cus_z6WBYzNhlioYX"; - $result = $customerController->createAddress($customerId, $address); - - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/address/GetAdressById.php b/examples/address/GetAdressById.php deleted file mode 100644 index 22e6da8..0000000 --- a/examples/address/GetAdressById.php +++ /dev/null @@ -1,23 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $customerId = "cus_z6WBYzNhlioYX"; - $addressId = "addr_zba6e5RuDCQn6"; - $result = $customerController->getAddress($customerId, $addressId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/card/CreateCard.php b/examples/card/CreateCard.php deleted file mode 100644 index af80c9a..0000000 --- a/examples/card/CreateCard.php +++ /dev/null @@ -1,46 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $card = new PagarmeApiSDKLib\Models\CreateCardRequest( - "4000000000000010", - "Tony stark", - 1, - 2025, - "123",$address,"","", - ['key0' => 'metadata9', - 'key1' => 'metadata0'],"", - new PagarmeApiSDKLib\Models\CreateCardOptionsRequest(false), - false,"" - - ); - - $customerId = "cus_z6WBYzNhXZd2"; - $result = $customerController->createCard($customerId, $card); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/card/GetCard.php b/examples/card/GetCard.php deleted file mode 100644 index d250352..0000000 --- a/examples/card/GetCard.php +++ /dev/null @@ -1,23 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $customerId = "cus_z6WBYzNhliZd2"; - $cardId = "card_R4e0W1K4l5gx"; - $result = $customerController->getCard($customerId, $cardId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/charges/CancelCharge.php b/examples/charges/CancelCharge.php deleted file mode 100644 index 4ca6dc0..0000000 --- a/examples/charges/CancelCharge.php +++ /dev/null @@ -1,22 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $chargeController = $client->getChargesController(); - - $chargeId = "ch_Yb916oootPg6pjP"; - $result = $chargeController->cancelCharge($chargeId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/charges/CancelChargePartial.php b/examples/charges/CancelChargePartial.php deleted file mode 100644 index ac70425..0000000 --- a/examples/charges/CancelChargePartial.php +++ /dev/null @@ -1,26 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $chargeController = $client->getChargesController(); - - $chargeId = "ch_BrW2jVuuin1E7D"; - - $request = new PagarmeApiSDKLib\Models\CreateCancelChargeRequest(""); - $request->setAmount(1000); - - $result = $chargeController->cancelCharge($chargeId, $request); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/charges/CaptureCharge.php b/examples/charges/CaptureCharge.php deleted file mode 100644 index 421aa4c..0000000 --- a/examples/charges/CaptureCharge.php +++ /dev/null @@ -1,23 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $chargeController = $client->getChargesController(); - - $chargeId = "ch_e9LwArrZIBk2zGp"; - - $result = $chargeController->captureCharge($chargeId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/charges/GetChargeById.php b/examples/charges/GetChargeById.php deleted file mode 100644 index ba8c013..0000000 --- a/examples/charges/GetChargeById.php +++ /dev/null @@ -1,22 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $chargeController = $client->getChargesController(); - - $chargeId = "ch_Yb916jjjtPg6pjP"; - $result = $chargeController->getCharge($chargeId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/customer/CreateCustomer.php b/examples/customer/CreateCustomer.php deleted file mode 100644 index 758e04b..0000000 --- a/examples/customer/CreateCustomer.php +++ /dev/null @@ -1,43 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customer = new PagarmeApiSDKLib\Models\CreateCustomerRequest( - "magno", - "magno.moreira@pagarme.com", - "90352621079", - "individual", - $address, - ['key0' => 'metadata9', 'key1' => 'metadata0'], - new PagarmeApiSDKLib\Models\CreatePhonesRequest(), - "code2" - ); - - $result = $customerController->createCustomer($customer); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/customer/GetCustomerById.php b/examples/customer/GetCustomerById.php deleted file mode 100644 index 924a60a..0000000 --- a/examples/customer/GetCustomerById.php +++ /dev/null @@ -1,22 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $customerController = $client->getCustomersController(); - - $customerId = "cus_z6WBYzNhggXZd2"; - $result = $customerController->getCustomer($customerId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/invoice/GetInvoiceById.php b/examples/invoice/GetInvoiceById.php deleted file mode 100644 index 461c654..0000000 --- a/examples/invoice/GetInvoiceById.php +++ /dev/null @@ -1,22 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $invoiceController = $client->getInvoicesController(); - - $invoiceId = "invoiceId"; - $result = $customerController->getInvoice($invoiceId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/marketplace/CreateAnticipation.php b/examples/marketplace/CreateAnticipation.php deleted file mode 100644 index 75460a2..0000000 --- a/examples/marketplace/CreateAnticipation.php +++ /dev/null @@ -1,23 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $recipientController = $client->getRecipientsController(); - - $request = new PagarmeApiSDKLib\Models\CreateAnticipationRequest(1000, "start", datetime::createFromFormat("Y-m-d", "2020-12-12")); - $recipientId = "recipientId"; - $result = $recipientController->createAnticipation($recipientId, $request); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/marketplace/CreateRecipient.php b/examples/marketplace/CreateRecipient.php deleted file mode 100644 index 8ef8fe9..0000000 --- a/examples/marketplace/CreateRecipient.php +++ /dev/null @@ -1,27 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $recipientController = $client->getRecipientsController(); - - $banckAccount = new PagarmeApiSDKLib\Models\CreateBankAccountRequest("Tony stark", "individual", "26224451990", "341", "1234", "6", "1234", "6", "checking", - ['key0' => 'metadata7', 'key1' => 'metadata6'], ""); - - $request = new PagarmeApiSDKLib\Models\CreateRecipientRequest("Tony Stark", "stark@pagar.me", "Recebedor TonyStark", "26224451990", "individual", $banckAccount, - ['key0' => 'metadata7', 'key1' => 'metadata6'],"1","bank_transfer" ); - - $result = $recipientController->createRecipient($request); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/marketplace/GetRecipientById.php b/examples/marketplace/GetRecipientById.php deleted file mode 100644 index 0900394..0000000 --- a/examples/marketplace/GetRecipientById.php +++ /dev/null @@ -1,22 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $recipientController = $client->getRecipientsController(); - - $recipientId = "rp_xO1jpA5so6Ighjb"; - $result = $recipientController->getRecipient($recipientId); - - echo json_encode($result, JSON_PRETTY_PRINT); -} -catch (Exception $ex) -{ - echo var_dump($ex, JSON_PRETTY_PRINT); -} -?> \ No newline at end of file diff --git a/examples/orders/CreateOrderBoleto.php b/examples/orders/CreateOrderBoleto.php deleted file mode 100644 index b6867ff..0000000 --- a/examples/orders/CreateOrderBoleto.php +++ /dev/null @@ -1,56 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $ordersController = $client->getOrdersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customer = new PagarmeApiSDKLib\Models\CreateCustomerRequest( - "magno", - "magno.moreira@pagarme.com", - "90352621079", - "individual", - $address, - ['key0' => 'metadata9', 'key1' => 'metadata0'], - new PagarmeApiSDKLib\Models\CreatePhonesRequest(), - "code2" - ); - - $boleto = new PagarmeApiSDKLib\Models\CreateBoletoPaymentRequest(1, - "033", "Pagar ate o vencimento",$address, - "","12036352065",""); - - $boleto->setDueAt(new DateTime('2023-12-31T00:00:00Z')); - $payment = new PagarmeApiSDKLib\Models\CreatePaymentRequest("boleto"); - $payment->setBoleto($boleto); - - $request = new PagarmeApiSDKLib\Models\CreateOrderRequest( - [new PagarmeApiSDKLib\Models\CreateOrderItemRequest(1490,"telefone",1,"eletronico")], - $customer,[$payment], "code", "", ['key0' => 'metadata9', 'key1' => 'metadata0'], false - ); - - $result = $ordersController->createOrder($request); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/orders/CreateOrderCreditCard.php b/examples/orders/CreateOrderCreditCard.php deleted file mode 100644 index b993f96..0000000 --- a/examples/orders/CreateOrderCreditCard.php +++ /dev/null @@ -1,69 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $ordersController = $client->getOrdersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customer = new PagarmeApiSDKLib\Models\CreateCustomerRequest( - "magno", - "magno.moreira@pagarme.com", - "90352621079", - "individual", - $address, - ['key0' => 'metadata9', 'key1' => 'metadata0'], - new PagarmeApiSDKLib\Models\CreatePhonesRequest(), - "code2" - ); - - $creditCard = new PagarmeApiSDKLib\Models\CreateCreditCardPaymentRequest(); - $card = new PagarmeApiSDKLib\Models\CreateCardRequest( - "4000000000000010", - "Tony stark", - 1, - 2025, - "123",$address,"","", - ['key0' => 'metadata9', - 'key1' => 'metadata0'],"", - new PagarmeApiSDKLib\Models\CreateCardOptionsRequest(false), - false,"" - - ); - - $creditCard->setCard($card); - $creditCard->setCapture(false); - - $payment = new PagarmeApiSDKLib\Models\CreatePaymentRequest("credit_card"); - $payment->setCreditCard($creditCard); - - $request = new PagarmeApiSDKLib\Models\CreateOrderRequest( - [new PagarmeApiSDKLib\Models\CreateOrderItemRequest(1490,"telefone",1,"eletronico")], - $customer,[$payment], "code", "", ['key0' => 'metadata9', 'key1' => 'metadata0'], false - ); - - - $result = $ordersController->createOrder($request); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/orders/CreateOrderPix.php b/examples/orders/CreateOrderPix.php deleted file mode 100644 index ac48189..0000000 --- a/examples/orders/CreateOrderPix.php +++ /dev/null @@ -1,55 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $ordersController = $client->getOrdersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customer = new PagarmeApiSDKLib\Models\CreateCustomerRequest( - "magno", - "magno.moreira@pagarme.com", - "90352621079", - "individual", - $address, - ['key0' => 'metadata9', 'key1' => 'metadata0'], - new PagarmeApiSDKLib\Models\CreatePhonesRequest(), - "code2" - ); - - $pix = new PagarmeApiSDKLib\Models\CreatePixPaymentRequest(); - $pix->setExpiresAt(new DateTime('2023-01-31T00:00:00Z')); - $pix->setAdditionalInformation([new PagarmeApiSDKLib\Models\PixAdditionalInformation("quantidade","2")]); - - $payment = new PagarmeApiSDKLib\Models\CreatePaymentRequest("pix"); - $payment->setPix($pix); - - $request = new PagarmeApiSDKLib\Models\CreateOrderRequest( - [new PagarmeApiSDKLib\Models\CreateOrderItemRequest(1490,"telefone",1,"eletronico")], - $customer,[$payment], "code", "", ['key0' => 'metadata9', 'key1' => 'metadata0'], false - ); - - $result = $ordersController->createOrder($request); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/orders/CreateOrderSplit.php b/examples/orders/CreateOrderSplit.php deleted file mode 100644 index d006f17..0000000 --- a/examples/orders/CreateOrderSplit.php +++ /dev/null @@ -1,73 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $ordersController = $client->getOrdersController(); - - $address = new PagarmeApiSDKLib\Models\CreateAddressRequest( - "Malibu Point", - "10880", - "90265", - "Central Malibu", - "Malibu", - "CA", - "US", - "complement1", - ['key0' => 'metadata7', 'key1' => 'metadata6'], - "line1", - "line2" - ); - - $customer = new PagarmeApiSDKLib\Models\CreateCustomerRequest( - "magno", - "magno.moreira@pagarme.com", - "90352621079", - "individual", - $address, - ['key0' => 'metadata9', 'key1' => 'metadata0'], - new PagarmeApiSDKLib\Models\CreatePhonesRequest(), - "code2" - ); - - $creditCard = new PagarmeApiSDKLib\Models\CreateCreditCardPaymentRequest(); - $card = new PagarmeApiSDKLib\Models\CreateCardRequest( - "4000000000000010", - "Tony stark", - 1, - 2025, - "123",$address,"","", - ['key0' => 'metadata9', - 'key1' => 'metadata0'],"", - new PagarmeApiSDKLib\Models\CreateCardOptionsRequest(false), - false,"" - - ); - - $creditCard->setCard($card); - $creditCard->setCapture(false); - - $payment = new PagarmeApiSDKLib\Models\CreatePaymentRequest("credit_card"); - $payment->setCreditCard($creditCard); - $payment->setSplit([ - new PagarmeApiSDKLib\Models\CreateSplitRequest("flat", 100000, "rp_xO1jpA5so6I1peMb" ), - new PagarmeApiSDKLib\Models\CreateSplitRequest("flat", 100000, "rp_xO1jpA5so6I1peMb" ) - ]); - - $request = new PagarmeApiSDKLib\Models\CreateOrderRequest( - [new PagarmeApiSDKLib\Models\CreateOrderItemRequest(200000,"telefone",1,"eletronico")], - $customer,[$payment], "code", "", ['key0' => 'metadata9', 'key1' => 'metadata0'], false - ); - - $result = $ordersController->createOrder($request); - - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/examples/orders/GetOrders.php b/examples/orders/GetOrders.php deleted file mode 100644 index d74e3d9..0000000 --- a/examples/orders/GetOrders.php +++ /dev/null @@ -1,18 +0,0 @@ -basicAuthUserName('basicAuthUserName') - ->basicAuthPassword('BasicAuthPassword') - ->build(); - - $ordersController = $client->getOrdersController(); - - $result = $ordersController->getOrders(); - echo json_encode($result, JSON_PRETTY_PRINT); - } - catch (Exception $ex) { - echo var_dump($ex, JSON_PRETTY_PRINT); - } -?> \ No newline at end of file diff --git a/src/ApiHelper.php b/src/ApiHelper.php index b78db25..3ffae4a 100644 --- a/src/ApiHelper.php +++ b/src/ApiHelper.php @@ -27,15 +27,15 @@ class ApiHelper */ private const INHERITED_MODELS_MAP = [ Models\GetTransactionResponse::class => [ - Models\GetVoucherTransactionResponse::class, Models\GetBankTransferTransactionResponse::class, Models\GetSafetyPayTransactionResponse::class, - Models\GetDebitCardTransactionResponse::class, + Models\GetVoucherTransactionResponse::class, Models\GetBoletoTransactionResponse::class, - Models\GetCashTransactionResponse::class, + Models\GetDebitCardTransactionResponse::class, Models\GetPrivateLabelTransactionResponse::class, - Models\GetPixTransactionResponse::class, - Models\GetCreditCardTransactionResponse::class + Models\GetCashTransactionResponse::class, + Models\GetCreditCardTransactionResponse::class, + Models\GetPixTransactionResponse::class ], Models\GetMovementObjectBaseResponse::class => [ Models\GetMovementObjectRefundResponse::class, diff --git a/src/AuthManagerInterface.php b/src/AuthManagerInterface.php deleted file mode 100644 index f8a4dc9..0000000 --- a/src/AuthManagerInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -requestBuilder(RequestMethod::GET, '/balance/operations') ->auth('global') @@ -41,7 +43,8 @@ public function getBalanceOperations( QueryParam::init('created_since', $createdSince) ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), QueryParam::init('created_until', $createdUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('recipient_id', $recipientId) ); $_resHandler = $this->responseHandler()->type(ListBalanceOperationResponse::class); diff --git a/src/Controllers/ChargesController.php b/src/Controllers/ChargesController.php index 30230af..a3a5aca 100644 --- a/src/Controllers/ChargesController.php +++ b/src/Controllers/ChargesController.php @@ -92,78 +92,55 @@ public function updateChargePaymentMethod( } /** - * Updates the card from a charge - * - * @param string $chargeId Charge id - * @param UpdateChargeCardRequest $request Request for updating a charge's card - * @param string|null $idempotencyKey + * @param string $chargeId Charge Id + * @param int|null $page Page number + * @param int|null $size Page size * - * @return GetChargeResponse Response from the API call + * @return ListChargeTransactionsResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateChargeCard( + public function getChargeTransactions( string $chargeId, - UpdateChargeCardRequest $request, - ?string $idempotencyKey = null - ): GetChargeResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/charges/{charge_id}/card') + ?int $page = null, + ?int $size = null + ): ListChargeTransactionsResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/{charge_id}/transactions') ->auth('global') ->parameters( TemplateParam::init('charge_id', $chargeId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetChargeResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @param string $status - * @param \DateTime|null $createdSince - * @param \DateTime|null $createdUntil - * - * @return GetChargesSummaryResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getChargesSummary( - string $status, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null - ): GetChargesSummaryResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/summary') - ->auth('global') - ->parameters( - QueryParam::init('status', $status), - QueryParam::init('created_since', $createdSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('created_until', $createdUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + QueryParam::init('page', $page), + QueryParam::init('size', $size) ); - $_resHandler = $this->responseHandler()->type(GetChargesSummaryResponse::class); + $_resHandler = $this->responseHandler()->type(ListChargeTransactionsResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a new charge + * Updates the due date from a charge * - * @param CreateChargeRequest $request Request for creating a charge + * @param string $chargeId Charge Id + * @param UpdateChargeDueDateRequest $request Request for updating the due date * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createCharge(CreateChargeRequest $request, ?string $idempotencyKey = null): GetChargeResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/Charges') + public function updateChargeDueDate( + string $chargeId, + UpdateChargeDueDateRequest $request, + ?string $idempotencyKey = null + ): GetChargeResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Charges/{charge_id}/due-date') ->auth('global') - ->parameters(BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey)); + ->parameters( + TemplateParam::init('charge_id', $chargeId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetChargeResponse::class); @@ -171,28 +148,51 @@ public function createCharge(CreateChargeRequest $request, ?string $idempotencyK } /** - * @param string $chargeId Charge Id + * Lists all charges + * * @param int|null $page Page number * @param int|null $size Page size + * @param string|null $code Filter for charge's code + * @param string|null $status Filter for charge's status + * @param string|null $paymentMethod Filter for charge's payment method + * @param string|null $customerId Filter for charge's customer id + * @param string|null $orderId Filter for charge's order id + * @param \DateTime|null $createdSince Filter for the beginning of the range for charge's + * creation + * @param \DateTime|null $createdUntil Filter for the end of the range for charge's creation * - * @return ListChargeTransactionsResponse Response from the API call + * @return ListChargesResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getChargeTransactions( - string $chargeId, + public function getCharges( ?int $page = null, - ?int $size = null - ): ListChargeTransactionsResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/{charge_id}/transactions') + ?int $size = null, + ?string $code = null, + ?string $status = null, + ?string $paymentMethod = null, + ?string $customerId = null, + ?string $orderId = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null + ): ListChargesResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges') ->auth('global') ->parameters( - TemplateParam::init('charge_id', $chargeId), QueryParam::init('page', $page), - QueryParam::init('size', $size) + QueryParam::init('size', $size), + QueryParam::init('code', $code), + QueryParam::init('status', $status), + QueryParam::init('payment_method', $paymentMethod), + QueryParam::init('customer_id', $customerId), + QueryParam::init('order_id', $orderId), + QueryParam::init('created_since', $createdSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_until', $createdUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(ListChargeTransactionsResponse::class); + $_resHandler = $this->responseHandler()->type(ListChargesResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -227,19 +227,28 @@ public function captureCharge( } /** - * Get a charge from its id + * Updates the card from a charge * * @param string $chargeId Charge id + * @param UpdateChargeCardRequest $request Request for updating a charge's card + * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getCharge(string $chargeId): GetChargeResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/{charge_id}') + public function updateChargeCard( + string $chargeId, + UpdateChargeCardRequest $request, + ?string $idempotencyKey = null + ): GetChargeResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/charges/{charge_id}/card') ->auth('global') - ->parameters(TemplateParam::init('charge_id', $chargeId)); + ->parameters( + TemplateParam::init('charge_id', $chargeId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetChargeResponse::class); @@ -247,28 +256,19 @@ public function getCharge(string $chargeId): GetChargeResponse } /** - * Cancel a charge + * Get a charge from its id * * @param string $chargeId Charge id - * @param CreateCancelChargeRequest|null $request Request for cancelling a charge - * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function cancelCharge( - string $chargeId, - ?CreateCancelChargeRequest $request = null, - ?string $idempotencyKey = null - ): GetChargeResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/charges/{charge_id}') + public function getCharge(string $chargeId): GetChargeResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/{charge_id}') ->auth('global') - ->parameters( - TemplateParam::init('charge_id', $chargeId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(TemplateParam::init('charge_id', $chargeId)); $_resHandler = $this->responseHandler()->type(GetChargeResponse::class); @@ -276,74 +276,50 @@ public function cancelCharge( } /** - * Lists all charges - * - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $code Filter for charge's code - * @param string|null $status Filter for charge's status - * @param string|null $paymentMethod Filter for charge's payment method - * @param string|null $customerId Filter for charge's customer id - * @param string|null $orderId Filter for charge's order id - * @param \DateTime|null $createdSince Filter for the beginning of the range for charge's - * creation - * @param \DateTime|null $createdUntil Filter for the end of the range for charge's creation + * @param string $status + * @param \DateTime|null $createdSince + * @param \DateTime|null $createdUntil * - * @return ListChargesResponse Response from the API call + * @return GetChargesSummaryResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getCharges( - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $status = null, - ?string $paymentMethod = null, - ?string $customerId = null, - ?string $orderId = null, + public function getChargesSummary( + string $status, ?\DateTime $createdSince = null, ?\DateTime $createdUntil = null - ): ListChargesResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges') + ): GetChargesSummaryResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/charges/summary') ->auth('global') ->parameters( - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('code', $code), QueryParam::init('status', $status), - QueryParam::init('payment_method', $paymentMethod), - QueryParam::init('customer_id', $customerId), - QueryParam::init('order_id', $orderId), QueryParam::init('created_since', $createdSince) ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), QueryParam::init('created_until', $createdUntil) ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(ListChargesResponse::class); + $_resHandler = $this->responseHandler()->type(GetChargesSummaryResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $chargeId - * @param CreateConfirmPaymentRequest|null $request Request for confirm payment + * Retries a charge + * + * @param string $chargeId Charge id * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function confirmPayment( - string $chargeId, - ?CreateConfirmPaymentRequest $request = null, - ?string $idempotencyKey = null - ): GetChargeResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/charges/{charge_id}/confirm-payment') + public function retryCharge(string $chargeId, ?string $idempotencyKey = null): GetChargeResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/charges/{charge_id}/retry') ->auth('global') ->parameters( TemplateParam::init('charge_id', $chargeId), - BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); @@ -353,22 +329,22 @@ public function confirmPayment( } /** - * Updates the due date from a charge + * Cancel a charge * - * @param string $chargeId Charge Id - * @param UpdateChargeDueDateRequest $request Request for updating the due date + * @param string $chargeId Charge id + * @param CreateCancelChargeRequest|null $request Request for cancelling a charge * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateChargeDueDate( + public function cancelCharge( string $chargeId, - UpdateChargeDueDateRequest $request, + ?CreateCancelChargeRequest $request = null, ?string $idempotencyKey = null ): GetChargeResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Charges/{charge_id}/due-date') + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/charges/{charge_id}') ->auth('global') ->parameters( TemplateParam::init('charge_id', $chargeId), @@ -382,21 +358,45 @@ public function updateChargeDueDate( } /** - * Retries a charge + * Creates a new charge * - * @param string $chargeId Charge id + * @param CreateChargeRequest $request Request for creating a charge * @param string|null $idempotencyKey * * @return GetChargeResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function retryCharge(string $chargeId, ?string $idempotencyKey = null): GetChargeResponse + public function createCharge(CreateChargeRequest $request, ?string $idempotencyKey = null): GetChargeResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/charges/{charge_id}/retry') + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/Charges') + ->auth('global') + ->parameters(BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey)); + + $_resHandler = $this->responseHandler()->type(GetChargeResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * @param string $chargeId + * @param CreateConfirmPaymentRequest|null $request Request for confirm payment + * @param string|null $idempotencyKey + * + * @return GetChargeResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function confirmPayment( + string $chargeId, + ?CreateConfirmPaymentRequest $request = null, + ?string $idempotencyKey = null + ): GetChargeResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/charges/{charge_id}/confirm-payment') ->auth('global') ->parameters( TemplateParam::init('charge_id', $chargeId), + BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); diff --git a/src/Controllers/CustomersController.php b/src/Controllers/CustomersController.php index c9ad0e0..f5ee284 100644 --- a/src/Controllers/CustomersController.php +++ b/src/Controllers/CustomersController.php @@ -131,35 +131,6 @@ public function deleteAccessToken( return $this->execute($_reqBuilder, $_resHandler); } - /** - * Creates a new address for a customer - * - * @param string $customerId Customer Id - * @param CreateAddressRequest $request Request for creating an address - * @param string|null $idempotencyKey - * - * @return GetAddressResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function createAddress( - string $customerId, - CreateAddressRequest $request, - ?string $idempotencyKey = null - ): GetAddressResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/addresses') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetAddressResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - /** * Creates a new customer * @@ -182,22 +153,22 @@ public function createCustomer(CreateCustomerRequest $request, ?string $idempote } /** - * Creates a new card for a customer + * Creates a new address for a customer * - * @param string $customerId Customer id - * @param CreateCardRequest $request Request for creating a card + * @param string $customerId Customer Id + * @param CreateAddressRequest $request Request for creating an address * @param string|null $idempotencyKey * - * @return GetCardResponse Response from the API call + * @return GetAddressResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createCard( + public function createAddress( string $customerId, - CreateCardRequest $request, + CreateAddressRequest $request, ?string $idempotencyKey = null - ): GetCardResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/cards') + ): GetAddressResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/addresses') ->auth('global') ->parameters( TemplateParam::init('customer_id', $customerId), @@ -205,59 +176,27 @@ public function createCard( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetCardResponse::class); + $_resHandler = $this->responseHandler()->type(GetAddressResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Get all cards from a customer + * Delete a Customer's access tokens * * @param string $customerId Customer Id - * @param int|null $page Page number - * @param int|null $size Page size - * - * @return ListCardsResponse Response from the API call * - * @throws ApiException Thrown if API call fails - */ - public function getCards(string $customerId, ?int $page = null, ?int $size = null): ListCardsResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/cards') - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - QueryParam::init('page', $page), - QueryParam::init('size', $size) - ); - - $_resHandler = $this->responseHandler()->type(ListCardsResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Renew a card - * - * @param string $customerId Customer id - * @param string $cardId Card Id - * @param string|null $idempotencyKey - * - * @return GetCardResponse Response from the API call + * @return ListAccessTokensResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function renewCard(string $customerId, string $cardId, ?string $idempotencyKey = null): GetCardResponse + public function deleteAccessTokens(string $customerId): ListAccessTokensResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/cards/{card_id}/renew') + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/access-tokens/') ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('card_id', $cardId), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(TemplateParam::init('customer_id', $customerId)); - $_resHandler = $this->responseHandler()->type(GetCardResponse::class); + $_resHandler = $this->responseHandler()->type(ListAccessTokensResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -319,49 +258,22 @@ public function deleteAddress( } /** - * Get a Customer's access token - * - * @param string $customerId Customer Id - * @param string $tokenId Token Id - * - * @return GetAccessTokenResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getAccessToken(string $customerId, string $tokenId): GetAccessTokenResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/customers/{customer_id}/access-tokens/{token_id}' - ) - ->auth('global') - ->parameters( - TemplateParam::init('customer_id', $customerId), - TemplateParam::init('token_id', $tokenId) - ); - - $_resHandler = $this->responseHandler()->type(GetAccessTokenResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the metadata a customer + * Creates a new card for a customer * - * @param string $customerId The customer id - * @param UpdateMetadataRequest $request Request for updating the customer metadata + * @param string $customerId Customer id + * @param CreateCardRequest $request Request for creating a card * @param string|null $idempotencyKey * - * @return GetCustomerResponse Response from the API call + * @return GetCardResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateCustomerMetadata( + public function createCard( string $customerId, - UpdateMetadataRequest $request, + CreateCardRequest $request, ?string $idempotencyKey = null - ): GetCustomerResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Customers/{customer_id}/metadata') + ): GetCardResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/cards') ->auth('global') ->parameters( TemplateParam::init('customer_id', $customerId), @@ -369,48 +281,74 @@ public function updateCustomerMetadata( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetCustomerResponse::class); + $_resHandler = $this->responseHandler()->type(GetCardResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Get a customer's card + * Get all Customers * - * @param string $customerId Customer id - * @param string $cardId Card id + * @param string|null $name Name of the Customer + * @param string|null $document Document of the Customer + * @param int|null $page Current page the the search + * @param int|null $size Quantity pages of the search + * @param string|null $email Customer's email + * @param string|null $code Customer's code * - * @return GetCardResponse Response from the API call + * @return ListCustomersResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getCard(string $customerId, string $cardId): GetCardResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/cards/{card_id}') + public function getCustomers( + ?string $name = null, + ?string $document = null, + ?int $page = 1, + ?int $size = 10, + ?string $email = null, + ?string $code = null + ): ListCustomersResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers') ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId), TemplateParam::init('card_id', $cardId)); + ->parameters( + QueryParam::init('name', $name), + QueryParam::init('document', $document), + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('email', $email), + QueryParam::init('Code', $code) + ); - $_resHandler = $this->responseHandler()->type(GetCardResponse::class); + $_resHandler = $this->responseHandler()->type(ListCustomersResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Delete a Customer's access tokens + * Updates a customer * - * @param string $customerId Customer Id + * @param string $customerId Customer id + * @param UpdateCustomerRequest $request Request for updating a customer + * @param string|null $idempotencyKey * - * @return ListAccessTokensResponse Response from the API call + * @return GetCustomerResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteAccessTokens(string $customerId): ListAccessTokensResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/access-tokens/') + public function updateCustomer( + string $customerId, + UpdateCustomerRequest $request, + ?string $idempotencyKey = null + ): GetCustomerResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/customers/{customer_id}') ->auth('global') - ->parameters(TemplateParam::init('customer_id', $customerId)); + ->parameters( + TemplateParam::init('customer_id', $customerId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); - $_resHandler = $this->responseHandler()->type(ListAccessTokensResponse::class); + $_resHandler = $this->responseHandler()->type(GetCustomerResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -471,60 +409,101 @@ public function getAccessTokens(string $customerId, ?int $page = null, ?int $siz } /** - * Get all Customers + * Get all cards from a customer * - * @param string|null $name Name of the Customer - * @param string|null $document Document of the Customer - * @param int|null $page Current page the the search - * @param int|null $size Quantity pages of the search - * @param string|null $email Customer's email - * @param string|null $code Customer's code + * @param string $customerId Customer Id + * @param int|null $page Page number + * @param int|null $size Page size * - * @return ListCustomersResponse Response from the API call + * @return ListCardsResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getCustomers( - ?string $name = null, - ?string $document = null, - ?int $page = 1, - ?int $size = 10, - ?string $email = null, - ?string $code = null - ): ListCustomersResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers') + public function getCards(string $customerId, ?int $page = null, ?int $size = null): ListCardsResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/cards') ->auth('global') ->parameters( - QueryParam::init('name', $name), - QueryParam::init('document', $document), + TemplateParam::init('customer_id', $customerId), QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('email', $email), - QueryParam::init('Code', $code) + QueryParam::init('size', $size) ); - $_resHandler = $this->responseHandler()->type(ListCustomersResponse::class); + $_resHandler = $this->responseHandler()->type(ListCardsResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates a customer + * Renew a card * * @param string $customerId Customer id - * @param UpdateCustomerRequest $request Request for updating a customer + * @param string $cardId Card Id + * @param string|null $idempotencyKey + * + * @return GetCardResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function renewCard(string $customerId, string $cardId, ?string $idempotencyKey = null): GetCardResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/customers/{customer_id}/cards/{card_id}/renew') + ->auth('global') + ->parameters( + TemplateParam::init('customer_id', $customerId), + TemplateParam::init('card_id', $cardId), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); + + $_resHandler = $this->responseHandler()->type(GetCardResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * Get a Customer's access token + * + * @param string $customerId Customer Id + * @param string $tokenId Token Id + * + * @return GetAccessTokenResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getAccessToken(string $customerId, string $tokenId): GetAccessTokenResponse + { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/customers/{customer_id}/access-tokens/{token_id}' + ) + ->auth('global') + ->parameters( + TemplateParam::init('customer_id', $customerId), + TemplateParam::init('token_id', $tokenId) + ); + + $_resHandler = $this->responseHandler()->type(GetAccessTokenResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * Updates the metadata a customer + * + * @param string $customerId The customer id + * @param UpdateMetadataRequest $request Request for updating the customer metadata * @param string|null $idempotencyKey * * @return GetCustomerResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateCustomer( + public function updateCustomerMetadata( string $customerId, - UpdateCustomerRequest $request, + UpdateMetadataRequest $request, ?string $idempotencyKey = null ): GetCustomerResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/customers/{customer_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Customers/{customer_id}/metadata') ->auth('global') ->parameters( TemplateParam::init('customer_id', $customerId), @@ -608,4 +587,25 @@ public function getCustomer(string $customerId): GetCustomerResponse return $this->execute($_reqBuilder, $_resHandler); } + + /** + * Get a customer's card + * + * @param string $customerId Customer id + * @param string $cardId Card id + * + * @return GetCardResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getCard(string $customerId, string $cardId): GetCardResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/customers/{customer_id}/cards/{card_id}') + ->auth('global') + ->parameters(TemplateParam::init('customer_id', $customerId), TemplateParam::init('card_id', $cardId)); + + $_resHandler = $this->responseHandler()->type(GetCardResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } } diff --git a/src/Controllers/InvoicesController.php b/src/Controllers/InvoicesController.php index 857a90a..73716c7 100644 --- a/src/Controllers/InvoicesController.php +++ b/src/Controllers/InvoicesController.php @@ -25,6 +25,78 @@ class InvoicesController extends BaseController { + /** + * Updates the metadata from an invoice + * + * @param string $invoiceId The invoice id + * @param UpdateMetadataRequest $request Request for updating the invoice metadata + * @param string|null $idempotencyKey + * + * @return GetInvoiceResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function updateInvoiceMetadata( + string $invoiceId, + UpdateMetadataRequest $request, + ?string $idempotencyKey = null + ): GetInvoiceResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/invoices/{invoice_id}/metadata') + ->auth('global') + ->parameters( + TemplateParam::init('invoice_id', $invoiceId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); + + $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * @param string $subscriptionId Subscription Id + * + * @return GetInvoiceResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getPartialInvoice(string $subscriptionId): GetInvoiceResponse + { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/subscriptions/{subscription_id}/partial-invoice' + )->auth('global')->parameters(TemplateParam::init('subscription_id', $subscriptionId)); + + $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * Cancels an invoice + * + * @param string $invoiceId Invoice id + * @param string|null $idempotencyKey + * + * @return GetInvoiceResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function cancelInvoice(string $invoiceId, ?string $idempotencyKey = null): GetInvoiceResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/invoices/{invoice_id}') + ->auth('global') + ->parameters( + TemplateParam::init('invoice_id', $invoiceId), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); + + $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + /** * Create an Invoice * @@ -116,71 +188,19 @@ public function getInvoices( } /** - * Cancels an invoice + * Gets an invoice * - * @param string $invoiceId Invoice id - * @param string|null $idempotencyKey + * @param string $invoiceId Invoice Id * * @return GetInvoiceResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function cancelInvoice(string $invoiceId, ?string $idempotencyKey = null): GetInvoiceResponse + public function getInvoice(string $invoiceId): GetInvoiceResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/invoices/{invoice_id}') - ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Updates the metadata from an invoice - * - * @param string $invoiceId The invoice id - * @param UpdateMetadataRequest $request Request for updating the invoice metadata - * @param string|null $idempotencyKey - * - * @return GetInvoiceResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function updateInvoiceMetadata( - string $invoiceId, - UpdateMetadataRequest $request, - ?string $idempotencyKey = null - ): GetInvoiceResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/invoices/{invoice_id}/metadata') + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/invoices/{invoice_id}') ->auth('global') - ->parameters( - TemplateParam::init('invoice_id', $invoiceId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @param string $subscriptionId Subscription Id - * - * @return GetInvoiceResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getPartialInvoice(string $subscriptionId): GetInvoiceResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/partial-invoice' - )->auth('global')->parameters(TemplateParam::init('subscription_id', $subscriptionId)); + ->parameters(TemplateParam::init('invoice_id', $invoiceId)); $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); @@ -215,24 +235,4 @@ public function updateInvoiceStatus( return $this->execute($_reqBuilder, $_resHandler); } - - /** - * Gets an invoice - * - * @param string $invoiceId Invoice Id - * - * @return GetInvoiceResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getInvoice(string $invoiceId): GetInvoiceResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/invoices/{invoice_id}') - ->auth('global') - ->parameters(TemplateParam::init('invoice_id', $invoiceId)); - - $_resHandler = $this->responseHandler()->type(GetInvoiceResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } } diff --git a/src/Controllers/OrdersController.php b/src/Controllers/OrdersController.php index cabe654..8c68db9 100644 --- a/src/Controllers/OrdersController.php +++ b/src/Controllers/OrdersController.php @@ -74,16 +74,27 @@ public function getOrders( /** * @param string $orderId Order Id * @param string $itemId Item Id + * @param UpdateOrderItemRequest $request Item Model + * @param string|null $idempotencyKey * * @return GetOrderItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getOrderItem(string $orderId, string $itemId): GetOrderItemResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/orders/{orderId}/items/{itemId}') + public function updateOrderItem( + string $orderId, + string $itemId, + UpdateOrderItemRequest $request, + ?string $idempotencyKey = null + ): GetOrderItemResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/orders/{orderId}/items/{itemId}') ->auth('global') - ->parameters(TemplateParam::init('orderId', $orderId), TemplateParam::init('itemId', $itemId)); + ->parameters( + TemplateParam::init('orderId', $orderId), + TemplateParam::init('itemId', $itemId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetOrderItemResponse::class); @@ -91,25 +102,54 @@ public function getOrderItem(string $orderId, string $itemId): GetOrderItemRespo } /** - * Gets an order - * - * @param string $orderId Order id + * @param string $orderId Order Id + * @param string|null $idempotencyKey * * @return GetOrderResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getOrder(string $orderId): GetOrderResponse + public function deleteAllOrderItems(string $orderId, ?string $idempotencyKey = null): GetOrderResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/orders/{order_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/orders/{orderId}/items') ->auth('global') - ->parameters(TemplateParam::init('order_id', $orderId)); + ->parameters( + TemplateParam::init('orderId', $orderId), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetOrderResponse::class); return $this->execute($_reqBuilder, $_resHandler); } + /** + * @param string $orderId Order Id + * @param string $itemId Item Id + * @param string|null $idempotencyKey + * + * @return GetOrderItemResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function deleteOrderItem( + string $orderId, + string $itemId, + ?string $idempotencyKey = null + ): GetOrderItemResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/orders/{orderId}/items/{itemId}') + ->auth('global') + ->parameters( + TemplateParam::init('orderId', $orderId), + TemplateParam::init('itemId', $itemId), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); + + $_resHandler = $this->responseHandler()->type(GetOrderItemResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + /** * @param string $id Order Id * @param UpdateOrderStatusRequest $request Update Order Model @@ -160,25 +200,22 @@ public function createOrder(CreateOrderRequest $body, ?string $idempotencyKey = /** * @param string $orderId Order Id - * @param string $itemId Item Id - * @param UpdateOrderItemRequest $request Item Model + * @param CreateOrderItemRequest $request Order Item Model * @param string|null $idempotencyKey * * @return GetOrderItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateOrderItem( + public function createOrderItem( string $orderId, - string $itemId, - UpdateOrderItemRequest $request, + CreateOrderItemRequest $request, ?string $idempotencyKey = null ): GetOrderItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/orders/{orderId}/items/{itemId}') + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/orders/{orderId}/items') ->auth('global') ->parameters( TemplateParam::init('orderId', $orderId), - TemplateParam::init('itemId', $itemId), BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); @@ -190,22 +227,19 @@ public function updateOrderItem( /** * @param string $orderId Order Id - * @param string|null $idempotencyKey + * @param string $itemId Item Id * - * @return GetOrderResponse Response from the API call + * @return GetOrderItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteAllOrderItems(string $orderId, ?string $idempotencyKey = null): GetOrderResponse + public function getOrderItem(string $orderId, string $itemId): GetOrderItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/orders/{orderId}/items') + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/orders/{orderId}/items/{itemId}') ->auth('global') - ->parameters( - TemplateParam::init('orderId', $orderId), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(TemplateParam::init('orderId', $orderId), TemplateParam::init('itemId', $itemId)); - $_resHandler = $this->responseHandler()->type(GetOrderResponse::class); + $_resHandler = $this->responseHandler()->type(GetOrderItemResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -240,55 +274,21 @@ public function updateOrderMetadata( } /** - * @param string $orderId Order Id - * @param string $itemId Item Id - * @param string|null $idempotencyKey - * - * @return GetOrderItemResponse Response from the API call + * Gets an order * - * @throws ApiException Thrown if API call fails - */ - public function deleteOrderItem( - string $orderId, - string $itemId, - ?string $idempotencyKey = null - ): GetOrderItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/orders/{orderId}/items/{itemId}') - ->auth('global') - ->parameters( - TemplateParam::init('orderId', $orderId), - TemplateParam::init('itemId', $itemId), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetOrderItemResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @param string $orderId Order Id - * @param CreateOrderItemRequest $request Order Item Model - * @param string|null $idempotencyKey + * @param string $orderId Order id * - * @return GetOrderItemResponse Response from the API call + * @return GetOrderResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createOrderItem( - string $orderId, - CreateOrderItemRequest $request, - ?string $idempotencyKey = null - ): GetOrderItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/orders/{orderId}/items') + public function getOrder(string $orderId): GetOrderResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/orders/{order_id}') ->auth('global') - ->parameters( - TemplateParam::init('orderId', $orderId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(TemplateParam::init('order_id', $orderId)); - $_resHandler = $this->responseHandler()->type(GetOrderItemResponse::class); + $_resHandler = $this->responseHandler()->type(GetOrderResponse::class); return $this->execute($_reqBuilder, $_resHandler); } diff --git a/src/Controllers/PlansController.php b/src/Controllers/PlansController.php index e824b56..d29683c 100644 --- a/src/Controllers/PlansController.php +++ b/src/Controllers/PlansController.php @@ -49,26 +49,21 @@ public function getPlan(string $planId): GetPlanResponse } /** - * Updates a plan + * Deletes a plan * * @param string $planId Plan id - * @param UpdatePlanRequest $request Request for updating a plan * @param string|null $idempotencyKey * * @return GetPlanResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updatePlan( - string $planId, - UpdatePlanRequest $request, - ?string $idempotencyKey = null - ): GetPlanResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/plans/{plan_id}') + public function deletePlan(string $planId, ?string $idempotencyKey = null): GetPlanResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/plans/{plan_id}') ->auth('global') ->parameters( TemplateParam::init('plan_id', $planId), - BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); @@ -107,26 +102,29 @@ public function updatePlanMetadata( } /** - * Removes an item from a plan + * Updates a plan item * * @param string $planId Plan id * @param string $planItemId Plan item id + * @param UpdatePlanItemRequest $body Request for updating the plan item * @param string|null $idempotencyKey * * @return GetPlanItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deletePlanItem( + public function updatePlanItem( string $planId, string $planItemId, + UpdatePlanItemRequest $body, ?string $idempotencyKey = null ): GetPlanItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/plans/{plan_id}/items/{plan_item_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/plans/{plan_id}/items/{plan_item_id}') ->auth('global') ->parameters( TemplateParam::init('plan_id', $planId), TemplateParam::init('plan_item_id', $planItemId), + BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey) ); @@ -136,44 +134,30 @@ public function deletePlanItem( } /** - * Gets all plans + * Adds a new item to a plan * - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $name Filter for Plan's name - * @param string|null $status Filter for Plan's status - * @param string|null $billingType Filter for plan's billing type - * @param \DateTime|null $createdSince Filter for plan's creation date start range - * @param \DateTime|null $createdUntil Filter for plan's creation date end range + * @param string $planId Plan id + * @param CreatePlanItemRequest $request Request for creating a plan item + * @param string|null $idempotencyKey * - * @return ListPlansResponse Response from the API call + * @return GetPlanItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getPlans( - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $status = null, - ?string $billingType = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null - ): ListPlansResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/plans') + public function createPlanItem( + string $planId, + CreatePlanItemRequest $request, + ?string $idempotencyKey = null + ): GetPlanItemResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/plans/{plan_id}/items') ->auth('global') ->parameters( - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('name', $name), - QueryParam::init('status', $status), - QueryParam::init('billing_type', $billingType), - QueryParam::init('created_since', $createdSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('created_until', $createdUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + TemplateParam::init('plan_id', $planId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(ListPlansResponse::class); + $_resHandler = $this->responseHandler()->type(GetPlanItemResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -200,23 +184,20 @@ public function getPlanItem(string $planId, string $planItemId): GetPlanItemResp } /** - * Deletes a plan + * Creates a new plan * - * @param string $planId Plan id + * @param CreatePlanRequest $body Request for creating a plan * @param string|null $idempotencyKey * * @return GetPlanResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deletePlan(string $planId, ?string $idempotencyKey = null): GetPlanResponse + public function createPlan(CreatePlanRequest $body, ?string $idempotencyKey = null): GetPlanResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/plans/{plan_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/plans') ->auth('global') - ->parameters( - TemplateParam::init('plan_id', $planId), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey)); $_resHandler = $this->responseHandler()->type(GetPlanResponse::class); @@ -224,29 +205,26 @@ public function deletePlan(string $planId, ?string $idempotencyKey = null): GetP } /** - * Updates a plan item + * Removes an item from a plan * * @param string $planId Plan id * @param string $planItemId Plan item id - * @param UpdatePlanItemRequest $body Request for updating the plan item * @param string|null $idempotencyKey * * @return GetPlanItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updatePlanItem( + public function deletePlanItem( string $planId, string $planItemId, - UpdatePlanItemRequest $body, ?string $idempotencyKey = null ): GetPlanItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/plans/{plan_id}/items/{plan_item_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/plans/{plan_id}/items/{plan_item_id}') ->auth('global') ->parameters( TemplateParam::init('plan_id', $planId), TemplateParam::init('plan_item_id', $planItemId), - BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey) ); @@ -256,49 +234,71 @@ public function updatePlanItem( } /** - * Adds a new item to a plan + * Gets all plans * - * @param string $planId Plan id - * @param CreatePlanItemRequest $request Request for creating a plan item - * @param string|null $idempotencyKey + * @param int|null $page Page number + * @param int|null $size Page size + * @param string|null $name Filter for Plan's name + * @param string|null $status Filter for Plan's status + * @param string|null $billingType Filter for plan's billing type + * @param \DateTime|null $createdSince Filter for plan's creation date start range + * @param \DateTime|null $createdUntil Filter for plan's creation date end range * - * @return GetPlanItemResponse Response from the API call + * @return ListPlansResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createPlanItem( - string $planId, - CreatePlanItemRequest $request, - ?string $idempotencyKey = null - ): GetPlanItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/plans/{plan_id}/items') + public function getPlans( + ?int $page = null, + ?int $size = null, + ?string $name = null, + ?string $status = null, + ?string $billingType = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null + ): ListPlansResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/plans') ->auth('global') ->parameters( - TemplateParam::init('plan_id', $planId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('name', $name), + QueryParam::init('status', $status), + QueryParam::init('billing_type', $billingType), + QueryParam::init('created_since', $createdSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_until', $createdUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(GetPlanItemResponse::class); + $_resHandler = $this->responseHandler()->type(ListPlansResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a new plan + * Updates a plan * - * @param CreatePlanRequest $body Request for creating a plan + * @param string $planId Plan id + * @param UpdatePlanRequest $request Request for updating a plan * @param string|null $idempotencyKey * * @return GetPlanResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createPlan(CreatePlanRequest $body, ?string $idempotencyKey = null): GetPlanResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/plans') + public function updatePlan( + string $planId, + UpdatePlanRequest $request, + ?string $idempotencyKey = null + ): GetPlanResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PUT, '/plans/{plan_id}') ->auth('global') - ->parameters(BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey)); + ->parameters( + TemplateParam::init('plan_id', $planId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetPlanResponse::class); diff --git a/src/Controllers/RecipientsController.php b/src/Controllers/RecipientsController.php index cdc2e90..4626510 100644 --- a/src/Controllers/RecipientsController.php +++ b/src/Controllers/RecipientsController.php @@ -149,103 +149,79 @@ public function getRecipients(?int $page = null, ?int $size = null): ListRecipie } /** - * Updates recipient metadata - * - * @param string $recipientId Recipient id - * @param UpdateMetadataRequest $request Metadata - * @param string|null $idempotencyKey - * - * @return GetRecipientResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function updateRecipientMetadata( - string $recipientId, - UpdateMetadataRequest $request, - ?string $idempotencyKey = null - ): GetRecipientResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/recipients/{recipient_id}/metadata') - ->auth('global') - ->parameters( - TemplateParam::init('recipient_id', $recipientId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); - - $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * Gets a transfer - * - * @param string $recipientId Recipient id - * @param string $transferId Transfer id + * @param string $recipientId + * @param string $withdrawalId * - * @return GetTransferResponse Response from the API call + * @return GetWithdrawResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getTransfer(string $recipientId, string $transferId): GetTransferResponse + public function getWithdrawById(string $recipientId, string $withdrawalId): GetWithdrawResponse { $_reqBuilder = $this->requestBuilder( RequestMethod::GET, - '/recipients/{recipient_id}/transfers/{transfer_id}' + '/recipients/{recipient_id}/withdrawals/{withdrawal_id}' ) ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - TemplateParam::init('transfer_id', $transferId) + TemplateParam::init('withdrawal_id', $withdrawalId) ); - $_resHandler = $this->responseHandler()->type(GetTransferResponse::class); + $_resHandler = $this->responseHandler()->type(GetWithdrawResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Gets an anticipation + * Updates the default bank account from a recipient * * @param string $recipientId Recipient id - * @param string $anticipationId Anticipation id + * @param UpdateRecipientBankAccountRequest $request Bank account data + * @param string|null $idempotencyKey * - * @return GetAnticipationResponse Response from the API call + * @return GetRecipientResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getAnticipation(string $recipientId, string $anticipationId): GetAnticipationResponse - { + public function updateRecipientDefaultBankAccount( + string $recipientId, + UpdateRecipientBankAccountRequest $request, + ?string $idempotencyKey = null + ): GetRecipientResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/recipients/{recipient_id}/anticipations/{anticipation_id}' + RequestMethod::PATCH, + '/recipients/{recipient_id}/default-bank-account' ) ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - TemplateParam::init('anticipation_id', $anticipationId) + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetAnticipationResponse::class); + $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $recipientId Recipient Identificator - * @param UpdateTransferSettingsRequest $request + * Updates recipient metadata + * + * @param string $recipientId Recipient id + * @param UpdateMetadataRequest $request Metadata * @param string|null $idempotencyKey * * @return GetRecipientResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateRecipientTransferSettings( + public function updateRecipientMetadata( string $recipientId, - UpdateTransferSettingsRequest $request, + UpdateMetadataRequest $request, ?string $idempotencyKey = null ): GetRecipientResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/recipients/{recipient_id}/transfer-settings') + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/recipients/{recipient_id}/metadata') ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), @@ -259,84 +235,68 @@ public function updateRecipientTransferSettings( } /** - * Retrieves a paginated list of anticipations from a recipient + * Gets a paginated list of transfers for the recipient * * @param string $recipientId Recipient id * @param int|null $page Page number * @param int|null $size Page size - * @param string|null $status Filter for anticipation status - * @param string|null $timeframe Filter for anticipation timeframe - * @param \DateTime|null $paymentDateSince Filter for start range for anticipation payment date - * @param \DateTime|null $paymentDateUntil Filter for end range for anticipation payment date - * @param \DateTime|null $createdSince Filter for start range for anticipation creation date - * @param \DateTime|null $createdUntil Filter for end range for anticipation creation date + * @param string|null $status Filter for transfer status + * @param \DateTime|null $createdSince Filter for start range of transfer creation date + * @param \DateTime|null $createdUntil Filter for end range of transfer creation date * - * @return ListAnticipationResponse Response from the API call + * @return ListTransferResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getAnticipations( + public function getTransfers( string $recipientId, ?int $page = null, ?int $size = null, ?string $status = null, - ?string $timeframe = null, - ?\DateTime $paymentDateSince = null, - ?\DateTime $paymentDateUntil = null, ?\DateTime $createdSince = null, ?\DateTime $createdUntil = null - ): ListAnticipationResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/anticipations') + ): ListTransferResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/transfers') ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), QueryParam::init('page', $page), QueryParam::init('size', $size), QueryParam::init('status', $status), - QueryParam::init('timeframe', $timeframe), - QueryParam::init('payment_date_since', $paymentDateSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('payment_date_until', $paymentDateUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), QueryParam::init('created_since', $createdSince) ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), QueryParam::init('created_until', $createdUntil) ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(ListAnticipationResponse::class); + $_resHandler = $this->responseHandler()->type(ListTransferResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates the default bank account from a recipient + * Gets a transfer * * @param string $recipientId Recipient id - * @param UpdateRecipientBankAccountRequest $request Bank account data - * @param string|null $idempotencyKey + * @param string $transferId Transfer id * - * @return GetRecipientResponse Response from the API call + * @return GetTransferResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateRecipientDefaultBankAccount( - string $recipientId, - UpdateRecipientBankAccountRequest $request, - ?string $idempotencyKey = null - ): GetRecipientResponse { + public function getTransfer(string $recipientId, string $transferId): GetTransferResponse + { $_reqBuilder = $this->requestBuilder( - RequestMethod::PATCH, - '/recipients/{recipient_id}/default-bank-account' + RequestMethod::GET, + '/recipients/{recipient_id}/transfers/{transfer_id}' ) ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('transfer_id', $transferId) ); - $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); + $_resHandler = $this->responseHandler()->type(GetTransferResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -361,71 +321,85 @@ public function createWithdraw(string $recipientId, CreateWithdrawRequest $reque } /** - * Get balance information for a recipient + * Updates recipient metadata * * @param string $recipientId Recipient id + * @param UpdateAutomaticAnticipationSettingsRequest $request Metadata + * @param string|null $idempotencyKey * - * @return GetBalanceResponse Response from the API call + * @return GetRecipientResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getBalance(string $recipientId): GetBalanceResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/balance') + public function updateAutomaticAnticipationSettings( + string $recipientId, + UpdateAutomaticAnticipationSettingsRequest $request, + ?string $idempotencyKey = null + ): GetRecipientResponse { + $_reqBuilder = $this->requestBuilder( + RequestMethod::PATCH, + '/recipients/{recipient_id}/automatic-anticipation-settings' + ) ->auth('global') - ->parameters(TemplateParam::init('recipient_id', $recipientId)); + ->parameters( + TemplateParam::init('recipient_id', $recipientId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); - $_resHandler = $this->responseHandler()->type(GetBalanceResponse::class); + $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a transfer for a recipient + * Gets an anticipation * - * @param string $recipientId Recipient Id - * @param CreateTransferRequest $request Transfer data - * @param string|null $idempotencyKey + * @param string $recipientId Recipient id + * @param string $anticipationId Anticipation id * - * @return GetTransferResponse Response from the API call + * @return GetAnticipationResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createTransfer( - string $recipientId, - CreateTransferRequest $request, - ?string $idempotencyKey = null - ): GetTransferResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/recipients/{recipient_id}/transfers') + public function getAnticipation(string $recipientId, string $anticipationId): GetAnticipationResponse + { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/recipients/{recipient_id}/anticipations/{anticipation_id}' + ) ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('anticipation_id', $anticipationId) ); - $_resHandler = $this->responseHandler()->type(GetTransferResponse::class); + $_resHandler = $this->responseHandler()->type(GetAnticipationResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a new recipient - * - * @param CreateRecipientRequest $request Recipient data + * @param string $recipientId Recipient Identificator + * @param UpdateTransferSettingsRequest $request * @param string|null $idempotencyKey * * @return GetRecipientResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createRecipient( - CreateRecipientRequest $request, + public function updateRecipientTransferSettings( + string $recipientId, + UpdateTransferSettingsRequest $request, ?string $idempotencyKey = null ): GetRecipientResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/recipients') + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/recipients/{recipient_id}/transfer-settings') ->auth('global') - ->parameters(BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey)); + ->parameters( + TemplateParam::init('recipient_id', $recipientId), + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) + ); $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); @@ -433,33 +407,52 @@ public function createRecipient( } /** - * Updates recipient metadata + * Retrieves a paginated list of anticipations from a recipient * * @param string $recipientId Recipient id - * @param UpdateAutomaticAnticipationSettingsRequest $request Metadata - * @param string|null $idempotencyKey + * @param int|null $page Page number + * @param int|null $size Page size + * @param string|null $status Filter for anticipation status + * @param string|null $timeframe Filter for anticipation timeframe + * @param \DateTime|null $paymentDateSince Filter for start range for anticipation payment date + * @param \DateTime|null $paymentDateUntil Filter for end range for anticipation payment date + * @param \DateTime|null $createdSince Filter for start range for anticipation creation date + * @param \DateTime|null $createdUntil Filter for end range for anticipation creation date * - * @return GetRecipientResponse Response from the API call + * @return ListAnticipationResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateAutomaticAnticipationSettings( + public function getAnticipations( string $recipientId, - UpdateAutomaticAnticipationSettingsRequest $request, - ?string $idempotencyKey = null - ): GetRecipientResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PATCH, - '/recipients/{recipient_id}/automatic-anticipation-settings' - ) + ?int $page = null, + ?int $size = null, + ?string $status = null, + ?string $timeframe = null, + ?\DateTime $paymentDateSince = null, + ?\DateTime $paymentDateUntil = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null + ): ListAnticipationResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/anticipations') ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('status', $status), + QueryParam::init('timeframe', $timeframe), + QueryParam::init('payment_date_since', $paymentDateSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('payment_date_until', $paymentDateUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_since', $createdSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_until', $createdUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); + $_resHandler = $this->responseHandler()->type(ListAnticipationResponse::class); return $this->execute($_reqBuilder, $_resHandler); } @@ -484,6 +477,26 @@ public function getRecipient(string $recipientId): GetRecipientResponse return $this->execute($_reqBuilder, $_resHandler); } + /** + * Get balance information for a recipient + * + * @param string $recipientId Recipient id + * + * @return GetBalanceResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getBalance(string $recipientId): GetBalanceResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/balance') + ->auth('global') + ->parameters(TemplateParam::init('recipient_id', $recipientId)); + + $_resHandler = $this->responseHandler()->type(GetBalanceResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + /** * Gets a paginated list of transfers for the recipient * @@ -525,66 +538,53 @@ public function getWithdrawals( } /** - * @param string $recipientId - * @param string $withdrawalId + * Creates a transfer for a recipient * - * @return GetWithdrawResponse Response from the API call + * @param string $recipientId Recipient Id + * @param CreateTransferRequest $request Transfer data + * @param string|null $idempotencyKey + * + * @return GetTransferResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getWithdrawById(string $recipientId, string $withdrawalId): GetWithdrawResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/recipients/{recipient_id}/withdrawals/{withdrawal_id}' - ) + public function createTransfer( + string $recipientId, + CreateTransferRequest $request, + ?string $idempotencyKey = null + ): GetTransferResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/recipients/{recipient_id}/transfers') ->auth('global') ->parameters( TemplateParam::init('recipient_id', $recipientId), - TemplateParam::init('withdrawal_id', $withdrawalId) + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetWithdrawResponse::class); + $_resHandler = $this->responseHandler()->type(GetTransferResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Gets a paginated list of transfers for the recipient + * Creates a new recipient * - * @param string $recipientId Recipient id - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $status Filter for transfer status - * @param \DateTime|null $createdSince Filter for start range of transfer creation date - * @param \DateTime|null $createdUntil Filter for end range of transfer creation date + * @param CreateRecipientRequest $request Recipient data + * @param string|null $idempotencyKey * - * @return ListTransferResponse Response from the API call + * @return GetRecipientResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getTransfers( - string $recipientId, - ?int $page = null, - ?int $size = null, - ?string $status = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null - ): ListTransferResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/recipients/{recipient_id}/transfers') + public function createRecipient( + CreateRecipientRequest $request, + ?string $idempotencyKey = null + ): GetRecipientResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/recipients') ->auth('global') - ->parameters( - TemplateParam::init('recipient_id', $recipientId), - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('status', $status), - QueryParam::init('created_since', $createdSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('created_until', $createdUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) - ); + ->parameters(BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey)); - $_resHandler = $this->responseHandler()->type(ListTransferResponse::class); + $_resHandler = $this->responseHandler()->type(GetRecipientResponse::class); return $this->execute($_reqBuilder, $_resHandler); } diff --git a/src/Controllers/SellersController.php b/src/Controllers/SellersController.php deleted file mode 100644 index b831b98..0000000 --- a/src/Controllers/SellersController.php +++ /dev/null @@ -1,431 +0,0 @@ -config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json', - 'content-type' => 'application/json', - 'idempotency-key' => $idempotencyKey - ]; - - //json encode body - $_bodyJson = Request\Body::Json($request); - - $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::post($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders(), $_bodyJson); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\GetSellerResponse'); - } - - /** - * @param string $sellerId Seller Id - * @param \PagarmeApiSDKLib\Models\UpdateMetadataRequest $request Request for updating the - * charge metadata - * @param string|null $idempotencyKey - * - * @return \PagarmeApiSDKLib\Models\GetSellerResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function updateSellerMetadata( - string $sellerId, - \PagarmeApiSDKLib\Models\UpdateMetadataRequest $request, - ?string $idempotencyKey = null - ): \PagarmeApiSDKLib\Models\GetSellerResponse { - //prepare query string for API call - $_queryBuilder = '/sellers/{seller_id}/metadata'; - - //process optional query parameters - $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ - 'seller_id' => $sellerId, - ]); - - //validate and preprocess url - $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json', - 'content-type' => 'application/json', - 'idempotency-key' => $idempotencyKey - ]; - - //json encode body - $_bodyJson = Request\Body::Json($request); - - $_httpRequest = new HttpRequest(HttpMethod::PATCH, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::patch($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders(), $_bodyJson); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\GetSellerResponse'); - } - - /** - * @param string $id - * @param \PagarmeApiSDKLib\Models\UpdateSellerRequest $request Update Seller model - * @param string|null $idempotencyKey - * - * @return \PagarmeApiSDKLib\Models\GetSellerResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function updateSeller( - string $id, - \PagarmeApiSDKLib\Models\UpdateSellerRequest $request, - ?string $idempotencyKey = null - ): \PagarmeApiSDKLib\Models\GetSellerResponse { - //prepare query string for API call - $_queryBuilder = '/sellers/{id}'; - - //process optional query parameters - $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ - 'id' => $id, - ]); - - //validate and preprocess url - $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json', - 'content-type' => 'application/json', - 'idempotency-key' => $idempotencyKey - ]; - - //json encode body - $_bodyJson = Request\Body::Json($request); - - $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::put($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders(), $_bodyJson); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\GetSellerResponse'); - } - - /** - * @param string $sellerId Seller Id - * @param string|null $idempotencyKey - * - * @return \PagarmeApiSDKLib\Models\GetSellerResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function deleteSeller( - string $sellerId, - ?string $idempotencyKey = null - ): \PagarmeApiSDKLib\Models\GetSellerResponse { - //prepare query string for API call - $_queryBuilder = '/sellers/{sellerId}'; - - //process optional query parameters - $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ - 'sellerId' => $sellerId, - ]); - - //validate and preprocess url - $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json', - 'idempotency-key' => $idempotencyKey - ]; - - $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::delete($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders()); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\GetSellerResponse'); - } - - /** - * @param string $id Seller Id - * - * @return \PagarmeApiSDKLib\Models\GetSellerResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getSellerById(string $id): \PagarmeApiSDKLib\Models\GetSellerResponse - { - //prepare query string for API call - $_queryBuilder = '/sellers/{id}'; - - //process optional query parameters - $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ - 'id' => $id, - ]); - - //validate and preprocess url - $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json' - ]; - - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::get($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders()); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\GetSellerResponse'); - } - - /** - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $name - * @param string|null $document - * @param string|null $code - * @param string|null $status - * @param string|null $type - * @param \DateTime|null $createdSince - * @param \DateTime|null $createdUntil - * - * @return \PagarmeApiSDKLib\Models\ListSellerResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getSellers( - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $document = null, - ?string $code = null, - ?string $status = null, - ?string $type = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null - ): \PagarmeApiSDKLib\Models\ListSellerResponse { - //prepare query string for API call - $_queryBuilder = '/sellers'; - - //process optional query parameters - ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ - 'page' => $page, - 'size' => $size, - 'name' => $name, - 'document' => $document, - 'code' => $code, - 'status' => $status, - 'type' => $type, - 'created_Since' => DateTimeHelper::toRfc3339DateTime($createdSince), - 'created_Until' => DateTimeHelper::toRfc3339DateTime($createdUntil), - ]); - - //validate and preprocess url - $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); - - //prepare headers - $_headers = [ - 'user-agent' => self::$userAgent, - 'Accept' => 'application/json' - ]; - - $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); - - // Apply authorization to request - $this->getAuthManager('global')->apply($_httpRequest); - - //call on-before Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); - } - - // and invoke the API call request to fetch the response - try { - $response = Request::get($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders()); - } catch (\Unirest\Exception $ex) { - throw new ApiException($ex->getMessage(), $_httpRequest); - } - - - $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); - $_httpContext = new HttpContext($_httpRequest, $_httpResponse); - - //call on-after Http callback - if ($this->getHttpCallBack() != null) { - $this->getHttpCallBack()->callOnAfterRequest($_httpContext); - } - - //handle errors defined at the API level - $this->validateResponse($_httpResponse, $_httpRequest); - $mapper = $this->getJsonMapper(); - return $mapper->mapClass($response->body, 'PagarmeApiSDKLib\\Models\\ListSellerResponse'); - } -} diff --git a/src/Controllers/SubscriptionsController.php b/src/Controllers/SubscriptionsController.php index 53d83c3..10cfdd5 100644 --- a/src/Controllers/SubscriptionsController.php +++ b/src/Controllers/SubscriptionsController.php @@ -74,116 +74,91 @@ public function renewSubscription(string $subscriptionId, ?string $idempotencyKe } /** - * Deletes a discount + * Updates the credit card from a subscription * * @param string $subscriptionId Subscription id - * @param string $discountId Discount Id + * @param UpdateSubscriptionCardRequest $request Request for updating a card * @param string|null $idempotencyKey * - * @return GetDiscountResponse Response from the API call + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteDiscount( + public function updateSubscriptionCard( string $subscriptionId, - string $discountId, + UpdateSubscriptionCardRequest $request, ?string $idempotencyKey = null - ): GetDiscountResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/subscriptions/{subscription_id}/discounts/{discount_id}' - ) + ): GetSubscriptionResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/card') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('discount_id', $discountId), + BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetDiscountResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Gets all subscriptions + * Deletes a usage * - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $code Filter for subscription's code - * @param string|null $billingType Filter for subscription's billing type - * @param string|null $customerId Filter for subscription's customer id - * @param string|null $planId Filter for subscription's plan id - * @param string|null $cardId Filter for subscription's card id - * @param string|null $status Filter for subscription's status - * @param \DateTime|null $nextBillingSince Filter for subscription's next billing date start - * range - * @param \DateTime|null $nextBillingUntil Filter for subscription's next billing date end range - * @param \DateTime|null $createdSince Filter for subscription's creation date start range - * @param \DateTime|null $createdUntil Filter for subscriptions creation date end range + * @param string $subscriptionId The subscription id + * @param string $itemId The subscription item id + * @param string $usageId The usage id + * @param string|null $idempotencyKey * - * @return ListSubscriptionsResponse Response from the API call + * @return GetUsageResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getSubscriptions( - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $billingType = null, - ?string $customerId = null, - ?string $planId = null, - ?string $cardId = null, - ?string $status = null, - ?\DateTime $nextBillingSince = null, - ?\DateTime $nextBillingUntil = null, - ?\DateTime $createdSince = null, - ?\DateTime $createdUntil = null - ): ListSubscriptionsResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions') + public function deleteUsage( + string $subscriptionId, + string $itemId, + string $usageId, + ?string $idempotencyKey = null + ): GetUsageResponse { + $_reqBuilder = $this->requestBuilder( + RequestMethod::DELETE, + '/subscriptions/{subscription_id}/items/{item_id}/usages/{usage_id}' + ) ->auth('global') ->parameters( - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('code', $code), - QueryParam::init('billing_type', $billingType), - QueryParam::init('customer_id', $customerId), - QueryParam::init('plan_id', $planId), - QueryParam::init('card_id', $cardId), - QueryParam::init('status', $status), - QueryParam::init('next_billing_since', $nextBillingSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('next_billing_until', $nextBillingUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('created_since', $createdSince) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('created_until', $createdUntil) - ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + TemplateParam::init('subscription_id', $subscriptionId), + TemplateParam::init('item_id', $itemId), + TemplateParam::init('usage_id', $usageId), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(ListSubscriptionsResponse::class); + $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $subscriptionId The subscription id - * @param string $discountId + * Creates a discount + * + * @param string $subscriptionId Subscription id + * @param CreateDiscountRequest $request Request for creating a discount + * @param string|null $idempotencyKey * * @return GetDiscountResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getDiscountById(string $subscriptionId, string $discountId): GetDiscountResponse - { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/discounts/{discountId}' - ) + public function createDiscount( + string $subscriptionId, + CreateDiscountRequest $request, + ?string $idempotencyKey = null + ): GetDiscountResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/discounts') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('discountId', $discountId) + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); $_resHandler = $this->responseHandler()->type(GetDiscountResponse::class); @@ -192,70 +167,53 @@ public function getDiscountById(string $subscriptionId, string $discountId): Get } /** - * Creates a new subscription + * Create Usage * - * @param CreateSubscriptionRequest $body Request for creating a subscription + * @param string $subscriptionId Subscription id + * @param string $itemId Item id * @param string|null $idempotencyKey * - * @return GetSubscriptionResponse Response from the API call + * @return GetUsageResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createSubscription( - CreateSubscriptionRequest $body, + public function createAnUsage( + string $subscriptionId, + string $itemId, ?string $idempotencyKey = null - ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions') - ->auth('global') - ->parameters(BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey)); - - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @param string $subscriptionId The subscription Id - * @param string $incrementId The increment Id - * - * @return GetIncrementResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getIncrementById(string $subscriptionId, string $incrementId): GetIncrementResponse - { + ): GetUsageResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/increments/{increment_id}' + RequestMethod::POST, + '/subscriptions/{subscription_id}/items/{item_id}/usages' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('increment_id', $incrementId) + TemplateParam::init('item_id', $itemId), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); + $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates the metadata from a subscription - * - * @param string $subscriptionId The subscription id - * @param UpdateMetadataRequest $request Request for updating the subscrption metadata + * @param string $subscriptionId Subscription Id + * @param UpdateCurrentCycleStatusRequest $request Request for updating the end date of the + * subscription current status * @param string|null $idempotencyKey * - * @return GetSubscriptionResponse Response from the API call + * @return void Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionMetadata( + public function updateCurrentCycleStatus( string $subscriptionId, - UpdateMetadataRequest $request, + UpdateCurrentCycleStatusRequest $request, ?string $idempotencyKey = null - ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Subscriptions/{subscription_id}/metadata') + ): void { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/cycle-status') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -263,81 +221,108 @@ public function updateSubscriptionMetadata( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); + $this->execute($_reqBuilder); } /** - * Deletes a increment + * Deletes a discount * * @param string $subscriptionId Subscription id - * @param string $incrementId Increment id + * @param string $discountId Discount Id * @param string|null $idempotencyKey * - * @return GetIncrementResponse Response from the API call + * @return GetDiscountResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteIncrement( + public function deleteDiscount( string $subscriptionId, - string $incrementId, + string $discountId, ?string $idempotencyKey = null - ): GetIncrementResponse { + ): GetDiscountResponse { $_reqBuilder = $this->requestBuilder( RequestMethod::DELETE, - '/subscriptions/{subscription_id}/increments/{increment_id}' + '/subscriptions/{subscription_id}/discounts/{discount_id}' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('increment_id', $incrementId), + TemplateParam::init('discount_id', $discountId), HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); + $_resHandler = $this->responseHandler()->type(GetDiscountResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Gets a subscription + * Get Subscription Items * - * @param string $subscriptionId Subscription id + * @param string $subscriptionId The subscription id + * @param int|null $page Page number + * @param int|null $size Page size + * @param string|null $name The item name + * @param string|null $code Identification code in the client system + * @param string|null $status The item statis + * @param string|null $description The item description + * @param string|null $createdSince Filter for item's creation date start range + * @param string|null $createdUntil Filter for item's creation date end range * - * @return GetSubscriptionResponse Response from the API call + * @return ListSubscriptionItemsResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getSubscription(string $subscriptionId): GetSubscriptionResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}') + public function getSubscriptionItems( + string $subscriptionId, + ?int $page = null, + ?int $size = null, + ?string $name = null, + ?string $code = null, + ?string $status = null, + ?string $description = null, + ?string $createdSince = null, + ?string $createdUntil = null + ): ListSubscriptionItemsResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/items') ->auth('global') - ->parameters(TemplateParam::init('subscription_id', $subscriptionId)); + ->parameters( + TemplateParam::init('subscription_id', $subscriptionId), + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('name', $name), + QueryParam::init('code', $code), + QueryParam::init('status', $status), + QueryParam::init('description', $description), + QueryParam::init('created_since', $createdSince), + QueryParam::init('created_until', $createdUntil) + ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); + $_resHandler = $this->responseHandler()->type(ListSubscriptionItemsResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $subscriptionId - * @param UpdateCurrentCycleEndDateRequest $request Request for updating the end date of the - * current signature cycle + * Updates the payment method from a subscription + * + * @param string $subscriptionId Subscription id + * @param UpdateSubscriptionPaymentMethodRequest $request Request for updating the paymentmethod + * from a subscription * @param string|null $idempotencyKey * * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateLatestPeriodEndAt( + public function updateSubscriptionPaymentMethod( string $subscriptionId, - UpdateCurrentCycleEndDateRequest $request, + UpdateSubscriptionPaymentMethodRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse { $_reqBuilder = $this->requestBuilder( RequestMethod::PATCH, - '/subscriptions/{subscription_id}/periods/latest/end-at' + '/subscriptions/{subscription_id}/payment-method' ) ->auth('global') ->parameters( @@ -352,21 +337,110 @@ public function updateLatestPeriodEndAt( } /** + * Get Subscription Item + * * @param string $subscriptionId Subscription Id - * @param UpdateCurrentCycleStatusRequest $request Request for updating the end date of the - * subscription current status + * @param string $itemId Item id + * + * @return GetSubscriptionItemResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getSubscriptionItem(string $subscriptionId, string $itemId): GetSubscriptionItemResponse + { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/subscriptions/{subscription_id}/items/{item_id}' + ) + ->auth('global') + ->parameters( + TemplateParam::init('subscription_id', $subscriptionId), + TemplateParam::init('item_id', $itemId) + ); + + $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * Gets all subscriptions + * + * @param int|null $page Page number + * @param int|null $size Page size + * @param string|null $code Filter for subscription's code + * @param string|null $billingType Filter for subscription's billing type + * @param string|null $customerId Filter for subscription's customer id + * @param string|null $planId Filter for subscription's plan id + * @param string|null $cardId Filter for subscription's card id + * @param string|null $status Filter for subscription's status + * @param \DateTime|null $nextBillingSince Filter for subscription's next billing date start + * range + * @param \DateTime|null $nextBillingUntil Filter for subscription's next billing date end range + * @param \DateTime|null $createdSince Filter for subscription's creation date start range + * @param \DateTime|null $createdUntil Filter for subscriptions creation date end range + * + * @return ListSubscriptionsResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getSubscriptions( + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $billingType = null, + ?string $customerId = null, + ?string $planId = null, + ?string $cardId = null, + ?string $status = null, + ?\DateTime $nextBillingSince = null, + ?\DateTime $nextBillingUntil = null, + ?\DateTime $createdSince = null, + ?\DateTime $createdUntil = null + ): ListSubscriptionsResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions') + ->auth('global') + ->parameters( + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('code', $code), + QueryParam::init('billing_type', $billingType), + QueryParam::init('customer_id', $customerId), + QueryParam::init('plan_id', $planId), + QueryParam::init('card_id', $cardId), + QueryParam::init('status', $status), + QueryParam::init('next_billing_since', $nextBillingSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('next_billing_until', $nextBillingUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_since', $createdSince) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('created_until', $createdUntil) + ->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + ); + + $_resHandler = $this->responseHandler()->type(ListSubscriptionsResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); + } + + /** + * Cancels a subscription + * + * @param string $subscriptionId Subscription id + * @param CreateCancelSubscriptionRequest|null $request Request for cancelling a subscription * @param string|null $idempotencyKey * - * @return void Response from the API call + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateCurrentCycleStatus( + public function cancelSubscription( string $subscriptionId, - UpdateCurrentCycleStatusRequest $request, + ?CreateCancelSubscriptionRequest $request = null, ?string $idempotencyKey = null - ): void { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/cycle-status') + ): GetSubscriptionResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/subscriptions/{subscription_id}') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -374,190 +448,167 @@ public function updateCurrentCycleStatus( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $this->execute($_reqBuilder); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); + + return $this->execute($_reqBuilder, $_resHandler); } /** - * Get Subscription Items + * Creates a increment * - * @param string $subscriptionId The subscription id - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $name The item name - * @param string|null $code Identification code in the client system - * @param string|null $status The item statis - * @param string|null $description The item description - * @param string|null $createdSince Filter for item's creation date start range - * @param string|null $createdUntil Filter for item's creation date end range + * @param string $subscriptionId Subscription id + * @param CreateIncrementRequest $request Request for creating a increment + * @param string|null $idempotencyKey * - * @return ListSubscriptionItemsResponse Response from the API call + * @return GetIncrementResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getSubscriptionItems( + public function createIncrement( string $subscriptionId, - ?int $page = null, - ?int $size = null, - ?string $name = null, - ?string $code = null, - ?string $status = null, - ?string $description = null, - ?string $createdSince = null, - ?string $createdUntil = null - ): ListSubscriptionItemsResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/items') + CreateIncrementRequest $request, + ?string $idempotencyKey = null + ): GetIncrementResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/increments') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('name', $name), - QueryParam::init('code', $code), - QueryParam::init('status', $status), - QueryParam::init('description', $description), - QueryParam::init('created_since', $createdSince), - QueryParam::init('created_until', $createdUntil) + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(ListSubscriptionItemsResponse::class); + $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Get Subscription Item + * Creates a usage * * @param string $subscriptionId Subscription Id * @param string $itemId Item id + * @param CreateUsageRequest $body Request for creating a usage + * @param string|null $idempotencyKey * - * @return GetSubscriptionItemResponse Response from the API call + * @return GetUsageResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getSubscriptionItem(string $subscriptionId, string $itemId): GetSubscriptionItemResponse - { + public function createUsage( + string $subscriptionId, + string $itemId, + CreateUsageRequest $body, + ?string $idempotencyKey = null + ): GetUsageResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/items/{item_id}' + RequestMethod::POST, + '/subscriptions/{subscription_id}/items/{item_id}/usages' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('item_id', $itemId) + TemplateParam::init('item_id', $itemId), + BodyParam::init($body), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); + $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $subscriptionId - * @param UpdateSubscriptionAffiliationIdRequest $request Request for updating a subscription - * affiliation id - * @param string|null $idempotencyKey + * @param string $subscriptionId The subscription id + * @param string $discountId * - * @return GetSubscriptionResponse Response from the API call + * @return GetDiscountResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionAffiliationId( - string $subscriptionId, - UpdateSubscriptionAffiliationIdRequest $request, - ?string $idempotencyKey = null - ): GetSubscriptionResponse { + public function getDiscountById(string $subscriptionId, string $discountId): GetDiscountResponse + { $_reqBuilder = $this->requestBuilder( - RequestMethod::PATCH, - '/subscriptions/{subscription_id}/gateway-affiliation-id' + RequestMethod::GET, + '/subscriptions/{subscription_id}/discounts/{discountId}' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('discountId', $discountId) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); + $_resHandler = $this->responseHandler()->type(GetDiscountResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $subscriptionId The subscription id - * @param int $page Page number - * @param int $size Page size + * Creates a new subscription * - * @return ListDiscountsResponse Response from the API call + * @param CreateSubscriptionRequest $body Request for creating a subscription + * @param string|null $idempotencyKey + * + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getDiscounts(string $subscriptionId, int $page, int $size): ListDiscountsResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/discounts/') + public function createSubscription( + CreateSubscriptionRequest $body, + ?string $idempotencyKey = null + ): GetSubscriptionResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions') ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - QueryParam::init('page', $page), - QueryParam::init('size', $size) - ); + ->parameters(BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey)); - $_resHandler = $this->responseHandler()->type(ListDiscountsResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates a subscription item - * - * @param string $subscriptionId Subscription Id - * @param string $itemId Item id - * @param UpdateSubscriptionItemRequest $body Request for updating a subscription item - * @param string|null $idempotencyKey + * @param string $subscriptionId The subscription Id + * @param string $incrementId The increment Id * - * @return GetSubscriptionItemResponse Response from the API call + * @return GetIncrementResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionItem( - string $subscriptionId, - string $itemId, - UpdateSubscriptionItemRequest $body, - ?string $idempotencyKey = null - ): GetSubscriptionItemResponse { + public function getIncrementById(string $subscriptionId, string $incrementId): GetIncrementResponse + { $_reqBuilder = $this->requestBuilder( - RequestMethod::PUT, - '/subscriptions/{subscription_id}/items/{item_id}' + RequestMethod::GET, + '/subscriptions/{subscription_id}/increments/{increment_id}' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('item_id', $itemId), - BodyParam::init($body), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('increment_id', $incrementId) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); + $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a new Subscription item - * - * @param string $subscriptionId Subscription id - * @param CreateSubscriptionItemRequest $request Request for creating a subscription item + * @param string $subscriptionId + * @param UpdateSubscriptionAffiliationIdRequest $request Request for updating a subscription + * affiliation id * @param string|null $idempotencyKey * - * @return GetSubscriptionItemResponse Response from the API call + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createSubscriptionItem( + public function updateSubscriptionAffiliationId( string $subscriptionId, - CreateSubscriptionItemRequest $request, + UpdateSubscriptionAffiliationIdRequest $request, ?string $idempotencyKey = null - ): GetSubscriptionItemResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/items') + ): GetSubscriptionResponse { + $_reqBuilder = $this->requestBuilder( + RequestMethod::PATCH, + '/subscriptions/{subscription_id}/gateway-affiliation-id' + ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -565,165 +616,138 @@ public function createSubscriptionItem( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Lists all usages from a subscription item + * Updates the metadata from a subscription * * @param string $subscriptionId The subscription id - * @param string $itemId The subscription item id - * @param int|null $page Page number - * @param int|null $size Page size - * @param string|null $code Identification code in the client system - * @param string|null $group Identification group in the client system - * @param \DateTime|null $usedSince - * @param \DateTime|null $usedUntil + * @param UpdateMetadataRequest $request Request for updating the subscrption metadata + * @param string|null $idempotencyKey * - * @return ListUsagesResponse Response from the API call + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getUsages( + public function updateSubscriptionMetadata( string $subscriptionId, - string $itemId, - ?int $page = null, - ?int $size = null, - ?string $code = null, - ?string $group = null, - ?\DateTime $usedSince = null, - ?\DateTime $usedUntil = null - ): ListUsagesResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/items/{item_id}/usages' - ) + UpdateMetadataRequest $request, + ?string $idempotencyKey = null + ): GetSubscriptionResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/Subscriptions/{subscription_id}/metadata') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('item_id', $itemId), - QueryParam::init('page', $page), - QueryParam::init('size', $size), - QueryParam::init('code', $code), - QueryParam::init('group', $group), - QueryParam::init('used_since', $usedSince)->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), - QueryParam::init('used_until', $usedUntil)->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) + BodyParam::init($request), + HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(ListUsagesResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Atualização do valor mínimo da assinatura + * Deletes a increment * - * @param string $subscriptionId Subscription Id - * @param UpdateSubscriptionMinimumPriceRequest $request Request da requisição com o valor - * mínimo que será configurado + * @param string $subscriptionId Subscription id + * @param string $incrementId Increment id * @param string|null $idempotencyKey * - * @return GetSubscriptionResponse Response from the API call + * @return GetIncrementResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionMiniumPrice( + public function deleteIncrement( string $subscriptionId, - UpdateSubscriptionMinimumPriceRequest $request, + string $incrementId, ?string $idempotencyKey = null - ): GetSubscriptionResponse { + ): GetIncrementResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::PATCH, - '/subscriptions/{subscription_id}/minimum_price' + RequestMethod::DELETE, + '/subscriptions/{subscription_id}/increments/{increment_id}' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - BodyParam::init($request), + TemplateParam::init('increment_id', $incrementId), HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); + $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * @param string $subscriptionId The subscription id - * @param string $cycleId + * @param string $subscriptionId Subscription Id + * @param string $page Page number + * @param string $size Page size * - * @return GetPeriodResponse Response from the API call + * @return ListCyclesResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function getSubscriptionCycleById(string $subscriptionId, string $cycleId): GetPeriodResponse + public function getSubscriptionCycles(string $subscriptionId, string $page, string $size): ListCyclesResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::GET, - '/subscriptions/{subscription_id}/cycles/{cycleId}' - ) + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/cycles') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('cycleId', $cycleId) + QueryParam::init('page', $page), + QueryParam::init('size', $size) ); - $_resHandler = $this->responseHandler()->type(GetPeriodResponse::class); + $_resHandler = $this->responseHandler()->type(ListCyclesResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Create Usage - * - * @param string $subscriptionId Subscription id - * @param string $itemId Item id - * @param string|null $idempotencyKey + * @param string $subscriptionId The subscription id + * @param int $page Page number + * @param int $size Page size * - * @return GetUsageResponse Response from the API call + * @return ListDiscountsResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createAnUsage( - string $subscriptionId, - string $itemId, - ?string $idempotencyKey = null - ): GetUsageResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/subscriptions/{subscription_id}/items/{item_id}/usages' - ) + public function getDiscounts(string $subscriptionId, int $page, int $size): ListDiscountsResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/discounts/') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('item_id', $itemId), - HeaderParam::init('idempotency-key', $idempotencyKey) + QueryParam::init('page', $page), + QueryParam::init('size', $size) ); - $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); + $_resHandler = $this->responseHandler()->type(ListDiscountsResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Cancels a subscription + * Updates the billing date from a subscription * - * @param string $subscriptionId Subscription id - * @param CreateCancelSubscriptionRequest|null $request Request for cancelling a subscription + * @param string $subscriptionId The subscription id + * @param UpdateSubscriptionBillingDateRequest $request Request for updating the subscription + * billing date * @param string|null $idempotencyKey * * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function cancelSubscription( + public function updateSubscriptionBillingDate( string $subscriptionId, - ?CreateCancelSubscriptionRequest $request = null, + UpdateSubscriptionBillingDateRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::DELETE, '/subscriptions/{subscription_id}') + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/billing-date') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -825,22 +849,23 @@ public function updateSubscriptionDueDays( } /** - * Updates the credit card from a subscription + * Updates the start at date from a subscription * - * @param string $subscriptionId Subscription id - * @param UpdateSubscriptionCardRequest $request Request for updating a card + * @param string $subscriptionId The subscription id + * @param UpdateSubscriptionStartAtRequest $request Request for updating the subscription start + * date * @param string|null $idempotencyKey * * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionCard( + public function updateSubscriptionStartAt( string $subscriptionId, - UpdateSubscriptionCardRequest $request, + UpdateSubscriptionStartAtRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/card') + $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/start-at') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -854,57 +879,57 @@ public function updateSubscriptionCard( } /** - * Deletes a usage + * Updates a subscription item * - * @param string $subscriptionId The subscription id - * @param string $itemId The subscription item id - * @param string $usageId The usage id + * @param string $subscriptionId Subscription Id + * @param string $itemId Item id + * @param UpdateSubscriptionItemRequest $body Request for updating a subscription item * @param string|null $idempotencyKey * - * @return GetUsageResponse Response from the API call + * @return GetSubscriptionItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteUsage( + public function updateSubscriptionItem( string $subscriptionId, string $itemId, - string $usageId, + UpdateSubscriptionItemRequest $body, ?string $idempotencyKey = null - ): GetUsageResponse { + ): GetSubscriptionItemResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::DELETE, - '/subscriptions/{subscription_id}/items/{item_id}/usages/{usage_id}' + RequestMethod::PUT, + '/subscriptions/{subscription_id}/items/{item_id}' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), TemplateParam::init('item_id', $itemId), - TemplateParam::init('usage_id', $usageId), + BodyParam::init($body), HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a discount + * Creates a new Subscription item * * @param string $subscriptionId Subscription id - * @param CreateDiscountRequest $request Request for creating a discount + * @param CreateSubscriptionItemRequest $request Request for creating a subscription item * @param string|null $idempotencyKey * - * @return GetDiscountResponse Response from the API call + * @return GetSubscriptionItemResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createDiscount( + public function createSubscriptionItem( string $subscriptionId, - CreateDiscountRequest $request, + CreateSubscriptionItemRequest $request, ?string $idempotencyKey = null - ): GetDiscountResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/discounts') + ): GetSubscriptionItemResponse { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/items') ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -912,38 +937,25 @@ public function createDiscount( HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetDiscountResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionItemResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates the payment method from a subscription + * Gets a subscription * * @param string $subscriptionId Subscription id - * @param UpdateSubscriptionPaymentMethodRequest $request Request for updating the paymentmethod - * from a subscription - * @param string|null $idempotencyKey * * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionPaymentMethod( - string $subscriptionId, - UpdateSubscriptionPaymentMethodRequest $request, - ?string $idempotencyKey = null - ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder( - RequestMethod::PATCH, - '/subscriptions/{subscription_id}/payment-method' - ) + public function getSubscription(string $subscriptionId): GetSubscriptionResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}') ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) - ); + ->parameters(TemplateParam::init('subscription_id', $subscriptionId)); $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); @@ -951,111 +963,104 @@ public function updateSubscriptionPaymentMethod( } /** - * Creates a increment + * Lists all usages from a subscription item * - * @param string $subscriptionId Subscription id - * @param CreateIncrementRequest $request Request for creating a increment - * @param string|null $idempotencyKey + * @param string $subscriptionId The subscription id + * @param string $itemId The subscription item id + * @param int|null $page Page number + * @param int|null $size Page size + * @param string|null $code Identification code in the client system + * @param string|null $group Identification group in the client system + * @param \DateTime|null $usedSince + * @param \DateTime|null $usedUntil * - * @return GetIncrementResponse Response from the API call + * @return ListUsagesResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createIncrement( + public function getUsages( string $subscriptionId, - CreateIncrementRequest $request, - ?string $idempotencyKey = null - ): GetIncrementResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/subscriptions/{subscription_id}/increments') + string $itemId, + ?int $page = null, + ?int $size = null, + ?string $code = null, + ?string $group = null, + ?\DateTime $usedSince = null, + ?\DateTime $usedUntil = null + ): ListUsagesResponse { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/subscriptions/{subscription_id}/items/{item_id}/usages' + ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('item_id', $itemId), + QueryParam::init('page', $page), + QueryParam::init('size', $size), + QueryParam::init('code', $code), + QueryParam::init('group', $group), + QueryParam::init('used_since', $usedSince)->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']), + QueryParam::init('used_until', $usedUntil)->serializeBy([DateTimeHelper::class, 'toRfc3339DateTime']) ); - $_resHandler = $this->responseHandler()->type(GetIncrementResponse::class); + $_resHandler = $this->responseHandler()->type(ListUsagesResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Creates a usage - * - * @param string $subscriptionId Subscription Id - * @param string $itemId Item id - * @param CreateUsageRequest $body Request for creating a usage + * @param string $subscriptionId + * @param UpdateCurrentCycleEndDateRequest $request Request for updating the end date of the + * current signature cycle * @param string|null $idempotencyKey * - * @return GetUsageResponse Response from the API call + * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function createUsage( + public function updateLatestPeriodEndAt( string $subscriptionId, - string $itemId, - CreateUsageRequest $body, + UpdateCurrentCycleEndDateRequest $request, ?string $idempotencyKey = null - ): GetUsageResponse { + ): GetSubscriptionResponse { $_reqBuilder = $this->requestBuilder( - RequestMethod::POST, - '/subscriptions/{subscription_id}/items/{item_id}/usages' + RequestMethod::PATCH, + '/subscriptions/{subscription_id}/periods/latest/end-at' ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - TemplateParam::init('item_id', $itemId), - BodyParam::init($body), + BodyParam::init($request), HeaderParam::init('idempotency-key', $idempotencyKey) ); - $_resHandler = $this->responseHandler()->type(GetUsageResponse::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - - /** - * @param string $subscriptionId Subscription Id - * @param string $page Page number - * @param string $size Page size - * - * @return ListCyclesResponse Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getSubscriptionCycles(string $subscriptionId, string $page, string $size): ListCyclesResponse - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/subscriptions/{subscription_id}/cycles') - ->auth('global') - ->parameters( - TemplateParam::init('subscription_id', $subscriptionId), - QueryParam::init('page', $page), - QueryParam::init('size', $size) - ); - - $_resHandler = $this->responseHandler()->type(ListCyclesResponse::class); + $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); return $this->execute($_reqBuilder, $_resHandler); } /** - * Updates the billing date from a subscription + * Atualização do valor mínimo da assinatura * - * @param string $subscriptionId The subscription id - * @param UpdateSubscriptionBillingDateRequest $request Request for updating the subscription - * billing date + * @param string $subscriptionId Subscription Id + * @param UpdateSubscriptionMinimumPriceRequest $request Request da requisição com o valor + * mínimo que será configurado * @param string|null $idempotencyKey * * @return GetSubscriptionResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionBillingDate( + public function updateSubscriptionMiniumPrice( string $subscriptionId, - UpdateSubscriptionBillingDateRequest $request, + UpdateSubscriptionMinimumPriceRequest $request, ?string $idempotencyKey = null ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/billing-date') + $_reqBuilder = $this->requestBuilder( + RequestMethod::PATCH, + '/subscriptions/{subscription_id}/minimum_price' + ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), @@ -1069,31 +1074,26 @@ public function updateSubscriptionBillingDate( } /** - * Updates the start at date from a subscription - * * @param string $subscriptionId The subscription id - * @param UpdateSubscriptionStartAtRequest $request Request for updating the subscription start - * date - * @param string|null $idempotencyKey + * @param string $cycleId * - * @return GetSubscriptionResponse Response from the API call + * @return GetPeriodResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function updateSubscriptionStartAt( - string $subscriptionId, - UpdateSubscriptionStartAtRequest $request, - ?string $idempotencyKey = null - ): GetSubscriptionResponse { - $_reqBuilder = $this->requestBuilder(RequestMethod::PATCH, '/subscriptions/{subscription_id}/start-at') + public function getSubscriptionCycleById(string $subscriptionId, string $cycleId): GetPeriodResponse + { + $_reqBuilder = $this->requestBuilder( + RequestMethod::GET, + '/subscriptions/{subscription_id}/cycles/{cycleId}' + ) ->auth('global') ->parameters( TemplateParam::init('subscription_id', $subscriptionId), - BodyParam::init($request), - HeaderParam::init('idempotency-key', $idempotencyKey) + TemplateParam::init('cycleId', $cycleId) ); - $_resHandler = $this->responseHandler()->type(GetSubscriptionResponse::class); + $_resHandler = $this->responseHandler()->type(GetPeriodResponse::class); return $this->execute($_reqBuilder, $_resHandler); } diff --git a/src/Controllers/TransfersController.php b/src/Controllers/TransfersController.php index 779edf3..39a6ca5 100644 --- a/src/Controllers/TransfersController.php +++ b/src/Controllers/TransfersController.php @@ -20,22 +20,6 @@ class TransfersController extends BaseController { - /** - * Gets all transfers - * - * @return ListTransfers Response from the API call - * - * @throws ApiException Thrown if API call fails - */ - public function getTransfers(): ListTransfers - { - $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/transfers')->auth('global'); - - $_resHandler = $this->responseHandler()->type(ListTransfers::class); - - return $this->execute($_reqBuilder, $_resHandler); - } - /** * @param string $transferId * @@ -71,4 +55,20 @@ public function createTransfer(CreateTransfer $request): GetTransfer return $this->execute($_reqBuilder, $_resHandler); } + + /** + * Gets all transfers + * + * @return ListTransfers Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function getTransfers(): ListTransfers + { + $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/transfers')->auth('global'); + + $_resHandler = $this->responseHandler()->type(ListTransfers::class); + + return $this->execute($_reqBuilder, $_resHandler); + } } diff --git a/src/Exceptions/Exception.php b/src/Exceptions/Exception.php deleted file mode 100644 index e21d08c..0000000 --- a/src/Exceptions/Exception.php +++ /dev/null @@ -1,15 +0,0 @@ -instance = $instance; + } + + /** + * Initializes a new create card payload request Builder object. + */ + public static function init(): self + { + return new self(new CreateCardPayloadRequest()); + } + + /** + * Sets type field. + */ + public function type(?string $value): self + { + $this->instance->setType($value); + return $this; + } + + /** + * Unsets type field. + */ + public function unsetType(): self + { + $this->instance->unsetType(); + return $this; + } + + /** + * Sets google pay field. + */ + public function googlePay(?CreateGooglePayRequest $value): self + { + $this->instance->setGooglePay($value); + return $this; + } + + /** + * Unsets google pay field. + */ + public function unsetGooglePay(): self + { + $this->instance->unsetGooglePay(); + return $this; + } + + /** + * Initializes a new create card payload request object. + */ + public function build(): CreateCardPayloadRequest + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/CreateCreditCardPaymentRequestBuilder.php b/src/Models/Builders/CreateCreditCardPaymentRequestBuilder.php index be1a2b0..f3d4b25 100644 --- a/src/Models/Builders/CreateCreditCardPaymentRequestBuilder.php +++ b/src/Models/Builders/CreateCreditCardPaymentRequestBuilder.php @@ -11,6 +11,7 @@ namespace PagarmeApiSDKLib\Models\Builders; use Core\Utils\CoreHelper; +use PagarmeApiSDKLib\Models\CreateCardPayloadRequest; use PagarmeApiSDKLib\Models\CreateCardPaymentContactlessRequest; use PagarmeApiSDKLib\Models\CreateCardRequest; use PagarmeApiSDKLib\Models\CreateCreditCardPaymentRequest; @@ -176,6 +177,15 @@ public function recurrencyCycle(?string $value): self return $this; } + /** + * Sets payload field. + */ + public function payload(?CreateCardPayloadRequest $value): self + { + $this->instance->setPayload($value); + return $this; + } + /** * Initializes a new create credit card payment request object. */ diff --git a/src/Models/Builders/CreateGooglePayIntermediateSigningKeyRequestBuilder.php b/src/Models/Builders/CreateGooglePayIntermediateSigningKeyRequestBuilder.php new file mode 100644 index 0000000..48fd5ae --- /dev/null +++ b/src/Models/Builders/CreateGooglePayIntermediateSigningKeyRequestBuilder.php @@ -0,0 +1,84 @@ +instance = $instance; + } + + /** + * Initializes a new create google pay intermediate signing key request Builder object. + */ + public static function init(): self + { + return new self(new CreateGooglePayIntermediateSigningKeyRequest()); + } + + /** + * Sets signed key field. + */ + public function signedKey(?string $value): self + { + $this->instance->setSignedKey($value); + return $this; + } + + /** + * Unsets signed key field. + */ + public function unsetSignedKey(): self + { + $this->instance->unsetSignedKey(); + return $this; + } + + /** + * Sets signatures field. + */ + public function signatures(?array $value): self + { + $this->instance->setSignatures($value); + return $this; + } + + /** + * Unsets signatures field. + */ + public function unsetSignatures(): self + { + $this->instance->unsetSignatures(); + return $this; + } + + /** + * Initializes a new create google pay intermediate signing key request object. + */ + public function build(): CreateGooglePayIntermediateSigningKeyRequest + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/CreateGooglePayRequestBuilder.php b/src/Models/Builders/CreateGooglePayRequestBuilder.php index 69f394c..15027f9 100644 --- a/src/Models/Builders/CreateGooglePayRequestBuilder.php +++ b/src/Models/Builders/CreateGooglePayRequestBuilder.php @@ -11,7 +11,7 @@ namespace PagarmeApiSDKLib\Models\Builders; use Core\Utils\CoreHelper; -use PagarmeApiSDKLib\Models\CreateGooglePayHeaderRequest; +use PagarmeApiSDKLib\Models\CreateGooglePayIntermediateSigningKeyRequest; use PagarmeApiSDKLib\Models\CreateGooglePayRequest; /** @@ -34,14 +34,117 @@ private function __construct(CreateGooglePayRequest $instance) /** * Initializes a new create google pay request Builder object. */ - public static function init( - string $version, - string $data, - CreateGooglePayHeaderRequest $header, - string $signature, - string $merchantIdentifier - ): self { - return new self(new CreateGooglePayRequest($version, $data, $header, $signature, $merchantIdentifier)); + public static function init(): self + { + return new self(new CreateGooglePayRequest()); + } + + /** + * Sets version field. + */ + public function version(?string $value): self + { + $this->instance->setVersion($value); + return $this; + } + + /** + * Unsets version field. + */ + public function unsetVersion(): self + { + $this->instance->unsetVersion(); + return $this; + } + + /** + * Sets data field. + */ + public function data(?string $value): self + { + $this->instance->setData($value); + return $this; + } + + /** + * Unsets data field. + */ + public function unsetData(): self + { + $this->instance->unsetData(); + return $this; + } + + /** + * Sets intermediate signing key field. + */ + public function intermediateSigningKey(?CreateGooglePayIntermediateSigningKeyRequest $value): self + { + $this->instance->setIntermediateSigningKey($value); + return $this; + } + + /** + * Unsets intermediate signing key field. + */ + public function unsetIntermediateSigningKey(): self + { + $this->instance->unsetIntermediateSigningKey(); + return $this; + } + + /** + * Sets signature field. + */ + public function signature(?string $value): self + { + $this->instance->setSignature($value); + return $this; + } + + /** + * Unsets signature field. + */ + public function unsetSignature(): self + { + $this->instance->unsetSignature(); + return $this; + } + + /** + * Sets signed message field. + */ + public function signedMessage(?string $value): self + { + $this->instance->setSignedMessage($value); + return $this; + } + + /** + * Unsets signed message field. + */ + public function unsetSignedMessage(): self + { + $this->instance->unsetSignedMessage(); + return $this; + } + + /** + * Sets merchant identifier field. + */ + public function merchantIdentifier(?string $value): self + { + $this->instance->setMerchantIdentifier($value); + return $this; + } + + /** + * Unsets merchant identifier field. + */ + public function unsetMerchantIdentifier(): self + { + $this->instance->unsetMerchantIdentifier(); + return $this; } /** diff --git a/src/Models/Builders/CreatePhoneRequestBuilder.php b/src/Models/Builders/CreatePhoneRequestBuilder.php index 839547b..b115332 100644 --- a/src/Models/Builders/CreatePhoneRequestBuilder.php +++ b/src/Models/Builders/CreatePhoneRequestBuilder.php @@ -65,6 +65,24 @@ public function areaCode(?string $value): self return $this; } + /** + * Sets type field. + */ + public function type(?string $value): self + { + $this->instance->setType($value); + return $this; + } + + /** + * Unsets type field. + */ + public function unsetType(): self + { + $this->instance->unsetType(); + return $this; + } + /** * Initializes a new create phone request object. */ diff --git a/src/Models/Builders/GetOrderItemResponseBuilder.php b/src/Models/Builders/GetOrderItemResponseBuilder.php index 7ebff8c..f4f78e9 100644 --- a/src/Models/Builders/GetOrderItemResponseBuilder.php +++ b/src/Models/Builders/GetOrderItemResponseBuilder.php @@ -57,20 +57,20 @@ public function unsetId(): self } /** - * Sets amount field. + * Sets type field. */ - public function amount(?int $value): self + public function type(?string $value): self { - $this->instance->setAmount($value); + $this->instance->setType($value); return $this; } /** - * Unsets amount field. + * Unsets type field. */ - public function unsetAmount(): self + public function unsetType(): self { - $this->instance->unsetAmount(); + $this->instance->unsetType(); return $this; } @@ -92,6 +92,24 @@ public function unsetDescription(): self return $this; } + /** + * Sets amount field. + */ + public function amount(?int $value): self + { + $this->instance->setAmount($value); + return $this; + } + + /** + * Unsets amount field. + */ + public function unsetAmount(): self + { + $this->instance->unsetAmount(); + return $this; + } + /** * Sets quantity field. */ @@ -146,6 +164,60 @@ public function unsetCode(): self return $this; } + /** + * Sets status field. + */ + public function status(?string $value): self + { + $this->instance->setStatus($value); + return $this; + } + + /** + * Unsets status field. + */ + public function unsetStatus(): self + { + $this->instance->unsetStatus(); + return $this; + } + + /** + * Sets created at field. + */ + public function createdAt(?\DateTime $value): self + { + $this->instance->setCreatedAt($value); + return $this; + } + + /** + * Unsets created at field. + */ + public function unsetCreatedAt(): self + { + $this->instance->unsetCreatedAt(); + return $this; + } + + /** + * Sets updated at field. + */ + public function updatedAt(?\DateTime $value): self + { + $this->instance->setUpdatedAt($value); + return $this; + } + + /** + * Unsets updated at field. + */ + public function unsetUpdatedAt(): self + { + $this->instance->unsetUpdatedAt(); + return $this; + } + /** * Initializes a new get order item response object. */ diff --git a/src/Models/Builders/GetOrderResponseBuilder.php b/src/Models/Builders/GetOrderResponseBuilder.php index 43a037c..b17870b 100644 --- a/src/Models/Builders/GetOrderResponseBuilder.php +++ b/src/Models/Builders/GetOrderResponseBuilder.php @@ -78,6 +78,24 @@ public function unsetCode(): self return $this; } + /** + * Sets amount field. + */ + public function amount(?int $value): self + { + $this->instance->setAmount($value); + return $this; + } + + /** + * Unsets amount field. + */ + public function unsetAmount(): self + { + $this->instance->unsetAmount(); + return $this; + } + /** * Sets currency field. */ @@ -96,6 +114,24 @@ public function unsetCurrency(): self return $this; } + /** + * Sets closed field. + */ + public function closed(?bool $value): self + { + $this->instance->setClosed($value); + return $this; + } + + /** + * Unsets closed field. + */ + public function unsetClosed(): self + { + $this->instance->unsetClosed(); + return $this; + } + /** * Sets items field. */ @@ -186,6 +222,24 @@ public function unsetUpdatedAt(): self return $this; } + /** + * Sets closed at field. + */ + public function closedAt(?\DateTime $value): self + { + $this->instance->setClosedAt($value); + return $this; + } + + /** + * Unsets closed at field. + */ + public function unsetClosedAt(): self + { + $this->instance->unsetClosedAt(); + return $this; + } + /** * Sets charges field. */ @@ -348,24 +402,6 @@ public function unsetDevice(): self return $this; } - /** - * Sets closed field. - */ - public function closed(?bool $value): self - { - $this->instance->setClosed($value); - return $this; - } - - /** - * Unsets closed field. - */ - public function unsetClosed(): self - { - $this->instance->unsetClosed(); - return $this; - } - /** * Initializes a new get order response object. */ diff --git a/src/Models/CancelSplitRequest.php b/src/Models/CancelSplitRequest.php deleted file mode 100644 index b57b6a8..0000000 --- a/src/Models/CancelSplitRequest.php +++ /dev/null @@ -1,193 +0,0 @@ -type = $type; - $this->amount = $amount; - $this->recipientId = $recipientId; - } - - /** - * Returns Type. - * - * Split type - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * - * Split type - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Amount. - * - * Amount - */ - public function getAmount(): int - { - return $this->amount; - } - - /** - * Sets Amount. - * - * Amount - * - * @required - * @maps amount - */ - public function setAmount(int $amount): void - { - $this->amount = $amount; - } - - /** - * Returns Recipient Id. - * - * Recipient id - */ - public function getRecipientId(): string - { - return $this->recipientId; - } - - /** - * Sets Recipient Id. - * - * Recipient id - * - * @required - * @maps recipient_id - */ - public function setRecipientId(string $recipientId): void - { - $this->recipientId = $recipientId; - } - - /** - * Returns Options. - * - * The split options request - */ - public function getOptions(): ?CreateSplitOptionsRequest - { - return $this->options; - } - - /** - * Sets Options. - * - * The split options request - * - * @maps options - */ - public function setOptions(?CreateSplitOptionsRequest $options): void - { - $this->options = $options; - } - - /** - * Returns Split Rule ID. - * - * Rule id - */ - public function getSplitRuleID(): ?string - { - return $this->splitRuleID; - } - - /** - * Sets Split Rule ID. - * - * Rule id - * - * @maps Split_Rule_ID - */ - public function setSplitRuleID(?string $splitRuleID): void - { - $this->splitRuleID = $splitRuleID; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['type'] = $this->type; - $json['amount'] = $this->amount; - $json['recipient_id'] = $this->recipientId; - if (isset($this->options)) { - $json['options'] = $this->options; - } - if (isset($this->splitRuleID)) { - $json['Split_Rule_ID'] = $this->splitRuleID; - } - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/CreateCardPayloadRequest.php b/src/Models/CreateCardPayloadRequest.php new file mode 100644 index 0000000..5e33353 --- /dev/null +++ b/src/Models/CreateCardPayloadRequest.php @@ -0,0 +1,106 @@ +type) == 0) { + return null; + } + return $this->type['value']; + } + + /** + * Sets Type. + * + * @maps type + */ + public function setType(?string $type): void + { + $this->type['value'] = $type; + } + + /** + * Unsets Type. + */ + public function unsetType(): void + { + $this->type = []; + } + + /** + * Returns Google Pay. + */ + public function getGooglePay(): ?CreateGooglePayRequest + { + if (count($this->googlePay) == 0) { + return null; + } + return $this->googlePay['value']; + } + + /** + * Sets Google Pay. + * + * @maps google_pay + */ + public function setGooglePay(?CreateGooglePayRequest $googlePay): void + { + $this->googlePay['value'] = $googlePay; + } + + /** + * Unsets Google Pay. + */ + public function unsetGooglePay(): void + { + $this->googlePay = []; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (!empty($this->type)) { + $json['type'] = $this->type['value']; + } + if (!empty($this->googlePay)) { + $json['google_pay'] = $this->googlePay['value']; + } + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/CreateCreditCardPaymentRequest.php b/src/Models/CreateCreditCardPaymentRequest.php index 8a4a2c6..23ff7ec 100644 --- a/src/Models/CreateCreditCardPaymentRequest.php +++ b/src/Models/CreateCreditCardPaymentRequest.php @@ -92,6 +92,11 @@ class CreateCreditCardPaymentRequest implements \JsonSerializable */ private $recurrencyCycle; + /** + * @var CreateCardPayloadRequest|null + */ + private $payload; + /** * Returns Installments. * Number of installments @@ -390,6 +395,24 @@ public function setRecurrencyCycle(?string $recurrencyCycle): void $this->recurrencyCycle = $recurrencyCycle; } + /** + * Returns Payload. + */ + public function getPayload(): ?CreateCardPayloadRequest + { + return $this->payload; + } + + /** + * Sets Payload. + * + * @maps payload + */ + public function setPayload(?CreateCardPayloadRequest $payload): void + { + $this->payload = $payload; + } + /** * Encode this object to JSON * @@ -447,6 +470,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->recurrencyCycle)) { $json['recurrency_cycle'] = $this->recurrencyCycle; } + if (isset($this->payload)) { + $json['payload'] = $this->payload; + } return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } diff --git a/src/Models/CreateGooglePayIntermediateSigningKeyRequest.php b/src/Models/CreateGooglePayIntermediateSigningKeyRequest.php new file mode 100644 index 0000000..853c6a7 --- /dev/null +++ b/src/Models/CreateGooglePayIntermediateSigningKeyRequest.php @@ -0,0 +1,122 @@ +signedKey) == 0) { + return null; + } + return $this->signedKey['value']; + } + + /** + * Sets Signed Key. + * Uma mensagem codificada em Base64 com a descrição de pagamento da chave. + * + * @maps signed_key + */ + public function setSignedKey(?string $signedKey): void + { + $this->signedKey['value'] = $signedKey; + } + + /** + * Unsets Signed Key. + * Uma mensagem codificada em Base64 com a descrição de pagamento da chave. + */ + public function unsetSignedKey(): void + { + $this->signedKey = []; + } + + /** + * Returns Signatures. + * Verifica se a origem da chave de assinatura intermediária é o Google. É codificada em Base64 e + * criada usando o ECDSA. + * + * @return string[]|null + */ + public function getSignatures(): ?array + { + if (count($this->signatures) == 0) { + return null; + } + return $this->signatures['value']; + } + + /** + * Sets Signatures. + * Verifica se a origem da chave de assinatura intermediária é o Google. É codificada em Base64 e + * criada usando o ECDSA. + * + * @maps signatures + * + * @param string[]|null $signatures + */ + public function setSignatures(?array $signatures): void + { + $this->signatures['value'] = $signatures; + } + + /** + * Unsets Signatures. + * Verifica se a origem da chave de assinatura intermediária é o Google. É codificada em Base64 e + * criada usando o ECDSA. + */ + public function unsetSignatures(): void + { + $this->signatures = []; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (!empty($this->signedKey)) { + $json['signed_key'] = $this->signedKey['value']; + } + if (!empty($this->signatures)) { + $json['signatures'] = $this->signatures['value']; + } + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/CreateGooglePayRequest.php b/src/Models/CreateGooglePayRequest.php index 56bf20b..c2ee4b1 100644 --- a/src/Models/CreateGooglePayRequest.php +++ b/src/Models/CreateGooglePayRequest.php @@ -18,154 +18,223 @@ class CreateGooglePayRequest implements \JsonSerializable { /** - * @var string + * @var array */ - private $version; + private $version = []; /** - * @var string + * @var array */ - private $data; + private $data = []; /** - * @var CreateGooglePayHeaderRequest + * @var array */ - private $header; + private $intermediateSigningKey = []; /** - * @var string + * @var array */ - private $signature; + private $signature = []; /** - * @var string + * @var array */ - private $merchantIdentifier; + private $signedMessage = []; /** - * @param string $version - * @param string $data - * @param CreateGooglePayHeaderRequest $header - * @param string $signature - * @param string $merchantIdentifier + * @var array */ - public function __construct( - string $version, - string $data, - CreateGooglePayHeaderRequest $header, - string $signature, - string $merchantIdentifier - ) { - $this->version = $version; - $this->data = $data; - $this->header = $header; - $this->signature = $signature; - $this->merchantIdentifier = $merchantIdentifier; - } + private $merchantIdentifier = []; /** * Returns Version. - * The token version + * Informação sobre a versão do token. Único valor aceito é EC_v2 */ - public function getVersion(): string + public function getVersion(): ?string { - return $this->version; + if (count($this->version) == 0) { + return null; + } + return $this->version['value']; } /** * Sets Version. - * The token version + * Informação sobre a versão do token. Único valor aceito é EC_v2 * - * @required * @maps version */ - public function setVersion(string $version): void + public function setVersion(?string $version): void + { + $this->version['value'] = $version; + } + + /** + * Unsets Version. + * Informação sobre a versão do token. Único valor aceito é EC_v2 + */ + public function unsetVersion(): void { - $this->version = $version; + $this->version = []; } /** * Returns Data. - * The cryptography data + * Dados de pagamento criptografados. Corresponde ao encryptedMessage do token Google. */ - public function getData(): string + public function getData(): ?string { - return $this->data; + if (count($this->data) == 0) { + return null; + } + return $this->data['value']; } /** * Sets Data. - * The cryptography data + * Dados de pagamento criptografados. Corresponde ao encryptedMessage do token Google. * - * @required * @maps data */ - public function setData(string $data): void + public function setData(?string $data): void + { + $this->data['value'] = $data; + } + + /** + * Unsets Data. + * Dados de pagamento criptografados. Corresponde ao encryptedMessage do token Google. + */ + public function unsetData(): void { - $this->data = $data; + $this->data = []; } /** - * Returns Header. - * The GooglePay header request + * Returns Intermediate Signing Key. + * The GooglePay intermediate signing key request */ - public function getHeader(): CreateGooglePayHeaderRequest + public function getIntermediateSigningKey(): ?CreateGooglePayIntermediateSigningKeyRequest { - return $this->header; + if (count($this->intermediateSigningKey) == 0) { + return null; + } + return $this->intermediateSigningKey['value']; } /** - * Sets Header. - * The GooglePay header request + * Sets Intermediate Signing Key. + * The GooglePay intermediate signing key request * - * @required - * @maps header + * @maps intermediate_signing_key */ - public function setHeader(CreateGooglePayHeaderRequest $header): void + public function setIntermediateSigningKey( + ?CreateGooglePayIntermediateSigningKeyRequest $intermediateSigningKey + ): void { + $this->intermediateSigningKey['value'] = $intermediateSigningKey; + } + + /** + * Unsets Intermediate Signing Key. + * The GooglePay intermediate signing key request + */ + public function unsetIntermediateSigningKey(): void { - $this->header = $header; + $this->intermediateSigningKey = []; } /** * Returns Signature. - * Detached PKCS #7 signature, Base64 encoded as string + * Assinatura dos dados de pagamento. Verifica se a origem da mensagem é o Google. Corresponde ao + * signature do token Google. */ - public function getSignature(): string + public function getSignature(): ?string { - return $this->signature; + if (count($this->signature) == 0) { + return null; + } + return $this->signature['value']; } /** * Sets Signature. - * Detached PKCS #7 signature, Base64 encoded as string + * Assinatura dos dados de pagamento. Verifica se a origem da mensagem é o Google. Corresponde ao + * signature do token Google. * - * @required * @maps signature */ - public function setSignature(string $signature): void + public function setSignature(?string $signature): void + { + $this->signature['value'] = $signature; + } + + /** + * Unsets Signature. + * Assinatura dos dados de pagamento. Verifica se a origem da mensagem é o Google. Corresponde ao + * signature do token Google. + */ + public function unsetSignature(): void { - $this->signature = $signature; + $this->signature = []; + } + + /** + * Returns Signed Message. + */ + public function getSignedMessage(): ?string + { + if (count($this->signedMessage) == 0) { + return null; + } + return $this->signedMessage['value']; + } + + /** + * Sets Signed Message. + * + * @maps signed_message + */ + public function setSignedMessage(?string $signedMessage): void + { + $this->signedMessage['value'] = $signedMessage; + } + + /** + * Unsets Signed Message. + */ + public function unsetSignedMessage(): void + { + $this->signedMessage = []; } /** * Returns Merchant Identifier. - * GooglePay Merchant identifier */ - public function getMerchantIdentifier(): string + public function getMerchantIdentifier(): ?string { - return $this->merchantIdentifier; + if (count($this->merchantIdentifier) == 0) { + return null; + } + return $this->merchantIdentifier['value']; } /** * Sets Merchant Identifier. - * GooglePay Merchant identifier * - * @required * @maps merchant_identifier */ - public function setMerchantIdentifier(string $merchantIdentifier): void + public function setMerchantIdentifier(?string $merchantIdentifier): void + { + $this->merchantIdentifier['value'] = $merchantIdentifier; + } + + /** + * Unsets Merchant Identifier. + */ + public function unsetMerchantIdentifier(): void { - $this->merchantIdentifier = $merchantIdentifier; + $this->merchantIdentifier = []; } /** @@ -180,11 +249,24 @@ public function setMerchantIdentifier(string $merchantIdentifier): void public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - $json['version'] = $this->version; - $json['data'] = $this->data; - $json['header'] = $this->header; - $json['signature'] = $this->signature; - $json['merchant_identifier'] = $this->merchantIdentifier; + if (!empty($this->version)) { + $json['version'] = $this->version['value']; + } + if (!empty($this->data)) { + $json['data'] = $this->data['value']; + } + if (!empty($this->intermediateSigningKey)) { + $json['intermediate_signing_key'] = $this->intermediateSigningKey['value']; + } + if (!empty($this->signature)) { + $json['signature'] = $this->signature['value']; + } + if (!empty($this->signedMessage)) { + $json['signed_message'] = $this->signedMessage['value']; + } + if (!empty($this->merchantIdentifier)) { + $json['merchant_identifier'] = $this->merchantIdentifier['value']; + } return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } diff --git a/src/Models/CreatePhoneRequest.php b/src/Models/CreatePhoneRequest.php index 03edb78..71c1e64 100644 --- a/src/Models/CreatePhoneRequest.php +++ b/src/Models/CreatePhoneRequest.php @@ -29,6 +29,11 @@ class CreatePhoneRequest implements \JsonSerializable */ private $areaCode; + /** + * @var array + */ + private $type = []; + /** * Returns Country Code. */ @@ -83,6 +88,35 @@ public function setAreaCode(?string $areaCode): void $this->areaCode = $areaCode; } + /** + * Returns Type. + */ + public function getType(): ?string + { + if (count($this->type) == 0) { + return null; + } + return $this->type['value']; + } + + /** + * Sets Type. + * + * @maps Type + */ + public function setType(?string $type): void + { + $this->type['value'] = $type; + } + + /** + * Unsets Type. + */ + public function unsetType(): void + { + $this->type = []; + } + /** * Encode this object to JSON * @@ -104,6 +138,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->areaCode)) { $json['area_code'] = $this->areaCode; } + if (!empty($this->type)) { + $json['Type'] = $this->type['value']; + } return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } diff --git a/src/Models/CreateSellerRequest.php b/src/Models/CreateSellerRequest.php deleted file mode 100644 index 8741382..0000000 --- a/src/Models/CreateSellerRequest.php +++ /dev/null @@ -1,249 +0,0 @@ -name = $name; - $this->metadata = $metadata; - } - - /** - * Returns Name. - * - * Name - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * - * Name - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Code. - * - * Seller's code identification - */ - public function getCode(): ?string - { - return $this->code; - } - - /** - * Sets Code. - * - * Seller's code identification - * - * @maps code - */ - public function setCode(?string $code): void - { - $this->code = $code; - } - - /** - * Returns Description. - * - * Description - */ - public function getDescription(): ?string - { - return $this->description; - } - - /** - * Sets Description. - * - * Description - * - * @maps description - */ - public function setDescription(?string $description): void - { - $this->description = $description; - } - - /** - * Returns Document. - * - * Document number (individual / company) - */ - public function getDocument(): ?string - { - return $this->document; - } - - /** - * Sets Document. - * - * Document number (individual / company) - * - * @maps document - */ - public function setDocument(?string $document): void - { - $this->document = $document; - } - - /** - * Returns Address. - * - * Address - */ - public function getAddress(): ?CreateAddressRequest - { - return $this->address; - } - - /** - * Sets Address. - * - * Address - * - * @maps address - */ - public function setAddress(?CreateAddressRequest $address): void - { - $this->address = $address; - } - - /** - * Returns Type. - * - * Person type (individual / company) - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * - * Person type (individual / company) - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Metadata. - * - * Metadata - */ - public function getMetadata(): array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * - * Metadata - * - * @required - * @maps metadata - */ - public function setMetadata(array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - if (isset($this->code)) { - $json['code'] = $this->code; - } - if (isset($this->description)) { - $json['description'] = $this->description; - } - if (isset($this->document)) { - $json['document'] = $this->document; - } - if (isset($this->address)) { - $json['address'] = $this->address; - } - if (isset($this->type)) { - $json['type'] = $this->type; - } - $json['metadata'] = $this->metadata; - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetOrderItemResponse.php b/src/Models/GetOrderItemResponse.php index 5e7052a..8babb25 100644 --- a/src/Models/GetOrderItemResponse.php +++ b/src/Models/GetOrderItemResponse.php @@ -10,6 +10,7 @@ namespace PagarmeApiSDKLib\Models; +use PagarmeApiSDKLib\Utils\DateTimeHelper; use stdClass; /** @@ -25,13 +26,18 @@ class GetOrderItemResponse implements \JsonSerializable /** * @var array */ - private $amount = []; + private $type = []; /** * @var array */ private $description = []; + /** + * @var array + */ + private $amount = []; + /** * @var array */ @@ -47,6 +53,21 @@ class GetOrderItemResponse implements \JsonSerializable */ private $code = []; + /** + * @var array + */ + private $status = []; + + /** + * @var array + */ + private $createdAt = []; + + /** + * @var array + */ + private $updatedAt = []; + /** * Returns Id. * Id @@ -80,32 +101,32 @@ public function unsetId(): void } /** - * Returns Amount. + * Returns Type. */ - public function getAmount(): ?int + public function getType(): ?string { - if (count($this->amount) == 0) { + if (count($this->type) == 0) { return null; } - return $this->amount['value']; + return $this->type['value']; } /** - * Sets Amount. + * Sets Type. * - * @maps amount + * @maps type */ - public function setAmount(?int $amount): void + public function setType(?string $type): void { - $this->amount['value'] = $amount; + $this->type['value'] = $type; } /** - * Unsets Amount. + * Unsets Type. */ - public function unsetAmount(): void + public function unsetType(): void { - $this->amount = []; + $this->type = []; } /** @@ -137,6 +158,35 @@ public function unsetDescription(): void $this->description = []; } + /** + * Returns Amount. + */ + public function getAmount(): ?int + { + if (count($this->amount) == 0) { + return null; + } + return $this->amount['value']; + } + + /** + * Sets Amount. + * + * @maps amount + */ + public function setAmount(?int $amount): void + { + $this->amount['value'] = $amount; + } + + /** + * Unsets Amount. + */ + public function unsetAmount(): void + { + $this->amount = []; + } + /** * Returns Quantity. */ @@ -230,6 +280,95 @@ public function unsetCode(): void $this->code = []; } + /** + * Returns Status. + */ + public function getStatus(): ?string + { + if (count($this->status) == 0) { + return null; + } + return $this->status['value']; + } + + /** + * Sets Status. + * + * @maps status + */ + public function setStatus(?string $status): void + { + $this->status['value'] = $status; + } + + /** + * Unsets Status. + */ + public function unsetStatus(): void + { + $this->status = []; + } + + /** + * Returns Created At. + */ + public function getCreatedAt(): ?\DateTime + { + if (count($this->createdAt) == 0) { + return null; + } + return $this->createdAt['value']; + } + + /** + * Sets Created At. + * + * @maps created_at + * @factory \PagarmeApiSDKLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setCreatedAt(?\DateTime $createdAt): void + { + $this->createdAt['value'] = $createdAt; + } + + /** + * Unsets Created At. + */ + public function unsetCreatedAt(): void + { + $this->createdAt = []; + } + + /** + * Returns Updated At. + */ + public function getUpdatedAt(): ?\DateTime + { + if (count($this->updatedAt) == 0) { + return null; + } + return $this->updatedAt['value']; + } + + /** + * Sets Updated At. + * + * @maps updated_at + * @factory \PagarmeApiSDKLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setUpdatedAt(?\DateTime $updatedAt): void + { + $this->updatedAt['value'] = $updatedAt; + } + + /** + * Unsets Updated At. + */ + public function unsetUpdatedAt(): void + { + $this->updatedAt = []; + } + /** * Encode this object to JSON * @@ -245,12 +384,15 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->id)) { $json['id'] = $this->id['value']; } - if (!empty($this->amount)) { - $json['amount'] = $this->amount['value']; + if (!empty($this->type)) { + $json['type'] = $this->type['value']; } if (!empty($this->description)) { $json['description'] = $this->description['value']; } + if (!empty($this->amount)) { + $json['amount'] = $this->amount['value']; + } if (!empty($this->quantity)) { $json['quantity'] = $this->quantity['value']; } @@ -260,6 +402,15 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->code)) { $json['code'] = $this->code['value']; } + if (!empty($this->status)) { + $json['status'] = $this->status['value']; + } + if (!empty($this->createdAt)) { + $json['created_at'] = DateTimeHelper::toRfc3339DateTime($this->createdAt['value']); + } + if (!empty($this->updatedAt)) { + $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt['value']); + } return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } diff --git a/src/Models/GetOrderResponse.php b/src/Models/GetOrderResponse.php index 032b8f2..e0c8c61 100644 --- a/src/Models/GetOrderResponse.php +++ b/src/Models/GetOrderResponse.php @@ -28,11 +28,21 @@ class GetOrderResponse implements \JsonSerializable */ private $code = []; + /** + * @var array + */ + private $amount = []; + /** * @var array */ private $currency = []; + /** + * @var array + */ + private $closed = []; + /** * @var array */ @@ -58,6 +68,11 @@ class GetOrderResponse implements \JsonSerializable */ private $updatedAt = []; + /** + * @var array + */ + private $closedAt = []; + /** * @var array */ @@ -103,11 +118,6 @@ class GetOrderResponse implements \JsonSerializable */ private $device = []; - /** - * @var array - */ - private $closed = []; - /** * Returns Id. */ @@ -166,6 +176,35 @@ public function unsetCode(): void $this->code = []; } + /** + * Returns Amount. + */ + public function getAmount(): ?int + { + if (count($this->amount) == 0) { + return null; + } + return $this->amount['value']; + } + + /** + * Sets Amount. + * + * @maps amount + */ + public function setAmount(?int $amount): void + { + $this->amount['value'] = $amount; + } + + /** + * Unsets Amount. + */ + public function unsetAmount(): void + { + $this->amount = []; + } + /** * Returns Currency. */ @@ -195,6 +234,38 @@ public function unsetCurrency(): void $this->currency = []; } + /** + * Returns Closed. + * Indicates whether the order is closed + */ + public function getClosed(): ?bool + { + if (count($this->closed) == 0) { + return null; + } + return $this->closed['value']; + } + + /** + * Sets Closed. + * Indicates whether the order is closed + * + * @maps closed + */ + public function setClosed(?bool $closed): void + { + $this->closed['value'] = $closed; + } + + /** + * Unsets Closed. + * Indicates whether the order is closed + */ + public function unsetClosed(): void + { + $this->closed = []; + } + /** * Returns Items. * @@ -346,6 +417,36 @@ public function unsetUpdatedAt(): void $this->updatedAt = []; } + /** + * Returns Closed At. + */ + public function getClosedAt(): ?\DateTime + { + if (count($this->closedAt) == 0) { + return null; + } + return $this->closedAt['value']; + } + + /** + * Sets Closed At. + * + * @maps closed_at + * @factory \PagarmeApiSDKLib\Utils\DateTimeHelper::fromRfc3339DateTime + */ + public function setClosedAt(?\DateTime $closedAt): void + { + $this->closedAt['value'] = $closedAt; + } + + /** + * Unsets Closed At. + */ + public function unsetClosedAt(): void + { + $this->closedAt = []; + } + /** * Returns Charges. * @@ -634,38 +735,6 @@ public function unsetDevice(): void $this->device = []; } - /** - * Returns Closed. - * Indicates whether the order is closed - */ - public function getClosed(): ?bool - { - if (count($this->closed) == 0) { - return null; - } - return $this->closed['value']; - } - - /** - * Sets Closed. - * Indicates whether the order is closed - * - * @maps closed - */ - public function setClosed(?bool $closed): void - { - $this->closed['value'] = $closed; - } - - /** - * Unsets Closed. - * Indicates whether the order is closed - */ - public function unsetClosed(): void - { - $this->closed = []; - } - /** * Encode this object to JSON * @@ -684,9 +753,15 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->code)) { $json['code'] = $this->code['value']; } + if (!empty($this->amount)) { + $json['amount'] = $this->amount['value']; + } if (!empty($this->currency)) { $json['currency'] = $this->currency['value']; } + if (!empty($this->closed)) { + $json['closed'] = $this->closed['value']; + } if (!empty($this->items)) { $json['items'] = $this->items['value']; } @@ -702,6 +777,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->updatedAt)) { $json['updated_at'] = DateTimeHelper::toRfc3339DateTime($this->updatedAt['value']); } + if (!empty($this->closedAt)) { + $json['closed_at'] = DateTimeHelper::toRfc3339DateTime($this->closedAt['value']); + } if (!empty($this->charges)) { $json['charges'] = $this->charges['value']; } @@ -729,9 +807,6 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->device)) { $json['device'] = $this->device['value']; } - if (!empty($this->closed)) { - $json['closed'] = $this->closed['value']; - } return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } diff --git a/src/Models/GetSellerResponse.php b/src/Models/GetSellerResponse.php deleted file mode 100644 index 37c8356..0000000 --- a/src/Models/GetSellerResponse.php +++ /dev/null @@ -1,375 +0,0 @@ -id = $id; - $this->name = $name; - $this->code = $code; - $this->document = $document; - $this->description = $description; - $this->status = $status; - $this->createdAt = $createdAt; - $this->updatedAt = $updatedAt; - $this->address = $address; - $this->metadata = $metadata; - } - - /** - * Returns Id. - * - * Identification - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * - * Identification - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Code. - */ - public function getCode(): string - { - return $this->code; - } - - /** - * Sets Code. - * - * @required - * @maps code - */ - public function setCode(string $code): void - { - $this->code = $code; - } - - /** - * Returns Document. - */ - public function getDocument(): string - { - return $this->document; - } - - /** - * Sets Document. - * - * @required - * @maps document - */ - public function setDocument(string $document): void - { - $this->document = $document; - } - - /** - * Returns Description. - * - * Description - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Sets Description. - * - * Description - * - * @required - * @maps description - */ - public function setDescription(string $description): void - { - $this->description = $description; - } - - /** - * Returns Status. - * - * Status - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * Sets Status. - * - * Status - * - * @required - * @maps Status - */ - public function setStatus(string $status): void - { - $this->status = $status; - } - - /** - * Returns Created At. - * - * Creation date - */ - public function getCreatedAt(): string - { - return $this->createdAt; - } - - /** - * Sets Created At. - * - * Creation date - * - * @required - * @maps CreatedAt - */ - public function setCreatedAt(string $createdAt): void - { - $this->createdAt = $createdAt; - } - - /** - * Returns Updated At. - * - * Updated date - */ - public function getUpdatedAt(): string - { - return $this->updatedAt; - } - - /** - * Sets Updated At. - * - * Updated date - * - * @required - * @maps UpdatedAt - */ - public function setUpdatedAt(string $updatedAt): void - { - $this->updatedAt = $updatedAt; - } - - /** - * Returns Address. - * - * Address - */ - public function getAddress(): GetAddressResponse - { - return $this->address; - } - - /** - * Sets Address. - * - * Address - * - * @required - * @maps Address - */ - public function setAddress(GetAddressResponse $address): void - { - $this->address = $address; - } - - /** - * Returns Metadata. - * - * Metadata - */ - public function getMetadata(): array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * - * Metadata - * - * @required - * @maps Metadata - */ - public function setMetadata(array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Returns Deleted At. - * - * Deleted date - */ - public function getDeletedAt(): ?string - { - return $this->deletedAt; - } - - /** - * Sets Deleted At. - * - * Deleted date - * - * @maps DeletedAt - */ - public function setDeletedAt(?string $deletedAt): void - { - $this->deletedAt = $deletedAt; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['id'] = $this->id; - $json['name'] = $this->name; - $json['code'] = $this->code; - $json['document'] = $this->document; - $json['description'] = $this->description; - $json['Status'] = $this->status; - $json['CreatedAt'] = $this->createdAt; - $json['UpdatedAt'] = $this->updatedAt; - $json['Address'] = $this->address; - $json['Metadata'] = $this->metadata; - if (isset($this->deletedAt)) { - $json['DeletedAt'] = $this->deletedAt; - } - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/GetSellersRequest.php b/src/Models/GetSellersRequest.php deleted file mode 100644 index 5847274..0000000 --- a/src/Models/GetSellersRequest.php +++ /dev/null @@ -1,224 +0,0 @@ -name = $name; - $this->document = $document; - $this->code = $code; - $this->status = $status; - $this->type = $type; - } - - /** - * Returns Name. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Document. - */ - public function getDocument(): string - { - return $this->document; - } - - /** - * Sets Document. - * - * @required - * @maps document - */ - public function setDocument(string $document): void - { - $this->document = $document; - } - - /** - * Returns Code. - */ - public function getCode(): string - { - return $this->code; - } - - /** - * Sets Code. - * - * @required - * @maps code - */ - public function setCode(string $code): void - { - $this->code = $code; - } - - /** - * Returns Status. - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * Sets Status. - * - * @required - * @maps status - */ - public function setStatus(string $status): void - { - $this->status = $status; - } - - /** - * Returns Type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Created Since. - */ - public function getCreatedSince(): ?string - { - return $this->createdSince; - } - - /** - * Sets Created Since. - * - * @maps created_Since - */ - public function setCreatedSince(?string $createdSince): void - { - $this->createdSince = $createdSince; - } - - /** - * Returns Created Until. - */ - public function getCreatedUntil(): ?string - { - return $this->createdUntil; - } - - /** - * Sets Created Until. - * - * @maps created_Until - */ - public function setCreatedUntil(?string $createdUntil): void - { - $this->createdUntil = $createdUntil; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - $json['document'] = $this->document; - $json['code'] = $this->code; - $json['status'] = $this->status; - $json['type'] = $this->type; - if (isset($this->createdSince)) { - $json['created_Since'] = $this->createdSince; - } - if (isset($this->createdUntil)) { - $json['created_Until'] = $this->createdUntil; - } - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/ListSellerResponse.php b/src/Models/ListSellerResponse.php deleted file mode 100644 index 19fdfca..0000000 --- a/src/Models/ListSellerResponse.php +++ /dev/null @@ -1,103 +0,0 @@ -data = $data; - $this->paging = $paging; - } - - /** - * Returns Data. - * - * The order object - * - * @return GetSellerResponse[] - */ - public function getData(): array - { - return $this->data; - } - - /** - * Sets Data. - * - * The order object - * - * @required - * @maps data - * - * @param GetSellerResponse[] $data - */ - public function setData(array $data): void - { - $this->data = $data; - } - - /** - * Returns Paging. - * - * Paging object - */ - public function getPaging(): PagingResponse - { - return $this->paging; - } - - /** - * Sets Paging. - * - * Paging object - * - * @required - * @maps paging - */ - public function setPaging(PagingResponse $paging): void - { - $this->paging = $paging; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['data'] = $this->data; - $json['paging'] = $this->paging; - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/Models/UpdateSellerRequest.php b/src/Models/UpdateSellerRequest.php deleted file mode 100644 index 685000d..0000000 --- a/src/Models/UpdateSellerRequest.php +++ /dev/null @@ -1,277 +0,0 @@ -name = $name; - $this->code = $code; - $this->description = $description; - $this->document = $document; - $this->status = $status; - $this->type = $type; - $this->address = $address; - $this->metadata = $metadata; - } - - /** - * Returns Name. - * - * Seller name - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * - * Seller name - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Returns Code. - * - * Seller code - */ - public function getCode(): string - { - return $this->code; - } - - /** - * Sets Code. - * - * Seller code - * - * @required - * @maps code - */ - public function setCode(string $code): void - { - $this->code = $code; - } - - /** - * Returns Description. - * - * Seller description - */ - public function getDescription(): string - { - return $this->description; - } - - /** - * Sets Description. - * - * Seller description - * - * @required - * @maps description - */ - public function setDescription(string $description): void - { - $this->description = $description; - } - - /** - * Returns Document. - * - * Seller document CPF or CNPJ - */ - public function getDocument(): string - { - return $this->document; - } - - /** - * Sets Document. - * - * Seller document CPF or CNPJ - * - * @required - * @maps document - */ - public function setDocument(string $document): void - { - $this->document = $document; - } - - /** - * Returns Status. - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * Sets Status. - * - * @required - * @maps status - */ - public function setStatus(string $status): void - { - $this->status = $status; - } - - /** - * Returns Type. - */ - public function getType(): string - { - return $this->type; - } - - /** - * Sets Type. - * - * @required - * @maps type - */ - public function setType(string $type): void - { - $this->type = $type; - } - - /** - * Returns Address. - */ - public function getAddress(): CreateAddressRequest - { - return $this->address; - } - - /** - * Sets Address. - * - * @required - * @maps address - */ - public function setAddress(CreateAddressRequest $address): void - { - $this->address = $address; - } - - /** - * Returns Metadata. - */ - public function getMetadata(): array - { - return $this->metadata; - } - - /** - * Sets Metadata. - * - * @required - * @maps metadata - */ - public function setMetadata(array $metadata): void - { - $this->metadata = $metadata; - } - - /** - * Encode this object to JSON - * - * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields - * are set. (default: false) - * - * @return mixed - */ - public function jsonSerialize(bool $asArrayWhenEmpty = false) - { - $json = []; - $json['name'] = $this->name; - $json['code'] = $this->code; - $json['description'] = $this->description; - $json['document'] = $this->document; - $json['status'] = $this->status; - $json['type'] = $this->type; - $json['address'] = $this->address; - $json['metadata'] = $this->metadata; - - return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; - } -} diff --git a/src/PagarmeApiSDKClient.php b/src/PagarmeApiSDKClient.php index 73a4b4d..d67b8a2 100644 --- a/src/PagarmeApiSDKClient.php +++ b/src/PagarmeApiSDKClient.php @@ -33,26 +33,26 @@ class PagarmeApiSDKClient implements ConfigurationInterface { + private $subscriptions; + private $orders; private $plans; - private $subscriptions; - private $invoices; private $customers; - private $recipients; - private $charges; - private $tokens; + private $recipients; - private $transfers; + private $tokens; private $transactions; + private $transfers; + private $payables; private $balanceOperations; @@ -80,7 +80,7 @@ public function __construct(array $config = []) ->converter(new CompatibilityConverter()) ->jsonHelper(ApiHelper::getJsonHelper()) ->apiCallback($this->config['httpCallback'] ?? null) - ->userAgent('PagarmeApiSDK - PHP 6.8.0') + ->userAgent('PagarmeApiSDK - PHP 6.8.1') ->globalConfig($this->getGlobalConfiguration()) ->globalErrors($this->getGlobalErrors()) ->serverUrls(self::ENVIRONMENT_MAP[$this->getEnvironment()], Server::DEFAULT_) @@ -204,6 +204,17 @@ public function getBaseUri(string $server = Server::DEFAULT_): string return $this->client->getGlobalRequest($server)->getQueryUrl(); } + /** + * Returns Subscriptions Controller + */ + public function getSubscriptionsController(): SubscriptionsController + { + if ($this->subscriptions == null) { + $this->subscriptions = new SubscriptionsController($this->client); + } + return $this->subscriptions; + } + /** * Returns Orders Controller */ @@ -226,17 +237,6 @@ public function getPlansController(): PlansController return $this->plans; } - /** - * Returns Subscriptions Controller - */ - public function getSubscriptionsController(): SubscriptionsController - { - if ($this->subscriptions == null) { - $this->subscriptions = new SubscriptionsController($this->client); - } - return $this->subscriptions; - } - /** * Returns Invoices Controller */ @@ -260,25 +260,25 @@ public function getCustomersController(): CustomersController } /** - * Returns Recipients Controller + * Returns Charges Controller */ - public function getRecipientsController(): RecipientsController + public function getChargesController(): ChargesController { - if ($this->recipients == null) { - $this->recipients = new RecipientsController($this->client); + if ($this->charges == null) { + $this->charges = new ChargesController($this->client); } - return $this->recipients; + return $this->charges; } /** - * Returns Charges Controller + * Returns Recipients Controller */ - public function getChargesController(): ChargesController + public function getRecipientsController(): RecipientsController { - if ($this->charges == null) { - $this->charges = new ChargesController($this->client); + if ($this->recipients == null) { + $this->recipients = new RecipientsController($this->client); } - return $this->charges; + return $this->recipients; } /** @@ -293,25 +293,25 @@ public function getTokensController(): TokensController } /** - * Returns Transfers Controller + * Returns Transactions Controller */ - public function getTransfersController(): TransfersController + public function getTransactionsController(): TransactionsController { - if ($this->transfers == null) { - $this->transfers = new TransfersController($this->client); + if ($this->transactions == null) { + $this->transactions = new TransactionsController($this->client); } - return $this->transfers; + return $this->transactions; } /** - * Returns Transactions Controller + * Returns Transfers Controller */ - public function getTransactionsController(): TransactionsController + public function getTransfersController(): TransfersController { - if ($this->transactions == null) { - $this->transactions = new TransactionsController($this->client); + if ($this->transfers == null) { + $this->transfers = new TransfersController($this->client); } - return $this->transactions; + return $this->transfers; } /**