-
Notifications
You must be signed in to change notification settings - Fork 17
Simple payment calls
License
Enriquevg/conekta.js
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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!'); } );
About
Simple payment calls