Recurrente

A Wrapper to interact with the Payment Gateway Recurrente.

Definition

Namespace: Tipi.Tools.Payments

Assembly: Tipi.Tools.Payments.dll

Package: Tipi.Tools.Recurrente

This class lets you interact with Recurrente's API.

Copied!

                
    RecurrenteOptions options = new RecurrenteOptions("PUBLIC_KEY", "PRIVATE_KEY");
    Recurrente = new Recurrente(options);
                
            
Dependency Injection

You can implement this class with a .Net Core app by injecting it on your Program.cs file.

Copied!

                
    using Tipi.Tools.Payments.Config;
    ...
    var builder = WebApplication.CreateBuilder(args);
    ...
    // Inject the Payment Processor
    builder.Services.ConfigureRecurrentePaymentGateway("PUBLIC_KEY", "PRIVATE_KEY"); // It is good practice to inject your keys from the Secrets.json
                
            
Controller Example

Here is an example of how to use the class in a controller.

Copied!

                
    using Tipi.Toolkit;
    ...
    public class  CheckoutController : Controller
    {
        // Define your private property
        private readonly IRecurrente _recurrente;
        ...
        public CheckoutController(IRecurrente recurrente)
        {
            _recurrente = recurrente;
        }
    }
                
            
Usage Example

Here is an example of the complete usage of the class.

Copied!

                
    // Create a new customer, this returns the Client Id
    var clientId = await _recurrente.CreateClientAsync("CLIENT_NAME", "CLIENT_EMAIL");
    
    // Create a new checkout, this will return you the checkout url
    var checkoutUrl = await _recurrente.CreateCheckoutAsync(clientId, "PRODUCT_ID");
                
            
Remarks

The Recurrente class is a wrapper to communicate with the API from Recurrente, this wrapper counts with all the necessary Methods that serve as the available API Endpoints

The class has a contructure that require you to pass two parameters, one for your public key and other for your provate key, you can obtain bothe keys from the Recurrente Web Portal. This class can work with the .Net Framework Dependency Injection, by providing methods to work in that way. All of the Method calls can be awaited and are thread safe

Constructors

Create an instance of Recurrente class, takin as parameter a new object of type RecurrenteOptions

Methods

Create a checkout based on a UserId and a PriceId.

Create a checkout based on PriceId.

Gets a specific Checkout object by it's Id.

Creates a new product, this is configured to work as a single time payment product.

Retrieves an existing product, this is configured to work as a single time payment product.

Creates a new subscription, this is configured to work as a recurring payment product.

Retrieves an existing subscription, this is configured to work as a recurring payment product.

Deletes a product or subscription by its Product Id.

Create a new customer, it requires a name and an email, if the customer already exist it will only return the the Id for that customer.

Retrieves an active subscription by it's Id.

Retrieves an user payment method by providing the checkout Id for that transaction.

Related Classes

Class used as parameter in order to initialize the Recurrente class.

Class used as return value for the CreateCheckoutAsync method.

Class used as return value for the CreateProductAsync method.

Class used a single charge price for a product.

Class used as return value for the CreateSubscriptionAsync method.

Class used a recurring charge price for a product.

Class used as return value for the GetActiveSubscriptionAsync method.

Class used to represent the user's saved Payment method.

Class used to represent a saved debit or credit Card.

Enums

Enum containing the Supported Currencies.

Enum containing the Supported Billing Interval Measurment Units.

Enum containing the Supported field requirement Values.