mercado_pago 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ ---
2
+ !binary "U0hBMjU2":
3
+ metadata.gz: !binary |-
4
+ MmU5NzY3ZjU0MmNhNDRmM2Q0ZmMzYWQ5ZTgxMWMyMTY3NjEwNDNiOGUyNzYw
5
+ ODYyODQ1ODJjNGQyNTI4MTg4Nw==
6
+ data.tar.gz: !binary |-
7
+ MDQyNjJjYzA3Zjg3ZTllMTA4MmEzNjMxMWNkNzJjMGQwNDQxYTRmZWYwMzFi
8
+ N2UwMzIzMDQwODE2Y2MyZWE4ZQ==
9
+ SHA512:
10
+ metadata.gz: !binary |-
11
+ ZWExYTIxYzkwYTc2ZWQ5MWMxOWJjY2ZkMTJiY2YxNTliODlhNTliZGNiMWZi
12
+ ZjJhZDllZmZkNzRiY2QxNTY1ZmU0NjVlY2ViM2M2MzIwZmNlZjJlM2QzNzc1
13
+ ZDkyZjk0MmNiZTM5ZjQxZmJmNTVmNDFhZDU4Mjk1NDNhZWM0OTg=
14
+ data.tar.gz: !binary |-
15
+ ZDlhNTJkNTFlNjQ3ZTcwNDcwNzhhY2YzNTNhYjBkZjA0NjM1MmUyZGRmYjA5
16
+ ZjE1MTczMmY0MGJlY2RhOTVmZGE5MmE0NGRiYzllNWM4YWRkMDA4OTMwODNl
17
+ MjI2NzBkMThiNjk1MjViMjQ1NjZkMThmMmRiMDU0ODg3M2MxMDA=
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1 @@
1
+ mercado_pago
@@ -0,0 +1 @@
1
+ 1.9.3
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 1.9.3
7
+ before_install: gem install bundler -v 1.16.6
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at djaircarvalho.dj7@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in mercado_pago.gemspec
6
+ gemspec
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mercado_pago (0.0.1)
5
+ blanket_wrapper
6
+ virtus (~> 1.0.5)
7
+ virtus_convert
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.4.0)
13
+ awesome_print (1.8.0)
14
+ axiom-types (0.1.1)
15
+ descendants_tracker (~> 0.0.4)
16
+ ice_nine (~> 0.11.0)
17
+ thread_safe (~> 0.3, >= 0.3.1)
18
+ blanket_wrapper (3.0.2)
19
+ httparty
20
+ recursive-open-struct
21
+ coercible (1.0.0)
22
+ descendants_tracker (~> 0.0.1)
23
+ columnize (0.9.0)
24
+ crack (0.4.3)
25
+ safe_yaml (~> 1.0.0)
26
+ debugger (1.6.8)
27
+ columnize (>= 0.3.1)
28
+ debugger-linecache (~> 1.2.0)
29
+ debugger-ruby_core_source (~> 1.3.5)
30
+ debugger-linecache (1.2.0)
31
+ debugger-ruby_core_source (1.3.8)
32
+ descendants_tracker (0.0.4)
33
+ thread_safe (~> 0.3, >= 0.3.1)
34
+ diff-lcs (1.3)
35
+ docile (1.3.2)
36
+ equalizer (0.0.11)
37
+ hashdiff (0.3.8)
38
+ httparty (0.14.0)
39
+ multi_xml (>= 0.5.2)
40
+ ice_nine (0.11.2)
41
+ json (2.2.0)
42
+ multi_xml (0.6.0)
43
+ rake (10.5.0)
44
+ recursive-open-struct (1.1.0)
45
+ rspec (3.8.0)
46
+ rspec-core (~> 3.8.0)
47
+ rspec-expectations (~> 3.8.0)
48
+ rspec-mocks (~> 3.8.0)
49
+ rspec-core (3.8.1)
50
+ rspec-support (~> 3.8.0)
51
+ rspec-expectations (3.8.4)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.8.0)
54
+ rspec-mocks (3.8.1)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.8.0)
57
+ rspec-support (3.8.2)
58
+ safe_yaml (1.0.5)
59
+ simplecov (0.16.1)
60
+ docile (~> 1.1)
61
+ json (>= 1.8, < 3)
62
+ simplecov-html (~> 0.10.0)
63
+ simplecov-html (0.10.2)
64
+ thread_safe (0.3.6)
65
+ vcr (5.0.0)
66
+ virtus (1.0.5)
67
+ axiom-types (~> 0.1)
68
+ coercible (~> 1.0)
69
+ descendants_tracker (~> 0.0, >= 0.0.3)
70
+ equalizer (~> 0.0, >= 0.0.9)
71
+ virtus_convert (0.1.0)
72
+ webmock (2.3.2)
73
+ addressable (>= 2.3.6)
74
+ crack (>= 0.3.2)
75
+ hashdiff
76
+
77
+ PLATFORMS
78
+ ruby
79
+
80
+ DEPENDENCIES
81
+ awesome_print
82
+ bundler (~> 1.16)
83
+ debugger
84
+ mercado_pago!
85
+ rake (~> 10.0)
86
+ rspec (~> 3.0)
87
+ simplecov
88
+ vcr
89
+ webmock
90
+
91
+ BUNDLED WITH
92
+ 1.16.6
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Djair Carvalho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ [![Gem Version](https://badge.fury.io/rb/mercado_pago.svg)](https://badge.fury.io/rb/mercado_pago)
2
+ # MercadoPago
3
+
4
+ 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/mercado_pago`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+
6
+ TODO: Delete this and the text above, and describe your gem
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'mercado_pago'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install mercado_pago
23
+
24
+ ## Usage
25
+
26
+ TODO: Write usage instructions here
27
+
28
+ ## Development
29
+
30
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
31
+
32
+ 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).
33
+
34
+ ## Contributing
35
+
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mercado_pago. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
+
42
+ ## Code of Conduct
43
+
44
+ Everyone interacting in the MercadoPago project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/mercado_pago/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "mercado_pago"
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,18 @@
1
+ require 'virtus'
2
+ require 'mercado_pago/version'
3
+ require 'mercado_pago/configuration'
4
+ require 'mercado_pago/entities'
5
+ require 'mercado_pago/actions'
6
+
7
+ module MercadoPago
8
+ class << self
9
+ attr_accessor :configuration
10
+
11
+ def configure
12
+ self.configuration ||= Configuration.new
13
+ yield configuration if block_given?
14
+ configuration
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ require_relative 'actions/base_action'
2
+ require_relative 'actions/create_advanced_payment'
3
+ require_relative 'actions/search_advanced_payment'
4
+ require_relative 'actions/refund_advanced_payment'
@@ -0,0 +1,38 @@
1
+ require 'blanket'
2
+ require 'ostruct'
3
+
4
+ module MercadoPago
5
+ class BaseAction
6
+
7
+ def initialize
8
+ self.rest_client = Blanket.wrap("https://api.mercadopago.com/v1/", params: {access_token: MercadoPago.configuration.access_token}, headers: {'Content-Type' =>'application/json'})
9
+ end
10
+
11
+ def run
12
+ perform
13
+ OpenStruct.new(success?: !has_errors?, advanced_payment: result_payment, errors: errors)
14
+ end
15
+
16
+ private
17
+
18
+ def perform
19
+ self.result_payment = AdvancedPayment.new(perform_action)
20
+ rescue Blanket::Exception => e
21
+ errors << e.message
22
+ end
23
+
24
+ def perform_action
25
+ nil
26
+ end
27
+
28
+ def has_errors?
29
+ errors.size > 0
30
+ end
31
+
32
+ def errors
33
+ @errors ||= []
34
+ end
35
+
36
+ attr_accessor :result_payment, :rest_client
37
+ end
38
+ end
@@ -0,0 +1,20 @@
1
+ module MercadoPago
2
+ class CreateAdvancedPayment < MercadoPago::BaseAction
3
+ def initialize(advanced_payment)
4
+ super()
5
+ self.advanced_payment = advanced_payment
6
+ end
7
+
8
+ private
9
+
10
+ def perform_action
11
+ rest_client.advanced_payments.post(body: body)
12
+ end
13
+
14
+ def body
15
+ advanced_payment.to_hash.to_json
16
+ end
17
+
18
+ attr_accessor :advanced_payment
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ module MercadoPago
2
+ class RefundAdvancedPayment < MercadoPago::BaseAction
3
+
4
+ def initialize(payment_id)
5
+ super()
6
+ self.payment_id = payment_id
7
+ end
8
+
9
+ private
10
+
11
+ def perform_action
12
+ rest_client.advanced_payments(payment_id).refunds.post
13
+ find_payment
14
+ end
15
+
16
+ def find_payment
17
+ SearchAdvancedPayment.new(payment_id).run.advanced_payment
18
+ end
19
+
20
+ attr_accessor :payment_id
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ module MercadoPago
2
+ class SearchAdvancedPayment < MercadoPago::BaseAction
3
+
4
+ def initialize(payment_id)
5
+ super()
6
+ self.payment_id = payment_id
7
+ end
8
+
9
+ private
10
+
11
+ def perform_action
12
+ rest_client.advanced_payments.get(payment_id)
13
+ end
14
+
15
+ attr_accessor :payment_id
16
+ end
17
+ end
@@ -0,0 +1,32 @@
1
+ require 'yaml'
2
+
3
+ module MercadoPago
4
+ class Configuration
5
+ DEFAULT_CONFIG_FILE_PATH = 'config/mercado_pago.yml'.freeze
6
+ attr_writer :config_file_path
7
+
8
+
9
+ def access_token
10
+ config['access_token']
11
+ end
12
+
13
+ def application_id
14
+ config['application_id']
15
+ end
16
+
17
+ def config_file_path
18
+ @config_file_path || DEFAULT_CONFIG_FILE_PATH
19
+ end
20
+
21
+ def environment
22
+ @environment ||= ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'test'
23
+ end
24
+
25
+ private
26
+
27
+ def config
28
+ @config ||= YAML.load(ERB.new(File.read(config_file_path)).result)[environment]
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'entities/base'
2
+ require_relative 'entities/phone'
3
+ require_relative 'entities/item'
4
+ require_relative 'entities/disbursement'
5
+ require_relative 'entities/payment_info'
6
+ require_relative 'entities/address'
7
+ require_relative 'entities/identification'
8
+ require_relative 'entities/payer'
9
+ require_relative 'entities/advanced_payment'
@@ -0,0 +1,8 @@
1
+ module MercadoPago
2
+ class Address < MercadoPago::Base
3
+
4
+ attribute :zip_code, String
5
+ attribute :street_name, String
6
+ attribute :street_number, Integer
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ module MercadoPago
2
+ class AdvancedPayment < MercadoPago::Base
3
+
4
+ attribute :id, Integer
5
+ attribute :application_id, String
6
+ attribute :notification_url, String
7
+ attribute :payer, Payer
8
+ attribute :payments, Array[PaymentInfo]
9
+ attribute :disbursements, Array[Disbursement]
10
+ attribute :capture, Boolean
11
+ attribute :binary_mode, Boolean, :default => false
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ require 'virtus_convert'
2
+ module MercadoPago
3
+ class Base
4
+ include Virtus.model
5
+
6
+ def to_hash
7
+ VirtusConvert.new(self, reject_nils: true).to_hash
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'disbursement/additional_info'
2
+
3
+ module MercadoPago
4
+ class Disbursement < MercadoPago::Base
5
+
6
+ attribute :id, Integer
7
+ attribute :amount, Float
8
+ attribute :external_reference, String
9
+ attribute :collector_id, Integer
10
+ attribute :application_fee, Float
11
+ attribute :money_release_days, Float
12
+ attribute :additional_info, AdditionalInfo
13
+
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module MercadoPago
2
+ class Disbursement < MercadoPago::Base
3
+ class AdditionalInfo < MercadoPago::Base
4
+
5
+ attribute :items, Array[Item]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module MercadoPago
2
+ class Identification < MercadoPago::Base
3
+
4
+ attribute :type, String
5
+ attribute :number, String
6
+ end
7
+ end
@@ -0,0 +1,13 @@
1
+ module MercadoPago
2
+ class Item < MercadoPago::Base
3
+
4
+ attribute :id, String
5
+ attribute :title, String
6
+ attribute :description, String
7
+ attribute :picture_url, String
8
+ attribute :category_id, String
9
+ attribute :quantity, Integer
10
+ attribute :unit_price, Float
11
+
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module MercadoPago
2
+ class Payer < MercadoPago::Base
3
+
4
+ attribute :id, String
5
+ attribute :email, String
6
+ attribute :type, String
7
+ attribute :first_name, String
8
+ attribute :last_name, String
9
+ attribute :identification, Identification
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ module MercadoPago
2
+ class PaymentInfo < MercadoPago::Base
3
+
4
+ attribute :id, Integer
5
+ attribute :status, String
6
+ attribute :status_detail, String
7
+ attribute :payment_type_id, String
8
+ attribute :payment_method_id, String
9
+ attribute :token, String
10
+ attribute :transaction_amount, Float
11
+ attribute :installments, Integer
12
+ attribute :processing_mode, String
13
+ attribute :issuer_id, String
14
+ attribute :description, String
15
+ attribute :capture, Boolean
16
+ attribute :external_reference, String
17
+ attribute :statement_descriptor, String
18
+ attribute :date_of_expiration, String
19
+
20
+ end
21
+ end
@@ -0,0 +1,8 @@
1
+ module MercadoPago
2
+ class Phone < MercadoPago::Base
3
+
4
+ attribute :area_code, String
5
+ attribute :number, String
6
+ attribute :extension, String
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module MercadoPago
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,53 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "mercado_pago/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "mercado_pago"
9
+ spec.version = MercadoPago::VERSION
10
+ spec.authors = ["Djair Carvalho"]
11
+ spec.email = ["djaircarvalho.dj7@gmail.com"]
12
+
13
+ spec.summary = %q{A simple gem to cover Mercado Pago's advanced payment.}
14
+ spec.description = %q{None of current gems cover advanced payments, so here we go.}
15
+ spec.homepage = "https://github.com/djaircarvalho/mercado_pago"
16
+ spec.license = "MIT"
17
+ spec.required_ruby_version = '>= 1.9.3'
18
+
19
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
21
+ if spec.respond_to?(:metadata)
22
+ spec.metadata["allowed_push_host"] = "https://rubygems.org/"
23
+
24
+ spec.metadata["homepage_uri"] = spec.homepage
25
+ spec.metadata["source_code_uri"] = "https://github.com/djaircarvalho/mercado_pago"
26
+ else
27
+ raise "RubyGems 2.0 or newer is required to protect against " \
28
+ "public gem pushes."
29
+ end
30
+
31
+ # Specify which files should be added to the gem when it is released.
32
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
34
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
+ end
36
+ spec.bindir = "exe"
37
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
+ spec.require_paths = ["lib"]
39
+
40
+ spec.add_dependency "virtus", "~> 1.0.5"
41
+ spec.add_dependency "virtus_convert"
42
+ spec.add_dependency "blanket_wrapper"
43
+
44
+ spec.add_development_dependency "bundler", "~> 1.16"
45
+ spec.add_development_dependency "rake", "~> 10.0"
46
+ spec.add_development_dependency "rspec", "~> 3.0"
47
+ spec.add_development_dependency "simplecov"
48
+ spec.add_development_dependency "webmock"
49
+ spec.add_development_dependency "vcr"
50
+ spec.add_development_dependency "awesome_print"
51
+ spec.add_development_dependency "debugger"
52
+
53
+ end
metadata ADDED
@@ -0,0 +1,234 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mercado_pago
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Djair Carvalho
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: virtus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.5
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.5
27
+ - !ruby/object:Gem::Dependency
28
+ name: virtus_convert
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: blanket_wrapper
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: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.16'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.16'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
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: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: vcr
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: awesome_print
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: debugger
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: None of current gems cover advanced payments, so here we go.
168
+ email:
169
+ - djaircarvalho.dj7@gmail.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - .gitignore
175
+ - .rspec
176
+ - .ruby-gemset
177
+ - .ruby-version
178
+ - .travis.yml
179
+ - CODE_OF_CONDUCT.md
180
+ - Gemfile
181
+ - Gemfile.lock
182
+ - LICENSE.txt
183
+ - README.md
184
+ - Rakefile
185
+ - bin/console
186
+ - bin/setup
187
+ - lib/mercado_pago.rb
188
+ - lib/mercado_pago/actions.rb
189
+ - lib/mercado_pago/actions/base_action.rb
190
+ - lib/mercado_pago/actions/create_advanced_payment.rb
191
+ - lib/mercado_pago/actions/refund_advanced_payment.rb
192
+ - lib/mercado_pago/actions/search_advanced_payment.rb
193
+ - lib/mercado_pago/configuration.rb
194
+ - lib/mercado_pago/entities.rb
195
+ - lib/mercado_pago/entities/address.rb
196
+ - lib/mercado_pago/entities/advanced_payment.rb
197
+ - lib/mercado_pago/entities/base.rb
198
+ - lib/mercado_pago/entities/disbursement.rb
199
+ - lib/mercado_pago/entities/disbursement/additional_info.rb
200
+ - lib/mercado_pago/entities/identification.rb
201
+ - lib/mercado_pago/entities/item.rb
202
+ - lib/mercado_pago/entities/payer.rb
203
+ - lib/mercado_pago/entities/payment_info.rb
204
+ - lib/mercado_pago/entities/phone.rb
205
+ - lib/mercado_pago/version.rb
206
+ - mercado_pago.gemspec
207
+ homepage: https://github.com/djaircarvalho/mercado_pago
208
+ licenses:
209
+ - MIT
210
+ metadata:
211
+ allowed_push_host: https://rubygems.org/
212
+ homepage_uri: https://github.com/djaircarvalho/mercado_pago
213
+ source_code_uri: https://github.com/djaircarvalho/mercado_pago
214
+ post_install_message:
215
+ rdoc_options: []
216
+ require_paths:
217
+ - lib
218
+ required_ruby_version: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: 1.9.3
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ! '>='
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ requirements: []
229
+ rubyforge_project:
230
+ rubygems_version: 2.7.8
231
+ signing_key:
232
+ specification_version: 4
233
+ summary: A simple gem to cover Mercado Pago's advanced payment.
234
+ test_files: []