Updated ReadMe and gemspec

This commit is contained in:
Brian Quinn 2011-01-25 11:30:18 +00:00
parent 9086741f52
commit 927e567bd0
3 changed files with 114 additions and 97 deletions

View File

@ -10,107 +10,126 @@ This extension allows the store to use PayPal Express from two locations:
options on the payment stage of the standard checkout. The selected shipping address and shipping method / costs are automatically
sent to the PayPal review page (along with detailed order information).
THIS FEATURE IS NOT YET COMPLETE
2. Cart Checkout - Presents the PayPal checkout button on the users Cart page and redirects the user to complete all shipping / addressing
information on PaypPal's site. This also supports PayPal's Instant Update feature to retrieve shipping options live from Spree when the user
selects / changes their shipping address on PayPal's site.
2. Cart Checkout (THIS FEATURE IS NOT YET COMPLETE) - Presents the PayPal checkout button on the users Cart page and redirects the user to complete
all shipping / addressing information on PaypPal's site. This also supports PayPal's Instant Update feature to retrieve shipping options live from
Spree when the user selects / changes their shipping address on PayPal's site.
This extension follows the documented flow for a PayPal Express Checkout, where a user is forwarded to PayPal to allow them to login and review
the order (possibly select / change shipping address and method), then the user is redirected back to Spree to confirm the order. The user
MUST confirm the order on the Spree site before the payment is authorized / captured from PayPal (and the order is transitioned to the New state).
USAGE (Checkout Payment)
========================
IPN & eCheck Support
===================
eCheck payments are now fully supported and PayPal's Instant Payment Notification service is also supported for receiving updates relating to eCheck payments only. To configure eCheck payments you'll need to:
1. Setup your application
###1. Install & Configure the extension (see Installation and Configuration sections below).
2. Configure PPE
###2. Configure your PayPal account to accept eCheck payments (under Profile on PayPal's website).
###3. Set the IPN URL on your PayPal account (under Profile on PayPal's website) to:
https://www.yourstore.com/paypal_notify
###4. Enable auto_capture within Spree (as eCheck payments are only supported for purchase and not authorize requests).
Spree::Config.set(:auto_capture => true)
Installation
============
###1. Add the following line to your application's Gemfile
gem "spree_paypal_express", :git => "git://github.com/spree/spree_paypal_express.git"
**Note:** The :git option is only required for the edge version, and can be removed to used the released gem.
###2. Run bundler
bundle install
###3. Copy assets / migrations
rake spree_paypal_express:install
###4. Run migration
rake db:migrate
Configuration
=============
###1. Before you begin
You'll need to have a Paypal developer account (developer.paypal.com) and both buyer and seller test accounts.
Tip: these are sandbox only, so use email addresses and passwords that are easy to remember, e.g. buyer@example.com and seller@example.com.
**Tip:** these are sandbox only, so use email addresses and passwords that are easy to remember, e.g. buyer@example.com and seller@example.com.
Your sandbox credentials are available from the API Credentials link.
Start your app
###2. Setup the Payment Method
http://localhost:3000/admin/payment_methods/new
Log in as an admin and add a new **Payment Method** (under Configuration), using following details:
Name: Paypal Express
**Name:** Paypal Express
Environment: Development
**Environment:** Development (or what ever environment you prefer)
Active: Yes
**Active:** Yes
Provider: BillingIntegration::PaypalExpress
**Provider:** BillingIntegration::PaypalExpress
Create
Click **Create* , and now add your credentials in the screen that follows:
Now add your credentials in the screen that follows
**Review:** unchecked [1]
review: unchecked [1]
**Signature:** API signature from your paypal seller test account
Signature: signature from your paypal seller test account
**Server:** test (for Development or live for Production)
Server: test
**Test Mode:** checked (or unchecked for Production)
Test Mode: checked
**Password:** API Password from your paypal seller test account
Password: API Password from your paypal seller test account
**Login:** API Username from your paypal seller test account (care to use the API Username and not the Test Account address)
Login: API Username from your paypal seller test account
Click **Update**
Update
Test Drive
==========
3. Test it
While testing PayPal Express checkout locally make sure you're logged into your PayPal **developer** account in another browser window before attempting a PayPal payment, as you'll be redirected and forced to sign in to your developer account.
Add an item to cart
1. Add an item to cart
Check out
2. Check out
Address step: complete it using a valid US address. (Use Sean Schofield's from the railsdog site ;))
3. Address step: complete it using a valid US address.
Delivery step: pick anything
4. Delivery step: pick anything
Payment step: pick Paypal Express. If this does not show up as an option, repeat Step 3.
5. On the Payment Step, you should see a PayPal button. You can select it directly or just click "Continue"
The Check out with PayPal button should appear.
6. You will get redirected to PayPals sandbox site, be sure to log in as a **Buyer** / **Personal** test account and not the account you use to configure the Payment Method with.
Make sure you're logged into your paypal developer account in another browser window before clicking it, as you'll be redirected to your test account (same browser, new window or tab).
7. You should now see the paypal order details screen with a Pay Now button.
On Paypal's site (your previously configured Seller test account), log in as the Buyer.
8. Click Pay Now, and you should now be redirected back to Spree's order thank you page.
If you set up a test buyer account as buyer@example.com previously, use this now.
You should now see the paypal order details screen with a Pay Now button.
Click Pay Now
You should now see the spree apps thank you for your order page
9. Log into the Admin UI and review the Order and Payment details to confirm the successful checkout.
4. Check the payment
Running Specs
=============
http://localhost:3000/admin/orders
###1. Create Test App
Edit your new order
rake test_app
Go to the Payments section from the right hand menu
###2. Run Specs
Pending Payments should show Paypal Express with the options of Show and Capture
Click Show and look over the info available
The payment has status Pending with a successful authorization
Back to Payments
This time click Capture, then OK
Click Show to see what's changed.
You should now see two transactions, the previous Authorize transaction and a new Capture one with status Completed
rake spec
NOTES
=====

View File

@ -2,6 +2,8 @@ class PaypalExpressCallbacksController < Spree::BaseController
include ActiveMerchant::Billing::Integrations
skip_before_filter :verify_authenticity_token
ssl_required
def notify
retrieve_details #need to retreive details first to ensure ActiveMerchant gets configured correctly.

View File

@ -1,21 +1,17 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_paypal_express'
s.version = '2.0.0'
s.summary = 'Add gem summary here'
#s.description = 'Add (optional) gem description here'
s.version = '1.0.0'
s.summary = 'Adds PayPal Express as a Payment Method to Spree store'
s.homepage = 'http://www.spreecommerce.com'
s.author = 'Rails Dog'
s.email = 'gems@railsdog.com'
s.required_ruby_version = '>= 1.8.7'
# s.author = 'David Heinemeier Hansson'
# s.email = 'david@loudthinking.com'
# s.homepage = 'http://www.rubyonrails.org'
# s.rubyforge_project = 'actionmailer'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
s.has_rdoc = false
s.files = Dir['CHANGELOG', 'README.md', 'LICENSE', 'lib/**/*', 'app/**/*']
s.require_path = 'lib'
s.requirements << 'none'
s.has_rdoc = true
s.add_dependency('spree_core', '>= 0.30.1')
s.add_dependency('spree_core', '>=0.40.3')
end