Skip to content

Commit

Permalink
feat: Add cancelPayoutOrderById method to PayoutOrdersApi (#307)
Browse files Browse the repository at this point in the history
This commit adds the `cancelPayoutOrderById()` method to the `PayoutOrdersApi` class. This method allows users to cancel a payout order by providing the ID of the resource. The method sends a PUT request to the server with the necessary parameters and returns a `PayoutOrderResponse` object if successful.
  • Loading branch information
fcarrero authored Nov 12, 2024
1 parent 66d27fd commit 929e9eb
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ require_once(__DIR__ . '/vendor/autoload.php');



// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure authorization
/**
* @var string $apiKey use private key for authentication
* @link https://developers.conekta.com/reference/autenticaci%C3%B3n for more information
*/
$apiKey = "key_xxxxx";
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken($apiKey);


$apiInstance = new Conekta\Api\AntifraudApi(
Expand Down Expand Up @@ -131,6 +136,7 @@ Class | Method | HTTP request | Description
*PaymentMethodsApi* | [**deleteCustomerPaymentMethods**](docs/Api/PaymentMethodsApi.md#deletecustomerpaymentmethods) | **DELETE** /customers/{id}/payment_sources/{payment_method_id} | Delete Payment Method
*PaymentMethodsApi* | [**getCustomerPaymentMethods**](docs/Api/PaymentMethodsApi.md#getcustomerpaymentmethods) | **GET** /customers/{id}/payment_sources | Get Payment Methods
*PaymentMethodsApi* | [**updateCustomerPaymentMethods**](docs/Api/PaymentMethodsApi.md#updatecustomerpaymentmethods) | **PUT** /customers/{id}/payment_sources/{payment_method_id} | Update Payment Method
*PayoutOrdersApi* | [**cancelPayoutOrderById**](docs/Api/PayoutOrdersApi.md#cancelpayoutorderbyid) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order
*PayoutOrdersApi* | [**createPayoutOrder**](docs/Api/PayoutOrdersApi.md#createpayoutorder) | **POST** /payout_orders | Create payout order
*PayoutOrdersApi* | [**getPayoutOrderById**](docs/Api/PayoutOrdersApi.md#getpayoutorderbyid) | **GET** /payout_orders/{id} | Get Payout Order
*PayoutOrdersApi* | [**getPayoutOrders**](docs/Api/PayoutOrdersApi.md#getpayoutorders) | **GET** /payout_orders | Get a list of Payout Orders
Expand Down
63 changes: 63 additions & 0 deletions docs/Api/PayoutOrdersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,74 @@ All URIs are relative to https://api.conekta.io, except if the operation defines

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**cancelPayoutOrderById()**](PayoutOrdersApi.md#cancelPayoutOrderById) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order |
| [**createPayoutOrder()**](PayoutOrdersApi.md#createPayoutOrder) | **POST** /payout_orders | Create payout order |
| [**getPayoutOrderById()**](PayoutOrdersApi.md#getPayoutOrderById) | **GET** /payout_orders/{id} | Get Payout Order |
| [**getPayoutOrders()**](PayoutOrdersApi.md#getPayoutOrders) | **GET** /payout_orders | Get a list of Payout Orders |


## `cancelPayoutOrderById()`

```php
cancelPayoutOrderById($id, $accept_language): \Conekta\Model\PayoutOrderResponse
```

Cancel Payout Order

Cancel a payout Order resource that corresponds to a payout order ID.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\PayoutOrdersApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use

try {
$result = $apiInstance->cancelPayoutOrderById($id, $accept_language);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PayoutOrdersApi->cancelPayoutOrderById: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| Identifier of the resource | |
| **accept_language** | **string**| Use for knowing which language to use | [optional] [default to &#39;es&#39;] |

### Return type

[**\Conekta\Model\PayoutOrderResponse**](../Model/PayoutOrderResponse.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/vnd.conekta-v2.1.0+json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `createPayoutOrder()`

```php
Expand Down
Loading

0 comments on commit 929e9eb

Please sign in to comment.