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-openpay-mx

v0.1.4

Published

Package that allows us to connect to OpenPay Mexico and make use of the following resources.

Downloads

16

Readme

Features

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

Installation

$ npm install connector-openpay-mx

Basic

The ctx (context) you assign can be sandbox or production in case of not sending it, the default ctx (context) is sandbox to make the connection to OpenPay Mexico.
The merchant is an object to which the id, private_key, public_key of the OpenPay Mexico merchant must be sent.

Examples

Get Merchant


const OpenpayMX = require('connector-openpay-mx');

const merchant = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
};

OpenPayMx.getMerchant(merchant).then(resolve => {
    //..
});

Create Customer


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customer: {
        external_id: "0f29d777-8fe8-4891-99e6-00",
        name: "Quiniela King",
        email: "[email protected]",
        requires_account: false,
        phone_number: "3321594848"
    }
}

OpenPayMx.createCustomer(params).then(resolve => {
    //..
});

Update Customer


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    customer : {
        name: "Paco",
        email: "[email protected]",
        phone_number: "3325414963"
    }
}

OpenPayMx.updateCustomer(params).then(resolve => {
    //..
});

Get Customer


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr"
}

OpenPayMx.getCustomer(params).then(resolve => {
    //..
});

Get Customers


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    searchParams: {
        limit : 10
    }
}

OpenPayMx.getCustomers(params).then(resolve => {
    //..
});

Delete Customer


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "ap7xkc6i9gfbr1dciq0k"
}

OpenPayMx.deleteCustomer(params).then(resolve => {
    //..
});

Create Bank Account


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "ap7xkc6i9gfbr1dciq0k",
    bankAccount: {
        clabe : "032180000118359719",
        alias : "Cuenta principal",
        holder_name : "Juan Hernández Sánchez"
    }
}

OpenPayMx.createBankAccount(params).then(resolve => {
    //..
});

Delete Bank Account


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "alq8azwq8njbwijtrlty",
    bankaccountId: "bhsxm0yecxqg42x10zsw"
}

OpenPayMx.deleteBankAccount(params).then(resolve => {
    //..
});

Get Bank Account


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "atxunufmfqpfyoklxten",
    bankaccountId: "bcwktkrrfxbzntzpcd53"
}

OpenPayMx.getBankAccount(params).then(resolve => {
    //..
});

Get Bank Accounts


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "atxunufmfqpfyoklxten"
}

OpenPayMx.getBankAccounts(params).then(resolve => {
    //..
});

Create Card


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "a1a3laf931xnckwbfq8j",
    cardRequest : {
        token_id : "ki6xlyzpyqsskmdwplb7",
        device_session_id : "Mddr8BGbgLQ9VnzkjoUcciAyDOBSfDJf"
    }
}

OpenPayMx.createCard(params).then(resolve => {
    //..
});

Delete Card


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "a1a3laf931xnckwbfq8j",
    cardId: "k8tqzqvwfuhoc3vd7fqe"
}

OpenPayMx.deleteCard(params).then(resolve => {
    //..
});

Get Card


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "ajkq3sxihfoszmbemk48",
    cardId: "kb5k2fdgrty0kybbshh7",
}

OpenPayMx.getCard(params).then(resolve => {
    //..
});

Get Cards


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "ajkq3sxihfoszmbemk47",
    searchParams: {
        limit: 3
    }
}

OpenPayMx.getCards(params).then(resolve => {
    //..
});

Create WebHook


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    webhook: {
        url: "https://requestb.in/11vxrsf1",
        user: "juanito",
        password: "passjuanito",
        event_types: [
            "charge.refunded",
            "charge.failed",
            "charge.cancelled",
            "charge.created",
            "chargeback.accepted"
        ]
    }
}

OpenPayMx.createWebHook(params).then(resolve => {
    //..
});

Delete WebHook


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    webhookId: "wxvanstudf4ssme8khmc"
}

OpenPayMx.deleteWebHook(params).then(resolve => {
    //..
});

Get WebHook


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    webhookId: "wxvanstudf4ssme8khmc"
}

OpenPayMx.getWebHook(params).then(resolve => {
    //..
});

Get WebHooks


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
}

OpenPayMx.getWebHooks(params).then(resolve => {
    //..
});

Create Bank Charge


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    bankChargeRequest: {
        method: "bank_account",
        amount: 100,
        description: "Cargo con banco",
        order_id: "oid-00055"
    }
}

OpenPayMx.createBankCharge(params).then(resolve => {
    //..
});

Create Store Charge


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    storeChargeRequest : {
        method: "store",
        amount: 100,
        description: "Cargo con tienda",
        order_id: "oid-00053",
        due_date: "2014-05-28T13:45:00"
    }
}

OpenPayMx.createStoreCharge(params).then(resolve => {
    //..
});

Create Card Charge


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    chargeRequest : {
        source_id: "kqgykn96i7bcs1wwhvgw",
        method: "card",
        amount: 100,
        currency: "MXN",
        description: "Cargo inicial a mi cuenta",
        order_id: "oid-00051",
        device_session_id: "kR1MiQhz2otdIuUlQkbEyitIqVMiI16f"
    }
}

OpenPayMx.createCardCharge(params).then(resolve => {
    //..
});

Can Confirm Charge


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    transactionId: "tryqihxac3msedn4yxed",
    captureRequest : {
        "amount": 100.00
    }
}

OpenPayMx.canConfirmCharge(params).then(resolve => {
    //..
});

Get Charge


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    transactionId: "tryqihxac3msedn4yxed"
}

OpenPayMx.getCharge(params).then(resolve => {
    //..
});

Create Payment


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    payoutRequest : {
        method: "bank_account",
        destination_id: "b3d54sd3mdjf75udjfvoc",
        amount: 10.50,
        description: "Retiro de saldo semanal",
        order_id: "oid-00021"
    }
}

OpenPayMx.createPayment(params).then(resolve => {
    //..
});

Get Payment


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    transactionId: "tr6cxbcefzatd10guvvw"
}

OpenPayMx.getPayment(params).then(resolve => {
    //..
});

Create Plan


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    planRequest : {
        amount: 150.00,
        status_after_retry: "cancelled",
        retry_times: 2,
        name: "Curso de ingles",
        repeat_unit: "month",
        trial_days: "30",
        repeat_every: "1"
    }
}

OpenPayMx.createPlan(params).then(resolve => {
    //..
});

Get Plan


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    planId: "p8e6x3hafqqsbmnoevrt"
}

OpenPayMx.getPlan(params).then(resolve => {
    //..
});

Get Plans


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    searchParams: {
        limit: 10
    }
}

OpenPayMx.getPlans(params).then(resolve => {
    //..
});

Create Subscription


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    subscriptionRequest : {
        plan_id: "pbi4kb8hpb64x0uud2eb",
        source_id : "kqgykn96i7bcs1wwhvgw",
        trial_end_date: "2020-01-11"
    }
}

OpenPayMx.createSubscription(params).then(resolve => {
    //..
});

Update Subscription


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    subscriptionId: "s0gmyor4yqtyv1miqwr0",
    subscriptionRequest : {
        source_id : "kqgykn96i7bcs1wwhvgw",
        trial_end_date: "2021-01-11"
    }
}

OpenPayMx.updateSubscription(params).then(resolve => {
    //..
});

Delete Subscription


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    subscriptionId: "s0gmyor4yqtyv1miqwr0"
}

OpenPayMx.deleteSubscription(params).then(resolve => {
    //..
});

Get Subscription


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    subscriptionId: "s0gmyor4yqtyv1miqwr0"
}

OpenPayMx.getSubscription(params).then(resolve => {
    //..
});

Get Subscriptions


const OpenpayMX = require('connector-openpay-mx');

const params = {
    ctx: "sandbox",
    merchant: {
        id: "mXXXXXXXXXXXXXXXXXXX",
        private_key: "sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        public_key: "pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    customerId: "axrpe1svywlkfl9w7rhr",
    searchParams : {
        limit: 2
    }
}

OpenPayMx.getSubscriptions(params).then(resolve => {
    //..
});

Official documentation Openpay México

  • Any questions about the use of resources consult the official documentation of Openpay México: https://www.openpay.mx/api/

End