sage_party 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sage_party.rb +7 -4
- metadata +3 -3
data/lib/sage_party.rb
CHANGED
@@ -2,8 +2,6 @@ require 'digest'
|
|
2
2
|
require 'active_support'
|
3
3
|
require 'party_resource'
|
4
4
|
|
5
|
-
PartyResource::Connector.add(:sage_party, {})
|
6
|
-
|
7
5
|
module SageParty
|
8
6
|
class Transaction
|
9
7
|
include PartyResource
|
@@ -12,9 +10,8 @@ module SageParty
|
|
12
10
|
URLS = {:simulator => 'https://test.sagepay.com/simulator/VSPServerGateway.asp?Service=VendorRegisterTx',
|
13
11
|
:test => 'https://test.sagepay.com/gateway/service/vspserver-register.vsp',
|
14
12
|
:live => 'https://live.sagepay.com/gateway/service/vspserver-register.vsp'}
|
15
|
-
::SAGE_PAY_SERVER = :simulator unless Object.const_defined?('SAGE_PAY_SERVER')
|
16
13
|
|
17
|
-
connect :raw_register, :post =>
|
14
|
+
connect :raw_register, :post => '', :as => :raw
|
18
15
|
|
19
16
|
%w{VPSProtocol StatusDetail VPSTxId SecurityKey NextURL
|
20
17
|
VPSTxId VendorTxCode Status TxAuthNo VendorName AVSCV2 SecurityKey
|
@@ -27,6 +24,12 @@ module SageParty
|
|
27
24
|
|
28
25
|
|
29
26
|
class << self
|
27
|
+
# Define which Sage server to use
|
28
|
+
# @param [Symbol] server One of :live, :test, or :simulator
|
29
|
+
def sage_pay_server(server)
|
30
|
+
PartyResource::Connector.add(:sage_party, {:base_uri => URLS[server.to_sym]})
|
31
|
+
end
|
32
|
+
|
30
33
|
# Register a new transaction with SagePay
|
31
34
|
# @return [Transaction]
|
32
35
|
def register_tx(data)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tristan Harris
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-06-01 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|