
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
WebPay::Mock helps development of WebPay client applications.
This generates a response object from request parameters, and wraps WebMock gem for easy end-to-end testing against webpay API server.
Add this line to your application's Gemfile:
gem 'webpay-mock'
And then execute:
$ bundle
Or install it yourself as:
$ gem install webpay-mock
In spec_helper.rb
,
require 'webpay/mock'
RSpec.configure do |c|
c.include WebPay::Mock::WebMockWrapper
end
In your spec file,
let(:params) { { amount: 1000, currency: 'jpy', card: 'tok_xxxxxxxxx', description: 'test charge' } }
let!(:response) { webpay_stub(:charges, :create, params: params) }
specify { expect(webpay.charge.create(params).id).to eq response['id'] }
See our test cases for more examples.
Just return an error by type.
webpay_stub(:charges, :create, error: :card_error, params: params)
Error kinds are:
Specify all fields to test a specific error.
webpay_stub(:charges, :create, params: params, response: card_error(
message: "You must provide the card which is not expired",
caused_by: "buyer",
param: "exp_month",
code: "invalid_expiry_month"
))
For up-to-date details about error structure, see API error document on our website.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Fixed bugs and new features must be tested.
Copyright (c) 2013- WebPay, Inc.
FAQs
Unknown package
We found that webpay-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
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.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.