pxpay 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ source "http://rubygems.org"
8
8
  group :development do
9
9
  gem "shoulda", ">= 0"
10
10
  gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.5.2"
11
+ gem "jeweler", "~> 1.6"
12
12
  gem "rcov", ">= 0"
13
13
  gem "builder"
14
14
  gem "nokogiri"
data/Gemfile.lock CHANGED
@@ -3,7 +3,7 @@ GEM
3
3
  specs:
4
4
  builder (2.1.2)
5
5
  git (1.2.5)
6
- jeweler (1.5.2)
6
+ jeweler (1.6.0)
7
7
  bundler (~> 1.0.0)
8
8
  git (>= 1.2.5)
9
9
  rake
@@ -21,7 +21,7 @@ PLATFORMS
21
21
  DEPENDENCIES
22
22
  builder
23
23
  bundler (~> 1.0.0)
24
- jeweler (~> 1.5.2)
24
+ jeweler (~> 1.6)
25
25
  nokogiri
26
26
  rcov
27
27
  rest-client
data/README.md CHANGED
@@ -14,8 +14,8 @@ Installation
14
14
  ------------
15
15
  Install from Rubygems
16
16
  gem install pxpay
17
- Then run `rails generate pxpay:install` to copy an initializer and a config yml file to your rails app.
18
- Make sure you add your own development credentials to the `config/initializers/pxpay.rb` file and create success and failure URLs for Payment Express to redirect you back.
17
+ Then run `rails generate pxpay:install` to copy an initializer to your rails app.
18
+ Make sure you add your own development credentials to the `config/initializers/pxpay.rb` file
19
19
  You can apply for a development account at <https://www.paymentexpress.com/pxmi/apply>
20
20
 
21
21
 
@@ -52,8 +52,12 @@ This means your success/failure URL will be hit at least twice for each transact
52
52
 
53
53
 
54
54
  Token Billing can be implemented by setting `:token_billing => true` inside the Request option hash.
55
+
56
+
55
57
  N.B.
56
58
  ----
59
+ The source of most non-gem related errors comes from the fact that Payment Express caches the details of a transaction with the ID given.
60
+ If you are having problems with the wrong price being charged or an invalid card type error make sure you are sending a unique ID through with each transaction.
57
61
 
58
62
  This gem is in no way endorsed or affiliated with Payment Express
59
63
 
@@ -61,7 +65,6 @@ TODO
61
65
  ----
62
66
  * Add ability to set global configuration options
63
67
  * Add more tests
64
- * Add support for optional text fields
65
68
 
66
69
  Contributing to PxPay
67
70
  =====================
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/pxpay/request.rb CHANGED
@@ -11,21 +11,22 @@ module Pxpay
11
11
  # Create a new instance of Pxpay::Request
12
12
  # Pxpay::Request.new( id, amount, options = {} )
13
13
  # Current available options are:
14
- # :currency_input, currency for transaction, default is NZD, can be any of Pxpay::Base.currency_types
15
- # :reference, a reference field, default is the id.
16
- # :email_address, email address of user, optional.
17
- # :token_billing, boolean value, set to true to enable token billing.
18
- # :billing_id, optional billing_id field only used if token_billing is set to true.
19
- # :txn_type, can be set to :auth for Auth transaction, defaults to Purchase
20
- # :url_success, Success URL, can optionally be set globally via Pxpay::Base.url_success=
21
- # :url_failure, Failure URL, can optionally be set globally via Pxpay::Base.url_failure=
22
- # :txn_data1, Optional data
23
- # :txn_data2, Optional data
24
- # :txn_data3, Optional data
25
- # :txn_data4, Optional data
26
- # :opt, Optional data
14
+ # :currency_input, currency for transaction, default is NZD, can be any of Pxpay::Base.currency_types
15
+ # :merchant_reference, a reference field, default is the id.
16
+ # :email_address, email address of user, optional.
17
+ # :token_billing, boolean value, set to true to enable token billing.
18
+ # :billing_id, optional billing_id field only used if token_billing is set to true.
19
+ # :txn_type, can be set to :auth for Auth transaction, defaults to Purchase
20
+ # :url_success, Success URL, can optionally be set globally via Pxpay::Base.url_success=
21
+ # :url_failure, Failure URL, can optionally be set globally via Pxpay::Base.url_failure=
22
+ # :txn_data1, Optional data
23
+ # :txn_data2, Optional data
24
+ # :txn_data3, Optional data
25
+ # :txn_data4, Optional data
26
+ # :opt, Optional data
27
27
 
