alipay_dualfun 0.0 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/alipay_dualfun.gemspec +3 -3
- data/lib/alipay_dualfun.rb +18 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDJlMjU3MTViZTdmZGJjNzFjNmY1ZjM4M2M2MWExYWI0NjRjODI2OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGUwYTc0NjFhMWNlNmZjMzljOTYyOWRlYWUwMmUyNzI5MzM3YmU4Nw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDQxNDE5NjJlYWY0MWU1MTVhOTI2YjY5ZDcyMDQwYjBmN2YwMGU2MThhZDFj
|
10
|
+
NTBhOWM2MzIzYzU1YWIyZDAwZTc0NGU5ZDMyNzYxZTBhN2VmNmQ2MTY0ODI0
|
11
|
+
YTJiMjI2NGRlNDdlYzE3MzkyNjZlNDY2NDhkMDc0ODJiMzAwMzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDc3NzViZmRjZTM2MGRkNTRjNDczNjFlMDExZGU2OGJjODI3MjIxNGFjNmIx
|
14
|
+
NmRjNzc5ZDQxMjE4Zjc2OTc2ODY0MmNkNzRhZWE0MTE5NTAxM2ZlNWViMjJi
|
15
|
+
MTYxNGM5N2Q0YTkzYzAwYTAyYzFmZTQ0ZTUzMTMyMTM3NWYyMmM=
|
data/alipay_dualfun.gemspec
CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "alipay_dualfun"
|
7
|
-
gem.version = "0.
|
7
|
+
gem.version = "0.1"
|
8
8
|
gem.authors = ["happypeter"]
|
9
9
|
gem.email = ["happypeter1983@gmail.com"]
|
10
|
-
gem.description = %q{This gem can help you integrate Alipay
|
11
|
-
gem.summary = %q{
|
10
|
+
gem.description = %q{This gem can help you integrate Alipay Dual-function Payment.}
|
11
|
+
gem.summary = %q{Ruby library for alipay dual function payment gateways}
|
12
12
|
gem.homepage = "https://github.com/happypeter/alipay_dualfun"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($/)
|
data/lib/alipay_dualfun.rb
CHANGED
@@ -18,7 +18,6 @@ module AlipayDualfun
|
|
18
18
|
:logistics_type, :logistics_fee, :logistics_payment,
|
19
19
|
:price, :quantity
|
20
20
|
]
|
21
|
-
|
22
21
|
end
|
23
22
|
|
24
23
|
class DualfunPay < Base
|
@@ -27,7 +26,6 @@ module AlipayDualfun
|
|
27
26
|
|
28
27
|
def initialize(order)
|
29
28
|
@order = order
|
30
|
-
|
31
29
|
@params = {}
|
32
30
|
end
|
33
31
|
|
@@ -68,6 +66,7 @@ module AlipayDualfun
|
|
68
66
|
end
|
69
67
|
|
70
68
|
private
|
69
|
+
|
71
70
|
def sign_params
|
72
71
|
params = @order.attributes.merge(@params)
|
73
72
|
params[:service] = SERVICE_LABEL
|
@@ -85,7 +84,6 @@ module AlipayDualfun
|
|
85
84
|
|
86
85
|
class Order
|
87
86
|
PAYMENT_TYPE_BUYING = 1
|
88
|
-
PAYMENT_TYPE_DONATION = 4
|
89
87
|
|
90
88
|
attr_accessor :merchant
|
91
89
|
attr_reader :attributes
|
@@ -104,12 +102,10 @@ module AlipayDualfun
|
|
104
102
|
self
|
105
103
|
end
|
106
104
|
|
107
|
-
|
108
|
-
|
109
|
-
@attributes[:
|
110
|
-
@attributes[:
|
111
|
-
@attributes[:price] = '0.1'
|
112
|
-
@attributes[:quantity] = '2'
|
105
|
+
|
106
|
+
def set_price_and_quantity(price, quantity)
|
107
|
+
@attributes[:price] = price
|
108
|
+
@attributes[:quantity] = quantity
|
113
109
|
self
|
114
110
|
end
|
115
111
|
|
@@ -118,25 +114,31 @@ module AlipayDualfun
|
|
118
114
|
self
|
119
115
|
end
|
120
116
|
|
121
|
-
|
122
|
-
|
123
|
-
|
117
|
+
#收银台页面上,商品展示的超链接。
|
118
|
+
def product_url(url)
|
119
|
+
@attributes[:show_url] = url
|
124
120
|
self
|
125
121
|
end
|
126
122
|
|
127
|
-
def
|
128
|
-
@attributes[:
|
123
|
+
def set_logistics(type, payment, fee)
|
124
|
+
@attributes[:logistics_type] = type
|
125
|
+
@attributes[:logistics_payment] = payment
|
126
|
+
@attributes[:logistics_fee] = fee
|
129
127
|
self
|
130
128
|
end
|
131
129
|
|
132
|
-
|
133
|
-
|
130
|
+
# set to 0, for virtaul goods with no delivery
|
131
|
+
def no_logistics
|
132
|
+
@attributes[:logistics_type] = 'POST'
|
133
|
+
@attributes[:logistics_payment] = 'BUYER_PAY'
|
134
|
+
@attributes[:logistics_fee] = '0'
|
134
135
|
self
|
135
136
|
end
|
136
137
|
|
137
138
|
def dualfun_pay
|
138
139
|
Product::DualfunPay.new(self)
|
139
140
|
end
|
141
|
+
|
140
142
|
end
|
141
143
|
|
142
144
|
class Merchant
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alipay_dualfun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- happypeter
|
@@ -10,7 +10,7 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: This gem can help you integrate Alipay
|
13
|
+
description: This gem can help you integrate Alipay Dual-function Payment.
|
14
14
|
email:
|
15
15
|
- happypeter1983@gmail.com
|
16
16
|
executables: []
|
@@ -45,6 +45,6 @@ rubyforge_project:
|
|
45
45
|
rubygems_version: 2.0.3
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
|
-
summary:
|
48
|
+
summary: Ruby library for alipay dual function payment gateways
|
49
49
|
test_files: []
|
50
50
|
has_rdoc:
|