npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

connector-conekta

v1.5.0

Published

Servicio para consumir los recursos de la pasarela de pagos CONEKTA

Downloads

28

Readme

Features

  • Package that allows us to connect to Conekta and make use of the following resources.

Installation

$ npm install connector-conekta

Basic

Connector to use CONKETA's customer service, orders, webhooks, plans and subscriptions.

Examples

Create Customer


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const customer = {
    "name": "Fulanito Mengano",
    "email": "[email protected]",
    "phone": "520000000000"
};

ConektaServices.Customer.create({ apiKeys, customer }).then(resolve => {
    //..
});

Get Customer


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const customer = "cus_54FDl0sf4d74F"

ConektaServices.Customer.get({ apiKeys, customer }).then(resolve => {
    //..
});

Create Webhook


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const webhook = {
    "url": "https://www.google.coom",
    "synchronous": false
};

ConektaServices.Webhook.create({ apiKeys, webhook }).then(resolve => {
    //..
});

Get Webhook


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const webhook = "web_G45fdg54Fgh4Hj4hg"

ConektaServices.Webhook.get({ apiKeys, webhook }).then(resolve => {
    //..
});

Get All Webhook


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

ConektaServices.Webhook.all({ apiKeys }).then(resolve => {
    //..
});

Delete Webhook


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const webhook = "web_G45fdg54Fgh4Hj4hg";

ConektaServices.Webhook.delete({ apiKeys, webhook }).then(resolve => {
    //..
});

Create Order by SPEI


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const order = {
    "customer_info": "cus_zzmpLsnM1oayuCwV7",
    "line_items": [
        {
            "unit_price": 25000
        }
    ],
    "charges": {
        "type": "spei",
        "reference_id": "tr454SDsa45sdDS8",
        "expires_at": "2022-12-30 23:59:59"
};

ConektaServices.Order.create({ apiKeys, order }).then(resolve => {
    //..
});

Create Order by CASH


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const order = {
    "customer_info": "cus_zzmpLsnM1oayuCwV7",
    "line_items": [
        {
            "unit_price": 25000
        }
    ],
    "charges": {
        "type": "oxxo_cash",
        "reference_id": "tr454SDsa45sdDS8",
        "expires_at": "2022-12-30 23:59:59"
};

ConektaServices.Order.create({ apiKeys, order }).then(resolve => {
    //..
});

Create Order by CARD


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const order = {
    "customer_info": "cus_zzmpLsnM1oayuCwV7",
    "line_items": [
        {
            "unit_price": 158050
        }
    ],
    "charges": {
        "type": "card",
        "token": "tok_test_visa_4242",
        "reference_id": "tr454SDsa45sdDS8",
        "expires_at": "2022-12-30 23:59:59"
};

ConektaServices.Order.create({ apiKeys, order }).then(resolve => {
    //..
});

Create Plan


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const plan = {
    "id": "Plan-12345",
    "name": "Annual plan",
    "amount": 150.00,
    "interval": "year",
    "frequency": 1,
    "trial_days": 30,
    "expiry_count": "12"
};

ConektaServices.Plan.create({ apiKeys, plan }).then(resolve => {
    //..
});

Get Plan


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const plan = "Plan-12345";

ConektaServices.Plan.get({ apiKeys, plan }).then(resolve => {
    //..
});

Get All Plans


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

ConektaServices.Plan.all({ apiKeys }).then(resolve => {
    //..
});

Create Subscription


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const subscription = {
    "customer_id": "cus_2swgCXBfKRPXFmzWe",
    "card_id": "src_2swgCXQXtsDTaEu8F",
    "plan_id": "Plan-1670255300"
};

ConektaServices.Subscription.create({ apiKeys, subscription }).then(resolve => {
    //..
});

Update Subscription


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const subscription = {
    "customer_id": "cus_2swgCXBfKRPXFmzWe",
    "card_id": "src_2swgCXQXtsDTaEu0X",
    "plan_id": "Plan-1670255389"
};

ConektaServices.Subscription.update({ apiKeys, subscription }).then(resolve => {
    //..
});

Cancel Subscription


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const subscription = {
    "customer_id": "cus_2swgCXBfKRPXFmzWe"
};

ConektaServices.Subscription.cancel({ apiKeys, subscription }).then(resolve => {
    //..
});

Create Empty Card Token


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const token = {
	"checkout": {
		"returns_control_on": "Token"
	}
};

ConektaServices.Card.createToken({ apiKeys, token }).then(resolve => {
    //..
});

Create Card


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const card = {
    "customer_id": "cus_2swgCXBfKRPXFmzWe",
    "type": "card",
    "token_id": "tok_2syGE69YFkHe1Ed5d"
};

ConektaServices.Card.create({ apiKeys, card }).then(resolve => {
    //..
});

Delete Existing Card


const ConektaServices = require("connector-conekta");

const apiKeys = {
    "publicKey": "key_XXXXXXXXXXXXXXXXXXXXXXX",
    "privateKey": "key_XXXXXXXXXXXXXXXXXXXXXXX"
};

const card = {
    "customer_id": "cus_2swgCXBfKRPXFmzWe",
    "card_id": "src_2swgCXQXtsDTaEu8F"
};

ConektaServices.Card.cancel({ apiKeys, card }).then(resolve => {
    //..
});