Git Product home page Git Product logo

conekta-.net's Introduction

conekta

Conekta sdk

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.1.0
  • Package version: 6.0.3
  • Generator version: 7.5.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/conekta/openapi/issues

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/conekta/conekta-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/conekta/conekta-python.git)

Then import the package:

import conekta

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import conekta

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import time
import conekta
from conekta.rest import ApiException
from pprint import pprint

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = conekta.Configuration(
    access_token = os.environ["API_KEY"]
)


# Enter a context with an instance of the API client
with conekta.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = conekta.CustomersApi(api_client)
    customer = conekta.Customer(
        email='[email protected]',
        name='Customer Name',
        phone='5534343434'
    ) # Customer | requested field for create Customer
    accept_language = 'es' # str | Use for knowing which language to use (optional) (default to 'es')

    try:
        # Create Customer
        api_response = api_instance.create_customer(customer, accept_language=accept_language)
        print("The response of CustomersApi->create_customer:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CustomersApi->create_customer: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.conekta.io

Class Method HTTP request Description
AntifraudApi create_rule_blacklist POST /antifraud/blacklists Create blacklisted rule
AntifraudApi create_rule_whitelist POST /antifraud/whitelists Create whitelisted rule
AntifraudApi delete_rule_blacklist DELETE /antifraud/blacklists/{id} Delete blacklisted rule
AntifraudApi delete_rule_whitelist DELETE /antifraud/whitelists/{id} Delete whitelisted rule
AntifraudApi get_rule_blacklist GET /antifraud/blacklists Get list of blacklisted rules
AntifraudApi get_rule_whitelist GET /antifraud/whitelists Get a list of whitelisted rules
ApiKeysApi create_api_key POST /api_keys Create Api Key
ApiKeysApi delete_api_key DELETE /api_keys/{id} Delete Api Key
ApiKeysApi get_api_key GET /api_keys/{id} Get Api Key
ApiKeysApi get_api_keys GET /api_keys Get list of Api Keys
ApiKeysApi update_api_key PUT /api_keys/{id} Update Api Key
BalancesApi get_balance GET /balance Get a company's balance
ChargesApi get_charges GET /charges Get A List of Charges
ChargesApi orders_create_charge POST /orders/{id}/charges Create charge
ChargesApi update_charge PUT /charges/{id} Update a charge
CompaniesApi get_companies GET /companies Get List of Companies
CompaniesApi get_company GET /companies/{id} Get Company
CustomersApi create_customer POST /customers Create customer
CustomersApi create_customer_fiscal_entities POST /customers/{id}/fiscal_entities Create Fiscal Entity
CustomersApi delete_customer_by_id DELETE /customers/{id} Delete Customer
CustomersApi get_customer_by_id GET /customers/{id} Get Customer
CustomersApi get_customers GET /customers Get a list of customers
CustomersApi update_customer PUT /customers/{id} Update customer
CustomersApi update_customer_fiscal_entities PUT /customers/{id}/fiscal_entities/{fiscal_entities_id} Update Fiscal Entity
DiscountsApi orders_create_discount_line POST /orders/{id}/discount_lines Create Discount
DiscountsApi orders_delete_discount_lines DELETE /orders/{id}/discount_lines/{discount_lines_id} Delete Discount
DiscountsApi orders_get_discount_line GET /orders/{id}/discount_lines/{discount_lines_id} Get Discount
DiscountsApi orders_get_discount_lines GET /orders/{id}/discount_lines Get a List of Discount
DiscountsApi orders_update_discount_lines PUT /orders/{id}/discount_lines/{discount_lines_id} Update Discount
EventsApi get_event GET /events/{id} Get Event
EventsApi get_events GET /events Get list of Events
EventsApi resend_event POST /events/{event_id}/webhook_logs/{webhook_log_id}/resend Resend Event
LogsApi get_log_by_id GET /logs/{id} Get Log
LogsApi get_logs GET /logs Get List Of Logs
OrdersApi cancel_order POST /orders/{id}/cancel Cancel Order
OrdersApi create_order POST /orders Create order
OrdersApi get_order_by_id GET /orders/{id} Get Order
OrdersApi get_orders GET /orders Get a list of Orders
OrdersApi order_cancel_refund DELETE /orders/{id}/refunds/{refund_id} Cancel Refund
OrdersApi order_refund POST /orders/{id}/refunds Refund Order
OrdersApi orders_create_capture POST /orders/{id}/capture Capture Order
OrdersApi update_order PUT /orders/{id} Update Order
PaymentLinkApi cancel_checkout PUT /checkouts/{id}/cancel Cancel Payment Link
PaymentLinkApi create_checkout POST /checkouts Create Unique Payment Link
PaymentLinkApi email_checkout POST /checkouts/{id}/email Send an email
PaymentLinkApi get_checkout GET /checkouts/{id} Get a payment link by ID
PaymentLinkApi get_checkouts GET /checkouts Get a list of payment links
PaymentLinkApi sms_checkout POST /checkouts/{id}/sms Send an sms
PaymentMethodsApi create_customer_payment_methods POST /customers/{id}/payment_sources Create Payment Method
PaymentMethodsApi delete_customer_payment_methods DELETE /customers/{id}/payment_sources/{payment_method_id} Delete Payment Method
PaymentMethodsApi get_customer_payment_methods GET /customers/{id}/payment_sources Get Payment Methods
PaymentMethodsApi update_customer_payment_methods PUT /customers/{id}/payment_sources/{payment_method_id} Update Payment Method
PayoutOrdersApi create_payout_order POST /payout_orders Create payout order
PayoutOrdersApi get_payout_order_by_id GET /payout_orders/{id} Get Payout Order
PayoutOrdersApi get_payout_orders GET /payout_orders Get a list of Payout Orders
PlansApi create_plan POST /plans Create Plan
PlansApi delete_plan DELETE /plans/{id} Delete Plan
PlansApi get_plan GET /plans/{id} Get Plan
PlansApi get_plans GET /plans Get A List of Plans
PlansApi update_plan PUT /plans/{id} Update Plan
ProductsApi orders_create_product POST /orders/{id}/line_items Create Product
ProductsApi orders_delete_product DELETE /orders/{id}/line_items/{line_item_id} Delete Product
ProductsApi orders_update_product PUT /orders/{id}/line_items/{line_item_id} Update Product
ShippingContactsApi create_customer_shipping_contacts POST /customers/{id}/shipping_contacts Create a shipping contacts
ShippingContactsApi delete_customer_shipping_contacts DELETE /customers/{id}/shipping_contacts/{shipping_contacts_id} Delete shipping contacts
ShippingContactsApi update_customer_shipping_contacts PUT /customers/{id}/shipping_contacts/{shipping_contacts_id} Update shipping contacts
ShippingsApi orders_create_shipping POST /orders/{id}/shipping_lines Create Shipping
ShippingsApi orders_delete_shipping DELETE /orders/{id}/shipping_lines/{shipping_id} Delete Shipping
ShippingsApi orders_update_shipping PUT /orders/{id}/shipping_lines/{shipping_id} Update Shipping
SubscriptionsApi cancel_subscription POST /customers/{id}/subscription/cancel Cancel Subscription
SubscriptionsApi create_subscription POST /customers/{id}/subscription Create Subscription
SubscriptionsApi get_all_events_from_subscription GET /customers/{id}/subscription/events Get Events By Subscription
SubscriptionsApi get_subscription GET /customers/{id}/subscription Get Subscription
SubscriptionsApi pause_subscription POST /customers/{id}/subscription/pause Pause Subscription
SubscriptionsApi resume_subscription POST /customers/{id}/subscription/resume Resume Subscription
SubscriptionsApi update_subscription PUT /customers/{id}/subscription Update Subscription
TaxesApi orders_create_taxes POST /orders/{id}/tax_lines Create Tax
TaxesApi orders_delete_taxes DELETE /orders/{id}/tax_lines/{tax_id} Delete Tax
TaxesApi orders_update_taxes PUT /orders/{id}/tax_lines/{tax_id} Update Tax
TokensApi create_token POST /tokens Create Token
TransactionsApi get_transaction GET /transactions/{id} Get transaction
TransactionsApi get_transactions GET /transactions Get List transactions
TransfersApi get_transfer GET /transfers/{id} Get Transfer
TransfersApi get_transfers GET /transfers Get a list of transfers
WebhookKeysApi create_webhook_key POST /webhook_keys Create Webhook Key
WebhookKeysApi delete_webhook_key DELETE /webhook_keys/{id} Delete Webhook key
WebhookKeysApi get_webhook_key GET /webhook_keys/{id} Get Webhook Key
WebhookKeysApi get_webhook_keys GET /webhook_keys Get List of Webhook Keys
WebhookKeysApi update_webhook_key PUT /webhook_keys/{id} Update Webhook Key
WebhooksApi create_webhook POST /webhooks Create Webhook
WebhooksApi delete_webhook DELETE /webhooks/{id} Delete Webhook
WebhooksApi get_webhook GET /webhooks/{id} Get Webhook
WebhooksApi get_webhooks GET /webhooks Get List of Webhooks
WebhooksApi test_webhook POST /webhooks/{id}/test Test Webhook
WebhooksApi update_webhook PUT /webhooks/{id} Update Webhook

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication

Author

[email protected]

conekta-.net's People

Contributors

andreasantillana avatar dependabot[bot] avatar fcarrero avatar hectorgool avatar jakumx avatar janee avatar julsdelatierra avatar leofischer avatar luiscarlos-gonzalez avatar mauroarcet avatar richpeniche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

conekta-.net's Issues

The token has already been used

Hi! i have a problem when a make a charge,this show me this error:

"The token has already been used"
"La tarjeta no pudo ser procesada"

when i do this with a test token this works fine but when i do it with another token this don´t work, this is my implementation.

    bool band = true;
    Order order;
    Expression<Func<Usuario, bool>> exp = (x) => x.IdUsuario == IdUsuario;
    UsuarioLoader uLoader = new UsuarioLoader();
    var usuario = uLoader.GetElementByProperty(exp);
    try
    {
        
        order = new conekta.Order().create(@"{
          ""currency"":""MXN"",
          ""customer_info"": {
            ""customer_id"": """+usuario.TokenConekta+@""" 
          },
          ""line_items"": [{
            ""name"": ""Cobro Union"",
            ""unit_price"": 1000,
            ""quantity"": 1
          }],
          ""charges"": [{
            ""payment_method"": {
               ""type"": ""card"",
                ""token_id"": """+tokenTarjeta+@"""
            },""amount"":1000
          }]
        }");

    }
    catch (ConektaException e)
    {
        band = false;
        foreach (JObject obj in e.details)
        {
            System.Console.WriteLine("\n [ERROR]:\n");
            System.Console.WriteLine("message:\t" + obj.GetValue("message"));
            System.Console.WriteLine("debug:\t" + obj.GetValue("debug_message"));
            System.Console.WriteLine("code:\t" + obj.GetValue("code"));
        }
    }

SendFailure ó ProtocolError

Bajé la úlitma versión y al hacer la prueba de crear un customer con el ApiKey que vienen por default funciona bien, pero si pones uno tuyo, marca ProtocolError, comenté la línea: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; en Requestor.cs, pero ahora manda SendFailure.

¿Cómo lo puedo arreglar?

Falta campo clabe en clase charge

Hola que tal. Estamos usando la clase Charge de Conekta y al generar la referencia para spei, no existe un campo llamado clabe en la clase Charge del sdk.

var conektaCharge = new Charge().toClass(jObject.ToString());
Respuesta de sdk conekta
image

clase actual de conekta_dot_net v1.1.0
image

Al crear un pedido, no permite procesarlo

Al crear un pedido, no permite procesarlo.

{
"details": [
{
"debug_message": "The "shipping_lines" is missing.",
"message": "El parametro "shipping_lines" es requerido.",
"param": "shipping_lines",
"code": "conekta.errors.parameter_validation.shipping_lines.missing"
}
],
"object": "error",
"type": "parameter_validation_error",
"log_id": "5a1f0d50b795b078f2d0e73e"
}

shipping_lines ese campo es opcional

image

Buscar Orden por referencia

Hay un método para buscar una Orden mandando como parámetro la Referencia de un pago offline? (Oxxo Pay)

parameter_validation_error

Al crear una orden, el retorno de la petición es un error con "parameter_validation_error". Hace un par de meses funcionaba, ahora que retomé el desarrollo no lo hace más (sobre sandbox).
Esta es la petición:
{
"line_items": [
{
"name": "Estacionario ",
"unit_price": 50000,
"quantity": 1
}
],
"shipping_lines": [
{
"amount": 0,
"carrier": "No Aplica",
"method": "No Aplica",
"metadata": {
"random_key": "No Aplica"
}
}
],
"customer_info": {
"name": "Jesús Martínez",
"phone": "4524176759",
"email": "[email protected]",
"corporate": false,
"vertical_info": {}
},
"shipping_contact": {
"phone": "4524176759",
"receiver": "Jesús Martínez",
"between_streets": "casa naranja ",
"address": {
"street1": "Mil cumbres",
"state": "Chihuahua/Ojinaga",
"country": "MX",
"postal_code": "60160",
"metadata": {
"soft_validations": true
}
}
},
"charges": [
{
"payment_method": {
"type": "card",
"token_id": "tok_test_mastercard_4444"
},
"amount": 50000
}
],
"currency": "mxn"
}

En en el detalle de la excepción, me menciona que: "The order amount does not match with the sum of charges amounts". Pero siempre he manejado un campo "amount", cambió el API?
Gracias por adelantado.

Implement call to void order resource

The .net library doesn't include a call to the void resource needed to cancel a pre-authorized order.

The java and nodejs versions added this endpoint as seen here and here I could submit the code if you are open to pull requests just let me know 👍

Shipment is needed for physical goods

Cuando hago el llamado de prueba que existe en Tests.cs para hacer un cargo me regresa el siguiente error:

Conekta API Implementation Error (422 - 422) :: {"object":"error","type":"parameter_validation_error","message":"Shipment is needed for physical goods.","message_to_purchaser":"El campo de shipment es obligatorio para productos f??sicos.","param":null,"code":"parameter_validation"}

Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código. 

Detalles de la excepción: System.Exception: Conekta API Implementation Error (422 - 422) :: {"object":"error","type":"parameter_validation_error","message":"Shipment is needed for physical goods.","message_to_purchaser":"El campo de shipment es obligatorio para productos f??sicos.","param":null,"code":"parameter_validation"}

Error de código fuente: 


Línea 51:                      string responseText = reader.ReadToEnd();
Línea 52: 
Línea 53:                      throw new Exception ("Conekta API Implementation Error (" + (int)httpResponse.StatusCode + " - " + httpResponse.StatusCode + ") :: " + responseText);
Línea 54:                  }
Línea 55:              }

