Recurrente Methods

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.

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 client, it requires a name and an email, if the client already exist it will only return the the Id for that client.

Retrieves an active subscription by it's Id.

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

CreateCheckoutAsync(String, String)

Create a checkout based on a UserId and a PriceId and returns the a Checkout object, this method is awaitable.

Copied!

                    
    // Create a new checkout, this will return you a Checkout Object
    var checkout = await _recurrente.CreateCheckoutAsync("CLIENT_ID", "PRICE_ID");
                    
                
CreateCheckoutAsync(String, String)

Create a checkout based on a PriceId and returns the a Checkout object, this method is awaitable.

Copied!

                    
    // Create a new checkout, this will return you a Checkout Object
    var checkout = await _recurrente.CreateCheckoutAsync("PRICE_ID");
                    
                
GetCheckoutAsync(String)

Returns a Checkout object, this method is awaitable.

Copied!

                    
    // Retrieves an existing Checkout
    var checkout = await _recurrente.GetCheckoutAsync("CHECKOUT_ID");
                    
                
CreateProductAsync(Product)

Create a new product, It takes as parameter a Product object, and returns another Product with Id and Price Id

Copied!

                    
    // Create a new Product
    var product = new Product(new SinglePrice()
        {
            Amount = 302.55,          
            Currency = Currency.GTQ          
         }); 
    // Add Product Fields   
    product.Name = "My Name";   
    ...   

    product = await _recurrente.CreateProductAsync(product);
                    
                
GetProductAsync(String)

Retrieves an exisiting product taking as parameter it's product Id and return a Product Object.

Copied!

                    
    // Retrieves a Product
    var product = await _recurrente.GetProductAsync("PRODUCT_ID");
                    
                
CreateSubscriptionAsync(Subscription)

Create a new subscription, It takes as parameter a Subscription object, and returns another Subscription with Id and Price Id

Copied!

                    
    // Create a new Subscription
    var subscription = new Subscription(new RecurringPrice()
        {
            Amount = 302.55,          
            Currency = Currency.GTQ                
            Interval = BillingInterval.Month         
            IntervalCount = 1        
         }); 
    // Add Subscription Fields   
    subscription.Name = "My Name";   
    ... 
    
    // Optional: Add Free Trial 
    subscription.SetFreeTrial(BillingInterval.Month, 1)

    subscription = await _recurrente.CreateSubscriptionAsync(subscription);
                    
                
GetSubscriptionAsync(String)

Retrieves an exisiting subscription taking as parameter it's subscription Id and return a Subscription Object.

Copied!

                    
    // Retrieves a Subscription
    var subscription = await _recurrente.GetSubscriptionAsync("PRODUCT_ID");
                    
                
DeleteItemAsync(String)

Deletes an object of type Subscription or type Product from its Product Id, return True if the object was correctly deleted.

Copied!

                    
    // Delete a product or subscription
    var result = await _recurrente.DeleteItemAsync("PRODUCT_ID");
                    
                
CreateClientAsync(String, String)

Create a new client, it requires a name and an email, if the client already exist it will only return the the Id for that client, this method is awaitable.

Copied!

                    
    // Create a new client, this returns the Client Id
    var clientId = await _recurrente.CreateClientAsync("CLIENT_NAME", "CLIENT_EMAIL");
                    
                
GetActiveSubscriptionAsync(String)

Gets an Active Subscription by it's Id, ir returns an object of type ActiveSubscription, this method is awaitable.

Copied!

                    
    // Gets an active subscription
    var subscription = await _recurrente.GetActiveSubscriptionAsync("ACTIVE_SUBSCRIPTION_ID");
                    
                
GetPaymentMethodAsync(String)

Gets Payment Method by its Checkout Id, ir returns an object of type PaymentMethod, this method is awaitable.

Copied!

                    
    // Gets an payment method
    var paymentMethod = await _recurrente.GetPaymentMethodAsync("CHECKOUT_ID");