Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
"Paysera is an advanced, effective, proven and safe electronic money system with an unlimited electronic money licence No. 1 issued by the Bank of Lithuania. It offers a free settlement account which allows for a quick, safe and low-cost (often – free of charge) payment for goods and services. Paysera account is a true electronic wallet, which can not be lost; you will always find the amount of money that you have deposited in your account. In most cases, this type of account is better than bank account, because it is subject to higher security requirements, administrators of Paysera system can not lend or invest money held on the owner’s account. Paysera.com services are constantly expanded and improved by the top-level specialists in accordance with the latest payment innovations." — Paysera
This gem provides easy access to the Paysera payment API.
Add this line to your application's Gemfile:
gem 'paysera'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paysera
You can set default configuration like this:
Paysera.config do |config|
config.projectid = 56571
config.sign_password = '36947d6dcbccc03ad591deab138dbb0c'
end
If you are using Ruby on Rails add it to config/initializers/paysera.rb
. However the gem usage is not restricted to Ruby on Rails, you can use it in any Ruby application.
To make a request execute this:
# Minimum requirements for request_params
request_params_example = {
orderid: 1,
accepturl: 'http://0.0.0.0:3000?accept',
cancelurl: 'http://0.0.0.0:3000?cancel',
callbackurl: 'http://0.0.0.0:3000?callback'
}
Paysera::Request.build_request(request_params_example, sign_password: 'my_sign_password')
sign_password is optional.
It will generate payment link to paysera - https://paysera.lt/pay/?data=...&sign=...
.
So you can do this if you are using Rails:
redirect_to Paysera::Request.build_request(...)
You can use any parameters from: https://developers.paysera.com/en/payments/current#request-parameters
If required parameters are not present or are invalid the gem will raise a Paysera::Error::Request
error with a specific error message.
If you specify projectid
or sign_password
it will overwrite the values set in the initializer.
# params should include valid data, ss1 and ss2
response = Paysera::Response.new(params, projectid: 123, sign_password: 'my_sign_password')
projectid and sign_password are optional.
If ss1
or ss2
fails to validate a Paysera::Error::Response
exception will be raised with a specific error message.
To check if it's a sms/mikro response:
if response.sms?
...
end
To check if it's a bank/makro response:
if response.bank?
...
end
To access the response data (keys are symbols):
response.get_data
puts response.get_data[:sms] # => keyword1 text
It will return a Hash with data: SMS specification and Bank specification(see "Encoded parameters")
If you specify projectid
or sign_password
it will overwrite the values set in the initializer.
Also you propably want to skip CSRF verification for your callback action:
skip_before_filter :verify_authenticity_token, :only => [:receive_callback] # :receive_callback - your callback action
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)MIT License: see LICENSE file
FAQs
Unknown package
We found that paysera demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.