usaepay 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7d29f7ac049832693d26f2494d94dc54ba578cbf41a60224ea731168220b11c4
4
+ data.tar.gz: ed788c4be5e34d8e3282e5897b077008ada1cb6f3af6593df25d38c93f9633dc
5
+ SHA512:
6
+ metadata.gz: 5ad1734ff2a18c79ca53f158f780ee3c805494b03960c18d90907dafc4a602a66037296aa9d5c565954c7ddda8382710b0cfcd0ab1f00a1471ca7034292f50da
7
+ data.tar.gz: 5b456b458d1535a99edefbf3d49d64e0783f4ee0807321005f6751f6b7bfb3f814fc77f6c3230f2d1837c5af6aa9558b14cfa18aa969849f5ceff69a6f2d3b7d
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/healpay/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in usaepay.gemspec
6
+ gemspec
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ usaepay (0.1.0)
5
+ savon
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ akami (1.3.1)
11
+ gyoku (>= 0.4.0)
12
+ nokogiri
13
+ builder (3.2.3)
14
+ gyoku (1.3.1)
15
+ builder (>= 2.1.2)
16
+ httpi (2.4.2)
17
+ rack
18
+ socksify
19
+ mini_portile2 (2.3.0)
20
+ minitest (5.11.1)
21
+ nokogiri (1.8.1)
22
+ mini_portile2 (~> 2.3.0)
23
+ nori (2.6.0)
24
+ rack (2.0.3)
25
+ rake (10.5.0)
26
+ savon (2.11.2)
27
+ akami (~> 1.2)
28
+ builder (>= 2.1.2)
29
+ gyoku (~> 1.2)
30
+ httpi (~> 2.3)
31
+ nokogiri (>= 1.4.0)
32
+ nori (~> 2.4)
33
+ wasabi (~> 3.4)
34
+ socksify (1.7.1)
35
+ wasabi (3.5.0)
36
+ httpi (~> 2.0)
37
+ nokogiri (>= 1.4.2)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ bundler (~> 1.16)
44
+ minitest (~> 5.0)
45
+ rake (~> 10.0)
46
+ usaepay!
47
+
48
+ BUNDLED WITH
49
+ 1.16.1
@@ -0,0 +1,35 @@
1
+ # Usaepay
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/usaepay`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'usaepay'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install usaepay
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/usaepay.
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "usaepay"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,42 @@
1
+ require 'savon'
2
+ require 'forwardable'
3
+ require 'net/https'
4
+
5
+ require "usaepay/version"
6
+
7
+ module USAePay
8
+ class Client
9
+ extend Forwardable
10
+ def_delegator :@savon, :call
11
+ def initialize(wsdl, opts={})
12
+ @wsdl = wsdl
13
+ @source_key = opts[:source_key] || raise('Missing source_key')
14
+ @pin = opts[:pin]
15
+ @savon = Savon.client(wsdl: @wsdl) do
16
+ convert_request_keys_to :camelcase
17
+ namespace_identifier :ns1
18
+ end
19
+ yield self if block_given?
20
+ end
21
+
22
+ def sha1
23
+ Digest::SHA1.hexdigest(@source_key.to_s + seed.to_s + @pin.to_s)
24
+ end
25
+
26
+ def seed
27
+ @seed ||= Time.now.to_i.to_s + rand(32768).to_s
28
+ end
29
+
30
+ def token
31
+ {
32
+ :source_key => @source_key,
33
+ :pin_hash => {
34
+ :type => "sha1",
35
+ :seed => seed,
36
+ :hash_value => sha1
37
+ },
38
+ :client_ip => "127.0.0.1"
39
+ }
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ module Usaepay
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,36 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "usaepay/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "usaepay"
8
+ spec.version = Usaepay::VERSION
9
+ spec.authors = ["Lance Carlson"]
10
+ spec.email = ["lancecarlson@gmail.com"]
11
+
12
+ spec.summary = %q{USAepay Client Library}
13
+ spec.homepage = "https://github.com/lancecarlson/usaepay.rb"
14
+
15
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
+ else
20
+ raise "RubyGems 2.0 or newer is required to protect against " \
21
+ "public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features)/})
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "savon"
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.16"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "minitest", "~> 5.0"
36
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: usaepay
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Lance Carlson
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-01-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: savon
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
69
+ description:
70
+ email:
71
+ - lancecarlson@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - README.md
81
+ - Rakefile
82
+ - bin/console
83
+ - bin/setup
84
+ - lib/usaepay.rb
85
+ - lib/usaepay/version.rb
86
+ - usaepay.gemspec
87
+ homepage: https://github.com/lancecarlson/usaepay.rb
88
+ licenses: []
89
+ metadata:
90
+ allowed_push_host: https://rubygems.org
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.7.3
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: USAepay Client Library
111
+ test_files: []