getlago / lago-ruby-client Goto Github PK
View Code? Open in Web Editor NEWRuby wrapper for the Lago Rest API
License: MIT License
Ruby wrapper for the Lago Rest API
License: MIT License
All non pre version from Rubygems was removed.
Why this removal ?
Can you get back ?
Thanks
Plans - CRUD
Coupons - CRUD
Add-ons - CRUD
Invoice - read, list all
Organization - update
Describe the bug
A clear and concise description of what the bug is.
In Readme.md, we read that this client is licensed under the MIT license. This is also reflected in (License copy) in the repository. However, in the Gemspec, and in the LICENSE file, we read that the gem is AGPL licensed.
To Reproduce
Steps to reproduce the behavior:
View files listed in description
Experience confusion as to which license applies to usage of this gem.
Expected behavior
I should be able to determine what license applies to this gem.
Screenshots
Not Applicable
Support
Not Applicable
Additional context
Since introduction of billing configuration in order to support stripe as a payment provider, we need to update the client to support the new attributes.
Related to https://github.com/getlago/lago-product/issues/23
Describe the bug
For example, let's use rails global id as the external_id, like: gid://app/Customer/1234
.
This works fine as the external_id when creating the customer, but when going to retrieve the Customer, it fails with a 404.
However, running URI.encode_www_form_component
on the external_id first retrieves the Customer correctly.
To Reproduce
Steps to reproduce the behavior:
gid://app/Customer/1234
client.customers.get("gid://app/Customer/1234")
Expected behavior
Step 2 should return a Customer.
The client should encode the external_id before performing the request.
Support
Additional context
It's likely this issue effects more than just the Customer get request, but I have only tested it on Customer.
I guess this could be debatable if it is in fact a bug, but I think it is at least surprising.
In a Lago::Api::HttpError
, the #error_code
method returns a string, not an integer. This is apparently what Net::Http
returns in its response.code
method as it's the source of the value.
In every other ruby Http client that I've used (Faraday, Excon, etc) the code is an integer which allows matching against Rails' http symbols like :not_found
etc.
Happy to provide a PR for this, either to change the type of the return value or at a minimum to document it in the README (or both)
Describe the bug
I am testing sending events to Lago using this gem. I get a boolean response where I would expect a representation of the resource that was create or some kind of http response object. In addition, if I send an event with a customer_id
that doesn't exist in Lago I get the same true response.
To Reproduce
client = Lago::Api::Client.new(api_key: ENV['LAGO_API_KEY'])
r = client.events.create(transaction_id: SecureRandom.uuid, customer_id: 2010, code: :mobilepay_transaction, properties: { donation_id: 12345 })
=> true
r = client.events.create(transaction_id: SecureRandom.uuid, customer_id: 20100000, code: :mobilepay_transaction, properties: { donation_id: 12345 })
=> true
Expected behavior
I expect the response to fail if the customer_id
doesn't exist in Lago. I also expect to get either an HTTP response that I can check the status and headers of or a representation of the resource created by the API call.
Describe the bug
The client.customers.checkout_url('external_id')
function is encountering an URI::InvalidURIError
. The error message suggests that the URI being constructed is invalid, leading to the issue.
Error:
Error:
URI::InvalidURIError in SubscriptionsController#test_lago
bad URI(is not URI?): "https://your-lago-host.com:443{:identifier=>nil}"
To Reproduce
Steps to reproduce the behavior:
@billing_client = Lago::Api::Client.new(api_key: API_KEY, api_url: LAGO_FRONT_URL)
@billing_client.customers.checkout_url("12345")
Expected behavior:
The checkout_url
function should successfully call the POST API and return the following object:
{
"checkout_url": "https://foo.bar",
"external_customer_id": "12345",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"payment_provider": "stripe"
}
Additional context
Api is used here: https://docs.getlago.com/api-reference/customers/psp-checkout-url
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.