spree_alipay 1.0 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd273af5fd6e08e188a44d019daac32b90b7a9bf
4
- data.tar.gz: d29c3da8caba4fb3271ee4b55eefe897c37709de
3
+ metadata.gz: af4a33725add120387e279050c4bf27cd7c5b8a7
4
+ data.tar.gz: e4a598300bbfe21fb256193325d1a7b76748733e
5
5
  SHA512:
6
- metadata.gz: 393ca0096bc7f8b6e6257d976bbb5a28d4d662b78d05e2840422732470943278ac7f10421b90f100543eef23563c7eafc7276caa02ba7fa38949f16cad25df1d
7
- data.tar.gz: 7a605a1b950cfebb1d579fe12f32a977dfe89e36e8ecfb364ad0fa190445d6d0766545f4ed113ea5aac8633c8722b6367de0af640af27d3770d0db3230d6e4e6
6
+ metadata.gz: 9a4fc30dd50e2187f805cb6ef85461dbfb88c54f0c6db2407826cc611e94c5a0cca0108c06fbf0d4f79722f280ffc13cae747ac9c860cf1612ffb038eea44612
7
+ data.tar.gz: f56014177d333c5fa6a616434b8480a22ecd81d4122b1bbfb441ab525a9add6cf93cdbd537a324a1d36eceb141ad3191c705512047b1db2cca6bcff911523c4f
@@ -0,0 +1,31 @@
1
+ require File.expand_path('../../config/application', __FILE__)
2
+
3
+ require 'rubygems'
4
+ require 'rake'
5
+ require 'rake/testtask'
6
+ require 'rake/packagetask'
7
+ require 'rake/gempackagetask'
8
+
9
+ spec = eval(File.read('spree_alipay.gemspec'))
10
+
11
+ Rake::GemPackageTask.new(spec) do |p|
12
+ p.gem_spec = spec
13
+ end
14
+
15
+ desc "Release to gemcutter"
16
+ task :release => :package do
17
+ require 'rake/gemcutter'
18
+ Rake::Gemcutter::Tasks.new(spec).define
19
+ Rake::Task['gem:push'].invoke
20
+ end
21
+
22
+ desc "Default Task"
23
+ task :default => [ :spec ]
24
+
25
+ require 'rspec/core/rake_task'
26
+ RSpec::Core::RakeTask.new
27
+
28
+ # require 'cucumber/rake/task'
29
+ # Cucumber::Rake::Task.new do |t|
30
+ # t.cucumber_opts = %w{--format pretty}
31
+ # end
@@ -1,4 +1,5 @@
1
- Spree::CheckoutController.class_eval do
1
+ module Spree
2
+ CheckoutController.class_eval do
2
3
 
3
4
  before_filter :redirect_for_alipay, :only => :update
4
5
 
@@ -15,3 +16,4 @@ Spree::CheckoutController.class_eval do
15
16
  end
16
17
  end
17
18
  end
19
+ end
@@ -0,0 +1,17 @@
1
+ Spree::CheckoutController.class_eval do
2
+
3
+ before_filter :redirect_for_alipay, :only => :update
4
+
5
+ private
6
+
7
+ def redirect_for_alipay
8
+ return unless params[:state] == "payment"
9
+ if params[:order][:payments_attributes].present?
10
+ @payment_method = Spree::PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])
11
+ end
12
+ if @payment_method && @payment_method.kind_of?(Spree::PaymentMethod::Alipay)
13
+ # @order.update_attributes(object_params)
14
+ redirect_to gateway_alipay_path(:gateway_id => @payment_method.id, :id => @order.number)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ en:
2
+ purchasing: "You're purchasing this"
3
+ existing_card: "Use an existing card"
4
+ new_card: "Use a new card"
5
+ spree:
6
+ account_id: "Account Id"
7
+ back_to_payment_options: "Back to payment options"
8
+ confirm_your_order: "Confirm your order"
9
+ currency_code: "Currency"
10
+ alipay: "Alipay"
11
+ alipay_pay_instructions: "Pay using credit or debit card from Alipay (you'll be redirected to Alipay secure server)"
12
+ alipay_payment: "Pay by credit card"
13
+ alipay_payment_failure: "Something went wrong. Please try again."
14
+ alipay_payment_response_error: "%{error_message}. Payment was not successful."
15
+ alipay_payment_success: "Your payment has been accepted."
16
+ alipay_submit: "Pay and place order"
17
+ language: "Language"
18
+ mode: "Work mode"
19
+ order_number: "Order number:"
20
+ pay_now: "Pay Now"
21
+ payment_id: "Payment ID"
22
+ payment_success: "Payment Success"
23
+ redirecting_for_payment: "Redirecting for payment ..."
24
+ redirect_success: "Success Redirect URL"
25
+ redirect_fail: "Failure Redirect URL"
26
+ secret_key: "Secret Key"
27
+ transaction_id: "Transaction ID"
28
+ url: "URL"
29
+
@@ -0,0 +1,11 @@
1
+
2
+ Spree::Core::Engine.routes.draw do
3
+
4
+ namespace :gateway do
5
+ get '/:gateway_id/alipay/:id' => 'alipay#show', :as => :alipay
6
+ get '/alipay/:id/comeback' => 'alipay#comeback', :as => :alipay_comeback
7
+ end
8
+ end
9
+
10
+
11
+
@@ -0,0 +1,14 @@
1
+ class CreateAlipayinfos < ActiveRecord::Migration
2
+ def change
3
+ create_table :spree_alipayinfos do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.string :transaction_id
7
+ t.string :payment_id
8
+ t.decimal :amount
9
+ t.integer :order_id
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -1,3 +1,5 @@
1
+ require 'rails/generators'
2
+
1
3
  namespace :spree_alipay do
