easypay 1.0.3 → 1.1.0

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/README.md CHANGED
@@ -31,7 +31,7 @@ Check on your initializers folder for easypay.rb and change the parameters:
31
31
  config.entity = 'entity provided by Easypay'
32
32
 
33
33
  # Code is needed only if you don't have validation by IP Address
34
- config.code = 'Code is needed only if you don't have validation by IP Address (Configure on Easypay Backoffice)'
34
+ config.code = "Code is needed only if you don't have validation by IP Address (Configure on Easypay Backoffice)"
35
35
 
36
36
  # Change routes in order to work them on your app
37
37
  config.easypay_notification_path = '/easypay/notifications.:format'
@@ -50,7 +50,7 @@ In your model, add:
50
50
  acts_as_payable :name => 'your_model_name_attr_if_different_from_name',
51
51
  :email => 'your_model_email_attr_if_different_from_email',
52
52
  :mobile => 'your_model_mobile_attr_if_different_from_mobile',
53
- :item_description => ''your_model_item_description_attr_if_different_from_item_description',
53
+ :item_description => 'your_model_item_description_attr_if_different_from_item_description',
54
54
  :item_quantity => 'your_model_item_quantity_attr_if_different_from_item_quantity',
55
55
  :value => 'your_model_value_attr_if_different_from_value',
56
56
  :description => 'your_model_description_attr_if_description_from_email',
@@ -6,13 +6,15 @@ module Easypay
6
6
 
7
7
  def process(object, options = {})
8
8
  @object = object
9
+ payable_type = @object.class.to_s
9
10
 
10
11
  if compliant?
11
12
  self.update_attributes(handle_model_methods)
12
13
 
13
14
  payment_reference = Easypay::Client.new(options).create_reference(self)
14
15
 
15
- self.update_attributes( :ep_message => payment_reference[:ep_message],
16
+ self.update_attributes( :payable_type => payable_type,
17
+ :ep_message => payment_reference[:ep_message],
16
18
  :ep_reference => payment_reference[:ep_reference],
17
19
  :ep_cin => payment_reference[:ep_cin],
18
20
  :ep_user => payment_reference[:ep_user],
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "easypay"
6
- s.version = "1.0.3"
6
+ s.version = "1.1.0"
7
7
  s.authors = ["Guilherme Pereira"]
8
8
  s.email = ["guiferrpereira@gmail.com"]
9
9
  s.homepage = ""
@@ -2,6 +2,7 @@ class CreateEasypayTables < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :easypay_payment_references, :force => true do |t|
4
4
  t.integer :payable_id
5
+ t.string :payable_type
5
6
  t.string :ep_key
6
7
  t.string :ep_doc
7
8
  t.string :ep_cin
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 3
10
- version: 1.0.3
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Guilherme Pereira
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-27 00:00:00 Z
18
+ date: 2012-08-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: nokogiri