qunar-ota 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 300bc3f0e3a599cb384ad6d31bb827350732d8bc
4
- data.tar.gz: 00e9e713edc48d66f175b61b43c55746816dbf08
3
+ metadata.gz: 1730bf36ec349eb6f964b48abc5f2a01a1fc97b8
4
+ data.tar.gz: 70b1f7a341079788be478f5b61231834e2da8d9e
5
5
  SHA512:
6
- metadata.gz: 4e27eb4f1138c7cde56c98a7c9ab21745d2d064395da451536f1f7511ad3c4ad5e9b1eff40d335d77665ac5777be06d7e85fa52574cd9e52b1ba2eb6e5e29fce
7
- data.tar.gz: bf2116f6f65b2233fb06a46334ea579929e4f138ab1fc01aa0ad8f136b07d3390aa6952cd47049adefa388a926daefcad8332243f41e0123b54046219ffa2888
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;
@@ -1,5 +1,5 @@
1
1
  module Qunar
2
2
  module Ota
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qunar-ota
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xiao Jie