Skip to content

Commit 9d2eb53

Browse files
committed
add in signing option for request_uri. removed uneccessary var for exchange service
1 parent efbb875 commit 9d2eb53

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,6 @@ AlipayGlobal::Service::Exchange.current_rates()
109109
Hash contains objects representing each currency
110110

111111
| Attribute | Data Type | Description |
112+
| --- | ----------- | ----------- |
112113
| time | DateTime | When Alipay retrieved the date and time of this currency rate |
113114
| rate | float | Rate for 1 FOREX Unit : Units of RMB/CNY |

lib/alipay_global.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
require 'alipay_global/service'
99
require 'alipay_global/service/trade'
1010
require 'alipay_global/service/exchange'
11+
require 'alipay_global/service/notification'
1112

1213
module AlipayGlobal
1314

lib/alipay_global/service.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ def self.gateway_url
44
AlipayGlobal.environment == "PRODUCTION" ? "https://mapi.alipay.com/gateway.do?" : "https://mapi.alipay.net/gateway.do?"
55
end
66

7-
def self.request_uri(params)
7+
def self.request_uri(params, sign = true)
88
uri = URI(gateway_url)
9-
uri.query = URI.encode_www_form(sign_params(params))
9+
processed_params = sign ? sign_params(params) : params
10+
uri.query = URI.encode_www_form(processed_params)
1011
uri
1112
end
1213

lib/alipay_global/service/exchange.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module AlipayGlobal
44
module Service
55
module Exchange
66

7-
@exchange_format = [:date,:time,:currency,:rate]
8-
97
def self.current_rates
108
exchange_rates_resp = {}
119
open(build_request) do |file|

0 commit comments

Comments
 (0)