28
28
  def initialize( id , price, options = {} )
29
+ warn "Using :reference is deprecated, please use :merchant_reference instead" if options[:reference]
29
30
  @post = build_xml( id, price, options )
30
31
  end
31
32
 
@@ -54,19 +55,19 @@ module Pxpay
54
55
  xml.PxPayKey ::Pxpay::Base.pxpay_key
55
56
  xml.AmountInput sprintf("%.2f", price)
56
57
  xml.TxnId id
57
- xml.TxnType options[:txn_type] ? options[:txn_type].to_s.capitalize : "Purchase"
58
- xml.CurrencyInput options[:currency_input] || "NZD"
59
- xml.MerchantReference options[:reference] || id.to_s
60
- xml.UrlSuccess options[:url_success] || ::Pxpay::Base.url_success
61
- xml.UrlFail options[:url_failure] || ::Pxpay::Base.url_failure
62
- xml.EmailAddress options[:email_address] if options[:email_address]
63
- xml.TxnData1 options[:txn_data1] if options[:txn_data1]
64
- xml.TxnData2 options[:txn_data2] if options[:txn_data2]
65
- xml.TxnData3 options[:txn_data3] if options[:txn_data3]
66
- xml.TxnData4 options[:txn_data4] if options[:txn_data4]
67
- xml.Opt options[:opt] if options[:opt]
68
- xml.EnableAddBillCard 1 if options[:token_billing]
69
- xml.BillingId options[:billing_id] if options[:token_billing]
58
+ xml.TxnType options[:txn_type] ? options[:txn_type].to_s.capitalize : "Purchase"
59
+ xml.CurrencyInput options[:currency_input] || "NZD"
60
+ xml.MerchantReference options[:merchant_reference] || options[:reference] || id.to_s ## Backwards compatibility
61
+ xml.UrlSuccess options[:url_success] || ::Pxpay::Base.url_success
62
+ xml.UrlFail options[:url_failure] || ::Pxpay::Base.url_failure
63
+ xml.EmailAddress options[:email_address] if options[:email_address]
64
+ xml.TxnData1 options[:txn_data1] if options[:txn_data1]
65
+ xml.TxnData2 options[:txn_data2] if options[:txn_data2]
66
+ xml.TxnData3 options[:txn_data3] if options[:txn_data3]
67
+ xml.TxnData4 options[:txn_data4] if options[:txn_data4]
68
+ xml.Opt options[:opt] if options[:opt]
69
+ xml.EnableAddBillCard 1 if options[:token_billing]
70
+ xml.BillingId options[:billing_id] if options[:token_billing]
70
71
  end
71
72
  end
72
73
  end
data/pxpay.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pxpay}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bradley Priest"]
12
- s.date = %q{2011-04-27}
12
+ s.date = %q{2011-05-15}
13
13
  s.description = %q{A Ruby wrapper around the DPS-hosted PxPay service}
