transbank-webpay 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fe020196d892c3624a23ca1b34120e389f013066
4
+ data.tar.gz: a5236458db9a18c0e89c0a9c93217504c6c605a7
5
+ SHA512:
6
+ metadata.gz: 172bf5d4851e558dab4e08705573539b34c8bb2a2ad75fd65930d133ebfedaf3d9fa0d80184e49a8ac4cb6c7410714b01a21ffd336114c090bdb82c511249f7d
7
+ data.tar.gz: f3fbc82cd2a93e6197a3ccd9bc0a9e92f91eece03801236b1418f927e24751ab87d55710dc08079a39b5bd29837929435464060a4aa0932087c1530a3ee4da8f
data/.gitignore ADDED
@@ -0,0 +1,31 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+
16
+
17
+ # OSX
18
+ .DS_Store
19
+ .AppleDouble
20
+ .LSOverride
21
+ # Icon must end with two \r
22
+ Icon
23
+
24
+ # Thumbnails
25
+ ._*
26
+ # Files that might appear on external disk
27
+ .Spotlight-V100
28
+ .Trashes
29
+ lib/transbank/webpay/.DS_Store
30
+ lib/transbank/.DS_Store
31
+ spec/.DS_Store
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ inherit_from:
2
+ - .rubocop_todo.yml
3
+
4
+ # Files you want to exclude
5
+ AllCops:
6
+ Exclude:
7
+ - Guardfile
8
+ - lib/transbank-webpay.rb
9
+
10
+ Style/Documentation:
11
+ Enabled: false
12
+
13
+ Metrics/MethodLength:
14
+ Max: 13
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,75 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-06-18 18:05:37 -0400 using RuboCop version 0.40.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
11
+ # URISchemes: http, https
12
+ Metrics/LineLength:
13
+ Max: 104
14
+
15
+ # Offense count: 1
16
+ # Cop supports --auto-correct.
17
+ Style/BlockComments:
18
+ Exclude:
19
+ - 'spec/spec_helper.rb'
20
+
21
+ # Offense count: 1
22
+ Style/Documentation:
23
+ Exclude:
24
+ - 'spec/**/*'
25
+ - 'test/**/*'
26
+ - 'lib/transbank/webpay.rb'
27
+
28
+ # Offense count: 1
29
+ # Cop supports --auto-correct.
30
+ # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
31
+ # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
32
+ Style/HashSyntax:
33
+ Enabled: false
34
+
35
+ # Offense count: 1
36
+ # Cop supports --auto-correct.
37
+ Style/MutableConstant:
38
+ Exclude:
39
+ - 'lib/transbank/webpay/version.rb'
40
+
41
+ # Offense count: 2
42
+ # Cop supports --auto-correct.
43
+ # Configuration parameters: PreferredDelimiters.
44
+ Style/PercentLiteralDelimiters:
45
+ Exclude:
46
+ - 'transbank-webpay.gemspec'
47
+
48
+ # Offense count: 1
49
+ # Cop supports --auto-correct.
50
+ # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
51
+ # SupportedStyles: slashes, percent_r, mixed
52
+ Style/RegexpLiteral:
53
+ Exclude:
54
+ - 'Guardfile'
55
+
56
+ # Offense count: 12
57
+ # Cop supports --auto-correct.
58
+ # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
59
+ # SupportedStyles: single_quotes, double_quotes
60
+ Style/StringLiterals:
61
+ Enabled: false
62
+
63
+ # Offense count: 1
64
+ # Cop supports --auto-correct.
65
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
66
+ # SupportedStyles: final_newline, final_blank_line
67
+ Style/TrailingBlankLines:
68
+ Exclude:
69
+ - 'Gemfile'
70
+
71
+ # Offense count: 2
72
+ # Cop supports --auto-correct.
73
+ Style/UnneededPercentQ:
74
+ Exclude:
75
+ - 'transbank-webpay.gemspec'
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in transbank_soap.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'rubocop', require: false
8
+ gem 'guard-rubocop', require: false
9
+ gem 'guard-rspec', require: false
10
+ end
data/Guardfile ADDED
@@ -0,0 +1,75 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.call("routing/#{m[1]}_routing"),
51
+ rspec.spec.call("controllers/#{m[1]}_controller"),
52
+ rspec.spec.call("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
71
+
72
+ guard :rubocop do
73
+ watch(%r{.+\.rb$})
74
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
75
+ end
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # Not ready for production
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "transbank/webpay"
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
data/bin/setup ADDED
@@ -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 @@
1
+ require 'transbank/webpay'
@@ -0,0 +1,36 @@
1
+ require 'net/https'
2
+ require 'uri'
3
+ require 'savon'
4
+ require 'signer'
5
+ require 'nori'
6
+ require 'ostruct'
7
+
8
+ require 'transbank/webpay/version'
9
+ require 'transbank/webpay/configuration'
10
+ require 'transbank/webpay/exception_response'
11
+ require 'transbank/webpay/client'
12
+ require 'transbank/webpay/response'
13
+ require 'transbank/webpay/document'
14
+ require 'transbank/webpay/params'
15
+ require 'transbank/webpay/request'
16
+ require 'transbank/webpay/api'
17
+
18
+ module Transbank
19
+ module Webpay
20
+ class << self
21
+ attr_accessor :configuration
22
+
23
+ # Delegate api
24
+ Api.instance_methods.each { |m| define_method(m) { |*args| api.send(m, *args) } }
25
+ end
26
+
27
+ def self.configure
28
+ self.configuration ||= Configuration.new
29
+ yield(configuration)
30
+ end
31
+
32
+ def self.api
33
+ @api ||= Api.new
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,31 @@
1
+ module Transbank
2
+ module Webpay
3
+ class Api
4
+ include Params
5
+
6
+ def init_transaction(underscore_params = {})
7
+ params = build_init_transaction_params(underscore_params)
8
+ url = config.wsdl_transaction_url
9
+ Request.new(url, :init_transaction, params).response
10
+ end
11
+
12
+ def get_transaction_result(token)
13
+ params = { tokenInput: token }
14
+ url = config.wsdl_transaction_url
15
+ Request.new(url, :get_transaction_result, params).response
16
+ end
17
+
18
+ def acknowledge_transaction(token)
19
+ params = { tokenInput: token }
20
+ url = config.wsdl_transaction_url
21
+ Request.new(url, :acknowledge_transaction, params).response
22
+ end
23
+
24
+ private
25
+
26
+ def config
27
+ Transbank::Webpay.configuration
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ module Transbank
2
+ module Webpay
3
+ class Client
4
+ attr_accessor :uri, :http
5
+
6
+ HEADER = { 'Content-Type' => 'application/soap+xml; charset=utf-8' }.freeze
7
+
8
+ def initialize(wsdl_url)
9
+ opt = Transbank::Webpay.configuration.http_options
10
+ self.uri = URI.parse wsdl_url
11
+ self.http = Net::HTTP.new uri.host, uri.port
12
+
13
+ # load options
14
+ define_options(opt)
15
+
16
+ # default options
17
+ http.use_ssl = true
18
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
19
+ end
20
+
21
+ def post(xml)
22
+ http.post(uri.path, xml, HEADER)
23
+ end
24
+
25
+ private
26
+
27
+ def define_options(opt = {})
28
+ opt.each { |attr, value| http.__send__("#{attr}=", value) }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,28 @@
1
+ module Transbank
2
+ module Webpay
3
+ class Configuration
4
+ attr_accessor :wsdl_transaction_url
5
+ attr_accessor :wsdl_cancel_url
6
+
7
+ attr_accessor :commerce_code
8
+
9
+ attr_accessor :cert_path
10
+ attr_accessor :key_path
11
+ attr_accessor :server_cert_path
12
+
13
+ attr_accessor :rescue_exceptions
14
+
15
+ attr_accessor :http_options
16
+
17
+ def initialize
18
+ @rescue_exceptions = [
19
+ Net::ReadTimeout, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
20
+ EOFError, Net::HTTPBadGateway, Net::HTTPBadResponse,
21
+ Net::HTTPHeaderSyntaxError, Net::ProtocolError
22
+ ]
23
+
24
+ @http_options = {}
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,59 @@
1
+ module Transbank
2
+ module Webpay
3
+ class Document
4
+ attr_reader :unsigned_document, :unsigned_xml
5
+ XML_HEADER = "<env:Header><wsse:Security xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' wsse:mustUnderstand='1'/></env:Header>".freeze # rubocop:disable LineLength
6
+ SOAPENV = 'http://schemas.xmlsoap.org/soap/envelope/'.freeze
7
+
8
+ def initialize(wsdl_url, action, params = {})
9
+ client = Savon.client(wsdl: wsdl_url)
10
+ xml = client.build_request(action, message: params).body
11
+
12
+ @unsigned_document = Nokogiri::XML(xml)
13
+ end
14
+
15
+ def envelope
16
+ @envelope ||= unsigned_document.at_xpath("//env:Envelope")
17
+ end
18
+
19
+ def to_xml
20
+ document.to_xml(save_with: 0)
21
+ end
22
+
23
+ def document
24
+ @document ||= Nokogiri::XML(signed_xml).tap do |signed_document|
25
+ x509data = signed_document.at_xpath("//*[local-name()='X509Data']")
26
+ new_data = x509data.clone
27
+ new_data.set_attribute('xmlns:ds', 'http://www.w3.org/2000/09/xmldsig#')
28
+ n = Nokogiri::XML::Node.new('wsse:SecurityTokenReference', signed_document)
29
+ n.add_child(new_data)
30
+ x509data.add_next_sibling(n)
31
+ end
32
+ end
33
+
34
+ def signed_xml
35
+ envelope.prepend_child(XML_HEADER)
36
+ unsigned_xml = unsigned_document.to_s
37
+
38
+ signer = Signer.new(unsigned_xml)
39
+ signer.cert = cert
40
+ signer.private_key = private_key
41
+
42
+ signer.document.xpath('//soapenv:Body', soapenv: SOAPENV).each do |node|
43
+ signer.digest!(node)
44
+ end
45
+
46
+ signer.sign!(:issuer_serial => true)
47
+ signer.to_xml
48
+ end
49
+
50
+ def cert
51
+ @cert ||= OpenSSL::X509::Certificate.new open(Transbank::Webpay.configuration.cert_path)
52
+ end
53
+
54
+ def private_key
55
+ @private_key ||= OpenSSL::PKey::RSA.new open(Transbank::Webpay.configuration.key_path)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,32 @@
1
+ module Transbank
2
+ module Webpay
3
+ class ExceptionResponse
4
+ attr_accessor :exception, :action
5
+
6
+ def initialize(exception, action)
7
+ self.exception = exception
8
+ self.action = action
9
+ end
10
+
11
+ def valid?
12
+ false
13
+ end
14
+
15
+ def errors
16
+ [exception.message]
17
+ end
18
+
19
+ def exception?
20
+ true
21
+ end
22
+
23
+ def errors_display
24
+ "#{exception.class}, #{exception.message}"
25
+ end
26
+
27
+ def inspect
28
+ "#<#{self.class}: valid: false, error: '#{errors_display}' >"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,22 @@
1
+ module Transbank
2
+ module Webpay
3
+ module Params
4
+ def build_init_transaction_params(underscore_params = {})
5
+ camelcase_params = {
6
+ wSTransactionType: 'TR_NORMAL_WS',
7
+ buyOrder: underscore_params[:buy_order],
8
+ sessionId: underscore_params[:session_id],
9
+ returnURL: underscore_params[:return_url],
10
+ finalURL: underscore_params[:final_url],
11
+ transactionDetails: {
12
+ amount: underscore_params[:amount],
13
+ commerceCode: Transbank::Webpay.configuration.commerce_code,
14
+ buyOrder: underscore_params[:buy_order]
15
+ }
16
+ }
17
+
18
+ { wsInitTransactionInput: camelcase_params }
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,35 @@
1
+ module Transbank
2
+ module Webpay
3
+ class Request
4
+ attr_accessor :client, :document, :action
5
+
6
+ def initialize(wsdl_url, action, params = {})
7
+ @action = action
8
+ @document = Document.new(wsdl_url, action, params)
9
+ @client = Client.new wsdl_url
10
+ end
11
+
12
+ def response
13
+ rescue_exceptions = Transbank::Webpay.configuration.rescue_exceptions
14
+
15
+ @response ||= begin
16
+ Response.new client.post(document.to_xml), action
17
+ rescue match_class(rescue_exceptions) => error
18
+ ExceptionResponse.new error, action
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def match_class(exceptions)
25
+ m = Module.new
26
+ (class << m; self; end).instance_eval do
27
+ define_method(:===) do |error|
28
+ (exceptions || []).include? error.class
29
+ end
30
+ end
31
+ m
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,161 @@
1
+ # rubocop:disable all
2
+ module Transbank
3
+ module Webpay
4
+ class Response
5
+ attr_accessor :content, :action, :attributes, :errors, :exception
6
+
7
+ RESPONSE_CODE = {
8
+ get_transaction_result: {
9
+ '0' => 'transacción aprobada',
10
+ '-1' => 'rechazo de transacción',
11
+ '-2' => 'transacción debe reintentarse',
12
+ '-3' => 'error en transacción',
13
+ '-4' => 'rechazo de transacción',
14
+ '-5' => 'rechazo por error de tasa',
15
+ '-6' => 'excede cupo máximo mensual',
16
+ '-7' => 'excede límite diario por transacción',
17
+ '-8' => 'rubro no autorizado'
18
+ },
19
+ default: {
20
+ '0' => 'aprobado',
21
+ '-98' => 'Error'
22
+ }
23
+ }
24
+
25
+ def initialize(content, action)
26
+ self.content = content
27
+ self.action = action
28
+ self.attributes = xml_result
29
+ self.errors = []
30
+ validate!
31
+ end
32
+
33
+ def body
34
+ content.body
35
+ end
36
+
37
+ def http_code
38
+ content.code
39
+ end
40
+
41
+ def doc
42
+ @doc ||= Nokogiri::XML body
43
+ end
44
+
45
+ def xml_result
46
+ parser.parse(doc.at_xpath("//return").to_s).fetch( :return, {}).tap do |hash|
47
+ hash[:detail_output].tap {|r| r[:amount] = r[:amount].to_i }
48
+
49
+ hash.each { |k, v| hash.store(k, OpenStruct.new(v)) if v.is_a?(Hash) }
50
+ end
51
+ end
52
+
53
+ def xml_error
54
+ doc.xpath("//faultstring")
55
+ end
56
+
57
+ def errors_display
58
+ errors.join ', '
59
+ end
60
+
61
+ def valid?
62
+ errors.empty?
63
+ end
64
+
65
+ def signed_node
66
+ doc.at_xpath '//ds:SignedInfo', {'ds' => 'http://www.w3.org/2000/09/xmldsig#'}
67
+ end
68
+
69
+ def signature_node
70
+ doc.at_xpath('//ds:SignatureValue', {'ds' => 'http://www.w3.org/2000/09/xmldsig#'})
71
+ end
72
+
73
+ def signature_decode
74
+ Base64.decode64(signature_node.content)
75
+ end
76
+
77
+ def response_code
78
+ @response_code ||= doc.xpath("//responseCode").text
79
+ end
80
+
81
+ def response_code_display
82
+ if response_code.present?
83
+ RESPONSE_CODE.fetch(action, RESPONSE_CODE[:default]).fetch(response_code, response_code)
84
+ end
85
+ end
86
+
87
+ def inspect
88
+ result = ["valid: #{valid?}"]
89
+ result << attributes_display if attributes.any?
90
+ result << "error: \"#{errors_display}\"" if errors.any?
91
+ "#<#{self.class} #{result.join(', ')} >"
92
+ end
93
+
94
+ def exception?
95
+ false
96
+ end
97
+
98
+ def exception
99
+ nil
100
+ end
101
+
102
+ def method_missing(method_name, *args, &block)
103
+ attributes[method_name.to_sym] || super
104
+ end
105
+
106
+ def respond_to_missing?(method_name, include_private = false)
107
+ attributes.keys.include?(method_name.to_sym) || super
108
+ end
109
+
110
+ def xml_error_display
111
+ xml_error.map { |e| e.text.gsub(/<!--|-->/, '').strip }
112
+ end
113
+
114
+ private
115
+
116
+ def verify
117
+ return if signature_node.nil?
118
+
119
+ signed_node.add_namespace 'soap', 'http://schemas.xmlsoap.org/soap/envelope/'
120
+ signed_node_canonicalize = signed_node.canonicalize Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0, ["soap"], nil
121
+
122
+ pub_key.verify OpenSSL::Digest::SHA1.new, signature_decode, signed_node_canonicalize
123
+ end
124
+
125
+ def server_cert
126
+ @server_cert ||= begin
127
+ path = Transbank::Webpay.configuration.server_cert_path
128
+ OpenSSL::X509::Certificate.new File.read(path)
129
+ end
130
+ end
131
+
132
+ def pub_key
133
+ server_cert.public_key
134
+ end
135
+
136
+ def parser
137
+ @parser ||= Nori.new convert_tags_to: lambda { |tag| tag.snakecase.to_sym }
138
+ end
139
+
140
+ def attributes_display
141
+ attributes.map{|name, value| "#{name}: \"#{value}\""}.join ', '
142
+ end
143
+
144
+ def validate!
145
+ if response_code.present? and response_code != '0'
146
+ self.errors << response_code_display
147
+ end
148
+
149
+ if content.class != Net::HTTPOK
150
+ self.errors += xml_error_display
151
+ self.errors << content.message if content.respond_to?(:message) and self.errors.blank?
152
+ end
153
+
154
+ if (self.errors.blank? || signature_node.present?) && !verify
155
+ raise Exceptions::InvalidSignature.new("Invalid signature")
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
161
+ # rubocop:enable all
@@ -0,0 +1,5 @@
1
+ module Transbank
2
+ module Webpay
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'transbank/webpay/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "transbank-webpay"
8
+ spec.version = Transbank::Webpay::VERSION
9
+ spec.authors = ['Ramón Soto']
10
+ spec.email = ['ramon.soto@clouw.com']
11
+
12
+ spec.summary = %q{transbank webpay soap gem}
13
+ spec.description = %q{transbank webpay SOAP gem}
14
+ spec.homepage = ''
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency 'signer'
23
+ spec.add_dependency 'savon', '~> 2.0'
24
+ spec.add_dependency 'nokogiri'
25
+ spec.add_dependency 'nori'
26
+
27
+ spec.add_development_dependency 'bundler', '~> 1.11'
28
+ spec.add_development_dependency 'rake', '~> 10.0'
29
+ spec.add_development_dependency 'rspec'
30
+ spec.add_development_dependency 'webmock', '>= 1.20'
31
+ end
metadata ADDED
@@ -0,0 +1,178 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: transbank-webpay
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ramón Soto
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-06-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: signer
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: savon
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nori
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '1.20'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '1.20'
125
+ description: transbank webpay SOAP gem
126
+ email:
127
+ - ramon.soto@clouw.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - ".rubocop.yml"
135
+ - ".rubocop_todo.yml"
136
+ - Gemfile
137
+ - Guardfile
138
+ - README.md
139
+ - Rakefile
140
+ - bin/console
141
+ - bin/setup
142
+ - lib/transbank-webpay.rb
143
+ - lib/transbank/webpay.rb
144
+ - lib/transbank/webpay/api.rb
145
+ - lib/transbank/webpay/client.rb
146
+ - lib/transbank/webpay/configuration.rb
147
+ - lib/transbank/webpay/document.rb
148
+ - lib/transbank/webpay/exception_response.rb
149
+ - lib/transbank/webpay/params.rb
150
+ - lib/transbank/webpay/request.rb
151
+ - lib/transbank/webpay/response.rb
152
+ - lib/transbank/webpay/version.rb
153
+ - transbank-webpay.gemspec
154
+ homepage: ''
155
+ licenses:
156
+ - MIT
157
+ metadata: {}
158
+ post_install_message:
159
+ rdoc_options: []
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ requirements: []
173
+ rubyforge_project:
174
+ rubygems_version: 2.5.1
175
+ signing_key:
176
+ specification_version: 4
177
+ summary: transbank webpay soap gem
178
+ test_files: []