easy_weixin 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0843694e5947e8ba1fd1459727b271f48217a9a
4
- data.tar.gz: ccbc0adf4502006987b1cb8bb7590ede9de7a9a3
3
+ metadata.gz: 3cc47937eed88e0cb0d575cad6221bb3036f8a38
4
+ data.tar.gz: 2b5bb766d154b3a3e5a66994bb059fe18fc2384f
5
5
  SHA512:
6
- metadata.gz: 91e1c6eab8245cfb261ec2ea2826aa6005a8566177395179674f275cba1a0303454a0d2e2d63831dd7b7ffe7f2163de78097b4c07e2d32ff5b5c004090044687
7
- data.tar.gz: dc5d05d514d44a71b6a6e57f76615b6dfc865ec6d5abe2b7db778973c8099513c1576812fd5f99d3a6c5c500fdef02acec1334ea0372d581ab5855d094c90287
6
+ metadata.gz: 58a2f278a74a2df1db7e9c7c13d1027df58bf6cbca977c03e53ade6566b4b78ae0f2b9633daecfdb0f2080a2d68722559c39a1d1f018cccfa5d6f353d8b06d67
7
+ data.tar.gz: cb0325179fc29cdd5738da13fc59e83954b21c34a7a3b4ffc0de17de439dfac247b1bcb0fad585c4eb83aeaeed7106e55593d4bf3fc1cf2baf56420cf10bf83b
@@ -1,3 +1,3 @@
1
1
  module EasyWeixin
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/easy_weixin.rb CHANGED
@@ -28,4 +28,9 @@ module EasyWeixin
28
28
  hash = MultiXml.parse(request_xml)['xml']
29
29
  source = OpenStruct.new(hash)
30
30
  end
31
+
32
+ def get_weixin_access_token(appid, appsecret)
33
+ url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#{appid}&secret=#{appsecret}"
34
+ JSON.parse(open(url).read)["access_token"]
35
+ end
31
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_weixin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - menghuanwd