nimbleshop_paypalwp 0.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -0
- data/app/assets/images/paypal_big.png +0 -0
- data/app/assets/images/paypal_small.png +0 -0
- data/app/controllers/nimbleshop_paypalwp/paypalwps_controller.rb +60 -0
- data/app/helpers/nimbleshop_paypalwp/exposed_helper.rb +72 -0
- data/app/models/nimbleshop_paypalwp/paypalwp.rb +17 -0
- data/app/views/nimbleshop_paypalwp/payments/_new.html.erb +37 -0
- data/app/views/nimbleshop_paypalwp/payments/_order_show_extra_info.html.erb +5 -0
- data/app/views/nimbleshop_paypalwp/paypalwps/_edit.html.erb +32 -0
- data/app/views/nimbleshop_paypalwp/paypalwps/_form.html.erb +36 -0
- data/config/routes.rb +8 -0
- data/lib/nimbleshop_paypalwp/active_merchant/billing/integrations/paypal/helper.rb +41 -0
- data/lib/nimbleshop_paypalwp/engine.rb +16 -0
- data/lib/nimbleshop_paypalwp/processor.rb +78 -0
- data/lib/nimbleshop_paypalwp/version.rb +3 -0
- data/lib/nimbleshop_paypalwp.rb +8 -0
- data/lib/tasks/nimbleshop_paypalwp_mock_ipn_callback.rake +77 -0
- data/lib/tasks/nimbleshop_paypalwp_tasks.rake +28 -0
- metadata +111 -0
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# nimbleshop_paypalwp extension
|
2
|
+
|
3
|
+
This is Paypal web payments standard ( paypalwp ) extension for [nimbleShop](http://nimbleShop.org) .
|
4
|
+
|
5
|
+
# Documentation
|
6
|
+
|
7
|
+
Documentation is available at [http://nimbleshop.org/](http://nimbleshop.org) .
|
8
|
+
|
9
|
+
# License
|
10
|
+
|
11
|
+
nimbleshop_paypalwp uses [MIT license](http://www.opensource.org/licenses/mit-license.php) .
|
12
|
+
|
Binary file
|
Binary file
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module NimbleshopPaypalwp
|
2
|
+
class PaypalwpsController < ::Admin::PaymentMethodsController
|
3
|
+
|
4
|
+
protect_from_forgery except: :notify
|
5
|
+
|
6
|
+
before_filter :load_payment_method, except: :notify
|
7
|
+
|
8
|
+
def notify
|
9
|
+
processor = NimbleshopPaypalwp::Processor.new(raw_post: request.raw_post)
|
10
|
+
order = processor.order
|
11
|
+
|
12
|
+
# Since IPN can send notification multiple times check if the order has already been set to purchased status
|
13
|
+
unless order.purchased?
|
14
|
+
processor.order.update_attributes(payment_method: NimbleshopPaypalwp::Paypalwp.first)
|
15
|
+
processor.purchase
|
16
|
+
end
|
17
|
+
|
18
|
+
render nothing: true
|
19
|
+
end
|
20
|
+
|
21
|
+
def update
|
22
|
+
respond_to do |format|
|
23
|
+
if @payment_method.update_attributes(post_params[:paypalwp])
|
24
|
+
format.js {
|
25
|
+
flash[:notice] = 'Paypal record was successfully updated'
|
26
|
+
render js: "window.location = '/admin/payment_methods'"
|
27
|
+
}
|
28
|
+
else
|
29
|
+
msg = @payment_method.errors.full_messages.first
|
30
|
+
error = %Q[alert("#{msg}")]
|
31
|
+
format.js { render js: error }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def destroy
|
37
|
+
respond_to do |format|
|
38
|
+
if @payment_method.destroy
|
39
|
+
format.js {
|
40
|
+
flash[:notice] = 'Paypal record was successfully deleted'
|
41
|
+
render js: "window.location = '/admin/payment_methods'"
|
42
|
+
}
|
43
|
+
else
|
44
|
+
format.js { render js: 'Paypal record could not be deleted. Please try again later.' }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def post_params
|
52
|
+
params.permit(paypalwp: [:merchant_email, :mode])
|
53
|
+
end
|
54
|
+
|
55
|
+
def load_payment_method
|
56
|
+
@payment_method = NimbleshopPaypalwp::Paypalwp.first
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'active_merchant/billing/integrations/action_view_helper'
|
2
|
+
|
3
|
+
module NimbleshopPaypalwp
|
4
|
+
module ExposedHelper
|
5
|
+
include ActiveMerchant::Billing::Integrations::ActionViewHelper
|
6
|
+
|
7
|
+
def nimbleshop_paypalwp_small_image
|
8
|
+
image_tag "engines/nimbleshop_paypalwp/paypal_small.png", alt: 'paypal icon'
|
9
|
+
end
|
10
|
+
|
11
|
+
def nimbleshop_paypalwp_big_image
|
12
|
+
image_tag "engines/nimbleshop_paypalwp/paypal_big.png", alt: 'paypal logo'
|
13
|
+
end
|
14
|
+
|
15
|
+
def nimbleshop_paypalwp_order_show_extra_info(order)
|
16
|
+
return unless NimbleshopPaypalwp::Paypalwp.first
|
17
|
+
render partial: '/nimbleshop_paypalwp/payments/order_show_extra_info', locals: { transaction: order.payment_transactions.last }
|
18
|
+
end
|
19
|
+
|
20
|
+
def nimbleshop_paypalwp_available_payment_options_icons
|
21
|
+
return unless NimbleshopPaypalwp::Paypalwp.first
|
22
|
+
image_tag "engines/nimbleshop_paypalwp/paypal_small.png", alt: 'paypal icon'
|
23
|
+
end
|
24
|
+
|
25
|
+
def nimbleshop_paypalwp_icon_for_order_payment(order)
|
26
|
+
image_tag "engines/nimbleshop_paypalwp/paypal_small.png", alt: 'paypal icon', height: '10px'
|
27
|
+
end
|
28
|
+
|
29
|
+
def update_service_with_attributes(service, order)
|
30
|
+
service.customer email: order.email
|
31
|
+
|
32
|
+
service.billing_address order.final_billing_address.attributes.slice(:city, :address1,:address2, :state, :country,:zip)
|
33
|
+
|
34
|
+
service.invoice order.number
|
35
|
+
service.line_items order.line_items
|
36
|
+
service.shipping order.shipping_cost.to_f.round(2)
|
37
|
+
service.tax order.tax.to_f.round(2)
|
38
|
+
|
39
|
+
service.notify_url nimbleshop_paypalwp_notify_url
|
40
|
+
service.return_url nimbleshop_paypalwp_return_url(order)
|
41
|
+
service.cancel_return_url nimbleshop_paypalwp_cancel_url(order)
|
42
|
+
end
|
43
|
+
|
44
|
+
def nimbleshop_paypalwp_crud_form
|
45
|
+
return unless NimbleshopPaypalwp::Paypalwp.first
|
46
|
+
render partial: '/nimbleshop_paypalwp/paypalwps/edit'
|
47
|
+
end
|
48
|
+
|
49
|
+
def nimbleshop_paypalwp_payment_form(order)
|
50
|
+
ActiveMerchant::Billing::Base.integration_mode = Rails.env.production? ? :production : :test
|
51
|
+
return unless NimbleshopPaypalwp::Paypalwp.first
|
52
|
+
render partial: '/nimbleshop_paypalwp/payments/new', locals: { order: order }
|
53
|
+
end
|
54
|
+
|
55
|
+
def nimbleshop_paypalwp_notify_url
|
56
|
+
Util.localhost2public_url( '/nimbleshop_paypalwp/paypalwp/notify', nimbleshop_paypalwp_protocol )
|
57
|
+
end
|
58
|
+
|
59
|
+
def nimbleshop_paypalwp_return_url(order)
|
60
|
+
Util.localhost2public_url( order_path(id: order.number), nimbleshop_paypalwp_protocol )
|
61
|
+
end
|
62
|
+
|
63
|
+
def nimbleshop_paypalwp_cancel_url(order)
|
64
|
+
Util.localhost2public_url( new_checkout_payment_path, nimbleshop_paypalwp_protocol )
|
65
|
+
end
|
66
|
+
|
67
|
+
def nimbleshop_paypalwp_protocol
|
68
|
+
NimbleshopPaypalwp::Paypalwp.first.mode == 'production' ? 'https' : 'http'
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NimbleshopPaypalwp
|
2
|
+
class Paypalwp < PaymentMethod
|
3
|
+
|
4
|
+
store_accessor :metadata, :merchant_email, :mode
|
5
|
+
|
6
|
+
before_save :set_mode
|
7
|
+
|
8
|
+
validates :merchant_email, email: true, presence: true
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def set_mode
|
13
|
+
self.mode ||= 'test'
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<% order = Order.find_by_id(session[:order_id])
|
2
|
+
record = NimbleshopPaypalwp::Paypalwp.first
|
3
|
+
ActiveMerchant::Billing::Base.mode = record.mode.to_sym
|
4
|
+
%>
|
5
|
+
|
6
|
+
<%= payment_service_for order.id, record.merchant_email,
|
7
|
+
:amount => order.total_amount.round(2),
|
8
|
+
:service => :paypal,
|
9
|
+
:html => { :id => 'paypal-payment-form' } do |service| %>
|
10
|
+
|
11
|
+
<% update_service_with_attributes(service, order) %>
|
12
|
+
|
13
|
+
<!-- Display the payment button. -->
|
14
|
+
<!--
|
15
|
+
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
|
16
|
+
-->
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<label class='radio'>
|
20
|
+
<%= radio_button_tag 'payment_choice', 'paypal' %>
|
21
|
+
<%= nimbleshop_paypalwp_small_image %>
|
22
|
+
</label>
|
23
|
+
|
24
|
+
<%= javascript_tag do %>
|
25
|
+
$(function() {
|
26
|
+
$("input#payment_choice_paypal:radio").change(function() {
|
27
|
+
var $this, val;
|
28
|
+
$this = $(this);
|
29
|
+
val = $this.val();
|
30
|
+
|
31
|
+
if (val === "paypal") {
|
32
|
+
$("form#paypal-payment-form").submit();
|
33
|
+
}
|
34
|
+
|
35
|
+
});
|
36
|
+
});
|
37
|
+
<% end %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div class='payment-method-engine-well'>
|
2
|
+
|
3
|
+
<div>
|
4
|
+
<h2>Paypal websites payment standard</h2>
|
5
|
+
<div class="edit_link">
|
6
|
+
<%= link_to 'Edit', '#', class: 'nimbleshop-payment-method-edit', id: 'nimbleshop-paypalwp-payment-method-edit' %>
|
7
|
+
|
8
|
+
<%= link_to nimbleshop_paypalwp.paypalwp_path, class: 'nimbleshop-payment-method-delete',
|
9
|
+
confirm: 'Do you really want to delete Paypal payment method', method: :delete, remote: true do %>
|
10
|
+
<i class='icon-remove icon-white'></i>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%= nimbleshop_paypalwp_big_image %>
|
15
|
+
|
16
|
+
<div class='clear'></div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<%= render partial: '/nimbleshop_paypalwp/paypalwps/form' %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<script>
|
23
|
+
$(function(){
|
24
|
+
|
25
|
+
$('#nimbleshop-paypalwp-payment-method-edit').toggle(function(){
|
26
|
+
$('#nimbleshop-paypalwp-form-well').show();
|
27
|
+
}, function(){
|
28
|
+
$('#nimbleshop-paypalwp-form-well').hide();
|
29
|
+
});
|
30
|
+
|
31
|
+
})
|
32
|
+
</script>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div class='well nimbleshop-payment-method-form-well' id='nimbleshop-paypalwp-form-well', style='display:none;'>
|
2
|
+
|
3
|
+
<%= form_for NimbleshopPaypalwp::Paypalwp.first, url: '/nimbleshop_paypalwp/paypalwp',
|
4
|
+
remote: true,
|
5
|
+
html: { method: 'put',
|
6
|
+
id: 'nimbleshop-paypalwp-form',
|
7
|
+
class: 'nimbleshop-payment-method-form form-horizontal'} do |f| %>
|
8
|
+
|
9
|
+
|
10
|
+
<fieldset>
|
11
|
+
|
12
|
+
<div class="control-group">
|
13
|
+
<%= f.label :merchant_email, nil, class: 'control-label' %>
|
14
|
+
<div class="controls">
|
15
|
+
<%= f.text_field :merchant_email, class: 'span6' %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="control-group">
|
20
|
+
<div class="controls">
|
21
|
+
<label class='checkbox'>
|
22
|
+
<%= f.check_box :mode, {}, 'test', 'production' %> Enable sandbox mode
|
23
|
+
</label>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
</fieldset>
|
28
|
+
|
29
|
+
<div class="form-actions">
|
30
|
+
<%= f.submit('Submit', class: 'btn btn-primary') %>
|
31
|
+
|
32
|
+
<%= link_to t(:cancel), nimbleshop_paypalwp.paypalwp_path, class: 'cancel btn' %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
</div>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
module ActiveMerchant #:nodoc:
|
2
|
+
module Billing #:nodoc:
|
3
|
+
module Integrations #:nodoc:
|
4
|
+
module Paypal
|
5
|
+
class Helper < ActiveMerchant::Billing::Integrations::Helper
|
6
|
+
|
7
|
+
def initialize(order, account, options = {})
|
8
|
+
super
|
9
|
+
|
10
|
+
# indicates we are using thirdparty shopping cart
|
11
|
+
add_field('cmd', '_cart')
|
12
|
+
add_field('upload', '1')
|
13
|
+
|
14
|
+
add_field('no_shipping', '1')
|
15
|
+
add_field('no_note', '1')
|
16
|
+
add_field('charset', 'utf-8')
|
17
|
+
add_field('address_override', '0')
|
18
|
+
add_field('bn', application_id.to_s.slice(0,32)) unless application_id.blank?
|
19
|
+
end
|
20
|
+
|
21
|
+
# pass the shipping cost for the whole cart
|
22
|
+
mapping :shipping, 'handling_cart'
|
23
|
+
mapping :tax, 'tax_cart'
|
24
|
+
|
25
|
+
# mapping header image
|
26
|
+
mapping :cpp_header_image, 'cpp_header_image'
|
27
|
+
|
28
|
+
# add line item details, note the amount_x
|
29
|
+
# should be price instead of line total
|
30
|
+
def line_items(line_items = [])
|
31
|
+
line_items.to_enum.with_index(1) do | line_item, index |
|
32
|
+
add_field("item_name_#{index}", line_item.product_name)
|
33
|
+
add_field("quantity_#{index}", line_item.quantity)
|
34
|
+
add_field("amount_#{index}", line_item.product_price)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module NimbleshopPaypalwp
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace NimbleshopPaypalwp
|
4
|
+
|
5
|
+
config.to_prepare do
|
6
|
+
::NimbleshopPaypalwp::Paypalwp
|
7
|
+
end
|
8
|
+
|
9
|
+
initializer 'nimbleshop_paypalwp_engine.action_controller' do |app|
|
10
|
+
ActiveSupport.on_load :action_controller do
|
11
|
+
helper NimbleshopPaypalwp::ExposedHelper
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module NimbleshopPaypalwp
|
2
|
+
class Processor < Processor::Base
|
3
|
+
|
4
|
+
attr_reader :order, :payment_method
|
5
|
+
|
6
|
+
def initialize(options = {})
|
7
|
+
@paypal_ipn = paypal_ipn(options[:raw_post])
|
8
|
+
@order = Order.find_by_number!(@paypal_ipn.invoice)
|
9
|
+
@payment_method = NimbleshopPaypalwp::Paypalwp.first
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def paypal_ipn(raw_post)
|
15
|
+
# ActiveMerchant::Billing::Integrations::Paypal::Notification is a subclass of
|
16
|
+
# ActiveMerchant::Billing::Integrations::Notification
|
17
|
+
#
|
18
|
+
# And ActiveMerchant::Billing::Integrations::Notification dependds on money gem
|
19
|
+
ActiveMerchant::Billing::Integrations::Paypal::Notification.new(raw_post)
|
20
|
+
end
|
21
|
+
|
22
|
+
def do_capture(options = {})
|
23
|
+
success = amount_match?
|
24
|
+
record_transaction('captured', success: success)
|
25
|
+
|
26
|
+
if success
|
27
|
+
order.update_attributes(purchased_at: purchased_at, payment_method: payment_method)
|
28
|
+
order.kapture
|
29
|
+
end
|
30
|
+
|
31
|
+
success
|
32
|
+
end
|
33
|
+
|
34
|
+
def do_authorize(options = {})
|
35
|
+
success = amount_match?
|
36
|
+
record_transaction('authorized', success: success)
|
37
|
+
|
38
|
+
if success
|
39
|
+
order.update_attributes(purchased_at: purchased_at, payment_method: payment_method)
|
40
|
+
order.authorize
|
41
|
+
end
|
42
|
+
|
43
|
+
success
|
44
|
+
end
|
45
|
+
|
46
|
+
def do_void(options = {})
|
47
|
+
end
|
48
|
+
|
49
|
+
def do_purchase(options = {})
|
50
|
+
success = amount_match?
|
51
|
+
record_transaction('purchased', success: success)
|
52
|
+
|
53
|
+
if success
|
54
|
+
order.update_attributes(purchased_at: @paypal_ipn.received_at, payment_method: payment_method)
|
55
|
+
order.purchase
|
56
|
+
end
|
57
|
+
|
58
|
+
success
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
def record_transaction(operation, options = {})
|
63
|
+
order.payment_transactions.create(options.merge(amount: @paypal_ipn.amount.cents,
|
64
|
+
params: { ipn: @paypal_ipn.raw },
|
65
|
+
transaction_gid: @paypal_ipn.transaction_id,
|
66
|
+
operation: operation))
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def amount_match?
|
71
|
+
@paypal_ipn.amount.cents == order.total_amount_in_cents
|
72
|
+
end
|
73
|
+
|
74
|
+
def purchased_at
|
75
|
+
Time.strptime(@paypal_ipn.params['payment_date'], "%H:%M:%S %b %d, %Y %z")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# This is a rake task that simulates what IPN will POST.
|
2
|
+
# It posts what was posted by IPN for following purchase.
|
3
|
+
#
|
4
|
+
# Colorful shoes - $191.00
|
5
|
+
# Quantity - 1
|
6
|
+
# Tax - $2.35
|
7
|
+
# Shipping and handling - $30.00
|
8
|
+
# Total - $223.35
|
9
|
+
#
|
10
|
+
|
11
|
+
desc 'sends IPN callback'
|
12
|
+
|
13
|
+
namespace :nimbleshop_paypalwp do
|
14
|
+
task mock_ipn_callback: :environment do
|
15
|
+
|
16
|
+
unless order_number = ENV['order_number']
|
17
|
+
puts 'Usage: rake ipn_callcak order_number=xxxxxxx'
|
18
|
+
abort
|
19
|
+
end
|
20
|
+
|
21
|
+
base_url = 'http://localhost:3000'
|
22
|
+
endpoint = base_url + '/nimbleshop_paypalwp/paypalwp/notify'
|
23
|
+
|
24
|
+
amt = (Order.find_by_number(order_number).total_amount_in_cents.to_i)/100.00
|
25
|
+
params = {
|
26
|
+
'invoice' => "#{order_number}",
|
27
|
+
'mc_gross' => "#{amt}",
|
28
|
+
'payment_gross' => "#{amt}",
|
29
|
+
|
30
|
+
'tax' => '2.35',
|
31
|
+
'mc_shipping' => '0.00',
|
32
|
+
'mc_handling' => '30.00',
|
33
|
+
'mc_gross_1' => '191.00',
|
34
|
+
|
35
|
+
'protection_eligibility' => 'Ineligible',
|
36
|
+
'item_number1' => '',
|
37
|
+
'payer_id' => '2VC8RD6BEMUT8',
|
38
|
+
'payment_date' => '20:16:58 May 29, 2012 PDT',
|
39
|
+
'payment_status' => 'Completed',
|
40
|
+
'charset' => 'windows-1252',
|
41
|
+
'first_name' => 'Neeraj',
|
42
|
+
'mc_fee' => '6.78',
|
43
|
+
'notify_version' => '3.4',
|
44
|
+
'custom' => '6',
|
45
|
+
'payer_status' => 'verified',
|
46
|
+
'business' => 'seller_1323037155_biz@bigbinary.com',
|
47
|
+
'num_cart_items' => '1',
|
48
|
+
'mc_handling1' => '0.00',
|
49
|
+
'verify_sign' => 'AOSCueeqFRzU.Zi4raNmmkcRNb.uAweHlv9hLj786DzApTlAZsEvUzgh',
|
50
|
+
'payer_email' => 'mary_1334795925_per@gmail.com',
|
51
|
+
'mc_shipping1' => '0.00',
|
52
|
+
'tax1' => '0.00',
|
53
|
+
'txn_id' => '50L283347C020742B',
|
54
|
+
'payment_type' => 'instant',
|
55
|
+
'last_name' => 'Singh',
|
56
|
+
'item_name1' => 'Colorful shoes',
|
57
|
+
'receiver_email' => 'seller_1323037155_biz@bigbinary.com',
|
58
|
+
'payment_fee' => '6.78',
|
59
|
+
'quantity1' => '1',
|
60
|
+
'receiver_id' => 'EULE94DW3YTH4',
|
61
|
+
'txn_type' => 'cart',
|
62
|
+
'mc_currency' => 'USD',
|
63
|
+
'residence_country' => 'US',
|
64
|
+
'test_ipn' => '1',
|
65
|
+
'transaction_subject' => '6',
|
66
|
+
'ipn_track_id' => 'b8b55bb690d65'
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
require 'net/http'
|
71
|
+
require 'uri'
|
72
|
+
|
73
|
+
uri = URI.parse(endpoint)
|
74
|
+
response = Net::HTTP.post_form(uri, params)
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
namespace :nimbleshop_paypalwp do
|
2
|
+
|
3
|
+
desc 'load paypal record'
|
4
|
+
task :load_record => :environment do
|
5
|
+
if NimbleshopPaypalwp::Paypalwp.find_by_permalink('paypalwp')
|
6
|
+
puts "Paypal record already exists"
|
7
|
+
else
|
8
|
+
NimbleshopPaypalwp::Paypalwp.create!(
|
9
|
+
{
|
10
|
+
name: 'Paypal website payments standard',
|
11
|
+
permalink: 'paypalwp',
|
12
|
+
merchant_email: 'seller_1323037155_biz@bigbinary.com',
|
13
|
+
description: %Q[<p> Paypal website payments standard is a payment solution provided by paypal which allows merchant to accept credit card and paypal payments. There is no monthly fee and no setup fee by paypal for this account. </p> <p> <a href='https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_ID=merchant/wp_standard&nav=2.1.0'> more information </a> </p>]
|
14
|
+
})
|
15
|
+
puts 'Paypalwp record was successfuly created'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'copies images from engine to main rails application'
|
20
|
+
task :copy_images do
|
21
|
+
engine_name = 'nimbleshop_paypalwp'
|
22
|
+
origin = File.expand_path('../../app/assets/images', File.dirname(__FILE__))
|
23
|
+
destination = Rails.root.join('app', 'assets', 'images', 'engines', engine_name)
|
24
|
+
FileUtils.mkdir_p(destination) if !File.exist?(destination)
|
25
|
+
Dir[File.join(origin, '**/*')].each { |file| FileUtils.cp(file, File.join(destination) ) unless File.directory?(file) }
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nimbleshop_paypalwp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.rc1
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Neeraj Singh
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-03 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activemerchant
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: valid_email
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: money
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Provides Paypal WPS functionality for nimbleshop
|
63
|
+
email:
|
64
|
+
- neeraj@bigbinary.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- app/assets/images/paypal_big.png
|
70
|
+
- app/assets/images/paypal_small.png
|
71
|
+
- app/controllers/nimbleshop_paypalwp/paypalwps_controller.rb
|
72
|
+
- app/helpers/nimbleshop_paypalwp/exposed_helper.rb
|
73
|
+
- app/models/nimbleshop_paypalwp/paypalwp.rb
|
74
|
+
- app/views/nimbleshop_paypalwp/payments/_new.html.erb
|
75
|
+
- app/views/nimbleshop_paypalwp/payments/_order_show_extra_info.html.erb
|
76
|
+
- app/views/nimbleshop_paypalwp/paypalwps/_edit.html.erb
|
77
|
+
- app/views/nimbleshop_paypalwp/paypalwps/_form.html.erb
|
78
|
+
- config/routes.rb
|
79
|
+
- lib/nimbleshop_paypalwp/active_merchant/billing/integrations/paypal/helper.rb
|
80
|
+
- lib/nimbleshop_paypalwp/engine.rb
|
81
|
+
- lib/nimbleshop_paypalwp/processor.rb
|
82
|
+
- lib/nimbleshop_paypalwp/version.rb
|
83
|
+
- lib/nimbleshop_paypalwp.rb
|
84
|
+
- lib/tasks/nimbleshop_paypalwp_mock_ipn_callback.rake
|
85
|
+
- lib/tasks/nimbleshop_paypalwp_tasks.rake
|
86
|
+
- README.md
|
87
|
+
homepage: http://nimbleShop.org
|
88
|
+
licenses: []
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>'
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 1.3.1
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 1.8.23
|
108
|
+
signing_key:
|
109
|
+
specification_version: 3
|
110
|
+
summary: Paypal WPS extension for nimbleshop
|
111
|
+
test_files: []
|