2
4
  desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
3
5
  task :install do
@@ -23,3 +25,4 @@ namespace :spree_alipay do
23
25
  end
24
26
 
25
27
  end
28
+
@@ -0,0 +1,31 @@
1
+ require 'rails/generators'
2
+ module SpreeAlipay
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+
6
+ desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
7
+ task :install do
8
+ Rake::Task['spree_alipay:install:migrations'].invoke
9
+ Rake::Task['spree_alipay:install:assets'].invoke
10
+ end
11
+
12
+ namespace :install do
13
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
14
+ task :migrations do
15
+ source = File.join(File.dirname(__FILE__), '..', '..', 'db')
16
+ destination = File.join(Rails.root, 'db')
17
+ Spree::Core::FileUtilz.mirror_files(source, destination)
18
+ end
19
+
20
+ desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
21
+ task :assets do
22
+ source = File.join(File.dirname(__FILE__), '..', '..', 'public')
23
+ destination = File.join(Rails.root, 'public')
24
+ puts "INFO: Mirroring assets from #{source} to #{destination}"
25
+ Spree::Core::FileUtilz.mirror_files(source, destination)
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,30 @@
1
+ # This file is copied to ~/spec when you run 'ruby script/generate rspec'
2
+ # from the project root directory.
3
+ ENV["RAILS_ENV"] ||= 'test'
4
+ require File.expand_path("../../../config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
+
11
+ RSpec.configure do |config|
12
+ # == Mock Framework
13
+ #
14
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
15
+ #
16
+ # config.mock_with :mocha
17
+ # config.mock_with :flexmock
18
+ # config.mock_with :rr
19
+ config.mock_with :rspec
20
+
21
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
22
+
23
+ #config.include Devise::TestHelpers, :type => :controller
24
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
25
+ # examples within a transaction, comment the following line or assign false
26
+ # instead of true.
27
+ config.use_transactional_fixtures = true
28
+ end
29
+
30
+ @configuration ||= AppConfiguration.find_or_create_by_name("Default configuration")
Binary file
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |s|
2
+ s.platform = Gem::Platform::RUBY
3
+ s.name = 'spree_alipay'
4
+ s.version = '1.2'
5
+ s.summary = 'Add gem summary here'
6
+ #s.description = 'Add (optional) gem description here'
7
+ s.required_ruby_version = '>= 2.2.0'
8
+ s.author = ['krypt2005']
9
+ s.email = ['krypt2005@gmail.com']
10
+ s.homepage = 'https://github.com/krypt2005/spree_alipay'
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.require_path = 'lib'
14
+ s.requirements << 'none'
15
+
16
+ s.has_rdoc = true
17
+
18
+ s.add_dependency 'spree_core', '~> 2.4.0'
19
+ end
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |s|
2
+ s.platform = Gem::Platform::RUBY
3
+ s.name = 'spree_alipay'
4
+ s.version = '1.1'
5
+ s.summary = 'Add gem summary here'
6
+ #s.description = 'Add (optional) gem description here'
7
+ s.required_ruby_version = '>= 2.2.0'
8
+ s.author = ['krypt2005']
9
+ s.email = ['krypt2005@gmail.com']
10
+ s.homepage = 'https://github.com/krypt2005/spree_alipay'
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.require_path = 'lib'
14
+ s.requirements << 'none'
15
+
16
+ s.has_rdoc = true
17
+
18
+ s.add_dependency 'spree_core', '~> 2.4.0'
19
+ end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_alipay
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - krypt2005
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-15 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: 2.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: 2.4.0
27
27
  description:
28
28
  email:
29
29
  - krypt2005@gmail.com
@@ -32,7 +32,9 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - README.md
35
+ - Rakefile
35
36
  - app/controllers/spree/checkout_controller_decorator.rb
37
+ - app/controllers/spree/checkout_controller_decorator.rb~
36
38
  - app/controllers/spree/gateway/alipay_controller.rb
37
39
  - app/models/spree/alipayinfo.rb
38
40
  - app/models/spree/payment_method/alipay.rb
@@ -40,12 +42,21 @@ files:
40
42
  - app/views/admin/payments/_list.html.erb
41
43
  - app/views/admin/payments/source_views/_alipay.html.erb
42
44
  - app/views/checkout/payment/_alipay.html.erb
45
+ - app/views/spree/checkout/payment/_alipay.html.erb
43
46
  - app/views/spree/gateway/alipay/show.html.erb
47
+ - config/locales/en.yml
48
+ - config/routes.rb
49
+ - db/migrate/20130702115540_create_alipayinfos.rb
44
50
  - lib/spree_alipay.rb
45
51
  - lib/spree_alipay_hooks.rb
46
52
  - lib/tasks/install.rake
53
+ - lib/tasks/install.rake~
47
54
  - lib/tasks/spree_alipay.rake
48
- homepage: http://vasilec.blogspot.de/
55
+ - spec/spec_helper.rb
56
+ - spree_alipay-1.1.gem
57
+ - spree_alipay.gemspec
58
+ - spree_alipay.gemspec~
59
+ homepage: https://github.com/krypt2005/spree_alipay
49
60
  licenses: []
50
61
  metadata: {}
51
62
  post_install_message:
@@ -56,7 +67,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
67
  requirements:
57
68
  - - ">="
58
69
  - !ruby/object:Gem::Version
59
- version: 2.0.0
70
+ version: 2.2.0
60
71
  required_rubygems_version: !ruby/object:Gem::Requirement
61
72
  requirements:
62
73
  - - ">="