Giter Club home page Giter Club logo

simplepay's Introduction

simplepay (Rails Amazon Simple Pay Interface)

simplepay.rubyforge.org

DESCRIPTION:

This gem provides a Rails interface to the Amazon Simple Pay payment service.

FEATURES/PROBLEMS:

Supports the following Amazon Simple Pay services:

  • Standard

  • Subscription

  • Marketplace

  • Donation

It looks like the Amazon Simple Pay (ASP) api was changed to require signatureVersion 2 on 2/10/2011. When generating your own dynamic signature please note that the account_id is not required. Also the access_key should be your AWS access_key, not the one generated by the payments website here:

https://payments-sandbox.amazon.com/sdui/sdui/standardbutton

More details at the forums…

https://forums.aws.amazon.com/thread.jspa?threadID=113625&tstart=0

Only updating (and testing) the Standard button for now…

SYNOPSIS:

Set up the gem requirement in your environment:

(in config/environment.rb)

config.gem "simplepay"

Configure the gem with your Amazon credentials:

(in config/initializers/simplepay.rb)

Simplepay.aws_access_key_id     = 'MYAMAZONACCESSKEYID'
Simplepay.aws_secret_access_key = 'MYAMAZONSECRETACCESSKEY'
Simplepay.account_id            = 'ACCOUNTIDFORAMAZONPAYMENTS'

Then, let Rails know about the Simplepay::Helpers:

(potentially in app/controllers/application[_controller].rb or really anywhere else)

require 'simplepay/rails'

Generating your Simple Pay forms

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"
}) %>

Marketplace forms

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          => '[email protected]',
  :fixed_marketplace_fee    => 10.00,
  :variable_marketplace_fee => 5
}) %>

REQUIREMENTS:

  1. You must have an Amazon Payments business account.

  2. You must know your Amazon Payments account identifier [instructions to come]

  3. You must know your Amazon Web Services access key and secret access key.

INSTALL:

sudo gem install simplepay

LICENSE:

(The MIT License)

Copyright © 2008 Nathaniel E. Bibler

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

simplepay's People

Contributors

davetchen avatar nathanpalmer avatar nbibler avatar qxjit avatar zapnap avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.