Archivo de origen: C:\Users\Yushell\Documents\Github\Repos\conekta-.net\src\conekta\conekta\Base\Requestor.cs    Línea: 53 

Seguimiento de la pila: 


[Exception: Conekta API Implementation Error (422 - 422) :: {"object":"error","type":"parameter_validation_error","message":"Shipment is needed for physical goods.","message_to_purchaser":"El campo de shipment es obligatorio para productos f??sicos.","param":null,"code":"parameter_validation"}]
   conekta.Requestor.request(String method, String resource_uri, String data) in C:\Users\Yushell\Documents\Github\Repos\conekta-.net\src\conekta\conekta\Base\Requestor.cs:53
   conekta.Resource.create(String resource_uri, String data) in C:\Users\Yushell\Documents\Github\Repos\conekta-.net\src\conekta\conekta\Base\Resource.cs:41
   conekta.Charge.create(String data) in C:\Users\Yushell\Documents\Github\Repos\conekta-.net\src\conekta\conekta\Models\Charge.cs:30
   Payments.Card.ChargeCard(String token) in c:\users\yushell\documents\visual studio 2015\Projects\Payments\Payments\Card.aspx.cs:24
   Payments.Card.Page_Load(Object sender, EventArgs e) in c:\users\yushell\documents\visual studio 2015\Projects\Payments\Payments\Card.aspx.cs:15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2952

