Skip to content

paveltyk/bepaid_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BepaidEx - Elixir Library for bePaid payment processing gateway

CircleCI Hex.pm Hex.pm

The BepaidEx Elixir library provides convenient access to the bePaid API from applications written in the Elixir language.

Installation

Add bepaid_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:bepaid_ex, "~> 0.9.0"}
  ]
end

Update your dependencies:

$ mix deps.get

Configuration

BepaidEx requires certain properties to be configured.

In order to load ENV vars at runtime, use {:system, ENV_VAR_NAME} notation. Please note ENV vars have to be set prior app loading: export BEPAID_SHOP_ID=123...

config :bepaid_ex,
  shop_id: {:system, "BEPAID_SHOP_ID"},
  key_secret: {:system, "BEPAID_KEY_SECRET"}

Otherwise you can set constant values via binaries:

config :bepaid_ex,
  shop_id: "BEPAID_SHOP_ID_HERE",
  key_secret: "BEPAID_KEY_SECRET_HERE"

Usage example:

alias Bepaid.{Gateway, Payment}

%Payment{amount: 100, description: "Test payment", test: true}
|> Payment.set_tracking_id()
|> Payment.update_customer(%{ip: "127.0.0.1"})
|> Payment.update_credit_card(%{token: "TOKEN"})
|> Bepaid.put_charge()

Links

License

Parameterize is released under MIT license.

About

The Elixir library for bePaid API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages