spree_unified_payment 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', :branch => '2-1-stab
11
11
 
12
12
  gem 'spree_wallet', :git => 'git://github.com/vinsol/spree_wallet.git', tag: '2.1.0'
13
13
 
14
- gem 'unified_payment', github: 'vinsol/Unified-Payments', branch: 'upgrade_rails4'
14
+ gem 'unified_payment', github: 'vinsol/Unified-Payments', tag: '1.1.0'
15
15
 
16
16
  gem 'delayed_job_active_record', :tag => 'v4.0.0'
17
17
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ Set Up
23
23
 
24
24
  Add To Gemfile:
25
25
  ```ruby
26
- gem 'spree_unified_payment', '1.1.0'
26
+ gem 'spree_unified_payment', '1.1.1'
27
27
  ```
28
28
  For Spree 2.0:
29
29
  ```ruby
data/Versionfile CHANGED
@@ -10,4 +10,4 @@
10
10
  # '0.40.x' => { :tag => 'v1.0.0', :version => '1.0.0' }
11
11
 
12
12
  "2.0.x" => { :tag => '1.0.2' }
13
- "2.1.x" => { :tag => '1.1.0' }
13
+ "2.1.x" => { :tag => '1.1.1' }
@@ -1,3 +1,4 @@
1
+ //= require jquery.ui.dialog.js
1
2
  $(document).ready(function() {
2
3
  click_on_overlay = function(pop_up_div) {
3
4
  $('div.ui-widget-overlay').on('click', function(){
@@ -13,7 +14,7 @@ $(document).ready(function() {
13
14
  autoOpen: false,
14
15
  modal: true,
15
16
  width:700,
16
- closeText: "X",
17
+ closeText: "",
17
18
  dialogClass:"quick_view_container",
18
19
  close: function(event, ui) {
19
20
  pop_up_div.remove();
@@ -5,6 +5,10 @@ module Spree
5
5
 
6
6
  before_filter :load_transactions, :only => [:query_gateway, :receipt]
7
7
 
8
+ def model_class
9
+ UnifiedPayment::Transaction
10
+ end
11
+
8
12
  def index
9
13
  params[:q] ||= {}
10
14
  @search = UnifiedPayment::Transaction.order('updated_at desc').ransack(params[:q])
@@ -13,8 +17,11 @@ module Spree
13
17
 
14
18
  def receipt
15
19
  @order = @card_transaction.order
16
- doc = Nokogiri::XML(@card_transaction.xml_response)
17
- @message = Hash.from_xml(doc.to_xml)['Message']
20
+ @xml_response = @card_transaction.xml_response
21
+ if @xml_response.include?('<Message')
22
+ doc = Nokogiri::XML(@card_transaction.xml_response)
23
+ @message = Hash.from_xml(doc.to_xml)['Message']
24
+ end
18
25
  render :layout => false
19
26
  end
20
27
 
@@ -1,6 +1,6 @@
1
- Deface::Override.new(:virtual_path => "spree/layouts/admin",
1
+ Deface::Override.new(:virtual_path => "spree/admin/shared/_menu",
2
2
  :name => "Add Unified tab to menu",
3
- :insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
3
+ :insert_bottom => "[data-hook='admin_tabs']",
4
4
  :text => " <%= tab( :UnifiedPayments , :url => admin_unified_payments_path) %>",
5
5
  :sequence => {:after => "promo_admin_tabs"},
6
6
  :disabled => false)
@@ -1,20 +1,24 @@
1
1
  <div class="logo-container">
2
2
  <%= image_tag(Spree::Config[:admin_interface_logo], :id => 'logo') %>
3
- </div>
4
- <h1>Receipt:</h1>
5
- <table border="0" cellpadding="5" cellspacing="0">
6
- <% mail_content_hash_for_unified(@message, @card_transaction).each_pair do |key, value| %>
7
- <tr>
8
- <td><%= key.to_s.split('_').inject([]) { |r,s| r += [s.capitalize] }.join(' ') %></td>
9
- <td><%= value.to_s %></td>
10
- </tr>
11
- <% end %>
12
- <tr>
13
- <td>Order Description</td>
14
- <% if @order.line_items.count == 1 %>
15
- <td>Payment for <%= @order.line_items.first.product.name + " at #{Spree::Config[:site_name]}"%></td>
16
- <% else %>
17
- <td>Payment for <%= @order.line_items.count.to_s + " products at #{Spree::Config[:site_name]}"%></td>
3
+ </div>
4
+ <% if @message %>
5
+ <h1>Receipt:</h1>
6
+ <table border="0" cellpadding="5" cellspacing="0">
7
+ <% mail_content_hash_for_unified(@message, @card_transaction).each_pair do |key, value| %>
8
+ <tr>
9
+ <td><%= key.to_s.split('_').inject([]) { |r,s| r += [s.capitalize] }.join(' ') %></td>
10
+ <td><%= value.to_s %></td>
11
+ </tr>
18
12
  <% end %>
19
- </tr>
20
- </table>
13
+ <tr>
14
+ <td>Order Description</td>
15
+ <% if @order.line_items.count == 1 %>
16
+ <td>Payment for <%= @order.line_items.first.product.name + " at #{Spree::Config[:site_name]}"%></td>
17
+ <% else %>
18
+ <td>Payment for <%= @order.line_items.count.to_s + " products at #{Spree::Config[:site_name]}"%></td>
19
+ <% end %>
20
+ </tr>
21
+ </table>
22
+ <% else %>
23
+ <p>No Receipt for this transaction</p>
24
+ <% end %>
data/config/routes.rb CHANGED
@@ -3,18 +3,12 @@ Spree::Core::Engine.routes.draw do
3
3
  get '/unified_payments/new' => "unified_payments#new", as: :new_unified_transaction
4
4
  post '/unified_payments/create' => "unified_payments#create", as: :create_unified_transaction
5
5
  post '/unified_payments/canceled' => "unified_payments#canceled", as: :canceled_unified_payments
6
- get '/unified_payments/declined' => "unified_payments#declined", as: :declined_unified_payments
6
+ post '/unified_payments/declined' => "unified_payments#declined", as: :declined_unified_payments
7
7
  post '/unified_payments/approved' => "unified_payments#approved", as: :approved_unified_payments
8
8
 
9
9
  get 'admin/unified_payments' => "admin/unified_payments#index"
10
- get 'admin/unified_payments/receipt/:transaction_id' => "admin/unified_payments#receipt", as: :unified_payments_receipt
11
- post 'admin/unified_payments/query_gateway' => "admin/unified_payments#query_gateway", as: :unified_payments_query_gateway
10
+ get 'admin/unified_payments/receipt/:transaction_id' => "admin/unified_payments#receipt", as: :admin_unified_payments_receipt
11
+ post 'admin/unified_payments/query_gateway' => "admin/unified_payments#query_gateway", as: :admin_unified_payments_query_gateway
12
12
 
13
- #for test
14
- #[TODO]:uncomment this later
15
- # get '/unified_payments/declined', :to => redirect{ |p, request| '/' }
16
-
17
- #[TODO]:remove this later
18
- # get '/unified_payments/approved', :to => "unified_payments#approved"
19
- # get '/unified_payments/canceled', :to => "unified_payments#canceled"
13
+ get '/unified_payments/declined', :to => redirect{ |p, request| '/' }
20
14
  end
@@ -18,6 +18,8 @@ describe Spree::Admin::UnifiedPaymentsController do
18
18
  card_transaction.stub(:order).and_return(order)
19
19
  end
20
20
 
21
+ it { controller.model_class.should eq(UnifiedPayment::Transaction) }
22
+
21
23
  describe '#index' do
22
24
  def send_request(params = {})
23
25
  get :index, params.merge!(:use_route => 'spree', :page => 0)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = "spree_unified_payment"
4
- s.version = "1.1.0"
4
+ s.version = "1.1.1"
5
5
  s.author = ["Manish Kangia", "Sushant Mittal"]
6
6
  s.email = 'info@vinsol.com'
7
7
  s.homepage = 'http://vinsol.com'
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.requirements << 'none'
18
18
 
19
19
  s.add_dependency('spree_core', '~> 2.1.0')
20
- s.add_dependency 'unified_payment', '1.0.2'
20
+ s.add_dependency 'unified_payment', '1.1.0'
21
21
  s.add_dependency 'spree_wallet', '~> 2.1.0'
22
22
  s.add_dependency 'delayed_job_active_record', '~> 4.0.0'
23
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_unified_payment
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Manish Kangia
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2014-03-28 00:00:00 Z
19
+ date: 2014-03-31 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: spree_core
@@ -45,9 +45,9 @@ dependencies:
45
45
  hash: 19
46
46
  segments:
47
47
  - 1
48
+ - 1
48
49
  - 0
49
- - 2
50
- version: 1.0.2
50
+ version: 1.1.0
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  - !ruby/object:Gem::Dependency
@@ -114,6 +114,7 @@ files:
114
114
  - app/models/unified_payment/transaction_decorator.rb
115
115
  - app/overrides/add_unified_tabs_to_admin_menu.rb
116
116
  - app/overrides/add_user_view_link_for_transactions.rb
117
+ - app/views/spree/admin/payments/source_views/_unifiedpaymentmethod.html.erb
117
118
  - app/views/spree/admin/unified_payments/index.html.erb
118
119
  - app/views/spree/admin/unified_payments/query_gateway.js.erb
119
120
  - app/views/spree/admin/unified_payments/receipt.html.erb