
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Adyen's Client Side Encryption (CSE) library for Ruby.
This is a port of Adyen's Android CSE library, packaged as a Ruby gem.
Check out the Python version here.
Add this line to your application's Gemfile:
gem 'adyen-cse-ruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install adyen-cse-ruby
require 'adyen_cse'
cse = AdyenCse::Encrypter.new(public_key)
encrypted_card = cse.encrypt!(
holder_name: "Adyen Shopper",
number: 4111_1111_1111_1111.to_s,
expiry_month: "08",
expiry_year: "2018",
cvc: "737"
)
Optionally, you may pass a custom generation_time
to mock expired data.
encrypted_card = cse.encrypt!(
...,
generation_time: Time.new(2015, 10, 21)
)
Example of an :adyen_test_card
factory with factory_bot.
# ./spec/factories/adyen_test_card.rb
require 'adyen_cse'
class AdyenTestCard
attr_reader :holder_name, :number, :expiry_month, :expiry_year, :cvc
PUBLIC_KEY = "your_public_key_here"
def initialize(params = {})
@holder_name = params[:holder_name]
@number = params[:number]
@expiry_month = params[:expiry_month]
@expiry_year = params[:expiry_year]
@cvc = params[:cvc]
end
def nonce
AdyenCse::Encrypter.new(PUBLIC_KEY).encrypt!(
holder_name: holder_name,
number: number,
expiry_month: expiry_month,
expiry_year: expiry_year,
cvc: cvc
)
end
end
FactoryBot.define do
factory :adyen_test_card do
sequence(:holder_name) { |n| "Shopper #{n}" }
expiry_month { '08' }
expiry_year { '2018' }
cvc { '737' }
visa
trait :visa do
number { 4111_1111_1111_1111.to_s }
end
trait :mastercard do
number { 5555_5555_5555_4444.to_s }
end
trait :amex do
number { 3451_779254_88348.to_s }
cvc { '7373' }
end
skip_create
initialize_with { new(attributes) }
end
end
Example usage:
RSpec.describe ExamplePaymentService do
let(:credit_card) { FactoryBot.build(:adyen_test_card) }
...
end
FAQs
Unknown package
We found that adyen-cse-ruby 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
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.