![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This gem provides a Rails 4 interface to the Amazon Simple Pay payment service.
Supports the following Amazon Simple Pay services:
Add simplepay to your Bundler Gemfile
#in Gemfile
gem "simplepay-rails4", :require => 'simplepay'
Configure the gem with your Amazon Web Services credentials:
#in config/initializers/simplepay.rb
Simplepay.aws_access_key_id = 'MYAMAZONACCESSKEYID'
Simplepay.aws_secret_access_key = 'MYAMAZONSECRETACCESSKEY'
Simplepay.use_sandbox = true # defaulted to true
Create an Amazon Payments Personal Account https://payments.amazon.com/sdui/sdui/basicaccount or on Sandbox: https://payments-sandbox.amazon.com/sdui/sdui/basicaccount
Create an Amazon Payments Business Account https://payments.amazon.com/sdui/sdui/premiumaccount or in the sandbox for testing https://payments-sandbox.amazon.com/sdui/sdui/premiumaccount
Create an Amazon Web Services Account
https://aws-portal.amazon.com/gp/aws/developer/registration/index.html
Retrieve the Access Key ID and Secret Access Key https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key
Note that the AWS Access Key ID and Secret Access Key is good for both testing in the sandbox and for production use.
Generally, this library will then be used directly from one (or more) of your views. Depending on the type of Simple Pay service you're using (see Simplepay::Services), some form values will be required, while others may be optional. This is done like so:
<%= simplepay_form_for(:standard, {
:amount => 10.95,
:description => "Profit!"
}) %>
<%= simplepay_form_for(:subscription, {
:amount => 10.95,
:description => "MORE Profit!",
:recurring_frequency => "1 month"
}) %>
You can add a custom submit button (and indeed custom form elements) using either an attribute or a block (not both)
<%= simplepay_form_for(:subscription, {
:amount => 10.95,
:description => "MORE Profit!",
:recurring_frequency => "1 month"
}, submit_tag('Custom Submit')) %>
<%# OR #%>
<%= simplepay_form_for :marketplace,
:amount => invoice.total,
:description => "Mutual profit!",
:recipient_email => 'seller@gmail.com',
:fixed_marketplace_fee => 10.00,
:variable_marketplace_fee => 5 do %>
<div>
<%= submit_tag 'Pay With Amazon', class: 'btn btn-primary' %>
</div>
<% end %>
Amazon Simple Pay Marketplace makes it easy to facilitate payments between buyers and sellers, and to charge a fee for the transaction. If you're building a marketplace application, your sellers must first agree to the policy that you set. You can do this by specifying the Simplepay::Services::MarketplacePolicy service:
<%= simplepay_form_for(:marketplace_policy, {
:max_fixed_fee => 5.00,
:max_variable_fee => 5,
:return_url => 'http://yourservice.com',
:reference_id => '1234567890'
}) %>
The user will be prompted to login to their Amazon account and accept the policy you propose. After they complete the process, they'll be returned to the return_url specified. Amazon will also provide a recipientEmail parameter that will contain the seller email here (you may want to craft your return url so that it contains the reference_id value and use this to 'acknowledge' a sellers consent and record their Amazon recipient email address).
Only once this is done will you be able to offer marketplace checkout options for that sellers items:
<%= simplepay_form_for(:marketplace, {
:amount => 34.95,
:description => "Mutual profit!",
:recipient_email => 'seller@gmail.com',
:fixed_marketplace_fee => 10.00,
:variable_marketplace_fee => 5
}) %>
sudo gem install simplepay-rails4
FAQs
Unknown package
We found that simplepay-rails4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.