14
14
  s.email = %q{bradleypriest@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -41,20 +41,17 @@ Gem::Specification.new do |s|
41
41
  s.homepage = %q{http://github.com/bradleypriest/pxpay}
42
42
  s.licenses = ["MIT"]
43
43
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.5.2}
44
+ s.rubygems_version = %q{1.3.7}
45
45
  s.summary = %q{Ruby wrapper for the Payment Express' PxPay API}
46
- s.test_files = [
47
- "test/helper.rb",
48
- "test/test_pxpay.rb"
49
- ]
50
46
 
51
47
  if s.respond_to? :specification_version then
48
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
52
49
  s.specification_version = 3
53
50
 
54
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
55
52
  s.add_development_dependency(%q<shoulda>, [">= 0"])
56
53
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
57
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
54
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
58
55
  s.add_development_dependency(%q<rcov>, [">= 0"])
59
56
  s.add_development_dependency(%q<builder>, [">= 0"])
60
57
  s.add_development_dependency(%q<nokogiri>, [">= 0"])
@@ -65,7 +62,7 @@ Gem::Specification.new do |s|
65
62
  else
66
63
  s.add_dependency(%q<shoulda>, [">= 0"])
67
64
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
68
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
65
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
69
66
  s.add_dependency(%q<rcov>, [">= 0"])
70
67
  s.add_dependency(%q<builder>, [">= 0"])
71
68
  s.add_dependency(%q<nokogiri>, [">= 0"])
@@ -77,7 +74,7 @@ Gem::Specification.new do |s|
77
74
  else
78
75
  s.add_dependency(%q<shoulda>, [">= 0"])
79
76
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
80
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
77
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
81
78
  s.add_dependency(%q<rcov>, [">= 0"])
82
79
  s.add_dependency(%q<builder>, [">= 0"])
83
80
  s.add_dependency(%q<nokogiri>, [">= 0"])
metadata CHANGED
@@ -1,8 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxpay
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 2
9
+ version: 0.2.2
6
10
  platform: ruby
7
11
  authors:
8
12
  - Bradley Priest
@@ -10,7 +14,7 @@ autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
16
 
13
- date: 2011-04-27 00:00:00 +12:00
17
+ date: 2011-05-15 00:00:00 +12:00
14
18
  default_executable:
15
19
  dependencies:
16
20
  - !ruby/object:Gem::Dependency
@@ -20,6 +24,8 @@ dependencies:
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
30
  type: :development
25
31
  prerelease: false
@@ -31,6 +37,10 @@ dependencies:
31
37
  requirements:
32
38
  - - ~>
33
39
  - !ruby/object:Gem::Version
40
+ segments:
41
+ - 1
42
+ - 0
43
+ - 0
34
44
  version: 1.0.0
35
45
  type: :development
36
46
  prerelease: false
@@ -42,7 +52,10 @@ dependencies:
42
52
  requirements:
43
53
  - - ~>
44
54
  - !ruby/object:Gem::Version
45
- version: 1.5.2
55
+ segments:
56
+ - 1
57
+ - 6
58
+ version: "1.6"
46
59
  type: :development
47
60
  prerelease: false
48
61
  version_requirements: *id003
@@ -53,6 +66,8 @@ dependencies:
53
66
  requirements:
54
67
  - - ">="
55
68
  - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
56
71
  version: "0"
57
72
  type: :development
58
73
  prerelease: false
@@ -64,6 +79,8 @@ dependencies:
64
79
  requirements:
65
80
  - - ">="
66
81
  - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
67
84
  version: "0"
68
85
  type: :development
69
86
  prerelease: false
@@ -75,6 +92,8 @@ dependencies:
75
92
  requirements:
76
93
  - - ">="
77
94
  - !ruby/object:Gem::Version
95
+ segments:
96
+ - 0
78
97
  version: "0"
79
98
  type: :development
80
99
  prerelease: false
@@ -86,6 +105,8 @@ dependencies:
86
105
  requirements:
87
106
  - - ">="
88
107
  - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
89
110
  version: "0"
90
111
  type: :development
91
112
  prerelease: false
@@ -97,6 +118,8 @@ dependencies:
97
118
  requirements:
98
119
  - - ">="
99
120
  - !ruby/object:Gem::Version
121
+ segments:
122
+ - 0
100
123
  version: "0"
101
124
  type: :runtime
102
125
  prerelease: false
@@ -108,6 +131,8 @@ dependencies:
108
131
  requirements:
109
132
  - - ">="
110
133
  - !ruby/object:Gem::Version
134
+ segments:
135
+ - 0
111
136
  version: "0"
112
137
  type: :runtime
113
138
  prerelease: false
@@ -119,6 +144,8 @@ dependencies:
119
144
  requirements:
120
145
  - - ">="
121
146
  - !ruby/object:Gem::Version
147
+ segments:
148
+ - 0
122
149
  version: "0"
123
150
  type: :runtime
124
151
  prerelease: false
@@ -167,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
194
  requirements:
168
195
  - - ">="
169
196
  - !ruby/object:Gem::Version
170
- hash: -3326667328160921882
197
+ hash: 3196313653595730493
171
198
  segments:
172
199
  - 0
173
200
  version: "0"
@@ -176,14 +203,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
203
  requirements:
177
204
  - - ">="
178
205
  - !ruby/object:Gem::Version
206
+ segments:
207
+ - 0
179
208
  version: "0"
180
209
  requirements: []
181
210
 
182
211
  rubyforge_project:
183
- rubygems_version: 1.5.2
212
+ rubygems_version: 1.3.7
184
213
  signing_key:
185
214
  specification_version: 3
186
215
  summary: Ruby wrapper for the Payment Express' PxPay API
187
- test_files:
188
- - test/helper.rb
189
- - test/test_pxpay.rb
216
+ test_files: []
217
+