Se supone que ese es el llamado correcto para productos digitales. Por que sale ese error?

Async/wait methods

Hi everyone, I dont see every codes of the lib yet but, the library do has methods non blocking?

I have methods for create costumers from api rest but this methods are non blocking, I decided to change the api rest raw for this lib, but I see that for example: Customer customer = new conekta.Customer().create is bloking, then my fastest solution at the moment is it:

await Task.Run(
                () => {

                    customer = new conekta.Customer().create(json);

                });

is not elegant by I need using await by standardize, In the future you add this type method?

if not maybe I can help you with it :p

Order support

Support Conekta /Orders support

  • refund
  • capture
  • create
  • find
  • where

Unprocessable Entity.

Estoy tratando de configurar en un nuevo proyecto la opcion de Oxxo PAY.
Usando el ejemplo de la documentacion.
conekta.Order order = new conekta.Order ().create(@"{
""line_items"": [{
""name"": ""Tacos"",
""unit_price"": 1000,
""quantity"": 12
}],
""shipping_lines"": [{
""amount"": 1500,
""carrier"": ""FEDEX""
}]," + //shipping_lines - physical goods only
@"""currency"": ""MXN"",
""customer_info"": {
""name"": ""Fulanito Pérez"",
""email"": ""[email protected]"",
""phone"": ""+5218181818181""
},
""shipping_contact"":{
""address"": {
""street1"": ""Calle 123, int 2"",
""postal_code"": ""06100"",
""country"": ""MX""
}
}," + //shipping_contact - required only for physical goods only
@"""charges"":[{
""payment_method"": {
""type"": ""oxxo_cash"",
""expires_at"": " + thirtyDaysFromNow + @"
}
}]
}");

Pero siempre devuelve.
Remote server returned an error: (422) Unprocessable Entity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.