qunar-ota 0.1.0 → 0.1.1
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/qunar/ota.rb +92 -1
- data/lib/qunar/ota/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1730bf36ec349eb6f964b48abc5f2a01a1fc97b8
|
4
|
+
data.tar.gz: 70b1f7a341079788be478f5b61231834e2da8d9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea2a75917db7959ec85818f5f0ce934fb97ad6327c2e668ed446db31377f9ce6fb5fdf26579e6f05333dae3e4fa404b74f5ebf91d7fc141a081718615142950
|
7
|
+
data.tar.gz: ad603b91932b86028c7a3907652447a7e6966be7eea2e5758d8c495926313aa9895f06fb0901605d09e9f82027d2af87461363da322adaaf73d9a5135934ad55
|
data/lib/qunar/ota.rb
CHANGED
@@ -23,7 +23,7 @@ module Qunar
|
|
23
23
|
http = Net::HTTP.new(url.host, url.port)
|
24
24
|
request = Net::HTTP::Post.new(url)
|
25
25
|
request['content-type'] = 'application/x-www-form-urlencoded'
|
26
|
-
request.body = @req_data = URI.encode_www_form(params)
|
26
|
+
request.body = @req_data = URI.encode_www_form(params.compact)
|
27
27
|
response = http.request(request)
|
28
28
|
raise RequestError, "HTTP Response: #{response.code} #{response.message}" unless response.is_a?(Net::HTTPSuccess)
|
29
29
|
result = JSON.parse(@resp = response.read_body)
|
@@ -59,6 +59,97 @@ module Qunar
|
|
59
59
|
})
|
60
60
|
request('otaOpt', params)
|
61
61
|
end
|
62
|
+
|
63
|
+
# ota_opt_confirm_room_success(order_num)
|
64
|
+
#
|
65
|
+
# 确认有房
|
66
|
+
def ota_opt_confirm_room_success(order_num)
|
67
|
+
ota_opt(order_num, 'CONFIRM_ROOM_SUCCESS')
|
68
|
+
end
|
69
|
+
|
70
|
+
# ota_opt_confirm_room_failure(order_num)
|
71
|
+
#
|
72
|
+
# 确认无房
|
73
|
+
def ota_opt_confirm_room_failure(order_num)
|
74
|
+
ota_opt(order_num, 'CONFIRM_ROOM_FAILURE')
|
75
|
+
end
|
76
|
+
|
77
|
+
# ota_opt_arrange_room(order_num, arrange_type, confirmation_number = nil)
|
78
|
+
#
|
79
|
+
# 安排房间
|
80
|
+
def ota_opt_arrange_room(order_num, arrange_type, confirmation_number = nil)
|
81
|
+
ota_opt(order_num, 'ARRANGE_ROOM', arrangeType: arrange_type, confirmationNumber: confirmation_number)
|
82
|
+
end
|
83
|
+
|
84
|
+
# ota_opt_add_remarks(order_num, remark)
|
85
|
+
#
|
86
|
+
# 添加备注
|
87
|
+
def ota_opt_add_remarks(order_num, remark)
|
88
|
+
ota_opt(order_num, 'ADD_REMARKS', remark: remark)
|
89
|
+
end
|
90
|
+
|
91
|
+
# ota_opt_apply_unsubscribe(order_num, money)
|
92
|
+
#
|
93
|
+
# 申请退订
|
94
|
+
def ota_opt_apply_unsubscribe(order_num, money)
|
95
|
+
ota_opt(order_num, 'APPLY_UNSUBSCRIBE', money: money)
|
96
|
+
end
|
97
|
+
|
98
|
+
# ota_opt_agree_unsubscrbe(order_num, money)
|
99
|
+
#
|
100
|
+
# 同意退订
|
101
|
+
def ota_opt_agree_unsubscrbe(order_num, money)
|
102
|
+
ota_opt(order_num, 'AGREE_UNSUBSCRBE', money: money)
|
103
|
+
end
|
104
|
+
|
105
|
+
# ota_opt_refuse_unsubscribe(order_num)
|
106
|
+
#
|
107
|
+
# 拒绝退订
|
108
|
+
def ota_opt_refuse_unsubscribe(order_num)
|
109
|
+
ota_opt(order_num, 'REFUSE_UNSUBSCRIBE')
|
110
|
+
end
|
111
|
+
|
112
|
+
# ota_opt_confirm_show(order_num)
|
113
|
+
#
|
114
|
+
# 确认入住
|
115
|
+
def ota_opt_confirm_show(order_num)
|
116
|
+
ota_opt(order_num, 'CONFIRM_SHOW')
|
117
|
+
end
|
118
|
+
|
119
|
+
# ota_opt_confirm_noshow(order_num)
|
120
|
+
#
|
121
|
+
# 确认未入住
|
122
|
+
def ota_opt_confirm_noshow(order_num)
|
123
|
+
ota_opt(order_num, 'CONFIRM_NOSHOW')
|
124
|
+
end
|
125
|
+
|
126
|
+
# ota_opt_agree_cashback(order_num)
|
127
|
+
#
|
128
|
+
# 确认离店可返现
|
129
|
+
def ota_opt_agree_cashback(order_num)
|
130
|
+
ota_opt(order_num, 'AGREE_CASHBACK')
|
131
|
+
end
|
132
|
+
|
133
|
+
# ota_opt_send_fax(order_num, params = {})
|
134
|
+
#
|
135
|
+
# 发送传真
|
136
|
+
def ota_opt_send_fax(order_num, params = {})
|
137
|
+
ota_opt(order_num, 'SEND_FAX', params)
|
138
|
+
end
|
139
|
+
|
140
|
+
# ota_opt_send_sms(order_num, sms_content)
|
141
|
+
#
|
142
|
+
# 短信内容
|
143
|
+
def ota_opt_send_sms(order_num, sms_content)
|
144
|
+
ota_opt(order_num, 'SEND_SMS', smsContent: sms_content)
|
145
|
+
end
|
146
|
+
|
147
|
+
# ota_opt_cc_reply(order_num, note)
|
148
|
+
#
|
149
|
+
# 工单反馈
|
150
|
+
def ota_opt_cc_reply(order_num, note)
|
151
|
+
ota_opt(order_num, 'CC_REPLY', note: note)
|
152
|
+
end
|
62
153
|
end
|
63
154
|
|
64
155
|
class RequestError < StandardError;
|
data/lib/qunar/ota/version.rb
CHANGED