Giter Club home page Giter Club logo

billplz-api's Introduction

billplz-api's People

Contributors

fathiabdulrahim avatar jarrettyew avatar mkhairi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

billplz-api's Issues

Bill creation take from environment variable instead of parameters

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

Finding collection return Flexirest::ResponseParseException

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>'

Deleting expired bill

Hi,

Not really an actual issue but, is there a way to automatically remove unused bill?
There are two scenario for example:

  1. Bill is expired.
  2. User close the window during checkout process

Failure to bundle install the gem

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 `

'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.