Conekta.net 6.0.14

There is a newer version of this package available.
See the version list below for details.
dotnet add package Conekta.net --version 6.0.14                
NuGet\Install-Package Conekta.net -Version 6.0.14                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Conekta.net" Version="6.0.14" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Conekta.net --version 6.0.14                
#r "nuget: Conekta.net, 6.0.14"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Conekta.net as a Cake Addin
#addin nuget:?package=Conekta.net&version=6.0.14

// Install Conekta.net as a Cake Tool
#tool nuget:?package=Conekta.net&version=6.0.14                

NET api

Conekta .NET API Library

nuget nugetdotnet CI

This is the officially supported .NET library for using Conekta's APIs.

Supported API versions

The library supports all APIs under the following services:

API Description Service Name Supported version
Payments API Our classic integration for online payments. Current supported version Payments API v2.1.0

For more information, refer to our documentation.

Prerequisites

  • Conekta account
  • API key. your API credential .
  • Conekta dotnet API Library supports .net standard 2.0 and above

Installation

Simply download and restore nuget packages https://www.nuget.org/packages/Conekta.net/ or install it from package manager

PM> Install-Package Conekta.net -Version x.x.x

Using the library

In order to submit http request to Conekta API you need to initialize the client. The following example makes a order request:


// Create a OrderRequest
using System;
using System.Collections.Generic;
using Conekta.net.Client;
using Conekta.net.Api;
using Conekta.net.Model;

// create the http client

string acceptLanguage = "en";
Configuration configuration = new()
{
    AccessToken = "Your merchant XAPI key"
};
var ordersApi = new OrdersApi(configuration);
var customerApi = new CustomersApi(config);

// create customer
var customer = new Customer(
    name: "test dot",
    phone: "+573143159063",
    email: "test@conekta.com"
);
CustomerResponse customerResponse = customerApi.CreateCustomer(customer);
// Create OrderRequest

var lineItems = new List<LineItems>{new (
        name: "toshiba",
        quantity: 1,
        unitPrice: 1555
    )};
var charges = new List<ChargeRequest>{new (
    amount: 1555,
    paymentMethod: new ChargeRequestPaymentMethod("cash")
)};
var customerInfo = new OrderRequestCustomerInfo(new CustomerInfoJustCustomerId(customerResponse.Id));
OrderRequest orderRequest = new OrderRequest(
    currency: "MXN",
    customerInfo: customerInfo,
    lineItems: lineItems,
    charges: charges
);
            
//Make the call to the service. This example code makes a call to /orders
OrderResponse response = ordersApi.CreateOrder(orderRequest, acceptLanguage);

Catching exception

Example

using System.Collections.Generic;
using System.Diagnostics;
using Conekta.net.Api;
using Conekta.net.Client;
using Conekta.net.Model;

namespace Example
{
    public class CreatePlanExample
    {
        public static void Main()
        {
            Configuration config = new Configuration( AccessToken = "Your merchant XAPI key");

            var apiInstance = new PlansApi(config);
            var planRequest = new PlanRequest(); // PlanRequest | requested field for plan
            var acceptLanguage = "es";  // string | Use for knowing which language to use (optional)  (default to es)

            try
            {
                // Create Plan
                PlanResponse result = apiInstance.CreatePlan(planRequest, acceptLanguage);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PlansApi.CreatePlan: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Running the tests

Navigate to conekta-.net folder and run the following commands.

dotnet build
dotnet test

Contributing

We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our contributing guidelines to find out how to raise a pull request.

Support

If you have a feature request, or spotted a bug or a technical problem, create an issue here.

For other questions, contact our Support Team.

Licence

This repository is available under the MIT license.

See also

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.15 217 12/12/2024
6.0.14 413 11/12/2024
6.0.13 114 10/25/2024
6.0.12 90 10/25/2024
6.0.11 171 10/14/2024
6.0.10 408 4/24/2024
6.0.9 513 3/26/2024
6.0.8 546 3/11/2024
6.0.7 309 12/13/2023
6.0.6 139 12/12/2023
6.0.5 160 12/7/2023
6.0.4 410 5/29/2023
6.0.3 344 5/16/2023
6.0.2 174 5/12/2023
6.0.1 171 5/10/2023
6.0.0 208 5/4/2023
6.0.0-alpha-3 152 4/14/2023
6.0.0-alpha-2 172 3/29/2023
6.0.0-alpha-1 170 3/24/2023

update entity webhook, nuget config