From 2eb00b812ccb8c454dd18f0a4fce225e19bcb001 Mon Sep 17 00:00:00 2001 From: Franklin Carrero Date: Tue, 26 Nov 2024 17:39:32 -0500 Subject: [PATCH] feat: Add new charge-related documentation and models (#8) This commit adds new documentation and models related to charges. It includes the following changes: - Added `ChargesOrderResponse.md` and `ChargesOrderResponseAllOfData.md` to the documentation. - Added `ChargesOrderResponse.dart` and `ChargesOrderResponseAllOfData.dart` to the model files. - Updated the version in `.openapi-generator/VERSION` from 7.5.0 to 7.10.0. - Updated the changelog with fixes and updates. - Updated the pubVersion in `config-dart.json` from 6.0.5 to 6.0.6. - Added new properties and descriptions in `ChargeOrderResponsePaymentMethod.md`, `ChargeRequest.md`, `ChargeRequestPaymentMethod.md`, `ChargeResponse.md`, and `ChargeResponsePaymentMethod.md`. - Added a new API method, `ordersCreateCharges`, for creating charges. These changes enhance the existing codebase by providing additional documentation and models for charge-related functionality, as well as introducing a new API method for creating charges. Co-authored-by: AI Assistant --- .openapi-generator/FILES | 8 + .openapi-generator/VERSION | 2 +- CHANGELOG.md | 2 + Makefile | 2 +- README.md | 8 +- VERSION | 2 +- config-dart.json | 2 +- doc/ChargeOrderResponsePaymentMethod.md | 19 +- doc/ChargeRequest.md | 2 +- doc/ChargeRequestPaymentMethod.md | 8 +- doc/ChargeResponse.md | 8 +- doc/ChargeResponsePaymentMethod.md | 19 +- doc/ChargesApi.md | 50 +++ doc/ChargesDataResponse.md | 8 +- doc/ChargesOrderResponse.md | 17 + doc/ChargesOrderResponseAllOfData.md | 32 ++ doc/Checkout.md | 1 + doc/CheckoutRequest.md | 1 + doc/Customer.md | 2 + doc/CustomerResponse.md | 2 + doc/OrderRefundRequest.md | 4 +- doc/OrderRequest.md | 2 +- doc/OrderResponseCharges.md | 2 +- doc/OrderResponseCheckout.md | 1 + doc/OrderResponseDiscountLines.md | 2 +- doc/PaymentMethodBankTransfer.md | 1 + doc/PaymentMethodCard.md | 17 +- doc/PaymentMethodCardRequest.md | 7 +- doc/PaymentMethodCash.md | 3 + doc/PaymentMethodGeneralRequest.md | 22 ++ doc/PaymentMethodTokenRequest.md | 16 + doc/PayoutOrdersApi.md | 46 +++ doc/SubscriptionResponse.md | 1 + doc/UpdateCustomer.md | 2 + lib/conekta.dart | 6 + lib/src/api/antifraud_api.dart | 13 +- lib/src/api/api_keys_api.dart | 11 +- lib/src/api/balances_api.dart | 3 +- lib/src/api/charges_api.dart | 132 ++++++- lib/src/api/companies_api.dart | 5 +- lib/src/api/customers_api.dart | 15 +- lib/src/api/discounts_api.dart | 11 +- lib/src/api/events_api.dart | 7 +- lib/src/api/logs_api.dart | 5 +- lib/src/api/orders_api.dart | 17 +- lib/src/api/payment_link_api.dart | 13 +- lib/src/api/payment_methods_api.dart | 9 +- lib/src/api/payout_orders_api.dart | 105 ++++- lib/src/api/plans_api.dart | 11 +- lib/src/api/products_api.dart | 7 +- lib/src/api/shipping_contacts_api.dart | 7 +- lib/src/api/shippings_api.dart | 7 +- lib/src/api/subscriptions_api.dart | 15 +- lib/src/api/taxes_api.dart | 7 +- lib/src/api/tokens_api.dart | 3 +- lib/src/api/transactions_api.dart | 5 +- lib/src/api/transfers_api.dart | 5 +- lib/src/api/webhook_keys_api.dart | 11 +- lib/src/api/webhooks_api.dart | 13 +- .../charge_order_response_payment_method.dart | 19 +- lib/src/model/charge_request.dart | 3 +- .../model/charge_request_payment_method.dart | 154 +------- .../charge_request_payment_method.g.dart | 89 +---- lib/src/model/charge_response.dart | 12 +- .../model/charge_response_payment_method.dart | 19 +- lib/src/model/charges_data_response.dart | 8 +- lib/src/model/charges_order_response.dart | 137 +++++++ lib/src/model/charges_order_response.g.dart | 143 +++++++ .../charges_order_response_all_of_data.dart | 367 ++++++++++++++++++ .../charges_order_response_all_of_data.g.dart | 336 ++++++++++++++++ lib/src/model/checkout.dart | 19 + lib/src/model/checkout.g.dart | 12 + lib/src/model/checkout_request.dart | 19 + lib/src/model/checkout_request.g.dart | 13 + ...eate_customer_payment_methods_request.dart | 6 +- lib/src/model/customer.dart | 38 ++ lib/src/model/customer.g.dart | 24 ++ .../customer_payment_methods_request.dart | 6 +- lib/src/model/customer_response.dart | 38 ++ lib/src/model/customer_response.g.dart | 24 ++ lib/src/model/order_refund_request.dart | 6 +- lib/src/model/order_request.dart | 4 +- lib/src/model/order_response_charges.dart | 10 +- lib/src/model/order_response_charges.g.dart | 11 +- lib/src/model/order_response_checkout.dart | 20 + lib/src/model/order_response_checkout.g.dart | 13 + .../model/order_response_discount_lines.dart | 10 +- .../order_response_discount_lines.g.dart | 10 +- .../model/payment_method_bank_transfer.dart | 18 + .../model/payment_method_bank_transfer.g.dart | 13 + lib/src/model/payment_method_card.dart | 43 +- lib/src/model/payment_method_card.g.dart | 13 + .../model/payment_method_card_request.dart | 103 ++++- .../model/payment_method_card_request.g.dart | 99 ++++- lib/src/model/payment_method_cash.dart | 138 +++++-- lib/src/model/payment_method_cash.g.dart | 38 ++ .../model/payment_method_general_request.dart | 238 ++++++++++++ .../payment_method_general_request.g.dart | 190 +++++++++ .../model/payment_method_token_request.dart | 121 ++++++ .../model/payment_method_token_request.g.dart | 116 ++++++ lib/src/model/subscription_response.dart | 19 + lib/src/model/subscription_response.g.dart | 13 + lib/src/model/update_customer.dart | 38 ++ lib/src/model/update_customer.g.dart | 25 ++ lib/src/serializers.dart | 8 + lib/src/serializers.g.dart | 15 +- lib/src/utils/utils.dart | 2 +- pubspec.yaml | 2 +- 108 files changed, 3103 insertions(+), 483 deletions(-) create mode 100644 doc/ChargesOrderResponse.md create mode 100644 doc/ChargesOrderResponseAllOfData.md create mode 100644 doc/PaymentMethodGeneralRequest.md create mode 100644 doc/PaymentMethodTokenRequest.md create mode 100644 lib/src/model/charges_order_response.dart create mode 100644 lib/src/model/charges_order_response.g.dart create mode 100644 lib/src/model/charges_order_response_all_of_data.dart create mode 100644 lib/src/model/charges_order_response_all_of_data.g.dart create mode 100644 lib/src/model/payment_method_general_request.dart create mode 100644 lib/src/model/payment_method_general_request.g.dart create mode 100644 lib/src/model/payment_method_token_request.dart create mode 100644 lib/src/model/payment_method_token_request.g.dart diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 6df14a1..208c9e7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -29,6 +29,8 @@ doc/ChargeResponseRefundsData.md doc/ChargeUpdateRequest.md doc/ChargesApi.md doc/ChargesDataResponse.md +doc/ChargesOrderResponse.md +doc/ChargesOrderResponseAllOfData.md doc/Checkout.md doc/CheckoutOrderTemplate.md doc/CheckoutOrderTemplateCustomerInfo.md @@ -136,9 +138,11 @@ doc/PaymentMethodCardResponse.md doc/PaymentMethodCash.md doc/PaymentMethodCashRequest.md doc/PaymentMethodCashResponse.md +doc/PaymentMethodGeneralRequest.md doc/PaymentMethodResponse.md doc/PaymentMethodSpeiRecurrent.md doc/PaymentMethodSpeiRequest.md +doc/PaymentMethodTokenRequest.md doc/PaymentMethodsApi.md doc/Payout.md doc/PayoutMethod.md @@ -255,6 +259,8 @@ lib/src/model/charge_response_refunds.dart lib/src/model/charge_response_refunds_data.dart lib/src/model/charge_update_request.dart lib/src/model/charges_data_response.dart +lib/src/model/charges_order_response.dart +lib/src/model/charges_order_response_all_of_data.dart lib/src/model/checkout.dart lib/src/model/checkout_order_template.dart lib/src/model/checkout_order_template_customer_info.dart @@ -356,9 +362,11 @@ lib/src/model/payment_method_card_response.dart lib/src/model/payment_method_cash.dart lib/src/model/payment_method_cash_request.dart lib/src/model/payment_method_cash_response.dart +lib/src/model/payment_method_general_request.dart lib/src/model/payment_method_response.dart lib/src/model/payment_method_spei_recurrent.dart lib/src/model/payment_method_spei_request.dart +lib/src/model/payment_method_token_request.dart lib/src/model/payout.dart lib/src/model/payout_method.dart lib/src/model/payout_order.dart diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 18bb418..758bb9c 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.5.0 +7.10.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index c175740..c125bf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 6.0.5 -2024-30-04 + * Fix entities ## 6.0.5 -2024-30-04 * Update entities and methods ## 6.0.4 -2024-20-02 diff --git a/Makefile b/Makefile index bb16c68..a40ebfa 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ dart: rm -rf ../conekta-dart/doc && \ rm -rf ../conekta-dart/lib/src/model && \ docker run --rm \ - -v ${PWD}:/local openapitools/openapi-generator-cli:v7.5.0 generate \ + -v ${PWD}:/local openapitools/openapi-generator-cli:v7.10.0 generate \ -i https://raw.githubusercontent.com/conekta/openapi/main/_build/api.yaml \ -g dart-dio \ -o /local \ diff --git a/README.md b/README.md index e2dcec1..1b7008b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For more information, please visit [https://github.com/conekta/openapi/issues](h To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml ```yaml dependencies: - conekta: 6.0.5 + conekta: 6.0.6 ``` ### Github @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description [*BalancesApi*](doc/BalancesApi.md) | [**getBalance**](doc/BalancesApi.md#getbalance) | **GET** /balance | Get a company's balance [*ChargesApi*](doc/ChargesApi.md) | [**getCharges**](doc/ChargesApi.md#getcharges) | **GET** /charges | Get A List of Charges [*ChargesApi*](doc/ChargesApi.md) | [**ordersCreateCharge**](doc/ChargesApi.md#orderscreatecharge) | **POST** /orders/{id}/charges | Create charge +[*ChargesApi*](doc/ChargesApi.md) | [**ordersCreateCharges**](doc/ChargesApi.md#orderscreatecharges) | **POST** /orders/{id}/add_charges | Create charges [*ChargesApi*](doc/ChargesApi.md) | [**updateCharge**](doc/ChargesApi.md#updatecharge) | **PUT** /charges/{id} | Update a charge [*CompaniesApi*](doc/CompaniesApi.md) | [**getCompanies**](doc/CompaniesApi.md#getcompanies) | **GET** /companies | Get List of Companies [*CompaniesApi*](doc/CompaniesApi.md) | [**getCompany**](doc/CompaniesApi.md#getcompany) | **GET** /companies/{id} | Get Company @@ -120,6 +121,7 @@ Class | Method | HTTP request | Description [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**deleteCustomerPaymentMethods**](doc/PaymentMethodsApi.md#deletecustomerpaymentmethods) | **DELETE** /customers/{id}/payment_sources/{payment_method_id} | Delete Payment Method [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**getCustomerPaymentMethods**](doc/PaymentMethodsApi.md#getcustomerpaymentmethods) | **GET** /customers/{id}/payment_sources | Get Payment Methods [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**updateCustomerPaymentMethods**](doc/PaymentMethodsApi.md#updatecustomerpaymentmethods) | **PUT** /customers/{id}/payment_sources/{payment_method_id} | Update Payment Method +[*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**cancelPayoutOrderById**](doc/PayoutOrdersApi.md#cancelpayoutorderbyid) | **PUT** /payout_orders/{id}/cancel | Cancel Payout Order [*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**createPayoutOrder**](doc/PayoutOrdersApi.md#createpayoutorder) | **POST** /payout_orders | Create payout order [*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**getPayoutOrderById**](doc/PayoutOrdersApi.md#getpayoutorderbyid) | **GET** /payout_orders/{id} | Get Payout Order [*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**getPayoutOrders**](doc/PayoutOrdersApi.md#getpayoutorders) | **GET** /payout_orders | Get a list of Payout Orders @@ -186,6 +188,8 @@ Class | Method | HTTP request | Description - [ChargeResponseRefundsData](doc/ChargeResponseRefundsData.md) - [ChargeUpdateRequest](doc/ChargeUpdateRequest.md) - [ChargesDataResponse](doc/ChargesDataResponse.md) + - [ChargesOrderResponse](doc/ChargesOrderResponse.md) + - [ChargesOrderResponseAllOfData](doc/ChargesOrderResponseAllOfData.md) - [Checkout](doc/Checkout.md) - [CheckoutOrderTemplate](doc/CheckoutOrderTemplate.md) - [CheckoutOrderTemplateCustomerInfo](doc/CheckoutOrderTemplateCustomerInfo.md) @@ -286,9 +290,11 @@ Class | Method | HTTP request | Description - [PaymentMethodCash](doc/PaymentMethodCash.md) - [PaymentMethodCashRequest](doc/PaymentMethodCashRequest.md) - [PaymentMethodCashResponse](doc/PaymentMethodCashResponse.md) + - [PaymentMethodGeneralRequest](doc/PaymentMethodGeneralRequest.md) - [PaymentMethodResponse](doc/PaymentMethodResponse.md) - [PaymentMethodSpeiRecurrent](doc/PaymentMethodSpeiRecurrent.md) - [PaymentMethodSpeiRequest](doc/PaymentMethodSpeiRequest.md) + - [PaymentMethodTokenRequest](doc/PaymentMethodTokenRequest.md) - [Payout](doc/Payout.md) - [PayoutMethod](doc/PayoutMethod.md) - [PayoutOrder](doc/PayoutOrder.md) diff --git a/VERSION b/VERSION index 288b2cd..b7ff151 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.5 +6.0.6 diff --git a/config-dart.json b/config-dart.json index cbb1c2b..3fe09d5 100644 --- a/config-dart.json +++ b/config-dart.json @@ -2,7 +2,7 @@ "useEnumExtension": true, "pubAuthor": "conekta", "pubLibrary": "conekta", - "pubVersion": "6.0.5", + "pubVersion": "6.0.6", "pubName": "conekta", "pubRepository": "https://www.github.com/conekta/conekta-dart", "pubHomepage" : "https://www.github.com/conekta/conekta-dart", diff --git a/doc/ChargeOrderResponsePaymentMethod.md b/doc/ChargeOrderResponsePaymentMethod.md index f49dc31..52aa452 100644 --- a/doc/ChargeOrderResponsePaymentMethod.md +++ b/doc/ChargeOrderResponsePaymentMethod.md @@ -10,24 +10,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **String** | | [optional] **object** | **String** | | +**agreement** | **String** | Agreement ID | [optional] **authCode** | **String** | | [optional] **cashierId** | **String** | | [optional] **reference** | **String** | | [optional] **barcodeUrl** | **String** | | [optional] **expiresAt** | **int** | | [optional] +**productType** | **String** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional] **serviceName** | **String** | | [optional] **store** | **String** | | [optional] **storeName** | **String** | | [optional] -**accountType** | **String** | | [optional] -**brand** | **String** | | [optional] +**customerIpAddress** | **String** | | [optional] +**accountType** | **String** | Account type of the card | [optional] +**brand** | **String** | Brand of the card | [optional] **contractId** | **String** | Id sent for recurrent charges. | [optional] -**country** | **String** | | [optional] -**expMonth** | **String** | | [optional] -**expYear** | **String** | | [optional] +**country** | **String** | Country of the card | [optional] +**expMonth** | **String** | Expiration month of the card | [optional] +**expYear** | **String** | Expiration year of the card | [optional] **fraudIndicators** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**issuer** | **String** | | [optional] -**last4** | **String** | | [optional] -**name** | **String** | | [optional] +**issuer** | **String** | Issuer of the card | [optional] +**last4** | **String** | Last 4 digits of the card | [optional] +**name** | **String** | Name of the cardholder | [optional] **bank** | **String** | | [optional] **clabe** | **String** | | [optional] **description** | **String** | | [optional] diff --git a/doc/ChargeRequest.md b/doc/ChargeRequest.md index b5c519c..2804c4c 100644 --- a/doc/ChargeRequest.md +++ b/doc/ChargeRequest.md @@ -8,7 +8,7 @@ import 'package:conekta/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amount** | **int** | | [optional] +**amount** | **int** | Amount to be charged in cents | [optional] **paymentMethod** | [**ChargeRequestPaymentMethod**](ChargeRequestPaymentMethod.md) | | **referenceId** | **String** | Custom reference to add to the charge | [optional] diff --git a/doc/ChargeRequestPaymentMethod.md b/doc/ChargeRequestPaymentMethod.md index a32cde5..815fd54 100644 --- a/doc/ChargeRequestPaymentMethod.md +++ b/doc/ChargeRequestPaymentMethod.md @@ -8,9 +8,15 @@ import 'package:conekta/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**type** | **String** | Type of payment method | +**cvc** | **String** | Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants | +**expMonth** | **String** | Card expiration month | +**expYear** | **String** | Card expiration year | +**name** | **String** | Cardholder name | +**number** | **String** | Card number | +**customerIpAddress** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] **expiresAt** | **int** | Method expiration date as unix timestamp | [optional] **monthlyInstallments** | **int** | How many months without interest to apply, it can be 3, 6, 9, 12 or 18 | [optional] -**type** | **String** | | **tokenId** | **String** | | [optional] **paymentSourceId** | **String** | | [optional] **contractId** | **String** | Optional id sent to indicate the bank contract for recurrent card charges. | [optional] diff --git a/doc/ChargeResponse.md b/doc/ChargeResponse.md index 3f22f6c..d278d06 100644 --- a/doc/ChargeResponse.md +++ b/doc/ChargeResponse.md @@ -17,11 +17,11 @@ Name | Type | Description | Notes **deviceFingerprint** | **String** | | [optional] **failureCode** | **String** | | [optional] **failureMessage** | **String** | | [optional] -**id** | **String** | | [optional] -**livemode** | **bool** | | [optional] +**id** | **String** | Charge ID | [optional] +**livemode** | **bool** | Whether the charge was made in live mode or not | [optional] **object** | **String** | | [optional] -**orderId** | **String** | | [optional] -**paidAt** | **int** | | [optional] +**orderId** | **String** | Order ID | [optional] +**paidAt** | **int** | Payment date | [optional] **paymentMethod** | [**ChargeResponsePaymentMethod**](ChargeResponsePaymentMethod.md) | | [optional] **referenceId** | **String** | Reference ID of the charge | [optional] **refunds** | [**ChargeResponseRefunds**](ChargeResponseRefunds.md) | | [optional] diff --git a/doc/ChargeResponsePaymentMethod.md b/doc/ChargeResponsePaymentMethod.md index 33293d6..5c658c8 100644 --- a/doc/ChargeResponsePaymentMethod.md +++ b/doc/ChargeResponsePaymentMethod.md @@ -10,24 +10,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **String** | | [optional] **object** | **String** | | +**agreement** | **String** | Agreement ID | [optional] **authCode** | **String** | | [optional] **cashierId** | **String** | | [optional] **reference** | **String** | | [optional] **barcodeUrl** | **String** | | [optional] **expiresAt** | **int** | | [optional] +**productType** | **String** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional] **serviceName** | **String** | | [optional] **store** | **String** | | [optional] **storeName** | **String** | | [optional] -**accountType** | **String** | | [optional] -**brand** | **String** | | [optional] +**customerIpAddress** | **String** | | [optional] +**accountType** | **String** | Account type of the card | [optional] +**brand** | **String** | Brand of the card | [optional] **contractId** | **String** | Id sent for recurrent charges. | [optional] -**country** | **String** | | [optional] -**expMonth** | **String** | | [optional] -**expYear** | **String** | | [optional] +**country** | **String** | Country of the card | [optional] +**expMonth** | **String** | Expiration month of the card | [optional] +**expYear** | **String** | Expiration year of the card | [optional] **fraudIndicators** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**issuer** | **String** | | [optional] -**last4** | **String** | | [optional] -**name** | **String** | | [optional] +**issuer** | **String** | Issuer of the card | [optional] +**last4** | **String** | Last 4 digits of the card | [optional] +**name** | **String** | Name of the cardholder | [optional] **bank** | **String** | | [optional] **clabe** | **String** | | [optional] **description** | **String** | | [optional] diff --git a/doc/ChargesApi.md b/doc/ChargesApi.md index d23905d..21552e3 100644 --- a/doc/ChargesApi.md +++ b/doc/ChargesApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**getCharges**](ChargesApi.md#getcharges) | **GET** /charges | Get A List of Charges [**ordersCreateCharge**](ChargesApi.md#orderscreatecharge) | **POST** /orders/{id}/charges | Create charge +[**ordersCreateCharges**](ChargesApi.md#orderscreatecharges) | **POST** /orders/{id}/add_charges | Create charges [**updateCharge**](ChargesApi.md#updatecharge) | **PUT** /charges/{id} | Update a charge @@ -114,6 +115,55 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **ordersCreateCharges** +> ChargesOrderResponse ordersCreateCharges(id, chargeRequest, acceptLanguage, xChildCompanyId) + +Create charges + +Create charges for an existing orden + +### Example +```dart +import 'package:conekta/api.dart'; + +final api = Conekta().getChargesApi(); +final String id = 6307a60c41de27127515a575; // String | Identifier of the resource +final ChargeRequest chargeRequest = ; // ChargeRequest | requested field for a charge +final String acceptLanguage = es; // String | Use for knowing which language to use +final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request. + +try { + final response = api.ordersCreateCharges(id, chargeRequest, acceptLanguage, xChildCompanyId); + print(response); +} catch on DioException (e) { + print('Exception when calling ChargesApi->ordersCreateCharges: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Identifier of the resource | + **chargeRequest** | [**ChargeRequest**](ChargeRequest.md)| requested field for a charge | + **acceptLanguage** | **String**| Use for knowing which language to use | [optional] [default to 'es'] + **xChildCompanyId** | **String**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] + +### Return type + +[**ChargesOrderResponse**](ChargesOrderResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/vnd.conekta-v2.1.0+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **updateCharge** > ChargeResponse updateCharge(id, chargeUpdateRequest, acceptLanguage, xChildCompanyId) diff --git a/doc/ChargesDataResponse.md b/doc/ChargesDataResponse.md index 2882433..bcdc9cb 100644 --- a/doc/ChargesDataResponse.md +++ b/doc/ChargesDataResponse.md @@ -17,11 +17,11 @@ Name | Type | Description | Notes **deviceFingerprint** | **String** | | [optional] **failureCode** | **String** | | [optional] **failureMessage** | **String** | | [optional] -**id** | **String** | | [optional] -**livemode** | **bool** | | [optional] +**id** | **String** | Charge ID | [optional] +**livemode** | **bool** | Whether the charge was made in live mode or not | [optional] **object** | **String** | | [optional] -**orderId** | **String** | | [optional] -**paidAt** | **int** | | [optional] +**orderId** | **String** | Order ID | [optional] +**paidAt** | **int** | Payment date | [optional] **paymentMethod** | [**ChargeResponsePaymentMethod**](ChargeResponsePaymentMethod.md) | | [optional] **referenceId** | **String** | Reference ID of the charge | [optional] **refunds** | [**ChargeResponseRefunds**](ChargeResponseRefunds.md) | | [optional] diff --git a/doc/ChargesOrderResponse.md b/doc/ChargesOrderResponse.md new file mode 100644 index 0000000..fbf7dc0 --- /dev/null +++ b/doc/ChargesOrderResponse.md @@ -0,0 +1,17 @@ +# conekta.model.ChargesOrderResponse + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **bool** | Indicates if there are more pages to be requested | +**object** | **String** | Object type, in this case is list | +**data** | [**BuiltList<ChargesOrderResponseAllOfData>**](ChargesOrderResponseAllOfData.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/ChargesOrderResponseAllOfData.md b/doc/ChargesOrderResponseAllOfData.md new file mode 100644 index 0000000..476306d --- /dev/null +++ b/doc/ChargesOrderResponseAllOfData.md @@ -0,0 +1,32 @@ +# conekta.model.ChargesOrderResponseAllOfData + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | | [optional] +**channel** | [**ChargeResponseChannel**](ChargeResponseChannel.md) | | [optional] +**createdAt** | **int** | | [optional] +**currency** | **String** | | [optional] +**customerId** | **String** | | [optional] +**description** | **String** | | [optional] +**deviceFingerprint** | **String** | | [optional] +**failureCode** | **String** | | [optional] +**failureMessage** | **String** | | [optional] +**id** | **String** | Charge ID | [optional] +**livemode** | **bool** | Whether the charge was made in live mode or not | [optional] +**object** | **String** | | [optional] +**orderId** | **String** | Order ID | [optional] +**paidAt** | **int** | Payment date | [optional] +**paymentMethod** | [**ChargeResponsePaymentMethod**](ChargeResponsePaymentMethod.md) | | [optional] +**referenceId** | **String** | Reference ID of the charge | [optional] +**refunds** | [**ChargeResponseRefunds**](ChargeResponseRefunds.md) | | [optional] +**status** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/Checkout.md b/doc/Checkout.md index 82d04e8..872852a 100644 --- a/doc/Checkout.md +++ b/doc/Checkout.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **expiresAt** | **int** | It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) | **monthlyInstallmentsEnabled** | **bool** | This flag allows you to specify if months without interest will be active. | [optional] **monthlyInstallmentsOptions** | **BuiltList<int>** | This field allows you to specify the number of months without interest. | [optional] +**threeDsMode** | **String** | Indicates the 3DS2 mode for the order, either smart or strict. | [optional] **name** | **String** | Reason for charge | **needsShippingContact** | **bool** | This flag allows you to fill in the shipping information at checkout. | [optional] **onDemandEnabled** | **bool** | This flag allows you to specify if the link will be on demand. | [optional] diff --git a/doc/CheckoutRequest.md b/doc/CheckoutRequest.md index 758a33d..05fa02d 100644 --- a/doc/CheckoutRequest.md +++ b/doc/CheckoutRequest.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **failureUrl** | **String** | Redirection url back to the site in case of failed payment, applies only to HostedPayment. | [optional] **monthlyInstallmentsEnabled** | **bool** | | [optional] **monthlyInstallmentsOptions** | **BuiltList<int>** | | [optional] +**maxFailedRetries** | **int** | Number of retries allowed before the checkout is marked as failed | [optional] **name** | **String** | Reason for payment | [optional] **onDemandEnabled** | **bool** | | [optional] **redirectionTime** | **int** | number of seconds to wait before redirecting to the success_url | [optional] diff --git a/doc/Customer.md b/doc/Customer.md index 784426c..63845ab 100644 --- a/doc/Customer.md +++ b/doc/Customer.md @@ -11,12 +11,14 @@ Name | Type | Description | Notes **antifraudInfo** | [**CustomerAntifraudInfo**](CustomerAntifraudInfo.md) | | [optional] **corporate** | **bool** | It is a value that allows identifying if the email is corporate or not. | [optional] [default to false] **customReference** | **String** | It is an undefined value. | [optional] +**dateOfBirth** | **String** | It is a parameter that allows to identify the date of birth of the client. | [optional] **email** | **String** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). | **defaultPaymentSourceId** | **String** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional] **defaultShippingContactId** | **String** | It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact) | [optional] **fiscalEntities** | [**BuiltList<CustomerFiscalEntitiesRequest>**](CustomerFiscalEntitiesRequest.md) | | [optional] **metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **name** | **String** | Client's name | +**nationalId** | **String** | It is a parameter that allows to identify the national identification number of the client. | [optional] **paymentSources** | [**BuiltList<CustomerPaymentMethodsRequest>**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional] **phone** | **String** | Is the customer's phone number | **planId** | **String** | Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription | [optional] diff --git a/doc/CustomerResponse.md b/doc/CustomerResponse.md index daaf930..03c0a07 100644 --- a/doc/CustomerResponse.md +++ b/doc/CustomerResponse.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **corporate** | **bool** | true if the customer is a company | [optional] **createdAt** | **int** | Creation date of the object | **customReference** | **String** | Custom reference | [optional] +**dateOfBirth** | **String** | It is a parameter that allows to identify the date of birth of the client. | [optional] **defaultFiscalEntityId** | **String** | | [optional] **defaultShippingContactId** | **String** | | [optional] **defaultPaymentSourceId** | **String** | | [optional] @@ -20,6 +21,7 @@ Name | Type | Description | Notes **id** | **String** | Customer's ID | **livemode** | **bool** | true if the object exists in live mode or the value false if the object exists in test mode | **name** | **String** | Customer's name | +**nationalId** | **String** | It is a parameter that allows to identify the national identification number of the client. | [optional] **metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **object** | **String** | | **paymentSources** | [**CustomerPaymentMethodsResponse**](CustomerPaymentMethodsResponse.md) | | [optional] diff --git a/doc/OrderRefundRequest.md b/doc/OrderRefundRequest.md index 7a59c67..a435bb0 100644 --- a/doc/OrderRefundRequest.md +++ b/doc/OrderRefundRequest.md @@ -8,9 +8,9 @@ import 'package:conekta/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amount** | **int** | | +**amount** | **int** | Amount to be refunded in cents | **expiresAt** | **int** | | [optional] -**reason** | **String** | | +**reason** | **String** | Reason for the refund | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/OrderRequest.md b/doc/OrderRequest.md index aa51dfa..e84ba7e 100644 --- a/doc/OrderRequest.md +++ b/doc/OrderRequest.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **needsShippingContact** | **bool** | Allows you to fill out the shipping information at checkout | [optional] **preAuthorize** | **bool** | Indicates whether the order charges must be preauthorized | [optional] [default to false] **processingMode** | **String** | Indicates the processing mode for the order, either ecommerce, recurrent or validation. | [optional] -**returnUrl** | **String** | Indicates the redirection callback upon completion of the 3DS2 flow. | [optional] +**returnUrl** | **String** | Indicates the redirection callback upon completion of the 3DS2 flow. Do not use this parameter if your order has a checkout parameter | [optional] **shippingContact** | [**CustomerShippingContacts**](CustomerShippingContacts.md) | | [optional] **shippingLines** | [**BuiltList<ShippingRequest>**](ShippingRequest.md) | List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products. | [optional] **taxLines** | [**BuiltList<OrderTaxRequest>**](OrderTaxRequest.md) | List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order. | [optional] diff --git a/doc/OrderResponseCharges.md b/doc/OrderResponseCharges.md index 0119b7d..2101aed 100644 --- a/doc/OrderResponseCharges.md +++ b/doc/OrderResponseCharges.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hasMore** | **bool** | Indicates if there are more pages to be requested | **object** | **String** | Object type, in this case is list | -**data** | [**BuiltList<ChargesDataResponse>**](ChargesDataResponse.md) | | [optional] +**data** | [**BuiltList<ChargesDataResponse>**](ChargeResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/OrderResponseCheckout.md b/doc/OrderResponseCheckout.md index 9850d47..3dcc3dd 100644 --- a/doc/OrderResponseCheckout.md +++ b/doc/OrderResponseCheckout.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **id** | **String** | | [optional] **isRedirectOnFailure** | **bool** | | [optional] **livemode** | **bool** | | [optional] +**maxFailedRetries** | **int** | Number of retries allowed before the checkout is marked as failed | [optional] **metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **monthlyInstallmentsEnabled** | **bool** | | [optional] **monthlyInstallmentsOptions** | **BuiltList<int>** | | [optional] diff --git a/doc/OrderResponseDiscountLines.md b/doc/OrderResponseDiscountLines.md index 7afbcbd..b1d7deb 100644 --- a/doc/OrderResponseDiscountLines.md +++ b/doc/OrderResponseDiscountLines.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hasMore** | **bool** | Indicates if there are more pages to be requested | **object** | **String** | Object type, in this case is list | -**data** | [**BuiltList<DiscountLinesDataResponse>**](DiscountLinesDataResponse.md) | | [optional] +**data** | [**BuiltList<DiscountLinesDataResponse>**](DiscountLinesResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/PaymentMethodBankTransfer.md b/doc/PaymentMethodBankTransfer.md index 1199baa..a66a0f7 100644 --- a/doc/PaymentMethodBankTransfer.md +++ b/doc/PaymentMethodBankTransfer.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **receivingAccountTaxId** | **String** | | [optional] **referenceNumber** | **String** | | [optional] **trackingCode** | **String** | | [optional] +**customerIpAddress** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/PaymentMethodCard.md b/doc/PaymentMethodCard.md index 2865777..19cb693 100644 --- a/doc/PaymentMethodCard.md +++ b/doc/PaymentMethodCard.md @@ -10,17 +10,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **String** | | [optional] **object** | **String** | | -**accountType** | **String** | | [optional] +**accountType** | **String** | Account type of the card | [optional] **authCode** | **String** | | [optional] -**brand** | **String** | | [optional] +**brand** | **String** | Brand of the card | [optional] **contractId** | **String** | Id sent for recurrent charges. | [optional] -**country** | **String** | | [optional] -**expMonth** | **String** | | [optional] -**expYear** | **String** | | [optional] +**country** | **String** | Country of the card | [optional] +**expMonth** | **String** | Expiration month of the card | [optional] +**expYear** | **String** | Expiration year of the card | [optional] **fraudIndicators** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**issuer** | **String** | | [optional] -**last4** | **String** | | [optional] -**name** | **String** | | [optional] +**issuer** | **String** | Issuer of the card | [optional] +**last4** | **String** | Last 4 digits of the card | [optional] +**name** | **String** | Name of the cardholder | [optional] +**customerIpAddress** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/PaymentMethodCardRequest.md b/doc/PaymentMethodCardRequest.md index aa2de31..67f1654 100644 --- a/doc/PaymentMethodCardRequest.md +++ b/doc/PaymentMethodCardRequest.md @@ -9,7 +9,12 @@ import 'package:conekta/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **String** | Type of payment method | -**tokenId** | **String** | Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. | +**cvc** | **String** | Card security code | +**expMonth** | **String** | Card expiration month | +**expYear** | **String** | Card expiration year | +**name** | **String** | Cardholder name | +**number** | **String** | Card number | +**customerIpAddress** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/PaymentMethodCash.md b/doc/PaymentMethodCash.md index d92f014..10cd72f 100644 --- a/doc/PaymentMethodCash.md +++ b/doc/PaymentMethodCash.md @@ -10,14 +10,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **String** | | [optional] **object** | **String** | | +**agreement** | **String** | Agreement ID | [optional] **authCode** | **int** | | [optional] **cashierId** | **String** | | [optional] **reference** | **String** | | [optional] **barcodeUrl** | **String** | | [optional] **expiresAt** | **int** | | [optional] +**productType** | **String** | Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. | [optional] **serviceName** | **String** | | [optional] **store** | **String** | | [optional] **storeName** | **String** | | [optional] +**customerIpAddress** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/doc/PaymentMethodGeneralRequest.md b/doc/PaymentMethodGeneralRequest.md new file mode 100644 index 0000000..b99d681 --- /dev/null +++ b/doc/PaymentMethodGeneralRequest.md @@ -0,0 +1,22 @@ +# conekta.model.PaymentMethodGeneralRequest + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expiresAt** | **int** | Method expiration date as unix timestamp | [optional] +**monthlyInstallments** | **int** | How many months without interest to apply, it can be 3, 6, 9, 12 or 18 | [optional] +**type** | **String** | Type of payment method | +**tokenId** | **String** | | [optional] +**paymentSourceId** | **String** | | [optional] +**cvc** | **String** | Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants | [optional] +**contractId** | **String** | Optional id sent to indicate the bank contract for recurrent card charges. | [optional] +**customerIpAddress** | **String** | Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PaymentMethodTokenRequest.md b/doc/PaymentMethodTokenRequest.md new file mode 100644 index 0000000..b59efe5 --- /dev/null +++ b/doc/PaymentMethodTokenRequest.md @@ -0,0 +1,16 @@ +# conekta.model.PaymentMethodTokenRequest + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | Type of payment method | +**tokenId** | **String** | Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrdersApi.md b/doc/PayoutOrdersApi.md index 499f4bc..1f3717c 100644 --- a/doc/PayoutOrdersApi.md +++ b/doc/PayoutOrdersApi.md @@ -9,11 +9,57 @@ All URIs are relative to *https://api.conekta.io* 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** +> PayoutOrderResponse cancelPayoutOrderById(id, acceptLanguage) + +Cancel Payout Order + +Cancel a payout Order resource that corresponds to a payout order ID. + +### Example +```dart +import 'package:conekta/api.dart'; + +final api = Conekta().getPayoutOrdersApi(); +final String id = 6307a60c41de27127515a575; // String | Identifier of the resource +final String acceptLanguage = es; // String | Use for knowing which language to use + +try { + final response = api.cancelPayoutOrderById(id, acceptLanguage); + print(response); +} catch on DioException (e) { + print('Exception when calling PayoutOrdersApi->cancelPayoutOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Identifier of the resource | + **acceptLanguage** | **String**| Use for knowing which language to use | [optional] [default to 'es'] + +### Return type + +[**PayoutOrderResponse**](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#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **createPayoutOrder** > PayoutOrderResponse createPayoutOrder(payoutOrder, acceptLanguage) diff --git a/doc/SubscriptionResponse.md b/doc/SubscriptionResponse.md index 54acfe1..3f39137 100644 --- a/doc/SubscriptionResponse.md +++ b/doc/SubscriptionResponse.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **billingCycleStart** | **int** | | [optional] **billingCycleEnd** | **int** | | [optional] **canceledAt** | **int** | | [optional] +**canceledReason** | **String** | Reason for cancellation. This field appears when the subscription status is 'canceled'. | [optional] **cardId** | **String** | | [optional] **chargeId** | **String** | | [optional] **createdAt** | **int** | | [optional] diff --git a/doc/UpdateCustomer.md b/doc/UpdateCustomer.md index 4033d14..94cd863 100644 --- a/doc/UpdateCustomer.md +++ b/doc/UpdateCustomer.md @@ -9,6 +9,7 @@ import 'package:conekta/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **antifraudInfo** | [**UpdateCustomerAntifraudInfo**](UpdateCustomerAntifraudInfo.md) | | [optional] +**dateOfBirth** | **String** | It is a parameter that allows to identify the date of birth of the client. | [optional] **defaultPaymentSourceId** | **String** | It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) | [optional] **email** | **String** | An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). | [optional] **name** | **String** | Client's name | [optional] @@ -19,6 +20,7 @@ Name | Type | Description | Notes **customReference** | **String** | It is an undefined value. | [optional] **fiscalEntities** | [**BuiltList<CustomerFiscalEntitiesRequest>**](CustomerFiscalEntitiesRequest.md) | | [optional] **metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] +**nationalId** | **String** | It is a parameter that allows to identify the national identification number of the client. | [optional] **paymentSources** | [**BuiltList<CustomerPaymentMethodsRequest>**](CustomerPaymentMethodsRequest.md) | Contains details of the payment methods that the customer has active or has used in Conekta | [optional] **shippingContacts** | [**BuiltList<CustomerShippingContacts>**](CustomerShippingContacts.md) | Contains the detail of the shipping addresses that the client has active or has used in Conekta | [optional] **subscription** | [**SubscriptionRequest**](SubscriptionRequest.md) | | [optional] diff --git a/lib/conekta.dart b/lib/conekta.dart index d0e3a55..25d4eef 100644 --- a/lib/conekta.dart +++ b/lib/conekta.dart @@ -5,6 +5,7 @@ export 'package:conekta/src/api.dart'; export 'package:conekta/src/auth/api_key_auth.dart'; export 'package:conekta/src/auth/basic_auth.dart'; +export 'package:conekta/src/auth/bearer_auth.dart'; export 'package:conekta/src/auth/oauth.dart'; export 'package:conekta/src/serializers.dart'; export 'package:conekta/src/model/date.dart'; @@ -53,6 +54,8 @@ export 'package:conekta/src/model/charge_response_refunds.dart'; export 'package:conekta/src/model/charge_response_refunds_data.dart'; export 'package:conekta/src/model/charge_update_request.dart'; export 'package:conekta/src/model/charges_data_response.dart'; +export 'package:conekta/src/model/charges_order_response.dart'; +export 'package:conekta/src/model/charges_order_response_all_of_data.dart'; export 'package:conekta/src/model/checkout.dart'; export 'package:conekta/src/model/checkout_order_template.dart'; export 'package:conekta/src/model/checkout_order_template_customer_info.dart'; @@ -153,9 +156,11 @@ export 'package:conekta/src/model/payment_method_card_response.dart'; export 'package:conekta/src/model/payment_method_cash.dart'; export 'package:conekta/src/model/payment_method_cash_request.dart'; export 'package:conekta/src/model/payment_method_cash_response.dart'; +export 'package:conekta/src/model/payment_method_general_request.dart'; export 'package:conekta/src/model/payment_method_response.dart'; export 'package:conekta/src/model/payment_method_spei_recurrent.dart'; export 'package:conekta/src/model/payment_method_spei_request.dart'; +export 'package:conekta/src/model/payment_method_token_request.dart'; export 'package:conekta/src/model/payout.dart'; export 'package:conekta/src/model/payout_method.dart'; export 'package:conekta/src/model/payout_order.dart'; @@ -207,3 +212,4 @@ export 'package:conekta/src/model/webhook_request.dart'; export 'package:conekta/src/model/webhook_response.dart'; export 'package:conekta/src/model/webhook_update_request.dart'; export 'package:conekta/src/model/whitelistlist_rule_response.dart'; + diff --git a/lib/src/api/antifraud_api.dart b/lib/src/api/antifraud_api.dart index 4c48ae0..fb83ce1 100644 --- a/lib/src/api/antifraud_api.dart +++ b/lib/src/api/antifraud_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -65,7 +66,7 @@ class AntifraudApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -184,7 +185,7 @@ class AntifraudApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -304,7 +305,7 @@ class AntifraudApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -405,7 +406,7 @@ class AntifraudApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -502,7 +503,7 @@ class AntifraudApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -598,7 +599,7 @@ class AntifraudApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/api_keys_api.dart b/lib/src/api/api_keys_api.dart index 0008e87..340c2ac 100644 --- a/lib/src/api/api_keys_api.dart +++ b/lib/src/api/api_keys_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -67,7 +68,7 @@ class ApiKeysApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -186,7 +187,7 @@ class ApiKeysApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -286,7 +287,7 @@ class ApiKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -393,7 +394,7 @@ class ApiKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -503,7 +504,7 @@ class ApiKeysApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/balances_api.dart b/lib/src/api/balances_api.dart index f3dc85a..2b3114a 100644 --- a/lib/src/api/balances_api.dart +++ b/lib/src/api/balances_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -56,7 +57,7 @@ class BalancesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/charges_api.dart b/lib/src/api/charges_api.dart index a63c810..c495ba0 100644 --- a/lib/src/api/charges_api.dart +++ b/lib/src/api/charges_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -12,6 +13,7 @@ import 'package:conekta/src/model/charge_order_response.dart'; import 'package:conekta/src/model/charge_request.dart'; import 'package:conekta/src/model/charge_response.dart'; import 'package:conekta/src/model/charge_update_request.dart'; +import 'package:conekta/src/model/charges_order_response.dart'; import 'package:conekta/src/model/error.dart'; import 'package:conekta/src/model/get_charges_response.dart'; import 'package:conekta/src/utils/utils.dart'; @@ -71,7 +73,7 @@ class ChargesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -183,7 +185,7 @@ class ChargesApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -263,6 +265,130 @@ class ChargesApi { ); } + /// Create charges + /// Create charges for an existing orden + /// + /// Parameters: + /// * [id] - Identifier of the resource + /// * [chargeRequest] - requested field for a charge + /// * [acceptLanguage] - Use for knowing which language to use + /// * [xChildCompanyId] - In the case of a holding company, the company id of the child company to which will process the request. + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [ChargesOrderResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> ordersCreateCharges({ + required String id, + required ChargeRequest chargeRequest, + String? acceptLanguage = 'es', + String? xChildCompanyId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/orders/{id}/add_charges'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString()); + // to determine the Accept header + List _contentTypes = [ + "application/json" + ]; + var localVarContentType = selectHeaderContentType(_contentTypes); + + // to determine the Accept header + List _accepts = [ + "application/vnd.conekta-v2.1.0+json" + ]; + final localVarAccept = selectHeaderAccept(_accepts); + final _options = Options( + method: r'POST', + headers: { + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', + if (acceptLanguage != null) r'Accept-Language': acceptLanguage, + if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, + if (localVarAccept != null) r'Accept': localVarAccept, + if (localVarContentType != null) r'Content-Type': localVarContentType, + r'X-Conekta-Client-User-Agent' : getConektaClientUserAgent(), + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearerAuth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(ChargeRequest); + _bodyData = _serializers.serialize(chargeRequest, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ChargesOrderResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(ChargesOrderResponse), + ) as ChargesOrderResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + /// Update a charge /// /// @@ -307,7 +433,7 @@ class ChargesApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/companies_api.dart b/lib/src/api/companies_api.dart index 1e7cca4..4e3de5f 100644 --- a/lib/src/api/companies_api.dart +++ b/lib/src/api/companies_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -66,7 +67,7 @@ class CompaniesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -172,7 +173,7 @@ class CompaniesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/customers_api.dart b/lib/src/api/customers_api.dart index b9bc1cf..29630eb 100644 --- a/lib/src/api/customers_api.dart +++ b/lib/src/api/customers_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -69,7 +70,7 @@ class CustomersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -193,7 +194,7 @@ class CustomersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -314,7 +315,7 @@ class CustomersApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -415,7 +416,7 @@ class CustomersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -522,7 +523,7 @@ class CustomersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -634,7 +635,7 @@ class CustomersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -760,7 +761,7 @@ class CustomersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/discounts_api.dart b/lib/src/api/discounts_api.dart index d4d3811..8b8d2f4 100644 --- a/lib/src/api/discounts_api.dart +++ b/lib/src/api/discounts_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -67,7 +68,7 @@ class DiscountsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -190,7 +191,7 @@ class DiscountsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -293,7 +294,7 @@ class DiscountsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -402,7 +403,7 @@ class DiscountsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -516,7 +517,7 @@ class DiscountsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/events_api.dart b/lib/src/api/events_api.dart index 161abbc..ba977d7 100644 --- a/lib/src/api/events_api.dart +++ b/lib/src/api/events_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -63,7 +64,7 @@ class EventsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -170,7 +171,7 @@ class EventsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -279,7 +280,7 @@ class EventsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/logs_api.dart b/lib/src/api/logs_api.dart index b62ae2c..76e3e1f 100644 --- a/lib/src/api/logs_api.dart +++ b/lib/src/api/logs_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -62,7 +63,7 @@ class LogsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -169,7 +170,7 @@ class LogsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/orders_api.dart b/lib/src/api/orders_api.dart index 3409850..11c9644 100644 --- a/lib/src/api/orders_api.dart +++ b/lib/src/api/orders_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -66,7 +67,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -168,7 +169,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -289,7 +290,7 @@ class OrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -410,7 +411,7 @@ class OrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -528,7 +529,7 @@ class OrdersApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -632,7 +633,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -756,7 +757,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -878,7 +879,7 @@ class OrdersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/payment_link_api.dart b/lib/src/api/payment_link_api.dart index a710981..6bc2ea1 100644 --- a/lib/src/api/payment_link_api.dart +++ b/lib/src/api/payment_link_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -65,7 +66,7 @@ class PaymentLinkApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -167,7 +168,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -291,7 +292,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -412,7 +413,7 @@ class PaymentLinkApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -519,7 +520,7 @@ class PaymentLinkApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -631,7 +632,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/payment_methods_api.dart b/lib/src/api/payment_methods_api.dart index fbd20d6..36d0e1e 100644 --- a/lib/src/api/payment_methods_api.dart +++ b/lib/src/api/payment_methods_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -68,7 +69,7 @@ class PaymentMethodsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -191,7 +192,7 @@ class PaymentMethodsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -300,7 +301,7 @@ class PaymentMethodsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -414,7 +415,7 @@ class PaymentMethodsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/payout_orders_api.dart b/lib/src/api/payout_orders_api.dart index 938b6f6..5d26fc7 100644 --- a/lib/src/api/payout_orders_api.dart +++ b/lib/src/api/payout_orders_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -22,6 +23,104 @@ class PayoutOrdersApi { const PayoutOrdersApi(this._dio, this._serializers); + /// Cancel Payout Order + /// Cancel a payout Order resource that corresponds to a payout order ID. + /// + /// Parameters: + /// * [id] - Identifier of the resource + /// * [acceptLanguage] - Use for knowing which language to use + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PayoutOrderResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> cancelPayoutOrderById({ + required String id, + String? acceptLanguage = 'es', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/payout_orders/{id}/cancel'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString()); + // to determine the Accept header + List _contentTypes = [ + ]; + var localVarContentType = selectHeaderContentType(_contentTypes); + + // to determine the Accept header + List _accepts = [ + "application/vnd.conekta-v2.1.0+json" + ]; + final localVarAccept = selectHeaderAccept(_accepts); + final _options = Options( + method: r'PUT', + headers: { + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', + if (acceptLanguage != null) r'Accept-Language': acceptLanguage, + if (localVarAccept != null) r'Accept': localVarAccept, + if (localVarContentType != null) r'Content-Type': localVarContentType, + r'X-Conekta-Client-User-Agent' : getConektaClientUserAgent(), + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearerAuth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PayoutOrderResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(PayoutOrderResponse), + ) as PayoutOrderResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + /// Create payout order /// Create a new payout order. /// @@ -62,7 +161,7 @@ class PayoutOrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -180,7 +279,7 @@ class PayoutOrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -284,7 +383,7 @@ class PayoutOrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/plans_api.dart b/lib/src/api/plans_api.dart index e105ab8..2c5dfd9 100644 --- a/lib/src/api/plans_api.dart +++ b/lib/src/api/plans_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -65,7 +66,7 @@ class PlansApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -184,7 +185,7 @@ class PlansApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -284,7 +285,7 @@ class PlansApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -391,7 +392,7 @@ class PlansApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -503,7 +504,7 @@ class PlansApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/products_api.dart b/lib/src/api/products_api.dart index 5e9e8d8..6b8e7c2 100644 --- a/lib/src/api/products_api.dart +++ b/lib/src/api/products_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -66,7 +67,7 @@ class ProductsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +190,7 @@ class ProductsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +296,7 @@ class ProductsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/shipping_contacts_api.dart b/lib/src/api/shipping_contacts_api.dart index 16645a0..ab1691e 100644 --- a/lib/src/api/shipping_contacts_api.dart +++ b/lib/src/api/shipping_contacts_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -66,7 +67,7 @@ class ShippingContactsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +190,7 @@ class ShippingContactsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +296,7 @@ class ShippingContactsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/shippings_api.dart b/lib/src/api/shippings_api.dart index e9e50a1..f961aa3 100644 --- a/lib/src/api/shippings_api.dart +++ b/lib/src/api/shippings_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -65,7 +66,7 @@ class ShippingsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -188,7 +189,7 @@ class ShippingsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -294,7 +295,7 @@ class ShippingsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/subscriptions_api.dart b/lib/src/api/subscriptions_api.dart index 367364b..cdf721d 100644 --- a/lib/src/api/subscriptions_api.dart +++ b/lib/src/api/subscriptions_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -64,7 +65,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -168,7 +169,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -289,7 +290,7 @@ class SubscriptionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -388,7 +389,7 @@ class SubscriptionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -488,7 +489,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -589,7 +590,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -693,7 +694,7 @@ class SubscriptionsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/taxes_api.dart b/lib/src/api/taxes_api.dart index ddc77f1..b06ef41 100644 --- a/lib/src/api/taxes_api.dart +++ b/lib/src/api/taxes_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -66,7 +67,7 @@ class TaxesApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +190,7 @@ class TaxesApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +296,7 @@ class TaxesApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/tokens_api.dart b/lib/src/api/tokens_api.dart index 16c1865..6369800 100644 --- a/lib/src/api/tokens_api.dart +++ b/lib/src/api/tokens_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -60,7 +61,7 @@ class TokensApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/transactions_api.dart b/lib/src/api/transactions_api.dart index 2bc0023..038f142 100644 --- a/lib/src/api/transactions_api.dart +++ b/lib/src/api/transactions_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -62,7 +63,7 @@ class TransactionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -175,7 +176,7 @@ class TransactionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/transfers_api.dart b/lib/src/api/transfers_api.dart index 313ee15..8eb5cec 100644 --- a/lib/src/api/transfers_api.dart +++ b/lib/src/api/transfers_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -62,7 +63,7 @@ class TransfersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -169,7 +170,7 @@ class TransfersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/webhook_keys_api.dart b/lib/src/api/webhook_keys_api.dart index cbfbcd8..e6d560e 100644 --- a/lib/src/api/webhook_keys_api.dart +++ b/lib/src/api/webhook_keys_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -65,7 +66,7 @@ class WebhookKeysApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -183,7 +184,7 @@ class WebhookKeysApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -283,7 +284,7 @@ class WebhookKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -390,7 +391,7 @@ class WebhookKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -500,7 +501,7 @@ class WebhookKeysApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/webhooks_api.dart b/lib/src/api/webhooks_api.dart index 8cdc6f0..77b791e 100644 --- a/lib/src/api/webhooks_api.dart +++ b/lib/src/api/webhooks_api.dart @@ -4,6 +4,7 @@ import 'dart:async'; +import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:dio/dio.dart'; @@ -63,7 +64,7 @@ class WebhooksApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -181,7 +182,7 @@ class WebhooksApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -281,7 +282,7 @@ class WebhooksApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -390,7 +391,7 @@ class WebhooksApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -498,7 +499,7 @@ class WebhooksApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -601,7 +602,7 @@ class WebhooksApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.6', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/model/charge_order_response_payment_method.dart b/lib/src/model/charge_order_response_payment_method.dart index 5a55066..a8643bb 100644 --- a/lib/src/model/charge_order_response_payment_method.dart +++ b/lib/src/model/charge_order_response_payment_method.dart @@ -19,24 +19,27 @@ part 'charge_order_response_payment_method.g.dart'; /// Properties: /// * [type] /// * [object] +/// * [agreement] - Agreement ID /// * [authCode] /// * [cashierId] /// * [reference] /// * [barcodeUrl] /// * [expiresAt] +/// * [productType] - Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. /// * [serviceName] /// * [store] /// * [storeName] -/// * [accountType] -/// * [brand] +/// * [customerIpAddress] +/// * [accountType] - Account type of the card +/// * [brand] - Brand of the card /// * [contractId] - Id sent for recurrent charges. -/// * [country] -/// * [expMonth] -/// * [expYear] +/// * [country] - Country of the card +/// * [expMonth] - Expiration month of the card +/// * [expYear] - Expiration year of the card /// * [fraudIndicators] -/// * [issuer] -/// * [last4] -/// * [name] +/// * [issuer] - Issuer of the card +/// * [last4] - Last 4 digits of the card +/// * [name] - Name of the cardholder /// * [bank] /// * [clabe] /// * [description] diff --git a/lib/src/model/charge_request.dart b/lib/src/model/charge_request.dart index e48cd6a..b45752f 100644 --- a/lib/src/model/charge_request.dart +++ b/lib/src/model/charge_request.dart @@ -12,11 +12,12 @@ part 'charge_request.g.dart'; /// The charges to be made /// /// Properties: -/// * [amount] +/// * [amount] - Amount to be charged in cents /// * [paymentMethod] /// * [referenceId] - Custom reference to add to the charge @BuiltValue() abstract class ChargeRequest implements Built { + /// Amount to be charged in cents @BuiltValueField(wireName: r'amount') int? get amount; diff --git a/lib/src/model/charge_request_payment_method.dart b/lib/src/model/charge_request_payment_method.dart index ec31041..9256dcc 100644 --- a/lib/src/model/charge_request_payment_method.dart +++ b/lib/src/model/charge_request_payment_method.dart @@ -3,42 +3,33 @@ // // ignore_for_file: unused_element +import 'package:conekta/src/model/payment_method_card_request.dart'; +import 'package:conekta/src/model/payment_method_general_request.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; +import 'package:one_of/one_of.dart'; part 'charge_request_payment_method.g.dart'; -/// Payment method used in the charge. Go to the [payment methods](https://developers.conekta.com/reference/m%C3%A9todos-de-pago) section for more details +/// ChargeRequestPaymentMethod /// /// Properties: +/// * [type] - Type of payment method +/// * [cvc] - Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants +/// * [expMonth] - Card expiration month +/// * [expYear] - Card expiration year +/// * [name] - Cardholder name +/// * [number] - Card number +/// * [customerIpAddress] - Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes /// * [expiresAt] - Method expiration date as unix timestamp /// * [monthlyInstallments] - How many months without interest to apply, it can be 3, 6, 9, 12 or 18 -/// * [type] /// * [tokenId] /// * [paymentSourceId] /// * [contractId] - Optional id sent to indicate the bank contract for recurrent card charges. @BuiltValue() abstract class ChargeRequestPaymentMethod implements Built { - /// Method expiration date as unix timestamp - @BuiltValueField(wireName: r'expires_at') - int? get expiresAt; - - /// How many months without interest to apply, it can be 3, 6, 9, 12 or 18 - @BuiltValueField(wireName: r'monthly_installments') - int? get monthlyInstallments; - - @BuiltValueField(wireName: r'type') - String get type; - - @BuiltValueField(wireName: r'token_id') - String? get tokenId; - - @BuiltValueField(wireName: r'payment_source_id') - String? get paymentSourceId; - - /// Optional id sent to indicate the bank contract for recurrent card charges. - @BuiltValueField(wireName: r'contract_id') - String? get contractId; + /// One Of [PaymentMethodCardRequest], [PaymentMethodGeneralRequest] + OneOf get oneOf; ChargeRequestPaymentMethod._(); @@ -63,46 +54,6 @@ class _$ChargeRequestPaymentMethodSerializer implements PrimitiveSerializer serializedList, - required ChargeRequestPaymentMethodBuilder result, - required List unhandled, - }) { - for (var i = 0; i < serializedList.length; i += 2) { - final key = serializedList[i] as String; - final value = serializedList[i + 1]; - switch (key) { - case r'expires_at': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.expiresAt = valueDes; - break; - case r'monthly_installments': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(int), - ) as int; - result.monthlyInstallments = valueDes; - break; - case r'type': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.type = valueDes; - break; - case r'token_id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.tokenId = valueDes; - break; - case r'payment_source_id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.paymentSourceId = valueDes; - break; - case r'contract_id': - final valueDes = serializers.deserialize( - value, - specifiedType: const FullType(String), - ) as String; - result.contractId = valueDes; - break; - default: - unhandled.add(key); - unhandled.add(value); - break; - } - } + final oneOf = object.oneOf; + return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!; } @override @@ -183,16 +73,10 @@ class _$ChargeRequestPaymentMethodSerializer implements PrimitiveSerializer).toList(); - final unhandled = []; - _deserializeProperties( - serializers, - serialized, - specifiedType: specifiedType, - serializedList: serializedList, - unhandled: unhandled, - result: result, - ); + Object? oneOfDataSrc; + final targetType = const FullType(OneOf, [FullType(PaymentMethodCardRequest), FullType(PaymentMethodGeneralRequest), ]); + oneOfDataSrc = serialized; + result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); } } diff --git a/lib/src/model/charge_request_payment_method.g.dart b/lib/src/model/charge_request_payment_method.g.dart index e6733cd..e363277 100644 --- a/lib/src/model/charge_request_payment_method.g.dart +++ b/lib/src/model/charge_request_payment_method.g.dart @@ -8,32 +8,15 @@ part of 'charge_request_payment_method.dart'; class _$ChargeRequestPaymentMethod extends ChargeRequestPaymentMethod { @override - final int? expiresAt; - @override - final int? monthlyInstallments; - @override - final String type; - @override - final String? tokenId; - @override - final String? paymentSourceId; - @override - final String? contractId; + final OneOf oneOf; factory _$ChargeRequestPaymentMethod( [void Function(ChargeRequestPaymentMethodBuilder)? updates]) => (new ChargeRequestPaymentMethodBuilder()..update(updates))._build(); - _$ChargeRequestPaymentMethod._( - {this.expiresAt, - this.monthlyInstallments, - required this.type, - this.tokenId, - this.paymentSourceId, - this.contractId}) - : super._() { + _$ChargeRequestPaymentMethod._({required this.oneOf}) : super._() { BuiltValueNullFieldError.checkNotNull( - type, r'ChargeRequestPaymentMethod', 'type'); + oneOf, r'ChargeRequestPaymentMethod', 'oneOf'); } @override @@ -48,24 +31,13 @@ class _$ChargeRequestPaymentMethod extends ChargeRequestPaymentMethod { @override bool operator ==(Object other) { if (identical(other, this)) return true; - return other is ChargeRequestPaymentMethod && - expiresAt == other.expiresAt && - monthlyInstallments == other.monthlyInstallments && - type == other.type && - tokenId == other.tokenId && - paymentSourceId == other.paymentSourceId && - contractId == other.contractId; + return other is ChargeRequestPaymentMethod && oneOf == other.oneOf; } @override int get hashCode { var _$hash = 0; - _$hash = $jc(_$hash, expiresAt.hashCode); - _$hash = $jc(_$hash, monthlyInstallments.hashCode); - _$hash = $jc(_$hash, type.hashCode); - _$hash = $jc(_$hash, tokenId.hashCode); - _$hash = $jc(_$hash, paymentSourceId.hashCode); - _$hash = $jc(_$hash, contractId.hashCode); + _$hash = $jc(_$hash, oneOf.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -73,12 +45,7 @@ class _$ChargeRequestPaymentMethod extends ChargeRequestPaymentMethod { @override String toString() { return (newBuiltValueToStringHelper(r'ChargeRequestPaymentMethod') - ..add('expiresAt', expiresAt) - ..add('monthlyInstallments', monthlyInstallments) - ..add('type', type) - ..add('tokenId', tokenId) - ..add('paymentSourceId', paymentSourceId) - ..add('contractId', contractId)) + ..add('oneOf', oneOf)) .toString(); } } @@ -88,31 +55,9 @@ class ChargeRequestPaymentMethodBuilder Builder { _$ChargeRequestPaymentMethod? _$v; - int? _expiresAt; - int? get expiresAt => _$this._expiresAt; - set expiresAt(int? expiresAt) => _$this._expiresAt = expiresAt; - - int? _monthlyInstallments; - int? get monthlyInstallments => _$this._monthlyInstallments; - set monthlyInstallments(int? monthlyInstallments) => - _$this._monthlyInstallments = monthlyInstallments; - - String? _type; - String? get type => _$this._type; - set type(String? type) => _$this._type = type; - - String? _tokenId; - String? get tokenId => _$this._tokenId; - set tokenId(String? tokenId) => _$this._tokenId = tokenId; - - String? _paymentSourceId; - String? get paymentSourceId => _$this._paymentSourceId; - set paymentSourceId(String? paymentSourceId) => - _$this._paymentSourceId = paymentSourceId; - - String? _contractId; - String? get contractId => _$this._contractId; - set contractId(String? contractId) => _$this._contractId = contractId; + OneOf? _oneOf; + OneOf? get oneOf => _$this._oneOf; + set oneOf(OneOf? oneOf) => _$this._oneOf = oneOf; ChargeRequestPaymentMethodBuilder() { ChargeRequestPaymentMethod._defaults(this); @@ -121,12 +66,7 @@ class ChargeRequestPaymentMethodBuilder ChargeRequestPaymentMethodBuilder get _$this { final $v = _$v; if ($v != null) { - _expiresAt = $v.expiresAt; - _monthlyInstallments = $v.monthlyInstallments; - _type = $v.type; - _tokenId = $v.tokenId; - _paymentSourceId = $v.paymentSourceId; - _contractId = $v.contractId; + _oneOf = $v.oneOf; _$v = null; } return this; @@ -149,13 +89,8 @@ class ChargeRequestPaymentMethodBuilder _$ChargeRequestPaymentMethod _build() { final _$result = _$v ?? new _$ChargeRequestPaymentMethod._( - expiresAt: expiresAt, - monthlyInstallments: monthlyInstallments, - type: BuiltValueNullFieldError.checkNotNull( - type, r'ChargeRequestPaymentMethod', 'type'), - tokenId: tokenId, - paymentSourceId: paymentSourceId, - contractId: contractId); + oneOf: BuiltValueNullFieldError.checkNotNull( + oneOf, r'ChargeRequestPaymentMethod', 'oneOf')); replace(_$result); return _$result; } diff --git a/lib/src/model/charge_response.dart b/lib/src/model/charge_response.dart index fe205db..8408843 100644 --- a/lib/src/model/charge_response.dart +++ b/lib/src/model/charge_response.dart @@ -23,11 +23,11 @@ part 'charge_response.g.dart'; /// * [deviceFingerprint] /// * [failureCode] /// * [failureMessage] -/// * [id] -/// * [livemode] +/// * [id] - Charge ID +/// * [livemode] - Whether the charge was made in live mode or not /// * [object] -/// * [orderId] -/// * [paidAt] +/// * [orderId] - Order ID +/// * [paidAt] - Payment date /// * [paymentMethod] /// * [referenceId] - Reference ID of the charge /// * [refunds] @@ -61,18 +61,22 @@ abstract class ChargeResponse { @BuiltValueField(wireName: r'failure_message') String? get failureMessage; + /// Charge ID @BuiltValueField(wireName: r'id') String? get id; + /// Whether the charge was made in live mode or not @BuiltValueField(wireName: r'livemode') bool? get livemode; @BuiltValueField(wireName: r'object') String? get object; + /// Order ID @BuiltValueField(wireName: r'order_id') String? get orderId; + /// Payment date @BuiltValueField(wireName: r'paid_at') int? get paidAt; diff --git a/lib/src/model/charge_response_payment_method.dart b/lib/src/model/charge_response_payment_method.dart index 43cbd42..c0e566e 100644 --- a/lib/src/model/charge_response_payment_method.dart +++ b/lib/src/model/charge_response_payment_method.dart @@ -19,24 +19,27 @@ part 'charge_response_payment_method.g.dart'; /// Properties: /// * [type] /// * [object] +/// * [agreement] - Agreement ID /// * [authCode] /// * [cashierId] /// * [reference] /// * [barcodeUrl] /// * [expiresAt] +/// * [productType] - Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. /// * [serviceName] /// * [store] /// * [storeName] -/// * [accountType] -/// * [brand] +/// * [customerIpAddress] +/// * [accountType] - Account type of the card +/// * [brand] - Brand of the card /// * [contractId] - Id sent for recurrent charges. -/// * [country] -/// * [expMonth] -/// * [expYear] +/// * [country] - Country of the card +/// * [expMonth] - Expiration month of the card +/// * [expYear] - Expiration year of the card /// * [fraudIndicators] -/// * [issuer] -/// * [last4] -/// * [name] +/// * [issuer] - Issuer of the card +/// * [last4] - Last 4 digits of the card +/// * [name] - Name of the cardholder /// * [bank] /// * [clabe] /// * [description] diff --git a/lib/src/model/charges_data_response.dart b/lib/src/model/charges_data_response.dart index 30cab8f..9b37c29 100644 --- a/lib/src/model/charges_data_response.dart +++ b/lib/src/model/charges_data_response.dart @@ -24,11 +24,11 @@ part 'charges_data_response.g.dart'; /// * [deviceFingerprint] /// * [failureCode] /// * [failureMessage] -/// * [id] -/// * [livemode] +/// * [id] - Charge ID +/// * [livemode] - Whether the charge was made in live mode or not /// * [object] -/// * [orderId] -/// * [paidAt] +/// * [orderId] - Order ID +/// * [paidAt] - Payment date /// * [paymentMethod] /// * [referenceId] - Reference ID of the charge /// * [refunds] diff --git a/lib/src/model/charges_order_response.dart b/lib/src/model/charges_order_response.dart new file mode 100644 index 0000000..38b668c --- /dev/null +++ b/lib/src/model/charges_order_response.dart @@ -0,0 +1,137 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/pagination.dart'; +import 'package:conekta/src/model/charges_order_response_all_of_data.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'charges_order_response.g.dart'; + +/// The charges associated with the order +/// +/// Properties: +/// * [hasMore] - Indicates if there are more pages to be requested +/// * [object] - Object type, in this case is list +/// * [data] +@BuiltValue() +abstract class ChargesOrderResponse implements Pagination, Built { + @BuiltValueField(wireName: r'data') + BuiltList? get data; + + ChargesOrderResponse._(); + + factory ChargesOrderResponse([void updates(ChargesOrderResponseBuilder b)]) = _$ChargesOrderResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ChargesOrderResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ChargesOrderResponseSerializer(); +} + +class _$ChargesOrderResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ChargesOrderResponse, _$ChargesOrderResponse]; + + @override + final String wireName = r'ChargesOrderResponse'; + + Iterable _serializeProperties( + Serializers serializers, + ChargesOrderResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.data != null) { + yield r'data'; + yield serializers.serialize( + object.data, + specifiedType: const FullType(BuiltList, [FullType(ChargesOrderResponseAllOfData)]), + ); + } + yield r'has_more'; + yield serializers.serialize( + object.hasMore, + specifiedType: const FullType(bool), + ); + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + ChargesOrderResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ChargesOrderResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'data': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(ChargesOrderResponseAllOfData)]), + ) as BuiltList; + result.data.replace(valueDes); + break; + case r'has_more': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.hasMore = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ChargesOrderResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ChargesOrderResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/charges_order_response.g.dart b/lib/src/model/charges_order_response.g.dart new file mode 100644 index 0000000..38e48d9 --- /dev/null +++ b/lib/src/model/charges_order_response.g.dart @@ -0,0 +1,143 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'charges_order_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ChargesOrderResponse extends ChargesOrderResponse { + @override + final BuiltList? data; + @override + final bool hasMore; + @override + final String object; + + factory _$ChargesOrderResponse( + [void Function(ChargesOrderResponseBuilder)? updates]) => + (new ChargesOrderResponseBuilder()..update(updates))._build(); + + _$ChargesOrderResponse._( + {this.data, required this.hasMore, required this.object}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + hasMore, r'ChargesOrderResponse', 'hasMore'); + BuiltValueNullFieldError.checkNotNull( + object, r'ChargesOrderResponse', 'object'); + } + + @override + ChargesOrderResponse rebuild( + void Function(ChargesOrderResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ChargesOrderResponseBuilder toBuilder() => + new ChargesOrderResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ChargesOrderResponse && + data == other.data && + hasMore == other.hasMore && + object == other.object; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jc(_$hash, hasMore.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ChargesOrderResponse') + ..add('data', data) + ..add('hasMore', hasMore) + ..add('object', object)) + .toString(); + } +} + +class ChargesOrderResponseBuilder + implements + Builder, + PaginationBuilder { + _$ChargesOrderResponse? _$v; + + ListBuilder? _data; + ListBuilder get data => + _$this._data ??= new ListBuilder(); + set data(covariant ListBuilder? data) => + _$this._data = data; + + bool? _hasMore; + bool? get hasMore => _$this._hasMore; + set hasMore(covariant bool? hasMore) => _$this._hasMore = hasMore; + + String? _object; + String? get object => _$this._object; + set object(covariant String? object) => _$this._object = object; + + ChargesOrderResponseBuilder() { + ChargesOrderResponse._defaults(this); + } + + ChargesOrderResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _data = $v.data?.toBuilder(); + _hasMore = $v.hasMore; + _object = $v.object; + _$v = null; + } + return this; + } + + @override + void replace(covariant ChargesOrderResponse other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ChargesOrderResponse; + } + + @override + void update(void Function(ChargesOrderResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ChargesOrderResponse build() => _build(); + + _$ChargesOrderResponse _build() { + _$ChargesOrderResponse _$result; + try { + _$result = _$v ?? + new _$ChargesOrderResponse._( + data: _data?.build(), + hasMore: BuiltValueNullFieldError.checkNotNull( + hasMore, r'ChargesOrderResponse', 'hasMore'), + object: BuiltValueNullFieldError.checkNotNull( + object, r'ChargesOrderResponse', 'object')); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'data'; + _data?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'ChargesOrderResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/charges_order_response_all_of_data.dart b/lib/src/model/charges_order_response_all_of_data.dart new file mode 100644 index 0000000..2af798e --- /dev/null +++ b/lib/src/model/charges_order_response_all_of_data.dart @@ -0,0 +1,367 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/charge_response_payment_method.dart'; +import 'package:conekta/src/model/charge_response.dart'; +import 'package:conekta/src/model/charge_response_refunds.dart'; +import 'package:conekta/src/model/charge_response_channel.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'charges_order_response_all_of_data.g.dart'; + +/// ChargesOrderResponseAllOfData +/// +/// Properties: +/// * [amount] +/// * [channel] +/// * [createdAt] +/// * [currency] +/// * [customerId] +/// * [description] +/// * [deviceFingerprint] +/// * [failureCode] +/// * [failureMessage] +/// * [id] - Charge ID +/// * [livemode] - Whether the charge was made in live mode or not +/// * [object] +/// * [orderId] - Order ID +/// * [paidAt] - Payment date +/// * [paymentMethod] +/// * [referenceId] - Reference ID of the charge +/// * [refunds] +/// * [status] +@BuiltValue() +abstract class ChargesOrderResponseAllOfData implements ChargeResponse, Built { + ChargesOrderResponseAllOfData._(); + + factory ChargesOrderResponseAllOfData([void updates(ChargesOrderResponseAllOfDataBuilder b)]) = _$ChargesOrderResponseAllOfData; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(ChargesOrderResponseAllOfDataBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$ChargesOrderResponseAllOfDataSerializer(); +} + +class _$ChargesOrderResponseAllOfDataSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [ChargesOrderResponseAllOfData, _$ChargesOrderResponseAllOfData]; + + @override + final String wireName = r'ChargesOrderResponseAllOfData'; + + Iterable _serializeProperties( + Serializers serializers, + ChargesOrderResponseAllOfData object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.amount != null) { + yield r'amount'; + yield serializers.serialize( + object.amount, + specifiedType: const FullType(int), + ); + } + if (object.failureCode != null) { + yield r'failure_code'; + yield serializers.serialize( + object.failureCode, + specifiedType: const FullType(String), + ); + } + if (object.deviceFingerprint != null) { + yield r'device_fingerprint'; + yield serializers.serialize( + object.deviceFingerprint, + specifiedType: const FullType(String), + ); + } + if (object.livemode != null) { + yield r'livemode'; + yield serializers.serialize( + object.livemode, + specifiedType: const FullType(bool), + ); + } + if (object.orderId != null) { + yield r'order_id'; + yield serializers.serialize( + object.orderId, + specifiedType: const FullType(String), + ); + } + if (object.channel != null) { + yield r'channel'; + yield serializers.serialize( + object.channel, + specifiedType: const FullType(ChargeResponseChannel), + ); + } + if (object.description != null) { + yield r'description'; + yield serializers.serialize( + object.description, + specifiedType: const FullType(String), + ); + } + if (object.referenceId != null) { + yield r'reference_id'; + yield serializers.serialize( + object.referenceId, + specifiedType: const FullType.nullable(String), + ); + } + if (object.refunds != null) { + yield r'refunds'; + yield serializers.serialize( + object.refunds, + specifiedType: const FullType.nullable(ChargeResponseRefunds), + ); + } + if (object.createdAt != null) { + yield r'created_at'; + yield serializers.serialize( + object.createdAt, + specifiedType: const FullType(int), + ); + } + if (object.customerId != null) { + yield r'customer_id'; + yield serializers.serialize( + object.customerId, + specifiedType: const FullType(String), + ); + } + if (object.paidAt != null) { + yield r'paid_at'; + yield serializers.serialize( + object.paidAt, + specifiedType: const FullType.nullable(int), + ); + } + if (object.paymentMethod != null) { + yield r'payment_method'; + yield serializers.serialize( + object.paymentMethod, + specifiedType: const FullType(ChargeResponsePaymentMethod), + ); + } + if (object.currency != null) { + yield r'currency'; + yield serializers.serialize( + object.currency, + specifiedType: const FullType(String), + ); + } + if (object.id != null) { + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + } + if (object.failureMessage != null) { + yield r'failure_message'; + yield serializers.serialize( + object.failureMessage, + specifiedType: const FullType(String), + ); + } + if (object.object != null) { + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + ChargesOrderResponseAllOfData object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required ChargesOrderResponseAllOfDataBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'amount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.amount = valueDes; + break; + case r'failure_code': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.failureCode = valueDes; + break; + case r'device_fingerprint': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.deviceFingerprint = valueDes; + break; + case r'livemode': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.livemode = valueDes; + break; + case r'order_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.orderId = valueDes; + break; + case r'channel': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(ChargeResponseChannel), + ) as ChargeResponseChannel; + result.channel.replace(valueDes); + break; + case r'description': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.description = valueDes; + break; + case r'reference_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.referenceId = valueDes; + break; + case r'refunds': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(ChargeResponseRefunds), + ) as ChargeResponseRefunds?; + if (valueDes == null) continue; + result.refunds.replace(valueDes); + break; + case r'created_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.createdAt = valueDes; + break; + case r'customer_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.customerId = valueDes; + break; + case r'paid_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(int), + ) as int?; + if (valueDes == null) continue; + result.paidAt = valueDes; + break; + case r'payment_method': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(ChargeResponsePaymentMethod), + ) as ChargeResponsePaymentMethod; + result.paymentMethod.replace(valueDes); + break; + case r'currency': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.currency = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'failure_message': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.failureMessage = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + ChargesOrderResponseAllOfData deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = ChargesOrderResponseAllOfDataBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/charges_order_response_all_of_data.g.dart b/lib/src/model/charges_order_response_all_of_data.g.dart new file mode 100644 index 0000000..078ca01 --- /dev/null +++ b/lib/src/model/charges_order_response_all_of_data.g.dart @@ -0,0 +1,336 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'charges_order_response_all_of_data.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$ChargesOrderResponseAllOfData extends ChargesOrderResponseAllOfData { + @override + final int? amount; + @override + final ChargeResponseChannel? channel; + @override + final int? createdAt; + @override + final String? currency; + @override + final String? customerId; + @override + final String? description; + @override + final String? deviceFingerprint; + @override + final String? failureCode; + @override + final String? failureMessage; + @override + final String? id; + @override + final bool? livemode; + @override + final String? object; + @override + final String? orderId; + @override + final int? paidAt; + @override + final ChargeResponsePaymentMethod? paymentMethod; + @override + final String? referenceId; + @override + final ChargeResponseRefunds? refunds; + @override + final String? status; + + factory _$ChargesOrderResponseAllOfData( + [void Function(ChargesOrderResponseAllOfDataBuilder)? updates]) => + (new ChargesOrderResponseAllOfDataBuilder()..update(updates))._build(); + + _$ChargesOrderResponseAllOfData._( + {this.amount, + this.channel, + this.createdAt, + this.currency, + this.customerId, + this.description, + this.deviceFingerprint, + this.failureCode, + this.failureMessage, + this.id, + this.livemode, + this.object, + this.orderId, + this.paidAt, + this.paymentMethod, + this.referenceId, + this.refunds, + this.status}) + : super._(); + + @override + ChargesOrderResponseAllOfData rebuild( + void Function(ChargesOrderResponseAllOfDataBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + ChargesOrderResponseAllOfDataBuilder toBuilder() => + new ChargesOrderResponseAllOfDataBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is ChargesOrderResponseAllOfData && + amount == other.amount && + channel == other.channel && + createdAt == other.createdAt && + currency == other.currency && + customerId == other.customerId && + description == other.description && + deviceFingerprint == other.deviceFingerprint && + failureCode == other.failureCode && + failureMessage == other.failureMessage && + id == other.id && + livemode == other.livemode && + object == other.object && + orderId == other.orderId && + paidAt == other.paidAt && + paymentMethod == other.paymentMethod && + referenceId == other.referenceId && + refunds == other.refunds && + status == other.status; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, amount.hashCode); + _$hash = $jc(_$hash, channel.hashCode); + _$hash = $jc(_$hash, createdAt.hashCode); + _$hash = $jc(_$hash, currency.hashCode); + _$hash = $jc(_$hash, customerId.hashCode); + _$hash = $jc(_$hash, description.hashCode); + _$hash = $jc(_$hash, deviceFingerprint.hashCode); + _$hash = $jc(_$hash, failureCode.hashCode); + _$hash = $jc(_$hash, failureMessage.hashCode); + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, livemode.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jc(_$hash, orderId.hashCode); + _$hash = $jc(_$hash, paidAt.hashCode); + _$hash = $jc(_$hash, paymentMethod.hashCode); + _$hash = $jc(_$hash, referenceId.hashCode); + _$hash = $jc(_$hash, refunds.hashCode); + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'ChargesOrderResponseAllOfData') + ..add('amount', amount) + ..add('channel', channel) + ..add('createdAt', createdAt) + ..add('currency', currency) + ..add('customerId', customerId) + ..add('description', description) + ..add('deviceFingerprint', deviceFingerprint) + ..add('failureCode', failureCode) + ..add('failureMessage', failureMessage) + ..add('id', id) + ..add('livemode', livemode) + ..add('object', object) + ..add('orderId', orderId) + ..add('paidAt', paidAt) + ..add('paymentMethod', paymentMethod) + ..add('referenceId', referenceId) + ..add('refunds', refunds) + ..add('status', status)) + .toString(); + } +} + +class ChargesOrderResponseAllOfDataBuilder + implements + Builder, + ChargeResponseBuilder { + _$ChargesOrderResponseAllOfData? _$v; + + int? _amount; + int? get amount => _$this._amount; + set amount(covariant int? amount) => _$this._amount = amount; + + ChargeResponseChannelBuilder? _channel; + ChargeResponseChannelBuilder get channel => + _$this._channel ??= new ChargeResponseChannelBuilder(); + set channel(covariant ChargeResponseChannelBuilder? channel) => + _$this._channel = channel; + + int? _createdAt; + int? get createdAt => _$this._createdAt; + set createdAt(covariant int? createdAt) => _$this._createdAt = createdAt; + + String? _currency; + String? get currency => _$this._currency; + set currency(covariant String? currency) => _$this._currency = currency; + + String? _customerId; + String? get customerId => _$this._customerId; + set customerId(covariant String? customerId) => + _$this._customerId = customerId; + + String? _description; + String? get description => _$this._description; + set description(covariant String? description) => + _$this._description = description; + + String? _deviceFingerprint; + String? get deviceFingerprint => _$this._deviceFingerprint; + set deviceFingerprint(covariant String? deviceFingerprint) => + _$this._deviceFingerprint = deviceFingerprint; + + String? _failureCode; + String? get failureCode => _$this._failureCode; + set failureCode(covariant String? failureCode) => + _$this._failureCode = failureCode; + + String? _failureMessage; + String? get failureMessage => _$this._failureMessage; + set failureMessage(covariant String? failureMessage) => + _$this._failureMessage = failureMessage; + + String? _id; + String? get id => _$this._id; + set id(covariant String? id) => _$this._id = id; + + bool? _livemode; + bool? get livemode => _$this._livemode; + set livemode(covariant bool? livemode) => _$this._livemode = livemode; + + String? _object; + String? get object => _$this._object; + set object(covariant String? object) => _$this._object = object; + + String? _orderId; + String? get orderId => _$this._orderId; + set orderId(covariant String? orderId) => _$this._orderId = orderId; + + int? _paidAt; + int? get paidAt => _$this._paidAt; + set paidAt(covariant int? paidAt) => _$this._paidAt = paidAt; + + ChargeResponsePaymentMethodBuilder? _paymentMethod; + ChargeResponsePaymentMethodBuilder get paymentMethod => + _$this._paymentMethod ??= new ChargeResponsePaymentMethodBuilder(); + set paymentMethod( + covariant ChargeResponsePaymentMethodBuilder? paymentMethod) => + _$this._paymentMethod = paymentMethod; + + String? _referenceId; + String? get referenceId => _$this._referenceId; + set referenceId(covariant String? referenceId) => + _$this._referenceId = referenceId; + + ChargeResponseRefundsBuilder? _refunds; + ChargeResponseRefundsBuilder get refunds => + _$this._refunds ??= new ChargeResponseRefundsBuilder(); + set refunds(covariant ChargeResponseRefundsBuilder? refunds) => + _$this._refunds = refunds; + + String? _status; + String? get status => _$this._status; + set status(covariant String? status) => _$this._status = status; + + ChargesOrderResponseAllOfDataBuilder() { + ChargesOrderResponseAllOfData._defaults(this); + } + + ChargesOrderResponseAllOfDataBuilder get _$this { + final $v = _$v; + if ($v != null) { + _amount = $v.amount; + _channel = $v.channel?.toBuilder(); + _createdAt = $v.createdAt; + _currency = $v.currency; + _customerId = $v.customerId; + _description = $v.description; + _deviceFingerprint = $v.deviceFingerprint; + _failureCode = $v.failureCode; + _failureMessage = $v.failureMessage; + _id = $v.id; + _livemode = $v.livemode; + _object = $v.object; + _orderId = $v.orderId; + _paidAt = $v.paidAt; + _paymentMethod = $v.paymentMethod?.toBuilder(); + _referenceId = $v.referenceId; + _refunds = $v.refunds?.toBuilder(); + _status = $v.status; + _$v = null; + } + return this; + } + + @override + void replace(covariant ChargesOrderResponseAllOfData other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$ChargesOrderResponseAllOfData; + } + + @override + void update(void Function(ChargesOrderResponseAllOfDataBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + ChargesOrderResponseAllOfData build() => _build(); + + _$ChargesOrderResponseAllOfData _build() { + _$ChargesOrderResponseAllOfData _$result; + try { + _$result = _$v ?? + new _$ChargesOrderResponseAllOfData._( + amount: amount, + channel: _channel?.build(), + createdAt: createdAt, + currency: currency, + customerId: customerId, + description: description, + deviceFingerprint: deviceFingerprint, + failureCode: failureCode, + failureMessage: failureMessage, + id: id, + livemode: livemode, + object: object, + orderId: orderId, + paidAt: paidAt, + paymentMethod: _paymentMethod?.build(), + referenceId: referenceId, + refunds: _refunds?.build(), + status: status); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'channel'; + _channel?.build(); + + _$failedField = 'paymentMethod'; + _paymentMethod?.build(); + + _$failedField = 'refunds'; + _refunds?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'ChargesOrderResponseAllOfData', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/checkout.dart b/lib/src/model/checkout.dart index f5a9f0e..7f3772e 100644 --- a/lib/src/model/checkout.dart +++ b/lib/src/model/checkout.dart @@ -17,6 +17,7 @@ part 'checkout.g.dart'; /// * [expiresAt] - It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) /// * [monthlyInstallmentsEnabled] - This flag allows you to specify if months without interest will be active. /// * [monthlyInstallmentsOptions] - This field allows you to specify the number of months without interest. +/// * [threeDsMode] - Indicates the 3DS2 mode for the order, either smart or strict. /// * [name] - Reason for charge /// * [needsShippingContact] - This flag allows you to fill in the shipping information at checkout. /// * [onDemandEnabled] - This flag allows you to specify if the link will be on demand. @@ -42,6 +43,10 @@ abstract class Checkout implements Built { @BuiltValueField(wireName: r'monthly_installments_options') BuiltList? get monthlyInstallmentsOptions; + /// Indicates the 3DS2 mode for the order, either smart or strict. + @BuiltValueField(wireName: r'three_ds_mode') + String? get threeDsMode; + /// Reason for charge @BuiltValueField(wireName: r'name') String get name; @@ -116,6 +121,13 @@ class _$CheckoutSerializer implements PrimitiveSerializer { specifiedType: const FullType(BuiltList, [FullType(int)]), ); } + if (object.threeDsMode != null) { + yield r'three_ds_mode'; + yield serializers.serialize( + object.threeDsMode, + specifiedType: const FullType(String), + ); + } yield r'name'; yield serializers.serialize( object.name, @@ -208,6 +220,13 @@ class _$CheckoutSerializer implements PrimitiveSerializer { ) as BuiltList; result.monthlyInstallmentsOptions.replace(valueDes); break; + case r'three_ds_mode': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.threeDsMode = valueDes; + break; case r'name': final valueDes = serializers.deserialize( value, diff --git a/lib/src/model/checkout.g.dart b/lib/src/model/checkout.g.dart index cd01ca1..4442cef 100644 --- a/lib/src/model/checkout.g.dart +++ b/lib/src/model/checkout.g.dart @@ -16,6 +16,8 @@ class _$Checkout extends Checkout { @override final BuiltList? monthlyInstallmentsOptions; @override + final String? threeDsMode; + @override final String name; @override final bool? needsShippingContact; @@ -38,6 +40,7 @@ class _$Checkout extends Checkout { required this.expiresAt, this.monthlyInstallmentsEnabled, this.monthlyInstallmentsOptions, + this.threeDsMode, required this.name, this.needsShippingContact, this.onDemandEnabled, @@ -71,6 +74,7 @@ class _$Checkout extends Checkout { expiresAt == other.expiresAt && monthlyInstallmentsEnabled == other.monthlyInstallmentsEnabled && monthlyInstallmentsOptions == other.monthlyInstallmentsOptions && + threeDsMode == other.threeDsMode && name == other.name && needsShippingContact == other.needsShippingContact && onDemandEnabled == other.onDemandEnabled && @@ -87,6 +91,7 @@ class _$Checkout extends Checkout { _$hash = $jc(_$hash, expiresAt.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsEnabled.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsOptions.hashCode); + _$hash = $jc(_$hash, threeDsMode.hashCode); _$hash = $jc(_$hash, name.hashCode); _$hash = $jc(_$hash, needsShippingContact.hashCode); _$hash = $jc(_$hash, onDemandEnabled.hashCode); @@ -105,6 +110,7 @@ class _$Checkout extends Checkout { ..add('expiresAt', expiresAt) ..add('monthlyInstallmentsEnabled', monthlyInstallmentsEnabled) ..add('monthlyInstallmentsOptions', monthlyInstallmentsOptions) + ..add('threeDsMode', threeDsMode) ..add('name', name) ..add('needsShippingContact', needsShippingContact) ..add('onDemandEnabled', onDemandEnabled) @@ -141,6 +147,10 @@ class CheckoutBuilder implements Builder { ListBuilder? monthlyInstallmentsOptions) => _$this._monthlyInstallmentsOptions = monthlyInstallmentsOptions; + String? _threeDsMode; + String? get threeDsMode => _$this._threeDsMode; + set threeDsMode(String? threeDsMode) => _$this._threeDsMode = threeDsMode; + String? _name; String? get name => _$this._name; set name(String? name) => _$this._name = name; @@ -185,6 +195,7 @@ class CheckoutBuilder implements Builder { _expiresAt = $v.expiresAt; _monthlyInstallmentsEnabled = $v.monthlyInstallmentsEnabled; _monthlyInstallmentsOptions = $v.monthlyInstallmentsOptions?.toBuilder(); + _threeDsMode = $v.threeDsMode; _name = $v.name; _needsShippingContact = $v.needsShippingContact; _onDemandEnabled = $v.onDemandEnabled; @@ -221,6 +232,7 @@ class CheckoutBuilder implements Builder { expiresAt, r'Checkout', 'expiresAt'), monthlyInstallmentsEnabled: monthlyInstallmentsEnabled, monthlyInstallmentsOptions: _monthlyInstallmentsOptions?.build(), + threeDsMode: threeDsMode, name: BuiltValueNullFieldError.checkNotNull( name, r'Checkout', 'name'), needsShippingContact: needsShippingContact, diff --git a/lib/src/model/checkout_request.dart b/lib/src/model/checkout_request.dart index 3214b9a..fc6026d 100644 --- a/lib/src/model/checkout_request.dart +++ b/lib/src/model/checkout_request.dart @@ -17,6 +17,7 @@ part 'checkout_request.g.dart'; /// * [failureUrl] - Redirection url back to the site in case of failed payment, applies only to HostedPayment. /// * [monthlyInstallmentsEnabled] /// * [monthlyInstallmentsOptions] +/// * [maxFailedRetries] - Number of retries allowed before the checkout is marked as failed /// * [name] - Reason for payment /// * [onDemandEnabled] /// * [redirectionTime] - number of seconds to wait before redirecting to the success_url @@ -42,6 +43,10 @@ abstract class CheckoutRequest implements Built? get monthlyInstallmentsOptions; + /// Number of retries allowed before the checkout is marked as failed + @BuiltValueField(wireName: r'max_failed_retries') + int? get maxFailedRetries; + /// Reason for payment @BuiltValueField(wireName: r'name') String? get name; @@ -117,6 +122,13 @@ class _$CheckoutRequestSerializer implements PrimitiveSerializer; result.monthlyInstallmentsOptions.replace(valueDes); break; + case r'max_failed_retries': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.maxFailedRetries = valueDes; + break; case r'name': final valueDes = serializers.deserialize( value, diff --git a/lib/src/model/checkout_request.g.dart b/lib/src/model/checkout_request.g.dart index a496e29..c83c738 100644 --- a/lib/src/model/checkout_request.g.dart +++ b/lib/src/model/checkout_request.g.dart @@ -18,6 +18,8 @@ class _$CheckoutRequest extends CheckoutRequest { @override final BuiltList? monthlyInstallmentsOptions; @override + final int? maxFailedRetries; + @override final String? name; @override final bool? onDemandEnabled; @@ -37,6 +39,7 @@ class _$CheckoutRequest extends CheckoutRequest { this.failureUrl, this.monthlyInstallmentsEnabled, this.monthlyInstallmentsOptions, + this.maxFailedRetries, this.name, this.onDemandEnabled, this.redirectionTime, @@ -64,6 +67,7 @@ class _$CheckoutRequest extends CheckoutRequest { failureUrl == other.failureUrl && monthlyInstallmentsEnabled == other.monthlyInstallmentsEnabled && monthlyInstallmentsOptions == other.monthlyInstallmentsOptions && + maxFailedRetries == other.maxFailedRetries && name == other.name && onDemandEnabled == other.onDemandEnabled && redirectionTime == other.redirectionTime && @@ -79,6 +83,7 @@ class _$CheckoutRequest extends CheckoutRequest { _$hash = $jc(_$hash, failureUrl.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsEnabled.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsOptions.hashCode); + _$hash = $jc(_$hash, maxFailedRetries.hashCode); _$hash = $jc(_$hash, name.hashCode); _$hash = $jc(_$hash, onDemandEnabled.hashCode); _$hash = $jc(_$hash, redirectionTime.hashCode); @@ -96,6 +101,7 @@ class _$CheckoutRequest extends CheckoutRequest { ..add('failureUrl', failureUrl) ..add('monthlyInstallmentsEnabled', monthlyInstallmentsEnabled) ..add('monthlyInstallmentsOptions', monthlyInstallmentsOptions) + ..add('maxFailedRetries', maxFailedRetries) ..add('name', name) ..add('onDemandEnabled', onDemandEnabled) ..add('redirectionTime', redirectionTime) @@ -135,6 +141,11 @@ class CheckoutRequestBuilder ListBuilder? monthlyInstallmentsOptions) => _$this._monthlyInstallmentsOptions = monthlyInstallmentsOptions; + int? _maxFailedRetries; + int? get maxFailedRetries => _$this._maxFailedRetries; + set maxFailedRetries(int? maxFailedRetries) => + _$this._maxFailedRetries = maxFailedRetries; + String? _name; String? get name => _$this._name; set name(String? name) => _$this._name = name; @@ -169,6 +180,7 @@ class CheckoutRequestBuilder _failureUrl = $v.failureUrl; _monthlyInstallmentsEnabled = $v.monthlyInstallmentsEnabled; _monthlyInstallmentsOptions = $v.monthlyInstallmentsOptions?.toBuilder(); + _maxFailedRetries = $v.maxFailedRetries; _name = $v.name; _onDemandEnabled = $v.onDemandEnabled; _redirectionTime = $v.redirectionTime; @@ -203,6 +215,7 @@ class CheckoutRequestBuilder failureUrl: failureUrl, monthlyInstallmentsEnabled: monthlyInstallmentsEnabled, monthlyInstallmentsOptions: _monthlyInstallmentsOptions?.build(), + maxFailedRetries: maxFailedRetries, name: name, onDemandEnabled: onDemandEnabled, redirectionTime: redirectionTime, diff --git a/lib/src/model/create_customer_payment_methods_request.dart b/lib/src/model/create_customer_payment_methods_request.dart index 2ecca9c..baa6429 100644 --- a/lib/src/model/create_customer_payment_methods_request.dart +++ b/lib/src/model/create_customer_payment_methods_request.dart @@ -3,7 +3,7 @@ // // ignore_for_file: unused_element -import 'package:conekta/src/model/payment_method_card_request.dart'; +import 'package:conekta/src/model/payment_method_token_request.dart'; import 'package:conekta/src/model/payment_method_cash_request.dart'; import 'package:conekta/src/model/payment_method_spei_request.dart'; import 'package:built_value/built_value.dart'; @@ -20,7 +20,7 @@ part 'create_customer_payment_methods_request.g.dart'; /// * [expiresAt] @BuiltValue() abstract class CreateCustomerPaymentMethodsRequest implements Built { - /// One Of [PaymentMethodCardRequest], [PaymentMethodCashRequest], [PaymentMethodSpeiRequest] + /// One Of [PaymentMethodCashRequest], [PaymentMethodSpeiRequest], [PaymentMethodTokenRequest] OneOf get oneOf; CreateCustomerPaymentMethodsRequest._(); @@ -66,7 +66,7 @@ class _$CreateCustomerPaymentMethodsRequestSerializer implements PrimitiveSerial }) { final result = CreateCustomerPaymentMethodsRequestBuilder(); Object? oneOfDataSrc; - final targetType = const FullType(OneOf, [FullType(PaymentMethodCardRequest), FullType(PaymentMethodCashRequest), FullType(PaymentMethodSpeiRequest), ]); + final targetType = const FullType(OneOf, [FullType(PaymentMethodTokenRequest), FullType(PaymentMethodCashRequest), FullType(PaymentMethodSpeiRequest), ]); oneOfDataSrc = serialized; result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf; return result.build(); diff --git a/lib/src/model/customer.dart b/lib/src/model/customer.dart index 56c9845..b99f523 100644 --- a/lib/src/model/customer.dart +++ b/lib/src/model/customer.dart @@ -21,12 +21,14 @@ part 'customer.g.dart'; /// * [antifraudInfo] /// * [corporate] - It is a value that allows identifying if the email is corporate or not. /// * [customReference] - It is an undefined value. +/// * [dateOfBirth] - It is a parameter that allows to identify the date of birth of the client. /// * [email] - An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). /// * [defaultPaymentSourceId] - It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) /// * [defaultShippingContactId] - It is a parameter that allows to identify in the response, the Conekta ID of the shipping address (shipping_contact) /// * [fiscalEntities] /// * [metadata] /// * [name] - Client's name +/// * [nationalId] - It is a parameter that allows to identify the national identification number of the client. /// * [paymentSources] - Contains details of the payment methods that the customer has active or has used in Conekta /// * [phone] - Is the customer's phone number /// * [planId] - Contains the ID of a plan, which could together with name, email and phone create a client directly to a subscription @@ -45,6 +47,10 @@ abstract class Customer implements Built { @BuiltValueField(wireName: r'custom_reference') String? get customReference; + /// It is a parameter that allows to identify the date of birth of the client. + @BuiltValueField(wireName: r'date_of_birth') + String? get dateOfBirth; + /// An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). @BuiltValueField(wireName: r'email') String get email; @@ -67,6 +73,10 @@ abstract class Customer implements Built { @BuiltValueField(wireName: r'name') String get name; + /// It is a parameter that allows to identify the national identification number of the client. + @BuiltValueField(wireName: r'national_id') + String? get nationalId; + /// Contains details of the payment methods that the customer has active or has used in Conekta @BuiltValueField(wireName: r'payment_sources') BuiltList? get paymentSources; @@ -131,6 +141,13 @@ class _$CustomerSerializer implements PrimitiveSerializer { specifiedType: const FullType(String), ); } + if (object.dateOfBirth != null) { + yield r'date_of_birth'; + yield serializers.serialize( + object.dateOfBirth, + specifiedType: const FullType(String), + ); + } yield r'email'; yield serializers.serialize( object.email, @@ -169,6 +186,13 @@ class _$CustomerSerializer implements PrimitiveSerializer { object.name, specifiedType: const FullType(String), ); + if (object.nationalId != null) { + yield r'national_id'; + yield serializers.serialize( + object.nationalId, + specifiedType: const FullType(String), + ); + } if (object.paymentSources != null) { yield r'payment_sources'; yield serializers.serialize( @@ -247,6 +271,13 @@ class _$CustomerSerializer implements PrimitiveSerializer { ) as String; result.customReference = valueDes; break; + case r'date_of_birth': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.dateOfBirth = valueDes; + break; case r'email': final valueDes = serializers.deserialize( value, @@ -289,6 +320,13 @@ class _$CustomerSerializer implements PrimitiveSerializer { ) as String; result.name = valueDes; break; + case r'national_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nationalId = valueDes; + break; case r'payment_sources': final valueDes = serializers.deserialize( value, diff --git a/lib/src/model/customer.g.dart b/lib/src/model/customer.g.dart index ce52578..8fe9a36 100644 --- a/lib/src/model/customer.g.dart +++ b/lib/src/model/customer.g.dart @@ -14,6 +14,8 @@ class _$Customer extends Customer { @override final String? customReference; @override + final String? dateOfBirth; + @override final String email; @override final String? defaultPaymentSourceId; @@ -26,6 +28,8 @@ class _$Customer extends Customer { @override final String name; @override + final String? nationalId; + @override final BuiltList? paymentSources; @override final String phone; @@ -43,12 +47,14 @@ class _$Customer extends Customer { {this.antifraudInfo, this.corporate, this.customReference, + this.dateOfBirth, required this.email, this.defaultPaymentSourceId, this.defaultShippingContactId, this.fiscalEntities, this.metadata, required this.name, + this.nationalId, this.paymentSources, required this.phone, this.planId, @@ -74,12 +80,14 @@ class _$Customer extends Customer { antifraudInfo == other.antifraudInfo && corporate == other.corporate && customReference == other.customReference && + dateOfBirth == other.dateOfBirth && email == other.email && defaultPaymentSourceId == other.defaultPaymentSourceId && defaultShippingContactId == other.defaultShippingContactId && fiscalEntities == other.fiscalEntities && metadata == other.metadata && name == other.name && + nationalId == other.nationalId && paymentSources == other.paymentSources && phone == other.phone && planId == other.planId && @@ -93,12 +101,14 @@ class _$Customer extends Customer { _$hash = $jc(_$hash, antifraudInfo.hashCode); _$hash = $jc(_$hash, corporate.hashCode); _$hash = $jc(_$hash, customReference.hashCode); + _$hash = $jc(_$hash, dateOfBirth.hashCode); _$hash = $jc(_$hash, email.hashCode); _$hash = $jc(_$hash, defaultPaymentSourceId.hashCode); _$hash = $jc(_$hash, defaultShippingContactId.hashCode); _$hash = $jc(_$hash, fiscalEntities.hashCode); _$hash = $jc(_$hash, metadata.hashCode); _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, nationalId.hashCode); _$hash = $jc(_$hash, paymentSources.hashCode); _$hash = $jc(_$hash, phone.hashCode); _$hash = $jc(_$hash, planId.hashCode); @@ -114,12 +124,14 @@ class _$Customer extends Customer { ..add('antifraudInfo', antifraudInfo) ..add('corporate', corporate) ..add('customReference', customReference) + ..add('dateOfBirth', dateOfBirth) ..add('email', email) ..add('defaultPaymentSourceId', defaultPaymentSourceId) ..add('defaultShippingContactId', defaultShippingContactId) ..add('fiscalEntities', fiscalEntities) ..add('metadata', metadata) ..add('name', name) + ..add('nationalId', nationalId) ..add('paymentSources', paymentSources) ..add('phone', phone) ..add('planId', planId) @@ -147,6 +159,10 @@ class CustomerBuilder implements Builder { set customReference(String? customReference) => _$this._customReference = customReference; + String? _dateOfBirth; + String? get dateOfBirth => _$this._dateOfBirth; + set dateOfBirth(String? dateOfBirth) => _$this._dateOfBirth = dateOfBirth; + String? _email; String? get email => _$this._email; set email(String? email) => _$this._email = email; @@ -179,6 +195,10 @@ class CustomerBuilder implements Builder { String? get name => _$this._name; set name(String? name) => _$this._name = name; + String? _nationalId; + String? get nationalId => _$this._nationalId; + set nationalId(String? nationalId) => _$this._nationalId = nationalId; + ListBuilder? _paymentSources; ListBuilder get paymentSources => _$this._paymentSources ??= @@ -218,12 +238,14 @@ class CustomerBuilder implements Builder { _antifraudInfo = $v.antifraudInfo?.toBuilder(); _corporate = $v.corporate; _customReference = $v.customReference; + _dateOfBirth = $v.dateOfBirth; _email = $v.email; _defaultPaymentSourceId = $v.defaultPaymentSourceId; _defaultShippingContactId = $v.defaultShippingContactId; _fiscalEntities = $v.fiscalEntities?.toBuilder(); _metadata = $v.metadata?.toBuilder(); _name = $v.name; + _nationalId = $v.nationalId; _paymentSources = $v.paymentSources?.toBuilder(); _phone = $v.phone; _planId = $v.planId; @@ -256,6 +278,7 @@ class CustomerBuilder implements Builder { antifraudInfo: _antifraudInfo?.build(), corporate: corporate, customReference: customReference, + dateOfBirth: dateOfBirth, email: BuiltValueNullFieldError.checkNotNull( email, r'Customer', 'email'), defaultPaymentSourceId: defaultPaymentSourceId, @@ -264,6 +287,7 @@ class CustomerBuilder implements Builder { metadata: _metadata?.build(), name: BuiltValueNullFieldError.checkNotNull( name, r'Customer', 'name'), + nationalId: nationalId, paymentSources: _paymentSources?.build(), phone: BuiltValueNullFieldError.checkNotNull( phone, r'Customer', 'phone'), diff --git a/lib/src/model/customer_payment_methods_request.dart b/lib/src/model/customer_payment_methods_request.dart index 1c33a52..1e0e353 100644 --- a/lib/src/model/customer_payment_methods_request.dart +++ b/lib/src/model/customer_payment_methods_request.dart @@ -3,7 +3,7 @@ // // ignore_for_file: unused_element -import 'package:conekta/src/model/payment_method_card_request.dart'; +import 'package:conekta/src/model/payment_method_token_request.dart'; import 'package:conekta/src/model/payment_method_cash_request.dart'; import 'package:conekta/src/model/payment_method_spei_request.dart'; import 'package:built_value/built_value.dart'; @@ -20,7 +20,7 @@ part 'customer_payment_methods_request.g.dart'; /// * [expiresAt] @BuiltValue() abstract class CustomerPaymentMethodsRequest implements Built { - /// One Of [PaymentMethodCardRequest], [PaymentMethodCashRequest], [PaymentMethodSpeiRequest] + /// One Of [PaymentMethodCashRequest], [PaymentMethodSpeiRequest], [PaymentMethodTokenRequest] OneOf get oneOf; CustomerPaymentMethodsRequest._(); @@ -66,7 +66,7 @@ class _$CustomerPaymentMethodsRequestSerializer implements PrimitiveSerializer? get metadata; @@ -148,6 +158,13 @@ class _$CustomerResponseSerializer implements PrimitiveSerializer? metadata; @override final String object; @@ -53,6 +57,7 @@ class _$CustomerResponse extends CustomerResponse { this.corporate, required this.createdAt, this.customReference, + this.dateOfBirth, this.defaultFiscalEntityId, this.defaultShippingContactId, this.defaultPaymentSourceId, @@ -61,6 +66,7 @@ class _$CustomerResponse extends CustomerResponse { required this.id, required this.livemode, required this.name, + this.nationalId, this.metadata, required this.object, this.paymentSources, @@ -94,6 +100,7 @@ class _$CustomerResponse extends CustomerResponse { corporate == other.corporate && createdAt == other.createdAt && customReference == other.customReference && + dateOfBirth == other.dateOfBirth && defaultFiscalEntityId == other.defaultFiscalEntityId && defaultShippingContactId == other.defaultShippingContactId && defaultPaymentSourceId == other.defaultPaymentSourceId && @@ -102,6 +109,7 @@ class _$CustomerResponse extends CustomerResponse { id == other.id && livemode == other.livemode && name == other.name && + nationalId == other.nationalId && metadata == other.metadata && object == other.object && paymentSources == other.paymentSources && @@ -117,6 +125,7 @@ class _$CustomerResponse extends CustomerResponse { _$hash = $jc(_$hash, corporate.hashCode); _$hash = $jc(_$hash, createdAt.hashCode); _$hash = $jc(_$hash, customReference.hashCode); + _$hash = $jc(_$hash, dateOfBirth.hashCode); _$hash = $jc(_$hash, defaultFiscalEntityId.hashCode); _$hash = $jc(_$hash, defaultShippingContactId.hashCode); _$hash = $jc(_$hash, defaultPaymentSourceId.hashCode); @@ -125,6 +134,7 @@ class _$CustomerResponse extends CustomerResponse { _$hash = $jc(_$hash, id.hashCode); _$hash = $jc(_$hash, livemode.hashCode); _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, nationalId.hashCode); _$hash = $jc(_$hash, metadata.hashCode); _$hash = $jc(_$hash, object.hashCode); _$hash = $jc(_$hash, paymentSources.hashCode); @@ -142,6 +152,7 @@ class _$CustomerResponse extends CustomerResponse { ..add('corporate', corporate) ..add('createdAt', createdAt) ..add('customReference', customReference) + ..add('dateOfBirth', dateOfBirth) ..add('defaultFiscalEntityId', defaultFiscalEntityId) ..add('defaultShippingContactId', defaultShippingContactId) ..add('defaultPaymentSourceId', defaultPaymentSourceId) @@ -150,6 +161,7 @@ class _$CustomerResponse extends CustomerResponse { ..add('id', id) ..add('livemode', livemode) ..add('name', name) + ..add('nationalId', nationalId) ..add('metadata', metadata) ..add('object', object) ..add('paymentSources', paymentSources) @@ -183,6 +195,10 @@ class CustomerResponseBuilder set customReference(String? customReference) => _$this._customReference = customReference; + String? _dateOfBirth; + String? get dateOfBirth => _$this._dateOfBirth; + set dateOfBirth(String? dateOfBirth) => _$this._dateOfBirth = dateOfBirth; + String? _defaultFiscalEntityId; String? get defaultFiscalEntityId => _$this._defaultFiscalEntityId; set defaultFiscalEntityId(String? defaultFiscalEntityId) => @@ -220,6 +236,10 @@ class CustomerResponseBuilder String? get name => _$this._name; set name(String? name) => _$this._name = name; + String? _nationalId; + String? get nationalId => _$this._nationalId; + set nationalId(String? nationalId) => _$this._nationalId = nationalId; + MapBuilder? _metadata; MapBuilder get metadata => _$this._metadata ??= new MapBuilder(); @@ -265,6 +285,7 @@ class CustomerResponseBuilder _corporate = $v.corporate; _createdAt = $v.createdAt; _customReference = $v.customReference; + _dateOfBirth = $v.dateOfBirth; _defaultFiscalEntityId = $v.defaultFiscalEntityId; _defaultShippingContactId = $v.defaultShippingContactId; _defaultPaymentSourceId = $v.defaultPaymentSourceId; @@ -273,6 +294,7 @@ class CustomerResponseBuilder _id = $v.id; _livemode = $v.livemode; _name = $v.name; + _nationalId = $v.nationalId; _metadata = $v.metadata?.toBuilder(); _object = $v.object; _paymentSources = $v.paymentSources?.toBuilder(); @@ -308,6 +330,7 @@ class CustomerResponseBuilder createdAt: BuiltValueNullFieldError.checkNotNull( createdAt, r'CustomerResponse', 'createdAt'), customReference: customReference, + dateOfBirth: dateOfBirth, defaultFiscalEntityId: defaultFiscalEntityId, defaultShippingContactId: defaultShippingContactId, defaultPaymentSourceId: defaultPaymentSourceId, @@ -319,6 +342,7 @@ class CustomerResponseBuilder livemode, r'CustomerResponse', 'livemode'), name: BuiltValueNullFieldError.checkNotNull( name, r'CustomerResponse', 'name'), + nationalId: nationalId, metadata: _metadata?.build(), object: BuiltValueNullFieldError.checkNotNull( object, r'CustomerResponse', 'object'), diff --git a/lib/src/model/order_refund_request.dart b/lib/src/model/order_refund_request.dart index b527c83..05a3658 100644 --- a/lib/src/model/order_refund_request.dart +++ b/lib/src/model/order_refund_request.dart @@ -11,17 +11,19 @@ part 'order_refund_request.g.dart'; /// OrderRefundRequest /// /// Properties: -/// * [amount] +/// * [amount] - Amount to be refunded in cents /// * [expiresAt] -/// * [reason] +/// * [reason] - Reason for the refund @BuiltValue() abstract class OrderRefundRequest implements Built { + /// Amount to be refunded in cents @BuiltValueField(wireName: r'amount') int get amount; @BuiltValueField(wireName: r'expires_at') int? get expiresAt; + /// Reason for the refund @BuiltValueField(wireName: r'reason') String get reason; diff --git a/lib/src/model/order_request.dart b/lib/src/model/order_request.dart index bf6463d..02b110d 100644 --- a/lib/src/model/order_request.dart +++ b/lib/src/model/order_request.dart @@ -33,7 +33,7 @@ part 'order_request.g.dart'; /// * [needsShippingContact] - Allows you to fill out the shipping information at checkout /// * [preAuthorize] - Indicates whether the order charges must be preauthorized /// * [processingMode] - Indicates the processing mode for the order, either ecommerce, recurrent or validation. -/// * [returnUrl] - Indicates the redirection callback upon completion of the 3DS2 flow. +/// * [returnUrl] - Indicates the redirection callback upon completion of the 3DS2 flow. Do not use this parameter if your order has a checkout parameter /// * [shippingContact] /// * [shippingLines] - List of [shipping costs](https://developers.conekta.com/v2.1.0/reference/orderscreateshipping). If the online store offers digital products. /// * [taxLines] - List of [taxes](https://developers.conekta.com/v2.1.0/reference/orderscreatetaxes) that are applied to the order. @@ -81,7 +81,7 @@ abstract class OrderRequest implements Built @BuiltValueField(wireName: r'processing_mode') String? get processingMode; - /// Indicates the redirection callback upon completion of the 3DS2 flow. + /// Indicates the redirection callback upon completion of the 3DS2 flow. Do not use this parameter if your order has a checkout parameter @BuiltValueField(wireName: r'return_url') String? get returnUrl; diff --git a/lib/src/model/order_response_charges.dart b/lib/src/model/order_response_charges.dart index cbea5c4..e74faa9 100644 --- a/lib/src/model/order_response_charges.dart +++ b/lib/src/model/order_response_charges.dart @@ -5,7 +5,7 @@ // ignore_for_file: unused_element import 'package:conekta/src/model/pagination.dart'; import 'package:built_collection/built_collection.dart'; -import 'package:conekta/src/model/charges_data_response.dart'; +import 'package:conekta/src/model/charge_response.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -20,7 +20,7 @@ part 'order_response_charges.g.dart'; @BuiltValue() abstract class OrderResponseCharges implements Pagination, Built { @BuiltValueField(wireName: r'data') - BuiltList? get data; + BuiltList? get data; OrderResponseCharges._(); @@ -49,7 +49,7 @@ class _$OrderResponseChargesSerializer implements PrimitiveSerializer; + specifiedType: const FullType(BuiltList, [FullType(ChargeResponse)]), + ) as BuiltList; result.data.replace(valueDes); break; case r'has_more': diff --git a/lib/src/model/order_response_charges.g.dart b/lib/src/model/order_response_charges.g.dart index 99b93d0..24b96a8 100644 --- a/lib/src/model/order_response_charges.g.dart +++ b/lib/src/model/order_response_charges.g.dart @@ -8,7 +8,7 @@ part of 'order_response_charges.dart'; class _$OrderResponseCharges extends OrderResponseCharges { @override - final BuiltList? data; + final BuiltList? data; @override final bool hasMore; @override @@ -71,11 +71,10 @@ class OrderResponseChargesBuilder PaginationBuilder { _$OrderResponseCharges? _$v; - ListBuilder? _data; - ListBuilder get data => - _$this._data ??= new ListBuilder(); - set data(covariant ListBuilder? data) => - _$this._data = data; + ListBuilder? _data; + ListBuilder get data => + _$this._data ??= new ListBuilder(); + set data(covariant ListBuilder? data) => _$this._data = data; bool? _hasMore; bool? get hasMore => _$this._hasMore; diff --git a/lib/src/model/order_response_checkout.dart b/lib/src/model/order_response_checkout.dart index 0d2a842..7d1e934 100644 --- a/lib/src/model/order_response_checkout.dart +++ b/lib/src/model/order_response_checkout.dart @@ -23,6 +23,7 @@ part 'order_response_checkout.g.dart'; /// * [id] /// * [isRedirectOnFailure] /// * [livemode] +/// * [maxFailedRetries] - Number of retries allowed before the checkout is marked as failed /// * [metadata] /// * [monthlyInstallmentsEnabled] /// * [monthlyInstallmentsOptions] @@ -72,6 +73,10 @@ abstract class OrderResponseCheckout implements Built? get metadata; @@ -217,6 +222,13 @@ class _$OrderResponseCheckoutSerializer implements PrimitiveSerializer? metadata; @override final bool? monthlyInstallmentsEnabled; @@ -77,6 +79,7 @@ class _$OrderResponseCheckout extends OrderResponseCheckout { this.id, this.isRedirectOnFailure, this.livemode, + this.maxFailedRetries, this.metadata, this.monthlyInstallmentsEnabled, this.monthlyInstallmentsOptions, @@ -119,6 +122,7 @@ class _$OrderResponseCheckout extends OrderResponseCheckout { id == other.id && isRedirectOnFailure == other.isRedirectOnFailure && livemode == other.livemode && + maxFailedRetries == other.maxFailedRetries && metadata == other.metadata && monthlyInstallmentsEnabled == other.monthlyInstallmentsEnabled && monthlyInstallmentsOptions == other.monthlyInstallmentsOptions && @@ -151,6 +155,7 @@ class _$OrderResponseCheckout extends OrderResponseCheckout { _$hash = $jc(_$hash, id.hashCode); _$hash = $jc(_$hash, isRedirectOnFailure.hashCode); _$hash = $jc(_$hash, livemode.hashCode); + _$hash = $jc(_$hash, maxFailedRetries.hashCode); _$hash = $jc(_$hash, metadata.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsEnabled.hashCode); _$hash = $jc(_$hash, monthlyInstallmentsOptions.hashCode); @@ -185,6 +190,7 @@ class _$OrderResponseCheckout extends OrderResponseCheckout { ..add('id', id) ..add('isRedirectOnFailure', isRedirectOnFailure) ..add('livemode', livemode) + ..add('maxFailedRetries', maxFailedRetries) ..add('metadata', metadata) ..add('monthlyInstallmentsEnabled', monthlyInstallmentsEnabled) ..add('monthlyInstallmentsOptions', monthlyInstallmentsOptions) @@ -255,6 +261,11 @@ class OrderResponseCheckoutBuilder bool? get livemode => _$this._livemode; set livemode(bool? livemode) => _$this._livemode = livemode; + int? _maxFailedRetries; + int? get maxFailedRetries => _$this._maxFailedRetries; + set maxFailedRetries(int? maxFailedRetries) => + _$this._maxFailedRetries = maxFailedRetries; + MapBuilder? _metadata; MapBuilder get metadata => _$this._metadata ??= new MapBuilder(); @@ -350,6 +361,7 @@ class OrderResponseCheckoutBuilder _id = $v.id; _isRedirectOnFailure = $v.isRedirectOnFailure; _livemode = $v.livemode; + _maxFailedRetries = $v.maxFailedRetries; _metadata = $v.metadata?.toBuilder(); _monthlyInstallmentsEnabled = $v.monthlyInstallmentsEnabled; _monthlyInstallmentsOptions = $v.monthlyInstallmentsOptions?.toBuilder(); @@ -401,6 +413,7 @@ class OrderResponseCheckoutBuilder id: id, isRedirectOnFailure: isRedirectOnFailure, livemode: livemode, + maxFailedRetries: maxFailedRetries, metadata: _metadata?.build(), monthlyInstallmentsEnabled: monthlyInstallmentsEnabled, monthlyInstallmentsOptions: _monthlyInstallmentsOptions?.build(), diff --git a/lib/src/model/order_response_discount_lines.dart b/lib/src/model/order_response_discount_lines.dart index 338be5b..176eb04 100644 --- a/lib/src/model/order_response_discount_lines.dart +++ b/lib/src/model/order_response_discount_lines.dart @@ -5,7 +5,7 @@ // ignore_for_file: unused_element import 'package:conekta/src/model/pagination.dart'; import 'package:built_collection/built_collection.dart'; -import 'package:conekta/src/model/discount_lines_data_response.dart'; +import 'package:conekta/src/model/discount_lines_response.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -20,7 +20,7 @@ part 'order_response_discount_lines.g.dart'; @BuiltValue() abstract class OrderResponseDiscountLines implements Pagination, Built { @BuiltValueField(wireName: r'data') - BuiltList? get data; + BuiltList? get data; OrderResponseDiscountLines._(); @@ -49,7 +49,7 @@ class _$OrderResponseDiscountLinesSerializer implements PrimitiveSerializer; + specifiedType: const FullType(BuiltList, [FullType(DiscountLinesResponse)]), + ) as BuiltList; result.data.replace(valueDes); break; case r'has_more': diff --git a/lib/src/model/order_response_discount_lines.g.dart b/lib/src/model/order_response_discount_lines.g.dart index 5dd0dfc..9e4f264 100644 --- a/lib/src/model/order_response_discount_lines.g.dart +++ b/lib/src/model/order_response_discount_lines.g.dart @@ -8,7 +8,7 @@ part of 'order_response_discount_lines.dart'; class _$OrderResponseDiscountLines extends OrderResponseDiscountLines { @override - final BuiltList? data; + final BuiltList? data; @override final bool hasMore; @override @@ -71,10 +71,10 @@ class OrderResponseDiscountLinesBuilder PaginationBuilder { _$OrderResponseDiscountLines? _$v; - ListBuilder? _data; - ListBuilder get data => - _$this._data ??= new ListBuilder(); - set data(covariant ListBuilder? data) => + ListBuilder? _data; + ListBuilder get data => + _$this._data ??= new ListBuilder(); + set data(covariant ListBuilder? data) => _$this._data = data; bool? _hasMore; diff --git a/lib/src/model/payment_method_bank_transfer.dart b/lib/src/model/payment_method_bank_transfer.dart index 38a06e9..d3ad5f1 100644 --- a/lib/src/model/payment_method_bank_transfer.dart +++ b/lib/src/model/payment_method_bank_transfer.dart @@ -32,6 +32,7 @@ part 'payment_method_bank_transfer.g.dart'; /// * [receivingAccountTaxId] /// * [referenceNumber] /// * [trackingCode] +/// * [customerIpAddress] @BuiltValue() abstract class PaymentMethodBankTransfer implements PaymentMethod, Built { @BuiltValueField(wireName: r'issuing_account_bank') @@ -52,6 +53,9 @@ abstract class PaymentMethodBankTransfer implements PaymentMethod, Built _$this._trackingCode = trackingCode; + String? _customerIpAddress; + String? get customerIpAddress => _$this._customerIpAddress; + set customerIpAddress(covariant String? customerIpAddress) => + _$this._customerIpAddress = customerIpAddress; + int? _expiresAt; int? get expiresAt => _$this._expiresAt; set expiresAt(covariant int? expiresAt) => _$this._expiresAt = expiresAt; @@ -260,6 +271,7 @@ class PaymentMethodBankTransferBuilder _issuingAccountNumber = $v.issuingAccountNumber; _description = $v.description; _trackingCode = $v.trackingCode; + _customerIpAddress = $v.customerIpAddress; _expiresAt = $v.expiresAt; _receivingAccountTaxId = $v.receivingAccountTaxId; _receivingAccountNumber = $v.receivingAccountNumber; @@ -302,6 +314,7 @@ class PaymentMethodBankTransferBuilder issuingAccountNumber: issuingAccountNumber, description: description, trackingCode: trackingCode, + customerIpAddress: customerIpAddress, expiresAt: expiresAt, receivingAccountTaxId: receivingAccountTaxId, receivingAccountNumber: receivingAccountNumber, diff --git a/lib/src/model/payment_method_card.dart b/lib/src/model/payment_method_card.dart index db53085..43312ad 100644 --- a/lib/src/model/payment_method_card.dart +++ b/lib/src/model/payment_method_card.dart @@ -16,34 +16,40 @@ part 'payment_method_card.g.dart'; /// Properties: /// * [type] /// * [object] -/// * [accountType] +/// * [accountType] - Account type of the card /// * [authCode] -/// * [brand] +/// * [brand] - Brand of the card /// * [contractId] - Id sent for recurrent charges. -/// * [country] -/// * [expMonth] -/// * [expYear] +/// * [country] - Country of the card +/// * [expMonth] - Expiration month of the card +/// * [expYear] - Expiration year of the card /// * [fraudIndicators] -/// * [issuer] -/// * [last4] -/// * [name] +/// * [issuer] - Issuer of the card +/// * [last4] - Last 4 digits of the card +/// * [name] - Name of the cardholder +/// * [customerIpAddress] - Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes @BuiltValue() abstract class PaymentMethodCard implements PaymentMethod, Built { + /// Country of the card @BuiltValueField(wireName: r'country') String? get country; + /// Expiration month of the card @BuiltValueField(wireName: r'exp_month') String? get expMonth; + /// Last 4 digits of the card @BuiltValueField(wireName: r'last4') String? get last4; @BuiltValueField(wireName: r'auth_code') String? get authCode; + /// Expiration year of the card @BuiltValueField(wireName: r'exp_year') String? get expYear; + /// Account type of the card @BuiltValueField(wireName: r'account_type') String? get accountType; @@ -51,15 +57,22 @@ abstract class PaymentMethodCard implements PaymentMethod, Built? get fraudIndicators; + /// Issuer of the card @BuiltValueField(wireName: r'issuer') String? get issuer; @@ -114,6 +127,13 @@ class _$PaymentMethodCardSerializer implements PrimitiveSerializer? fraudIndicators; @@ -47,6 +49,7 @@ class _$PaymentMethodCard extends PaymentMethodCard { this.accountType, this.contractId, this.name, + this.customerIpAddress, this.brand, this.fraudIndicators, this.issuer, @@ -77,6 +80,7 @@ class _$PaymentMethodCard extends PaymentMethodCard { accountType == other.accountType && contractId == other.contractId && name == other.name && + customerIpAddress == other.customerIpAddress && brand == other.brand && fraudIndicators == other.fraudIndicators && issuer == other.issuer && @@ -95,6 +99,7 @@ class _$PaymentMethodCard extends PaymentMethodCard { _$hash = $jc(_$hash, accountType.hashCode); _$hash = $jc(_$hash, contractId.hashCode); _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, customerIpAddress.hashCode); _$hash = $jc(_$hash, brand.hashCode); _$hash = $jc(_$hash, fraudIndicators.hashCode); _$hash = $jc(_$hash, issuer.hashCode); @@ -115,6 +120,7 @@ class _$PaymentMethodCard extends PaymentMethodCard { ..add('accountType', accountType) ..add('contractId', contractId) ..add('name', name) + ..add('customerIpAddress', customerIpAddress) ..add('brand', brand) ..add('fraudIndicators', fraudIndicators) ..add('issuer', issuer) @@ -164,6 +170,11 @@ class PaymentMethodCardBuilder String? get name => _$this._name; set name(covariant String? name) => _$this._name = name; + String? _customerIpAddress; + String? get customerIpAddress => _$this._customerIpAddress; + set customerIpAddress(covariant String? customerIpAddress) => + _$this._customerIpAddress = customerIpAddress; + String? _brand; String? get brand => _$this._brand; set brand(covariant String? brand) => _$this._brand = brand; @@ -201,6 +212,7 @@ class PaymentMethodCardBuilder _accountType = $v.accountType; _contractId = $v.contractId; _name = $v.name; + _customerIpAddress = $v.customerIpAddress; _brand = $v.brand; _fraudIndicators = $v.fraudIndicators?.toBuilder(); _issuer = $v.issuer; @@ -238,6 +250,7 @@ class PaymentMethodCardBuilder accountType: accountType, contractId: contractId, name: name, + customerIpAddress: customerIpAddress, brand: brand, fraudIndicators: _fraudIndicators?.build(), issuer: issuer, diff --git a/lib/src/model/payment_method_card_request.dart b/lib/src/model/payment_method_card_request.dart index 8400fce..dddacaa 100644 --- a/lib/src/model/payment_method_card_request.dart +++ b/lib/src/model/payment_method_card_request.dart @@ -13,12 +13,37 @@ part 'payment_method_card_request.g.dart'; /// /// Properties: /// * [type] - Type of payment method -/// * [tokenId] - Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. +/// * [cvc] - Card security code +/// * [expMonth] - Card expiration month +/// * [expYear] - Card expiration year +/// * [name] - Cardholder name +/// * [number] - Card number +/// * [customerIpAddress] - Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes @BuiltValue() abstract class PaymentMethodCardRequest implements CustomerPaymentMethodRequest, Built { - /// Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. - @BuiltValueField(wireName: r'token_id') - String get tokenId; + /// Card security code + @BuiltValueField(wireName: r'cvc') + String get cvc; + + /// Card expiration month + @BuiltValueField(wireName: r'exp_month') + String get expMonth; + + /// Card number + @BuiltValueField(wireName: r'number') + String get number; + + /// Card expiration year + @BuiltValueField(wireName: r'exp_year') + String get expYear; + + /// Cardholder name + @BuiltValueField(wireName: r'name') + String get name; + + /// Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes + @BuiltValueField(wireName: r'customer_ip_address') + String? get customerIpAddress; PaymentMethodCardRequest._(); @@ -43,11 +68,38 @@ class _$PaymentMethodCardRequestSerializer implements PrimitiveSerializer (new PaymentMethodCardRequestBuilder()..update(updates))._build(); - _$PaymentMethodCardRequest._({required this.tokenId, required this.type}) + _$PaymentMethodCardRequest._( + {required this.cvc, + required this.expMonth, + required this.number, + required this.expYear, + required this.name, + this.customerIpAddress, + required this.type}) : super._() { BuiltValueNullFieldError.checkNotNull( - tokenId, r'PaymentMethodCardRequest', 'tokenId'); + cvc, r'PaymentMethodCardRequest', 'cvc'); + BuiltValueNullFieldError.checkNotNull( + expMonth, r'PaymentMethodCardRequest', 'expMonth'); + BuiltValueNullFieldError.checkNotNull( + number, r'PaymentMethodCardRequest', 'number'); + BuiltValueNullFieldError.checkNotNull( + expYear, r'PaymentMethodCardRequest', 'expYear'); + BuiltValueNullFieldError.checkNotNull( + name, r'PaymentMethodCardRequest', 'name'); BuiltValueNullFieldError.checkNotNull( type, r'PaymentMethodCardRequest', 'type'); } @@ -37,14 +62,24 @@ class _$PaymentMethodCardRequest extends PaymentMethodCardRequest { bool operator ==(Object other) { if (identical(other, this)) return true; return other is PaymentMethodCardRequest && - tokenId == other.tokenId && + cvc == other.cvc && + expMonth == other.expMonth && + number == other.number && + expYear == other.expYear && + name == other.name && + customerIpAddress == other.customerIpAddress && type == other.type; } @override int get hashCode { var _$hash = 0; - _$hash = $jc(_$hash, tokenId.hashCode); + _$hash = $jc(_$hash, cvc.hashCode); + _$hash = $jc(_$hash, expMonth.hashCode); + _$hash = $jc(_$hash, number.hashCode); + _$hash = $jc(_$hash, expYear.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, customerIpAddress.hashCode); _$hash = $jc(_$hash, type.hashCode); _$hash = $jf(_$hash); return _$hash; @@ -53,7 +88,12 @@ class _$PaymentMethodCardRequest extends PaymentMethodCardRequest { @override String toString() { return (newBuiltValueToStringHelper(r'PaymentMethodCardRequest') - ..add('tokenId', tokenId) + ..add('cvc', cvc) + ..add('expMonth', expMonth) + ..add('number', number) + ..add('expYear', expYear) + ..add('name', name) + ..add('customerIpAddress', customerIpAddress) ..add('type', type)) .toString(); } @@ -65,9 +105,30 @@ class PaymentMethodCardRequestBuilder CustomerPaymentMethodRequestBuilder { _$PaymentMethodCardRequest? _$v; - String? _tokenId; - String? get tokenId => _$this._tokenId; - set tokenId(covariant String? tokenId) => _$this._tokenId = tokenId; + String? _cvc; + String? get cvc => _$this._cvc; + set cvc(covariant String? cvc) => _$this._cvc = cvc; + + String? _expMonth; + String? get expMonth => _$this._expMonth; + set expMonth(covariant String? expMonth) => _$this._expMonth = expMonth; + + String? _number; + String? get number => _$this._number; + set number(covariant String? number) => _$this._number = number; + + String? _expYear; + String? get expYear => _$this._expYear; + set expYear(covariant String? expYear) => _$this._expYear = expYear; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + String? _customerIpAddress; + String? get customerIpAddress => _$this._customerIpAddress; + set customerIpAddress(covariant String? customerIpAddress) => + _$this._customerIpAddress = customerIpAddress; String? _type; String? get type => _$this._type; @@ -80,7 +141,12 @@ class PaymentMethodCardRequestBuilder PaymentMethodCardRequestBuilder get _$this { final $v = _$v; if ($v != null) { - _tokenId = $v.tokenId; + _cvc = $v.cvc; + _expMonth = $v.expMonth; + _number = $v.number; + _expYear = $v.expYear; + _name = $v.name; + _customerIpAddress = $v.customerIpAddress; _type = $v.type; _$v = null; } @@ -104,8 +170,17 @@ class PaymentMethodCardRequestBuilder _$PaymentMethodCardRequest _build() { final _$result = _$v ?? new _$PaymentMethodCardRequest._( - tokenId: BuiltValueNullFieldError.checkNotNull( - tokenId, r'PaymentMethodCardRequest', 'tokenId'), + cvc: BuiltValueNullFieldError.checkNotNull( + cvc, r'PaymentMethodCardRequest', 'cvc'), + expMonth: BuiltValueNullFieldError.checkNotNull( + expMonth, r'PaymentMethodCardRequest', 'expMonth'), + number: BuiltValueNullFieldError.checkNotNull( + number, r'PaymentMethodCardRequest', 'number'), + expYear: BuiltValueNullFieldError.checkNotNull( + expYear, r'PaymentMethodCardRequest', 'expYear'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'PaymentMethodCardRequest', 'name'), + customerIpAddress: customerIpAddress, type: BuiltValueNullFieldError.checkNotNull( type, r'PaymentMethodCardRequest', 'type')); replace(_$result); diff --git a/lib/src/model/payment_method_cash.dart b/lib/src/model/payment_method_cash.dart index 562cdee..26a210e 100644 --- a/lib/src/model/payment_method_cash.dart +++ b/lib/src/model/payment_method_cash.dart @@ -14,19 +14,26 @@ part 'payment_method_cash.g.dart'; /// Properties: /// * [type] /// * [object] +/// * [agreement] - Agreement ID /// * [authCode] /// * [cashierId] /// * [reference] /// * [barcodeUrl] /// * [expiresAt] +/// * [productType] - Product type, e.g. bbva_cash_in, cash_in, pespay_cash_in, etc. /// * [serviceName] /// * [store] /// * [storeName] +/// * [customerIpAddress] @BuiltValue() abstract class PaymentMethodCash implements PaymentMethod, Built { @BuiltValueField(wireName: r'reference') String? get reference; + /// Agreement ID + @BuiltValueField(wireName: r'agreement') + String? get agreement; + @BuiltValueField(wireName: r'auth_code') int? get authCode; @@ -42,12 +49,19 @@ abstract class PaymentMethodCash implements PaymentMethod, Built _$this._reference; set reference(covariant String? reference) => _$this._reference = reference; + String? _agreement; + String? get agreement => _$this._agreement; + set agreement(covariant String? agreement) => _$this._agreement = agreement; + int? _authCode; int? get authCode => _$this._authCode; set authCode(covariant int? authCode) => _$this._authCode = authCode; @@ -137,6 +159,11 @@ class PaymentMethodCashBuilder String? get store => _$this._store; set store(covariant String? store) => _$this._store = store; + String? _customerIpAddress; + String? get customerIpAddress => _$this._customerIpAddress; + set customerIpAddress(covariant String? customerIpAddress) => + _$this._customerIpAddress = customerIpAddress; + String? _serviceName; String? get serviceName => _$this._serviceName; set serviceName(covariant String? serviceName) => @@ -146,6 +173,11 @@ class PaymentMethodCashBuilder int? get expiresAt => _$this._expiresAt; set expiresAt(covariant int? expiresAt) => _$this._expiresAt = expiresAt; + String? _productType; + String? get productType => _$this._productType; + set productType(covariant String? productType) => + _$this._productType = productType; + String? _type; String? get type => _$this._type; set type(covariant String? type) => _$this._type = type; @@ -162,13 +194,16 @@ class PaymentMethodCashBuilder final $v = _$v; if ($v != null) { _reference = $v.reference; + _agreement = $v.agreement; _authCode = $v.authCode; _cashierId = $v.cashierId; _storeName = $v.storeName; _barcodeUrl = $v.barcodeUrl; _store = $v.store; + _customerIpAddress = $v.customerIpAddress; _serviceName = $v.serviceName; _expiresAt = $v.expiresAt; + _productType = $v.productType; _type = $v.type; _object = $v.object; _$v = null; @@ -194,13 +229,16 @@ class PaymentMethodCashBuilder final _$result = _$v ?? new _$PaymentMethodCash._( reference: reference, + agreement: agreement, authCode: authCode, cashierId: cashierId, storeName: storeName, barcodeUrl: barcodeUrl, store: store, + customerIpAddress: customerIpAddress, serviceName: serviceName, expiresAt: expiresAt, + productType: productType, type: type, object: BuiltValueNullFieldError.checkNotNull( object, r'PaymentMethodCash', 'object')); diff --git a/lib/src/model/payment_method_general_request.dart b/lib/src/model/payment_method_general_request.dart new file mode 100644 index 0000000..f675339 --- /dev/null +++ b/lib/src/model/payment_method_general_request.dart @@ -0,0 +1,238 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payment_method_general_request.g.dart'; + +/// Payment method used in the charge. Go to the [payment methods](https://developers.conekta.com/reference/m%C3%A9todos-de-pago) section for more details +/// +/// Properties: +/// * [expiresAt] - Method expiration date as unix timestamp +/// * [monthlyInstallments] - How many months without interest to apply, it can be 3, 6, 9, 12 or 18 +/// * [type] - Type of payment method +/// * [tokenId] +/// * [paymentSourceId] +/// * [cvc] - Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants +/// * [contractId] - Optional id sent to indicate the bank contract for recurrent card charges. +/// * [customerIpAddress] - Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes +@BuiltValue() +abstract class PaymentMethodGeneralRequest implements Built { + /// Method expiration date as unix timestamp + @BuiltValueField(wireName: r'expires_at') + int? get expiresAt; + + /// How many months without interest to apply, it can be 3, 6, 9, 12 or 18 + @BuiltValueField(wireName: r'monthly_installments') + int? get monthlyInstallments; + + /// Type of payment method + @BuiltValueField(wireName: r'type') + String get type; + + @BuiltValueField(wireName: r'token_id') + String? get tokenId; + + @BuiltValueField(wireName: r'payment_source_id') + String? get paymentSourceId; + + /// Optional, It is a value that allows identifying the security code of the card. Only for PCI merchants + @BuiltValueField(wireName: r'cvc') + String? get cvc; + + /// Optional id sent to indicate the bank contract for recurrent card charges. + @BuiltValueField(wireName: r'contract_id') + String? get contractId; + + /// Optional field used to capture the customer's IP address for fraud prevention and security monitoring purposes + @BuiltValueField(wireName: r'customer_ip_address') + String? get customerIpAddress; + + PaymentMethodGeneralRequest._(); + + factory PaymentMethodGeneralRequest([void updates(PaymentMethodGeneralRequestBuilder b)]) = _$PaymentMethodGeneralRequest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PaymentMethodGeneralRequestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PaymentMethodGeneralRequestSerializer(); +} + +class _$PaymentMethodGeneralRequestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PaymentMethodGeneralRequest, _$PaymentMethodGeneralRequest]; + + @override + final String wireName = r'PaymentMethodGeneralRequest'; + + Iterable _serializeProperties( + Serializers serializers, + PaymentMethodGeneralRequest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.expiresAt != null) { + yield r'expires_at'; + yield serializers.serialize( + object.expiresAt, + specifiedType: const FullType(int), + ); + } + if (object.monthlyInstallments != null) { + yield r'monthly_installments'; + yield serializers.serialize( + object.monthlyInstallments, + specifiedType: const FullType(int), + ); + } + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + if (object.tokenId != null) { + yield r'token_id'; + yield serializers.serialize( + object.tokenId, + specifiedType: const FullType(String), + ); + } + if (object.paymentSourceId != null) { + yield r'payment_source_id'; + yield serializers.serialize( + object.paymentSourceId, + specifiedType: const FullType(String), + ); + } + if (object.cvc != null) { + yield r'cvc'; + yield serializers.serialize( + object.cvc, + specifiedType: const FullType(String), + ); + } + if (object.contractId != null) { + yield r'contract_id'; + yield serializers.serialize( + object.contractId, + specifiedType: const FullType(String), + ); + } + if (object.customerIpAddress != null) { + yield r'customer_ip_address'; + yield serializers.serialize( + object.customerIpAddress, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + PaymentMethodGeneralRequest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PaymentMethodGeneralRequestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'expires_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.expiresAt = valueDes; + break; + case r'monthly_installments': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.monthlyInstallments = valueDes; + break; + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + case r'token_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.tokenId = valueDes; + break; + case r'payment_source_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.paymentSourceId = valueDes; + break; + case r'cvc': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.cvc = valueDes; + break; + case r'contract_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.contractId = valueDes; + break; + case r'customer_ip_address': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.customerIpAddress = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PaymentMethodGeneralRequest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PaymentMethodGeneralRequestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payment_method_general_request.g.dart b/lib/src/model/payment_method_general_request.g.dart new file mode 100644 index 0000000..bc6b13e --- /dev/null +++ b/lib/src/model/payment_method_general_request.g.dart @@ -0,0 +1,190 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payment_method_general_request.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PaymentMethodGeneralRequest extends PaymentMethodGeneralRequest { + @override + final int? expiresAt; + @override + final int? monthlyInstallments; + @override + final String type; + @override + final String? tokenId; + @override + final String? paymentSourceId; + @override + final String? cvc; + @override + final String? contractId; + @override + final String? customerIpAddress; + + factory _$PaymentMethodGeneralRequest( + [void Function(PaymentMethodGeneralRequestBuilder)? updates]) => + (new PaymentMethodGeneralRequestBuilder()..update(updates))._build(); + + _$PaymentMethodGeneralRequest._( + {this.expiresAt, + this.monthlyInstallments, + required this.type, + this.tokenId, + this.paymentSourceId, + this.cvc, + this.contractId, + this.customerIpAddress}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + type, r'PaymentMethodGeneralRequest', 'type'); + } + + @override + PaymentMethodGeneralRequest rebuild( + void Function(PaymentMethodGeneralRequestBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PaymentMethodGeneralRequestBuilder toBuilder() => + new PaymentMethodGeneralRequestBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PaymentMethodGeneralRequest && + expiresAt == other.expiresAt && + monthlyInstallments == other.monthlyInstallments && + type == other.type && + tokenId == other.tokenId && + paymentSourceId == other.paymentSourceId && + cvc == other.cvc && + contractId == other.contractId && + customerIpAddress == other.customerIpAddress; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, expiresAt.hashCode); + _$hash = $jc(_$hash, monthlyInstallments.hashCode); + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jc(_$hash, tokenId.hashCode); + _$hash = $jc(_$hash, paymentSourceId.hashCode); + _$hash = $jc(_$hash, cvc.hashCode); + _$hash = $jc(_$hash, contractId.hashCode); + _$hash = $jc(_$hash, customerIpAddress.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PaymentMethodGeneralRequest') + ..add('expiresAt', expiresAt) + ..add('monthlyInstallments', monthlyInstallments) + ..add('type', type) + ..add('tokenId', tokenId) + ..add('paymentSourceId', paymentSourceId) + ..add('cvc', cvc) + ..add('contractId', contractId) + ..add('customerIpAddress', customerIpAddress)) + .toString(); + } +} + +class PaymentMethodGeneralRequestBuilder + implements + Builder { + _$PaymentMethodGeneralRequest? _$v; + + int? _expiresAt; + int? get expiresAt => _$this._expiresAt; + set expiresAt(int? expiresAt) => _$this._expiresAt = expiresAt; + + int? _monthlyInstallments; + int? get monthlyInstallments => _$this._monthlyInstallments; + set monthlyInstallments(int? monthlyInstallments) => + _$this._monthlyInstallments = monthlyInstallments; + + String? _type; + String? get type => _$this._type; + set type(String? type) => _$this._type = type; + + String? _tokenId; + String? get tokenId => _$this._tokenId; + set tokenId(String? tokenId) => _$this._tokenId = tokenId; + + String? _paymentSourceId; + String? get paymentSourceId => _$this._paymentSourceId; + set paymentSourceId(String? paymentSourceId) => + _$this._paymentSourceId = paymentSourceId; + + String? _cvc; + String? get cvc => _$this._cvc; + set cvc(String? cvc) => _$this._cvc = cvc; + + String? _contractId; + String? get contractId => _$this._contractId; + set contractId(String? contractId) => _$this._contractId = contractId; + + String? _customerIpAddress; + String? get customerIpAddress => _$this._customerIpAddress; + set customerIpAddress(String? customerIpAddress) => + _$this._customerIpAddress = customerIpAddress; + + PaymentMethodGeneralRequestBuilder() { + PaymentMethodGeneralRequest._defaults(this); + } + + PaymentMethodGeneralRequestBuilder get _$this { + final $v = _$v; + if ($v != null) { + _expiresAt = $v.expiresAt; + _monthlyInstallments = $v.monthlyInstallments; + _type = $v.type; + _tokenId = $v.tokenId; + _paymentSourceId = $v.paymentSourceId; + _cvc = $v.cvc; + _contractId = $v.contractId; + _customerIpAddress = $v.customerIpAddress; + _$v = null; + } + return this; + } + + @override + void replace(PaymentMethodGeneralRequest other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PaymentMethodGeneralRequest; + } + + @override + void update(void Function(PaymentMethodGeneralRequestBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PaymentMethodGeneralRequest build() => _build(); + + _$PaymentMethodGeneralRequest _build() { + final _$result = _$v ?? + new _$PaymentMethodGeneralRequest._( + expiresAt: expiresAt, + monthlyInstallments: monthlyInstallments, + type: BuiltValueNullFieldError.checkNotNull( + type, r'PaymentMethodGeneralRequest', 'type'), + tokenId: tokenId, + paymentSourceId: paymentSourceId, + cvc: cvc, + contractId: contractId, + customerIpAddress: customerIpAddress); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payment_method_token_request.dart b/lib/src/model/payment_method_token_request.dart new file mode 100644 index 0000000..fc9993e --- /dev/null +++ b/lib/src/model/payment_method_token_request.dart @@ -0,0 +1,121 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/customer_payment_method_request.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payment_method_token_request.g.dart'; + +/// PaymentMethodTokenRequest +/// +/// Properties: +/// * [type] - Type of payment method +/// * [tokenId] - Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. +@BuiltValue() +abstract class PaymentMethodTokenRequest implements CustomerPaymentMethodRequest, Built { + /// Token id that will be used to create a \"card\" type payment method. See the (subscriptions)[https://developers.conekta.com/v2.1.0/reference/createsubscription] tutorial for more information on how to tokenize cards. + @BuiltValueField(wireName: r'token_id') + String get tokenId; + + PaymentMethodTokenRequest._(); + + factory PaymentMethodTokenRequest([void updates(PaymentMethodTokenRequestBuilder b)]) = _$PaymentMethodTokenRequest; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PaymentMethodTokenRequestBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PaymentMethodTokenRequestSerializer(); +} + +class _$PaymentMethodTokenRequestSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PaymentMethodTokenRequest, _$PaymentMethodTokenRequest]; + + @override + final String wireName = r'PaymentMethodTokenRequest'; + + Iterable _serializeProperties( + Serializers serializers, + PaymentMethodTokenRequest object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'token_id'; + yield serializers.serialize( + object.tokenId, + specifiedType: const FullType(String), + ); + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PaymentMethodTokenRequest object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PaymentMethodTokenRequestBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'token_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.tokenId = valueDes; + break; + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PaymentMethodTokenRequest deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PaymentMethodTokenRequestBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payment_method_token_request.g.dart b/lib/src/model/payment_method_token_request.g.dart new file mode 100644 index 0000000..723d3ca --- /dev/null +++ b/lib/src/model/payment_method_token_request.g.dart @@ -0,0 +1,116 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payment_method_token_request.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PaymentMethodTokenRequest extends PaymentMethodTokenRequest { + @override + final String tokenId; + @override + final String type; + + factory _$PaymentMethodTokenRequest( + [void Function(PaymentMethodTokenRequestBuilder)? updates]) => + (new PaymentMethodTokenRequestBuilder()..update(updates))._build(); + + _$PaymentMethodTokenRequest._({required this.tokenId, required this.type}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + tokenId, r'PaymentMethodTokenRequest', 'tokenId'); + BuiltValueNullFieldError.checkNotNull( + type, r'PaymentMethodTokenRequest', 'type'); + } + + @override + PaymentMethodTokenRequest rebuild( + void Function(PaymentMethodTokenRequestBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PaymentMethodTokenRequestBuilder toBuilder() => + new PaymentMethodTokenRequestBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PaymentMethodTokenRequest && + tokenId == other.tokenId && + type == other.type; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, tokenId.hashCode); + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PaymentMethodTokenRequest') + ..add('tokenId', tokenId) + ..add('type', type)) + .toString(); + } +} + +class PaymentMethodTokenRequestBuilder + implements + Builder, + CustomerPaymentMethodRequestBuilder { + _$PaymentMethodTokenRequest? _$v; + + String? _tokenId; + String? get tokenId => _$this._tokenId; + set tokenId(covariant String? tokenId) => _$this._tokenId = tokenId; + + String? _type; + String? get type => _$this._type; + set type(covariant String? type) => _$this._type = type; + + PaymentMethodTokenRequestBuilder() { + PaymentMethodTokenRequest._defaults(this); + } + + PaymentMethodTokenRequestBuilder get _$this { + final $v = _$v; + if ($v != null) { + _tokenId = $v.tokenId; + _type = $v.type; + _$v = null; + } + return this; + } + + @override + void replace(covariant PaymentMethodTokenRequest other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PaymentMethodTokenRequest; + } + + @override + void update(void Function(PaymentMethodTokenRequestBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PaymentMethodTokenRequest build() => _build(); + + _$PaymentMethodTokenRequest _build() { + final _$result = _$v ?? + new _$PaymentMethodTokenRequest._( + tokenId: BuiltValueNullFieldError.checkNotNull( + tokenId, r'PaymentMethodTokenRequest', 'tokenId'), + type: BuiltValueNullFieldError.checkNotNull( + type, r'PaymentMethodTokenRequest', 'type')); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/subscription_response.dart b/lib/src/model/subscription_response.dart index d5ef819..d1bffde 100644 --- a/lib/src/model/subscription_response.dart +++ b/lib/src/model/subscription_response.dart @@ -14,6 +14,7 @@ part 'subscription_response.g.dart'; /// * [billingCycleStart] /// * [billingCycleEnd] /// * [canceledAt] +/// * [canceledReason] - Reason for cancellation. This field appears when the subscription status is 'canceled'. /// * [cardId] /// * [chargeId] /// * [createdAt] @@ -39,6 +40,10 @@ abstract class SubscriptionResponse implements Built _$this._canceledAt; set canceledAt(int? canceledAt) => _$this._canceledAt = canceledAt; + String? _canceledReason; + String? get canceledReason => _$this._canceledReason; + set canceledReason(String? canceledReason) => + _$this._canceledReason = canceledReason; + String? _cardId; String? get cardId => _$this._cardId; set cardId(String? cardId) => _$this._cardId = cardId; @@ -233,6 +244,7 @@ class SubscriptionResponseBuilder _billingCycleStart = $v.billingCycleStart; _billingCycleEnd = $v.billingCycleEnd; _canceledAt = $v.canceledAt; + _canceledReason = $v.canceledReason; _cardId = $v.cardId; _chargeId = $v.chargeId; _createdAt = $v.createdAt; @@ -272,6 +284,7 @@ class SubscriptionResponseBuilder billingCycleStart: billingCycleStart, billingCycleEnd: billingCycleEnd, canceledAt: canceledAt, + canceledReason: canceledReason, cardId: cardId, chargeId: chargeId, createdAt: createdAt, diff --git a/lib/src/model/update_customer.dart b/lib/src/model/update_customer.dart index a941c9b..6f98e87 100644 --- a/lib/src/model/update_customer.dart +++ b/lib/src/model/update_customer.dart @@ -19,6 +19,7 @@ part 'update_customer.g.dart'; /// /// Properties: /// * [antifraudInfo] +/// * [dateOfBirth] - It is a parameter that allows to identify the date of birth of the client. /// * [defaultPaymentSourceId] - It is a parameter that allows to identify in the response, the Conekta ID of a payment method (payment_id) /// * [email] - An email address is a series of customizable characters followed by a universal Internet symbol, the at symbol (@), the name of a host server, and a web domain ending (.mx, .com, .org, . net, etc). /// * [name] - Client's name @@ -29,6 +30,7 @@ part 'update_customer.g.dart'; /// * [customReference] - It is an undefined value. /// * [fiscalEntities] /// * [metadata] +/// * [nationalId] - It is a parameter that allows to identify the national identification number of the client. /// * [paymentSources] - Contains details of the payment methods that the customer has active or has used in Conekta /// * [shippingContacts] - Contains the detail of the shipping addresses that the client has active or has used in Conekta /// * [subscription] @@ -37,6 +39,10 @@ abstract class UpdateCustomer implements Built? get metadata; + /// It is a parameter that allows to identify the national identification number of the client. + @BuiltValueField(wireName: r'national_id') + String? get nationalId; + /// Contains details of the payment methods that the customer has active or has used in Conekta @BuiltValueField(wireName: r'payment_sources') BuiltList? get paymentSources; @@ -117,6 +127,13 @@ class _$UpdateCustomerSerializer implements PrimitiveSerializer specifiedType: const FullType.nullable(UpdateCustomerAntifraudInfo), ); } + if (object.dateOfBirth != null) { + yield r'date_of_birth'; + yield serializers.serialize( + object.dateOfBirth, + specifiedType: const FullType(String), + ); + } if (object.defaultPaymentSourceId != null) { yield r'default_payment_source_id'; yield serializers.serialize( @@ -187,6 +204,13 @@ class _$UpdateCustomerSerializer implements PrimitiveSerializer specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } + if (object.nationalId != null) { + yield r'national_id'; + yield serializers.serialize( + object.nationalId, + specifiedType: const FullType(String), + ); + } if (object.paymentSources != null) { yield r'payment_sources'; yield serializers.serialize( @@ -239,6 +263,13 @@ class _$UpdateCustomerSerializer implements PrimitiveSerializer if (valueDes == null) continue; result.antifraudInfo.replace(valueDes); break; + case r'date_of_birth': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.dateOfBirth = valueDes; + break; case r'default_payment_source_id': final valueDes = serializers.deserialize( value, @@ -309,6 +340,13 @@ class _$UpdateCustomerSerializer implements PrimitiveSerializer ) as BuiltMap; result.metadata.replace(valueDes); break; + case r'national_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.nationalId = valueDes; + break; case r'payment_sources': final valueDes = serializers.deserialize( value, diff --git a/lib/src/model/update_customer.g.dart b/lib/src/model/update_customer.g.dart index 8f16bd0..64e80b7 100644 --- a/lib/src/model/update_customer.g.dart +++ b/lib/src/model/update_customer.g.dart @@ -10,6 +10,8 @@ class _$UpdateCustomer extends UpdateCustomer { @override final UpdateCustomerAntifraudInfo? antifraudInfo; @override + final String? dateOfBirth; + @override final String? defaultPaymentSourceId; @override final String? email; @@ -30,6 +32,8 @@ class _$UpdateCustomer extends UpdateCustomer { @override final BuiltMap? metadata; @override + final String? nationalId; + @override final BuiltList? paymentSources; @override final BuiltList? shippingContacts; @@ -41,6 +45,7 @@ class _$UpdateCustomer extends UpdateCustomer { _$UpdateCustomer._( {this.antifraudInfo, + this.dateOfBirth, this.defaultPaymentSourceId, this.email, this.name, @@ -51,6 +56,7 @@ class _$UpdateCustomer extends UpdateCustomer { this.customReference, this.fiscalEntities, this.metadata, + this.nationalId, this.paymentSources, this.shippingContacts, this.subscription}) @@ -69,6 +75,7 @@ class _$UpdateCustomer extends UpdateCustomer { if (identical(other, this)) return true; return other is UpdateCustomer && antifraudInfo == other.antifraudInfo && + dateOfBirth == other.dateOfBirth && defaultPaymentSourceId == other.defaultPaymentSourceId && email == other.email && name == other.name && @@ -79,6 +86,7 @@ class _$UpdateCustomer extends UpdateCustomer { customReference == other.customReference && fiscalEntities == other.fiscalEntities && metadata == other.metadata && + nationalId == other.nationalId && paymentSources == other.paymentSources && shippingContacts == other.shippingContacts && subscription == other.subscription; @@ -88,6 +96,7 @@ class _$UpdateCustomer extends UpdateCustomer { int get hashCode { var _$hash = 0; _$hash = $jc(_$hash, antifraudInfo.hashCode); + _$hash = $jc(_$hash, dateOfBirth.hashCode); _$hash = $jc(_$hash, defaultPaymentSourceId.hashCode); _$hash = $jc(_$hash, email.hashCode); _$hash = $jc(_$hash, name.hashCode); @@ -98,6 +107,7 @@ class _$UpdateCustomer extends UpdateCustomer { _$hash = $jc(_$hash, customReference.hashCode); _$hash = $jc(_$hash, fiscalEntities.hashCode); _$hash = $jc(_$hash, metadata.hashCode); + _$hash = $jc(_$hash, nationalId.hashCode); _$hash = $jc(_$hash, paymentSources.hashCode); _$hash = $jc(_$hash, shippingContacts.hashCode); _$hash = $jc(_$hash, subscription.hashCode); @@ -109,6 +119,7 @@ class _$UpdateCustomer extends UpdateCustomer { String toString() { return (newBuiltValueToStringHelper(r'UpdateCustomer') ..add('antifraudInfo', antifraudInfo) + ..add('dateOfBirth', dateOfBirth) ..add('defaultPaymentSourceId', defaultPaymentSourceId) ..add('email', email) ..add('name', name) @@ -119,6 +130,7 @@ class _$UpdateCustomer extends UpdateCustomer { ..add('customReference', customReference) ..add('fiscalEntities', fiscalEntities) ..add('metadata', metadata) + ..add('nationalId', nationalId) ..add('paymentSources', paymentSources) ..add('shippingContacts', shippingContacts) ..add('subscription', subscription)) @@ -136,6 +148,10 @@ class UpdateCustomerBuilder set antifraudInfo(UpdateCustomerAntifraudInfoBuilder? antifraudInfo) => _$this._antifraudInfo = antifraudInfo; + String? _dateOfBirth; + String? get dateOfBirth => _$this._dateOfBirth; + set dateOfBirth(String? dateOfBirth) => _$this._dateOfBirth = dateOfBirth; + String? _defaultPaymentSourceId; String? get defaultPaymentSourceId => _$this._defaultPaymentSourceId; set defaultPaymentSourceId(String? defaultPaymentSourceId) => @@ -185,6 +201,10 @@ class UpdateCustomerBuilder set metadata(MapBuilder? metadata) => _$this._metadata = metadata; + String? _nationalId; + String? get nationalId => _$this._nationalId; + set nationalId(String? nationalId) => _$this._nationalId = nationalId; + ListBuilder? _paymentSources; ListBuilder get paymentSources => _$this._paymentSources ??= @@ -214,6 +234,7 @@ class UpdateCustomerBuilder final $v = _$v; if ($v != null) { _antifraudInfo = $v.antifraudInfo?.toBuilder(); + _dateOfBirth = $v.dateOfBirth; _defaultPaymentSourceId = $v.defaultPaymentSourceId; _email = $v.email; _name = $v.name; @@ -224,6 +245,7 @@ class UpdateCustomerBuilder _customReference = $v.customReference; _fiscalEntities = $v.fiscalEntities?.toBuilder(); _metadata = $v.metadata?.toBuilder(); + _nationalId = $v.nationalId; _paymentSources = $v.paymentSources?.toBuilder(); _shippingContacts = $v.shippingContacts?.toBuilder(); _subscription = $v.subscription?.toBuilder(); @@ -252,6 +274,7 @@ class UpdateCustomerBuilder _$result = _$v ?? new _$UpdateCustomer._( antifraudInfo: _antifraudInfo?.build(), + dateOfBirth: dateOfBirth, defaultPaymentSourceId: defaultPaymentSourceId, email: email, name: name, @@ -262,6 +285,7 @@ class UpdateCustomerBuilder customReference: customReference, fiscalEntities: _fiscalEntities?.build(), metadata: _metadata?.build(), + nationalId: nationalId, paymentSources: _paymentSources?.build(), shippingContacts: _shippingContacts?.build(), subscription: _subscription?.build()); @@ -275,6 +299,7 @@ class UpdateCustomerBuilder _fiscalEntities?.build(); _$failedField = 'metadata'; _metadata?.build(); + _$failedField = 'paymentSources'; _paymentSources?.build(); _$failedField = 'shippingContacts'; diff --git a/lib/src/serializers.dart b/lib/src/serializers.dart index 010ebc2..433568c 100644 --- a/lib/src/serializers.dart +++ b/lib/src/serializers.dart @@ -33,6 +33,8 @@ import 'package:conekta/src/model/charge_response_refunds.dart'; import 'package:conekta/src/model/charge_response_refunds_data.dart'; import 'package:conekta/src/model/charge_update_request.dart'; import 'package:conekta/src/model/charges_data_response.dart'; +import 'package:conekta/src/model/charges_order_response.dart'; +import 'package:conekta/src/model/charges_order_response_all_of_data.dart'; import 'package:conekta/src/model/checkout.dart'; import 'package:conekta/src/model/checkout_order_template.dart'; import 'package:conekta/src/model/checkout_order_template_customer_info.dart'; @@ -133,9 +135,11 @@ import 'package:conekta/src/model/payment_method_card_response.dart'; import 'package:conekta/src/model/payment_method_cash.dart'; import 'package:conekta/src/model/payment_method_cash_request.dart'; import 'package:conekta/src/model/payment_method_cash_response.dart'; +import 'package:conekta/src/model/payment_method_general_request.dart'; import 'package:conekta/src/model/payment_method_response.dart'; import 'package:conekta/src/model/payment_method_spei_recurrent.dart'; import 'package:conekta/src/model/payment_method_spei_request.dart'; +import 'package:conekta/src/model/payment_method_token_request.dart'; import 'package:conekta/src/model/payout.dart'; import 'package:conekta/src/model/payout_method.dart'; import 'package:conekta/src/model/payout_order.dart'; @@ -210,6 +214,8 @@ part 'serializers.g.dart'; ChargeResponseRefundsData, ChargeUpdateRequest, ChargesDataResponse, + ChargesOrderResponse, + ChargesOrderResponseAllOfData, Checkout, CheckoutOrderTemplate, CheckoutOrderTemplateCustomerInfo, @@ -310,9 +316,11 @@ part 'serializers.g.dart'; PaymentMethodCash, PaymentMethodCashRequest, PaymentMethodCashResponse, + PaymentMethodGeneralRequest, PaymentMethodResponse,$PaymentMethodResponse, PaymentMethodSpeiRecurrent, PaymentMethodSpeiRequest, + PaymentMethodTokenRequest, Payout, PayoutMethod, PayoutOrder, diff --git a/lib/src/serializers.g.dart b/lib/src/serializers.g.dart index 7eeda90..e9cda0a 100644 --- a/lib/src/serializers.g.dart +++ b/lib/src/serializers.g.dart @@ -44,6 +44,8 @@ Serializers _$serializers = (new Serializers().toBuilder() ..add(ChargeResponseRefundsData.serializer) ..add(ChargeUpdateRequest.serializer) ..add(ChargesDataResponse.serializer) + ..add(ChargesOrderResponse.serializer) + ..add(ChargesOrderResponseAllOfData.serializer) ..add(Checkout.serializer) ..add(CheckoutOrderTemplate.serializer) ..add(CheckoutOrderTemplateCustomerInfo.serializer) @@ -134,8 +136,10 @@ Serializers _$serializers = (new Serializers().toBuilder() ..add(PaymentMethodCash.serializer) ..add(PaymentMethodCashRequest.serializer) ..add(PaymentMethodCashResponse.serializer) + ..add(PaymentMethodGeneralRequest.serializer) ..add(PaymentMethodSpeiRecurrent.serializer) ..add(PaymentMethodSpeiRequest.serializer) + ..add(PaymentMethodTokenRequest.serializer) ..add(Payout.serializer) ..add(PayoutMethod.serializer) ..add(PayoutOrder.serializer) @@ -261,14 +265,17 @@ Serializers _$serializers = (new Serializers().toBuilder() ..addBuilderFactory( const FullType(BuiltList, const [const FullType(ChargeResponse)]), () => new ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(ChargeResponse)]), + () => new ListBuilder()) ..addBuilderFactory( const FullType( BuiltList, const [const FullType(ChargeResponseRefundsData)]), () => new ListBuilder()) ..addBuilderFactory( const FullType( - BuiltList, const [const FullType(ChargesDataResponse)]), - () => new ListBuilder()) + BuiltList, const [const FullType(ChargesOrderResponseAllOfData)]), + () => new ListBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(CheckoutResponse)]), () => new ListBuilder()) @@ -334,8 +341,8 @@ Serializers _$serializers = (new Serializers().toBuilder() () => new ListBuilder()) ..addBuilderFactory( const FullType( - BuiltList, const [const FullType(DiscountLinesDataResponse)]), - () => new ListBuilder()) + BuiltList, const [const FullType(DiscountLinesResponse)]), + () => new ListBuilder()) ..addBuilderFactory( const FullType( BuiltList, const [const FullType(DiscountLinesResponse)]), diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index 908edc3..9e56293 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -71,7 +71,7 @@ String getConektaClientUserAgent() { return cachedUserClient; } Map cachedData = { - "bindings_version": "6.0.5", + "bindings_version": "6.0.6", "lang": "Dart", "publisher": "conekta", "lang_version": Platform.version.split(' ')[0], diff --git a/pubspec.yaml b/pubspec.yaml index cb5fe71..afd8f14 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: conekta -version: 6.0.5 +version: 6.0.6 description: A simple Conekta API wrapper, that is meant to be used on the server. homepage: https://www.github.com/conekta/conekta-dart repository: https://www.github.com/conekta/conekta-dart