besepa / besepa-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby client for besepa.com
Home Page: besepa.com
License: MIT License
Ruby client for besepa.com
Home Page: besepa.com
License: MIT License
No se guarda el cliente (DEVELOPMENT)
def create
@hotel = @hotel.update(hotel_params)
@hotel.user = current_user
@hotel.publish = false
@customer = Besepa::Customer.create(@hotel.account.name)
iban = @hotel.account.iban
bic = @hotel.account.bic
bank_name = @hotel.account.bank
mandate_options = {
scheme: "CORE", #o b2b
signature_type: 'checkbox', # o sms. Si es SMS, añadir el teléfono en phone_number o se lo pedimos
type: "RECURRENT",
redirect_after_signature: "https://waitinglist.es/hoteles?mandato=firmado"
}
ba = @customer.add_bank_account(iban, bic, bank_name, mandate_options)
@hotel.ba_url = ba.url
respond_to do |format|
if @hotel.save(validate: false)
# resto...
initializers/besepa.rb:
Besepa.configure do |config|
config.api_key = 'mi API key'
config.endpoint = 'https://sandbox.besepa.com)'
end
Hi!
Is there any way to get information about validation errors from the API? Right now, I'm just receiving a 422 error when trying to add a debit to a customer, with no further explanation:
Besepa::Customer.find(id).add_debit("XXXXXXX", "XXXXXX", "My description", 10000, "2014-05-10", nil, nil)
# => Besepa::Errors::InvalidResourceError: (Status 422) invalid_resource (El recurso no se puedo guardar porque falló alguna de las validaciones)
Both customer and bank_account exist.
Thanks!
The README says
By default, this gem points to Besepa's sandbox (https://sandbox.besepa.com). If you want to point to Besepa's production environment, use https://api.besepa.com as endpoint.
but according to
https://github.com/besepa/besepa-ruby/blob/master/lib/besepa/utils/config.rb#L12
DEFAULT_ENDPOINT = 'http://app.besepa.com'
So either the README or config.rb should be updated 😉
Also note that the code says app.besepa.com and the readme says api.besepa.com - I don't know which one is the right one or if it doesn't matter 😃
It's a nice thing to have :-) Could you consider adding one?
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.