so_paid 0.0.5 → 0.0.6

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.
@@ -0,0 +1,19 @@
1
+ class Order < ActiveRecord::Base
2
+
3
+ attr_accessible :amount_cents
4
+
5
+ monetize :amount_cents
6
+
7
+ # so_paid gem Cybersource config
8
+ def cs_transaction_uuid
9
+ "mbs_" + id
10
+ end
11
+
12
+ def cs_amount
13
+ amount.format(:symbol=>false)
14
+ end
15
+
16
+ alias_method :cs_reference_number, :id
17
+
18
+
19
+ end
@@ -0,0 +1,11 @@
1
+ <!-- here we can call @payment_vendor.hop_url(:iframe) or other specific
2
+ option at view-rendering-time, or let it default to our current config setup,
3
+ but test/live has already been determined at this point based on test_user_email or test_mode -->
4
+ <form action="<%=@payment_vendor.hop_url%>" method="post" target="payment_vendor">
5
+ <% @payment_vendor.generate_params.each_pair do |key, value| %>
6
+ <input type="hidden" name="<%=key%>" value="<%=value%>" >
7
+ <%end%>
8
+ <%= submit_tag "Complete Credit Card Payment", :class=>"btn btn-success btn-large" %>
9
+ </form>
10
+
11
+ <iframe name="payment_vendor"></iframe>
@@ -1,6 +1,6 @@
1
- <!-- you can call @payment_vendor.hop_url(:iframe) or other specific
2
- option here at view-rendering-time, but test/live has already been
3
- determined at this point based on test_user_email or test_mode -->
1
+ <!-- here we can call @payment_vendor.hop_url(:webmobile) or other specific
2
+ option at view-rendering-time, or let it default to our current config setup,
3
+ but test/live has already been determined at this point based on test_user_email or test_mode -->
4
4
  <form action="<%=@payment_vendor.hop_url%>" method="post" >
5
5
  <% @payment_vendor.generate_params.each_pair do |key, value| %>
6
6
  <input type="hidden" name="<%=key%>" value="<%=value%>" >
@@ -100,7 +100,7 @@ module SoPaid
100
100
 
101
101
 
102
102
  def set_order_specific_params
103
- o_specific = { :amount=>"amount_cents", :reference_number=>"id", :transaction_uuid=>"uniq_app_order_id" }
103
+ o_specific = { :amount=>"cs_amount", :reference_number=>"cs_reference_number", :transaction_uuid=>"cs_transaction_uuid" }
104
104
 
105
105
  o_specific.each_pair do |key, method|
106
106
  if @pv_order_params[key].present?
@@ -1,3 +1,3 @@
1
1
  module SoPaid
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: so_paid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -90,7 +90,9 @@ files:
90
90
  - Rakefile
91
91
  - examples/.DS_Store
92
92
  - examples/app/controllers/payments_controller.rb
93
- - examples/app/views/confirm.html.erb
93
+ - examples/app/models/order.rb
94
+ - examples/app/views/confirm_iframe.html.erb
95
+ - examples/app/views/confirm_webmobile.html.erb
94
96
  - examples/config/initializers/pay_me.rb
95
97
  - examples/config/routes.rb
96
98
  - lib/.DS_Store