payline 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/lib/payline/client.rb +34 -25
- data/lib/payline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3c625f6bec31b410e849e830804d25b9d562cf3
|
4
|
+
data.tar.gz: b8161b441daa9f14f3b53a88d1b3ee170214742b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbfbf9a79feac0ebac06c36285d0d1ce12cea40fea58e1837397bc9a9e4abf8ff52bd85dd605c728286078670b74bd3618d7ef6445d15580274e0605e4551c64
|
7
|
+
data.tar.gz: 3f562c8b7faf2faafce4c38b4167d410c2b54fe0effc1bdd563d2a163cdcb2516ed7e4a5aed24a5f1becff89c1ae5701dca156581a0bf8a35f6ba313670c2ace
|
data/lib/payline/client.rb
CHANGED
@@ -6,9 +6,42 @@ module Payline
|
|
6
6
|
@response_handler = Payline::ResponseHandler.new
|
7
7
|
end
|
8
8
|
|
9
|
+
def debit(guid, amount, credit_card)
|
10
|
+
proccess("CC.DB", guid, amount, credit_card)
|
11
|
+
end
|
12
|
+
|
9
13
|
def reserve(guid, amount, credit_card)
|
14
|
+
proccess("CC.PA", guid, amount, credit_card)
|
15
|
+
end
|
16
|
+
|
17
|
+
def capture(reserve_response, amount)
|
10
18
|
params = {
|
11
|
-
'
|
19
|
+
'PRESENTATION.CURRENCY' => @config.currency,
|
20
|
+
'PAYMENT.CODE' => "CC.CP",
|
21
|
+
'PRESENTATION.AMOUNT' => amount,
|
22
|
+
'IDENTIFICATION.TRANSACTIONID'=>reserve_response.merchant_reference,
|
23
|
+
'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id
|
24
|
+
}
|
25
|
+
do_request(params)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def reverse(reserve_response, amount)
|
30
|
+
params = {
|
31
|
+
'PRESENTATION.CURRENCY' => @config.currency,
|
32
|
+
'PAYMENT.CODE' => "CC.RV",
|
33
|
+
'PRESENTATION.AMOUNT' => amount,
|
34
|
+
'IDENTIFICATION.TRANSACTIONID'=> reserve_response.merchant_reference,
|
35
|
+
'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id
|
36
|
+
}
|
37
|
+
do_request(params)
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def proccess(code, guid, amount, credit_card)
|
43
|
+
params = {
|
44
|
+
'PAYMENT.CODE' => code,
|
12
45
|
'PRESENTATION.AMOUNT' => amount,
|
13
46
|
'PRESENTATION.CURRENCY' => @config.currency,
|
14
47
|
|
@@ -37,30 +70,6 @@ module Payline
|
|
37
70
|
Payline::ReserveResponse.new(merchant_id, ref_id)
|
38
71
|
end
|
39
72
|
|
40
|
-
def capture(reserve_response, amount)
|
41
|
-
params = {
|
42
|
-
'PRESENTATION.CURRENCY' => @config.currency,
|
43
|
-
'PAYMENT.CODE' => "CC.CP",
|
44
|
-
'PRESENTATION.AMOUNT' => amount,
|
45
|
-
'IDENTIFICATION.TRANSACTIONID'=>reserve_response.merchant_reference,
|
46
|
-
'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id
|
47
|
-
}
|
48
|
-
do_request(params)
|
49
|
-
end
|
50
|
-
|
51
|
-
def reverse(reserve_response, amount)
|
52
|
-
params = {
|
53
|
-
'PRESENTATION.CURRENCY' => @config.currency,
|
54
|
-
'PAYMENT.CODE' => "CC.RV",
|
55
|
-
'PRESENTATION.AMOUNT' => amount,
|
56
|
-
'IDENTIFICATION.TRANSACTIONID'=> reserve_response.merchant_reference,
|
57
|
-
'IDENTIFICATION.REFERENCEID'=> reserve_response.transaction_id
|
58
|
-
}
|
59
|
-
do_request(params)
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
73
|
def do_request(params)
|
65
74
|
uri = URI(Payline::Urls::PAYMENT)
|
66
75
|
http = Net::HTTP.new(uri.host, uri.port)
|
data/lib/payline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: payline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rubin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|