Skip to content

Instantly share code, notes, and snippets.

@breim
Created March 7, 2015 05:25
Show Gist options
  • Select an option

  • Save breim/6a59a29a404ec8354561 to your computer and use it in GitHub Desktop.

Select an option

Save breim/6a59a29a404ec8354561 to your computer and use it in GitHub Desktop.

Bcash example for friend

An simple example

How to use ?

Create database, migration and popule database

$ rake db:create && rake db:migrate && rake db:seeds

You need seed

app/controllers/items_controller.rb

check action in controller called payment

    items = []
    items << Bcash::Item.new(id: @item.id, description: @item.name, amount: 1, price: @item.price)
    package = Bcash::Package.create(items, 0 ,Bcash::PAD, url_retorno: 'http://meu-site.com.br') # O zero representa o valor do frete,altere o valor de acordo com sua necessidade
    @payment = Bcash::Payment.new(package, email_loja: 'leiarf@gmail.com')

check VIEW in app/controllers/views/items/payment.html.erb

Bye bye, good luck! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment