
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
This guide provides an overview of using the Kody API and its reference documentation for Ruby.
Add this line to your application's Gemfile:
gem 'kody-clientsdk-ruby'
And then execute:
bundle install
Or install it yourself as:
gem install kody-clientsdk-ruby
The client library uses a combination of a Store ID
and an API key
.
These will be shared with you during the technical integration onboarding or by your Kody contact.
During development, you will have access to a test Store and test API key, and when the integration is ready for live access, the production credentials will be shared securely with you and associated with a live store that was onboarded on Kody.
The test and live API calls are always compatible, only changing credentials and the service hostname is required to enable the integration in production.
grpc-staging.kodypay.com
grpc.kodypay.com
require 'kody'
# Configure the Kody client
Kody.configure do |config|
config.api_key = 'your-api-key'
config.store_id = 'your-store-id'
config.staging! # Use staging environment for testing
end
# Create a client instance
client = Kody::Client.new
# Initiate a payment
begin
response = client.ecom.initiate_payment(
payment_reference: Kody::EcomClient.generate_payment_reference,
amount_minor_units: 2000, # £20.00 in pence
currency: 'GBP',
order_id: Kody::EcomClient.generate_order_id,
return_url: 'https://your-website.com/payment-return'
)
puts "Payment initiated successfully!"
puts "Payment ID: #{response.response.payment_id}"
puts "Payment URL: #{response.response.payment_url}"
rescue Kody::Error => e
puts "Error: #{e.message}"
rescue GRPC::BadStatus => e
puts "gRPC Error: #{e.message}"
end
# Production environment (default)
Kody.configure do |config|
config.api_key = 'your-production-api-key'
config.store_id = 'your-production-store-id'
# config.host defaults to 'grpc.kodypay.com'
end
# Staging environment
Kody.configure do |config|
config.api_key = 'your-test-api-key'
config.store_id = 'your-test-store-id'
config.staging! # Sets host to 'grpc-staging.kodypay.com'
end
# Local development
Kody.configure do |config|
config.api_key = 'your-api-key'
config.store_id = 'your-store-id'
config.development! # Sets host to 'localhost:8080' with TLS disabled
end
You can also configure using environment variables:
export KODY_API_KEY="your-api-key"
export KODY_STORE_ID="your-store-id"
Kody.configure do |config|
config.api_key = ENV['KODY_API_KEY']
config.store_id = ENV['KODY_STORE_ID']
config.staging! # or production/development
end
response = client.ecom.initiate_payment(
payment_reference: 'unique-payment-ref',
amount_minor_units: 2000, # Amount in minor units (e.g., pence for GBP)
currency: 'GBP',
order_id: 'order-123',
return_url: 'https://your-site.com/payment-return',
# Optional parameters:
order_metadata: '{"item": "Product Name"}',
expiry: {
show_timer: true,
expiring_seconds: 1800 # 30 minutes
},
locale: 'en_GB',
show_order_summary: true,
show_merchant_name: true
)
response = client.ecom.get_payments(
page: 1,
page_size: 10,
# Optional filter:
filter: {
order_id: 'specific-order-id' # Optional: filter by order ID
}
)
puts "Total payments: #{response.response.total}"
response.response.payments.each do |payment|
puts "Payment ID: #{payment.payment_id}"
puts "Status: #{payment.status}"
puts "Amount: #{payment.sale_data.amount_minor_units}" if payment.has_sale_data?
end
Note: Currently, initiate_payment
and get_payments
methods are implemented. Additional methods (payment details, refunds, etc.) will be added in future versions.
The SDK provides convenient helper methods:
# Generate unique payment reference
payment_ref = Kody::EcomClient.generate_payment_reference
# Returns: "pay_a1b2c3d4e5f6g7h8"
# Generate unique order ID
order_id = Kody::EcomClient.generate_order_id
# Returns: "order_a1b2c3d4e5f6g7h8"
Complete examples can be found in the samples/
directory:
For complete API documentation, examples, and integration guides, please visit: 📚 https://api-docs.kody.com
This is a minimal initial version of the Ruby SDK focusing on the core payment initiation functionality. The SDK follows the same patterns as other Kody client SDKs and will be extended with additional features in future releases.
Bug reports and pull requests are welcome on GitHub at https://github.com/KodyPay/kody-clientsdk-ruby.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that kody-clientsdk-ruby demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.