mkhairi / billplz-api Goto Github PK
View Code? Open in Web Editor NEWbillplz api for ruby
License: MIT License
billplz api for ruby
License: MIT License
This code below is taken from documentation, it imply that bill will be created based on given collection id:
bill = Billplz::Bill.create(collection_id: "ajij091j", email: "[email protected]", name:"Admin BillPlz", amount: 200, callback_url: "billplz.com", description: "Shopping Items")
the bug probably coming from the code below in bills.rb
def replace_body(name, request)
if name == :create
#add collection id here
request.post_params = request.post_params.merge(collection_id: "#{ENV['BILLPLZ_COLLECTION_ID']}")
request.body = request.post_params.to_json
end
end
collection = Billplz::Collection.find("collectionidhere")
returned
Flexirest::Base Base URL set to be https://billplz.com/api/v3
Flexirest Billplz::Collection:/collections/collectionidhere - Trying to read from cache
Flexirest Billplz::Collection#find - Requesting https://billplz.com/api/v3/collections/collectionidhere
Flexirest (1131.7ms) Billplz::Collection#find
Flexirest::ResponseParseException: Flexirest::ResponseParseException
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/request.rb:418:in `handle_response'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/request.rb:213:in `block (2 levels) in call'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:57:in `on_complete'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/request.rb:194:in `block in call'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/notifications.rb:164:in `instrument'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/request.rb:150:in `call'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/mapping.rb:46:in `_call'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/flexirest-1.3.33/lib/flexirest/mapping.rb:28:in `block in _map_call'
from (irb):1
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/console.rb:65:in `start'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/console_helper.rb:9:in `start'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:78:in `console'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Hi,
Not really an actual issue but, is there a way to automatically remove unused bill?
There are two scenario for example:
I am trying to install gem using bundler. I setup the initializers. and I got errors as below.
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:94:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'billplz-api'. (Bundler::GemRequireError) Gem Load Error is: uninitialized constant Billplz::Flexirest Backtrace for gem load error is: /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/billplz-api-0.1.0/lib/billplz/model.rb:2:in
module:Billplz'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/billplz-api-0.1.0/lib/billplz/model.rb:1:in <top (required)>' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/billplz-api-0.1.0/lib/billplz-api.rb:8:in
<top (required)>'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:91:in require' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:91:in
block (2 levels) in require'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in each' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:86:in
block in require'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in each' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:75:in
require'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.14.5/lib/bundler.rb:107:in require' /home/bantu-hakim/Workspace/Bantu/ProjectAPI/config/application.rb:17:in
<top (required)>'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in require' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in
require_application_and_environment!'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:77:in console' /home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in
run_command!'
/home/bantu-hakim/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in <top (required)>' bin/rails:4:in
require'
bin/rails:4:in `
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.