GithubHelp home page GithubHelp logo

conekta.js's Introduction

A simple library to process payments.

Before you get started, you will need to create an account on https://admin.conekta.io.  After creating and activating your company, you will have access to a set of keys (https://admin.conekta.io#developer.keys) which will allow you to begin processing payments.  To get started, include conekta.js (https://s3.amazonaws.com/conektaapi/v0.2.0/js/conekta.js) on your page and set your public keys:

    Conekta.setPublishableKey('xxxxxxxxxxxxxxxx');


To start processing credit cards do this:

    Conekta.charge.new({
      amount:10000,
      currency:'MXN',
      description:'Double-black belt'
      card:{
        name:'Bruce Lee',
        number:'4111111111111111',
        exp_year:'12',
        exp_month:'04',
        cvv:'123',
      }
    },
    function(charge){
      alert('Success!');
    },
    function(response){
      alert('Fail!');
    }
    );

For oxxo:

    Conekta.charge.new(
        {
          amount:10000,
          currency:'MXN',
          description:'Double-black belt'
          cash:{
            type:'oxxo'
          }
        }, 
        function(charge){
            $('#my-oxxo-barcode-tag').attr('src', charge.payment_method.barcode_url);
        },
        function(error){
            alert('Fail!');
        }
    );

For bank_transfers:

    Conekta.charge.new(
        {
          amount:10000,
          currency:'MXN',
          description:'Double-black belt'
          bank:{
            type:'banorte'
          }
        }, 
        function(charge){
            $('#my-bank-transfer-bank-name-tag').attr('src', charge.payment_method.bank);
            $('#my-bank-transfer-service-name-tag').attr('src', charge.payment_method.service_name);
            $('#my-bank-transfer-service-id-tag').attr('src', charge.payment_method.service_id);
            $('#my-bank-transfer-reference-tag').attr('src', charge.payment_method.reference);
        },
        function(error){
            alert('Fail!');
        }
    );

conekta.js's People

Contributors

leofischer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.