- Notifications
You must be signed in to change notification settings - Fork13
Elixir library for Conekta api calls
License
altyaper/conekta-elixir
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Wrapper to connect withhttps://api.conekta.io.
Add Conekta to yourmix.exs
dependencies:
#mix.exsdefpdepsdo[#If you have trouble with poison add#{:poison, "~> 3.1", override: true}{:conekta,"~> 1.0"}]end
Add your keys in yourconfig.exs
file
# config.exsconfig:conekta,publickey:"YOUR-PUBLIC-KEY",privatekey:"YOUR-PRIVATE-KEY"
Get all current customers
#Get the lastConekta.Customers.customers()
Create a customer by passing a%Conekta.Customer{}
struct
#Create a new customer mapnew_customer=%Customer{name:"Fake Name",email:"fake@email.com",corporate:true,payment_sources:[%{token_id:"tok_test_visa_4242",type:"card"}]}#Create a new customerConekta.Customers.create(new_customer)
Find a customer by passing the unique ID
Conekta.Customers.find(id)
Delete a customer by passing the unique ID
Conekta.Customers.delete(id)
Conekta.Orders.orders()
#Create a new order mapnew_order=%Order{currency:"MXN",customer_info:%{customer_id:content.id},line_items:[%{name:"Product 1",unit_price:35000,quantity:1}],charges:[%{payment_method:%{type:"default"}}]}#Create an orderresponse=Conekta.Orders.create(new_order)
Helper function for webhook handling.check possible events
caseConekta.WebHook.received(params)do{:charge_created,struct}->...{:charge_paid,struct}->...{:plan_created,struct}->...{:customer_created,struct}->...{:subscription_created,struct}->...{:subscription_paid,struct}->...{:subscription_canceled,struct}->...{:chargeback_created,struct}->...{:chargeback_lost,struct}->...end
If you want to add something new, make sure all the tests pass before making a PR
mixtest
I would love to check new contributions to this repository.Fork fromdev and do a PR intodev again.
Available withMIT License.
About
Elixir library for Conekta api calls
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.