mercadopago-sdk 1.3.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +10 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- data/.github/workflows/ruby.yml +35 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +104 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CODING_GUIDELINES.md +70 -0
- data/CONTRIBUTING.md +57 -0
- data/Gemfile +6 -1
- data/Gemfile.lock +45 -17
- data/LICENSE.txt +21 -0
- data/README.md +51 -27
- data/Rakefile +3 -1
- data/docs/CODE_OF_CONDUCT_md.html +154 -0
- data/docs/CODING_GUIDELINES_md.html +188 -0
- data/docs/CONTRIBUTING_md.html +165 -0
- data/docs/LICENSE_txt.html +96 -0
- data/docs/Mercadopago.html +123 -0
- data/docs/Mercadopago/AdvancedPayment.html +279 -0
- data/docs/Mercadopago/Card.html +204 -0
- data/docs/Mercadopago/CardToken.html +160 -0
- data/docs/Mercadopago/Config.html +266 -0
- data/docs/Mercadopago/Customer.html +228 -0
- data/docs/Mercadopago/DisbursementRefund.html +183 -0
- data/docs/Mercadopago/HttpClient.html +249 -0
- data/docs/Mercadopago/IdentificationType.html +136 -0
- data/docs/Mercadopago/MPBase.html +316 -0
- data/docs/Mercadopago/MerchantOrder.html +209 -0
- data/docs/Mercadopago/Payment.html +208 -0
- data/docs/Mercadopago/PaymentMethods.html +136 -0
- data/docs/Mercadopago/Preference.html +184 -0
- data/docs/Mercadopago/Refund.html +160 -0
- data/docs/Mercadopago/RequestOptions.html +433 -0
- data/docs/Mercadopago/SDK.html +528 -0
- data/docs/Mercadopago/User.html +136 -0
- data/docs/README_md.html +181 -0
- data/docs/created.rid +25 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +619 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +109 -0
- data/docs/js/darkfish.js +84 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +562 -0
- data/lib/mercadopago.rb +24 -295
- data/lib/mercadopago/config/config.rb +42 -0
- data/lib/mercadopago/config/request_options.rb +85 -0
- data/lib/mercadopago/core/mp_base.rb +77 -0
- data/lib/mercadopago/http/http_client.rb +74 -0
- data/lib/mercadopago/resources/advanced_payment.rb +48 -0
- data/lib/mercadopago/resources/card.rb +31 -0
- data/lib/mercadopago/resources/card_token.rb +19 -0
- data/lib/mercadopago/resources/customer.rb +36 -0
- data/lib/mercadopago/resources/disbursement_refund.rb +24 -0
- data/lib/mercadopago/resources/identification_type.rb +13 -0
- data/lib/mercadopago/resources/merchant_order.rb +32 -0
- data/lib/mercadopago/resources/payment.rb +35 -0
- data/lib/mercadopago/resources/payment_methods.rb +13 -0
- data/lib/mercadopago/resources/preference.rb +26 -0
- data/lib/mercadopago/resources/refund.rb +24 -0
- data/lib/mercadopago/resources/user.rb +13 -0
- data/lib/mercadopago/sdk.rb +85 -0
- data/mercadopago.gemspec +11 -11
- data/tests/test_card.rb +79 -0
- data/tests/test_card_token.rb +39 -0
- data/tests/test_customer.rb +54 -0
- data/tests/test_identification_type.rb +16 -0
- data/tests/test_merchant_order.rb +94 -0
- data/tests/test_payment.rb +102 -0
- data/tests/test_payment_methods.rb +14 -0
- data/tests/test_preference.rb +49 -0
- data/tests/test_refund.rb +88 -0
- data/tests/test_user.rb +17 -0
- data/tests/tests.rb +12 -56
- metadata +127 -24
- data/.travis.yml +0 -14
- data/examples/checkout-buttons/basic_preference/button.rb +0 -28
- data/examples/instant-payment-notifications/receive-ipn.rb +0 -25
- data/examples/payment-search/search-approved-payments.rb +0 -23
- data/examples/payment-search/search-creditcard-payments.rb +0 -23
- data/examples/payment-search/search-funded-payments-by-name.rb +0 -23
- data/examples/payment-search/search-payments-from-email-and-date.rb +0 -23
- data/examples/payment-search/search-payments.rb +0 -23
- data/examples/preapproval-payments/button.rb +0 -42
- data/lib/ssl_options_patch.rb +0 -15
- data/lib/version.rb +0 -2
- data/travis_Gemfile +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee45ea6f73bf8d6f15c8ccc1c52e8c8aaa2100d48bb412e854191fe0f839abb
|
4
|
+
data.tar.gz: db1205f29dee26aa91a344a9976a22179015a586d407c2a4a9c1b9bd59a55586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a4ce5dd066d00115c1e1d379ea4a24714039d72235bce09e5129152ad6166178bc3a3acff78fe86075e7a6e75c449dfb8b1643a50e7f1b7296928a6391338f3
|
7
|
+
data.tar.gz: e7073e0605e07728d9b331092f06887ef6af1a000814c80805c9cb2208ebdc341e5b1bfd2a4aa88b0baf8cb7a4a9c314155500d119c4194346c7c6c3f74fdf12
|
data/.editorconfig
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
**Describe the bug**
|
10
|
+
A clear and concise description of what the bug is.
|
11
|
+
|
12
|
+
**To Reproduce**
|
13
|
+
Steps to reproduce the behavior:
|
14
|
+
|
15
|
+
- Test case to reproduce the bug. Try to reproduce in the latest version.
|
16
|
+
- Code sample that fails
|
17
|
+
|
18
|
+
**Expected behavior**
|
19
|
+
A clear and concise description of what you expected to happen.
|
20
|
+
|
21
|
+
**Environment (please complete the following information):**
|
22
|
+
|
23
|
+
- OS: [e.g. Linux/Mac/Windows]
|
24
|
+
- Ruby version: [e.g. 2.3]
|
25
|
+
- SDK version: [e.g. 2.0.0]
|
26
|
+
|
27
|
+
**Additional context**
|
28
|
+
Add any other context about the problem here. [e.g. Links to previous bugs].
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest completely new features or minor improvements to existing functionality
|
4
|
+
title: ''
|
5
|
+
labels: enhancement, proposed
|
6
|
+
|
7
|
+
---
|
8
|
+
|
9
|
+
**Is your feature request related to a problem? Please describe.**
|
10
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
11
|
+
|
12
|
+
**Describe the solution you'd like**
|
13
|
+
A clear and concise description of what you want to happen.
|
14
|
+
|
15
|
+
**Describe alternatives you've considered**
|
16
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
17
|
+
|
18
|
+
**Additional context**
|
19
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@21351ecc0a7c196081abca5dc55b08f085efe09a
|
28
|
+
with:
|
29
|
+
ruby-version: 2.6
|
30
|
+
- name: Install dependencies
|
31
|
+
run: bundle install
|
32
|
+
- name: Rubocop
|
33
|
+
run: rubocop lib
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake
|
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2021-01-06 19:35:39 UTC using RuboCop version 1.7.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: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'mercadopago.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 8
|
17
|
+
Lint/SelfAssignment:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/mercadopago/core/mp_base.rb'
|
20
|
+
|
21
|
+
# Offense count: 1
|
22
|
+
# Cop supports --auto-correct.
|
23
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
24
|
+
Lint/UnusedMethodArgument:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/mercadopago/resources/disbursement_refund.rb'
|
27
|
+
|
28
|
+
# Offense count: 36
|
29
|
+
Lint/UselessAssignment:
|
30
|
+
Exclude:
|
31
|
+
- 'examples/instant-payment-notifications/receive-ipn.rb'
|
32
|
+
- 'lib/mercadopago/core/mp_base.rb'
|
33
|
+
- 'lib/mercadopago/http/http_client.rb'
|
34
|
+
- 'lib/mercadopago/resources/advanced_payment.rb'
|
35
|
+
- 'lib/mercadopago/resources/disbursement_refund.rb'
|
36
|
+
- 'tests/test_card.rb'
|
37
|
+
- 'tests/test_card_token.rb'
|
38
|
+
|
39
|
+
# Offense count: 2
|
40
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
41
|
+
Metrics/AbcSize:
|
42
|
+
Max: 25
|
43
|
+
|
44
|
+
# Offense count: 15
|
45
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
46
|
+
Metrics/MethodLength:
|
47
|
+
Max: 69
|
48
|
+
|
49
|
+
# Offense count: 3
|
50
|
+
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
51
|
+
Metrics/ParameterLists:
|
52
|
+
Max: 7
|
53
|
+
|
54
|
+
# Offense count: 1
|
55
|
+
Naming/AccessorMethodName:
|
56
|
+
Exclude:
|
57
|
+
- 'lib/mercadopago/config/request_options.rb'
|
58
|
+
|
59
|
+
# Offense count: 6
|
60
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
61
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
62
|
+
Naming/FileName:
|
63
|
+
Exclude:
|
64
|
+
- 'examples/instant-payment-notifications/receive-ipn.rb'
|
65
|
+
- 'examples/payment-search/search-approved-payments.rb'
|
66
|
+
- 'examples/payment-search/search-creditcard-payments.rb'
|
67
|
+
- 'examples/payment-search/search-funded-payments-by-name.rb'
|
68
|
+
- 'examples/payment-search/search-payments-from-email-and-date.rb'
|
69
|
+
- 'examples/payment-search/search-payments.rb'
|
70
|
+
|
71
|
+
# Offense count: 23
|
72
|
+
# Configuration parameters: EnforcedStyle.
|
73
|
+
# SupportedStyles: snake_case, camelCase
|
74
|
+
Naming/VariableName:
|
75
|
+
Exclude:
|
76
|
+
- 'examples/checkout-buttons/basic_preference/button.rb'
|
77
|
+
- 'examples/payment-search/search-approved-payments.rb'
|
78
|
+
- 'examples/payment-search/search-creditcard-payments.rb'
|
79
|
+
- 'examples/payment-search/search-funded-payments-by-name.rb'
|
80
|
+
- 'examples/payment-search/search-payments-from-email-and-date.rb'
|
81
|
+
- 'examples/payment-search/search-payments.rb'
|
82
|
+
- 'examples/preapproval-payments/button.rb'
|
83
|
+
- 'lib/mercadopago/config/config.rb'
|
84
|
+
|
85
|
+
# Offense count: 7
|
86
|
+
Style/ClassVars:
|
87
|
+
Exclude:
|
88
|
+
- 'lib/mercadopago/config/config.rb'
|
89
|
+
|
90
|
+
# Offense count: 32
|
91
|
+
Style/Documentation:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
# Offense count: 2
|
95
|
+
Style/IdenticalConditionalBranches:
|
96
|
+
Exclude:
|
97
|
+
- 'examples/instant-payment-notifications/receive-ipn.rb'
|
98
|
+
|
99
|
+
# Offense count: 12
|
100
|
+
# Cop supports --auto-correct.
|
101
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
102
|
+
# URISchemes: http, https
|
103
|
+
Layout/LineLength:
|
104
|
+
Max: 151
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.2
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -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 danilo.elias@mercadolivre.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 [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Coding Guidelines
|
2
|
+
|
3
|
+
The Mercado Pago Ruby SDK is a collaborative effort from the start. The SDK team thinks that contributions from different developer will enrich it's feature set and make it more relevant to the community.
|
4
|
+
|
5
|
+
However; absorbing all contributions as-is, while expedient, might lead to difficulties in maintenance of the codebase is left unchecked. Collaborative codebases often establish guidelines for contributors to ensure code remains maintainable over time. The effort to maintain the SDK is no different in this regard so a bit of guidance is in order.
|
6
|
+
|
7
|
+
The purpose of this guide is to set a baseline for contributions. These guidelines are not intended to limit the tools at your disposal nor to rewire the way you think but rather to encourage good neighbor behavior.
|
8
|
+
|
9
|
+
## Language Guidelines
|
10
|
+
|
11
|
+
We use **english** language. This is to be consistent everywhere, and to be considerate with developers that do not speak our native language.
|
12
|
+
|
13
|
+
Therefore: source code, comments, documentation, commit messages, review comments, and any other kind of contribution *MUST* use english language.
|
14
|
+
|
15
|
+
Typos are unavoidable, but try to reduce them by using a spellchecker. Most IDEs can be configured to run one automatically.
|
16
|
+
|
17
|
+
## Code Guidelines
|
18
|
+
|
19
|
+
* Set your IDE to follow the [`.editorconfig`](https://editorconfig.org/) in each repository.
|
20
|
+
* Follow the [RuboCop Ruby Style Guide](https://github.com/rubocop/ruby-style-guide).
|
21
|
+
|
22
|
+
Generally speaking, be conscious when contributing and try following the same style that the code in the SDK already has. If you have any doubts, just ask us!
|
23
|
+
|
24
|
+
This rules will be enforced automatically when making a pull requests, and checks will fail if you do not follow them, resulting in your contribution being automatically rejected until fixed.
|
25
|
+
|
26
|
+
## Comment Guidelines
|
27
|
+
|
28
|
+
Comments in code are a hard thing to write, not because the words are difficult to produce but because it is hard to make relevant comments. Too much of it and people do not read comments (and it obfuscates code reading) and too little of it gives you no recourse but to read large portions of codebase to get insight as to what a feature/codeblock is doing. Both situations are undesirable and efforts should be made at all time to have a please comment reading experience
|
29
|
+
|
30
|
+
As a general rule you would have to comment on decisions you made while coding that are not part of any specification.
|
31
|
+
|
32
|
+
In particular you should always comment any decision that:
|
33
|
+
|
34
|
+
* Departs from common wisdom or convention (The **why's** are necessary).
|
35
|
+
* Takes a significant amount of time to produce. A good rule of thumb here is that if you spent more than 1 hour thinking on how to produce a fragment of code that took 2 minutes of wrist time to write you should document your thinking to aid reader and allow for validation.
|
36
|
+
* Need to preserve properties of the implementation. This is the case of performance sensitive portions of the codebase, goroutines synchronization, implementations of security primitives, congestion control algorithms, etc.
|
37
|
+
|
38
|
+
As a general rule of what not to comment you should avoid:
|
39
|
+
|
40
|
+
* Commenting on structure of programs that is already part of a convention, specified or otherwise.
|
41
|
+
* Having pedantic explanations of behavior that can be found by immediate examination of the surrounding code artifacts.
|
42
|
+
* Commenting on behavior you cannot attest.
|
43
|
+
|
44
|
+
### Branching Guidelines
|
45
|
+
|
46
|
+
Currently `master` is our only long term branch, below a few suggestions of short term branches naming:
|
47
|
+
|
48
|
+
* `hotfix/something-needs-fix`: Small routine patches in code to features already there.
|
49
|
+
* `feature/something-new`: A new feature or a change in a existent feature. Beware of breaking changes that would require a major version bump.
|
50
|
+
* `doc/improves-documentation-for-this-feature`: If you add or change documentation with no impact to the source code.
|
51
|
+
|
52
|
+
### Git Guidelines
|
53
|
+
|
54
|
+
All commits **SHOULD** follow the [seven rules of a great Git commit message](https://chris.beams.io/posts/git-commit):
|
55
|
+
|
56
|
+
1. Separate subject from body with a blank line.
|
57
|
+
2. Limit the subject line to 72 characters.
|
58
|
+
3. Capitalize the subject line.
|
59
|
+
4. Do not end the subject line with a period.
|
60
|
+
5. Use the imperative mood in the subject line.
|
61
|
+
6. Wrap the body at 72 characters.
|
62
|
+
7. Use the body to explain what and why vs. how.
|
63
|
+
|
64
|
+
Commits such as "fix tests", "now it's working" and many other common messages we find usually in code **WON'T** be accepted.
|
65
|
+
|
66
|
+
Ideally we would like to enforce these rules, but we are realistic and understand that it might be a big change for some people. So unless deviating heavily from what was stated we might accept your commits even if not following these rules perfectly.
|
67
|
+
|
68
|
+
Please avoid taking to much time to deliver code, and always [rebase](https://git-scm.com/docs/git-rebase) your code to avoid reverse merge commits.
|
69
|
+
|
70
|
+
When reviewing, check if the PR adheres to [RuboCop Ruby Style Guide](https://github.com/rubocop/ruby-style-guide).
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Contributing to the Mercado Pago Ruby SDK
|
2
|
+
|
3
|
+
Thank you for your interest in contributing to the Mercado Pago Ruby SDK!
|
4
|
+
|
5
|
+
## How to contribute
|
6
|
+
|
7
|
+
In order to contribute to the Mercado Pago Ruby SDK effectively we provide guidelines to address common case for contributions. Presently we have guides for the following type of changes.
|
8
|
+
|
9
|
+
* Request For Change (RFC) / Feature Request: These are suggestions / requests for features the SDK currently does not have. The SDK team evaluates these requests for adequacy / relevance / capacity and overall architectural consistency.
|
10
|
+
* Bug Reports: These are reports of non compliant behavior with the SDK specification and other blatantly wrong behavior of the Mercado Pago Ruby SDK.
|
11
|
+
|
12
|
+
In addition to contributing in the form of Bug Reports and RFCs it is also possible to contribute directly in code with a Pull Request (PR). In the case of a Pull Request you should also indicate the nature of the Pull Request (Feature/Bug/etc.) to help the team asses the Pull Request. If you are enthusiastic about a particular Feature being added or a bug being fixed, a PR is often the quickest way to promote your change as the team does not have to allocate as much resources to process the contribution.
|
13
|
+
|
14
|
+
In the case of PRs it is often best to consult with the SDK team before embarking on a PR, specially if it's a beefy one. Spending time on a PR that might later be rejected because major discrepancies with vision or competing contributions is an uncomfortable outcome for all involved people. Remember the SDK team with privilege overall consistency and progress over any one particular contribution.
|
15
|
+
|
16
|
+
## Coding Guidance
|
17
|
+
|
18
|
+
All contributions *MUST* follow the [Coding Guidelines](CODING_GUIDELINES.md). Contributions that fail to follow this guidelines will be disregarded and told to make the required modifications to do so.
|
19
|
+
|
20
|
+
## Request For Change / Feature Request
|
21
|
+
|
22
|
+
Generally speaking an RFC is needed when you want to add a new feature or change an existing one in an incompatible way that might result in a major version bump to the toolkit.
|
23
|
+
|
24
|
+
Though it seems a little bureaucratic, the process is in place in order to avoid frustration of a potential contributor by making the discussions take place before any code is written. Once the design and direction is fully agreed then the contributor can work peacefully knowing that their change will be committed.
|
25
|
+
|
26
|
+
As of this moment all you need to do is create an issue and use the [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.md).
|
27
|
+
|
28
|
+
Please prepend your issue title with `[RFC]` so that's easier to filter.
|
29
|
+
|
30
|
+
## Bug Reports
|
31
|
+
|
32
|
+
Bugs are a reality in software. We can't fix what we don't know about, so please report liberally. If you're not sure if something is a bug or not, feel free to file it anyway.
|
33
|
+
|
34
|
+
Before reporting a bug, please search existing issues and pull requests, as it's possible that someone else has already reported your error. In the off case that you find your issue as fixed/closed, please add a reference to it on your new one.
|
35
|
+
|
36
|
+
Your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.
|
37
|
+
|
38
|
+
Opening an issue is as easy as following [this link](https://github.com/mercadopago/sdk-dotnet/issues/new) and filling out the given template.
|
39
|
+
|
40
|
+
Bug reports may also be sent in the form of a [pull request](#pull-request) containing a failing test.
|
41
|
+
|
42
|
+
## Pull Request
|
43
|
+
|
44
|
+
First and foremost: Source code, documentation, commit messages, review comments, and any other kind of contribution must *MUST* follow the [Coding Guidelines](CODING_GUIDELINES.md).
|
45
|
+
|
46
|
+
We use the "fork and pull" model [described here](https://help.github.com/articles/about-collaborative-development-models/), where contributors push changes to their personal fork and create pull requests to bring those changes into the source repository.
|
47
|
+
|
48
|
+
Your basic steps to get going:
|
49
|
+
|
50
|
+
* Fork the corresponding toolkit repository and create a branch from master for the issue you are working on.
|
51
|
+
* Commit as you go following our git conventions.
|
52
|
+
* Include tests that cover all non-trivial code. The existing tests should provide a template on how to test the toolkit correctly.
|
53
|
+
* Make sure all test passes.
|
54
|
+
* All code changes are expected to comply with the formatting style.
|
55
|
+
* Push your commits to GitHub and create a pull request against the corresponding toolkit component master branch.
|
56
|
+
|
57
|
+
If taking to much time to deliver code, **always** [rebase](https://git-scm.com/docs/git-rebase) towards `master` before asking for a review, and avoid reverse merge commits.
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,26 +1,54 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
mercadopago-sdk (0.3.5)
|
5
|
-
json
|
6
|
-
|
7
1
|
GEM
|
8
2
|
remote: https://rubygems.org/
|
9
3
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
ast (2.4.2)
|
5
|
+
domain_name (0.5.20190701)
|
6
|
+
unf (>= 0.0.5, < 1.0.0)
|
7
|
+
http-accept (1.7.0)
|
8
|
+
http-cookie (1.0.3)
|
9
|
+
domain_name (~> 0.5)
|
10
|
+
mime-types (3.3.1)
|
11
|
+
mime-types-data (~> 3.2015)
|
12
|
+
mime-types-data (3.2021.0225)
|
13
|
+
minitest (5.14.4)
|
14
|
+
netrc (0.11.0)
|
15
|
+
parallel (1.20.1)
|
16
|
+
parser (3.0.0.0)
|
17
|
+
ast (~> 2.4.1)
|
18
|
+
rainbow (3.0.0)
|
19
|
+
rake (13.0.3)
|
20
|
+
regexp_parser (2.1.1)
|
21
|
+
rest-client (2.1.0)
|
22
|
+
http-accept (>= 1.7.0, < 2.0)
|
23
|
+
http-cookie (>= 1.0.2, < 2.0)
|
24
|
+
mime-types (>= 1.16, < 4.0)
|
25
|
+
netrc (~> 0.8)
|
26
|
+
rexml (3.2.4)
|
27
|
+
rubocop (1.11.0)
|
28
|
+
parallel (~> 1.10)
|
29
|
+
parser (>= 3.0.0.0)
|
30
|
+
rainbow (>= 2.2.2, < 4.0)
|
31
|
+
regexp_parser (>= 1.8, < 3.0)
|
32
|
+
rexml
|
33
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
34
|
+
ruby-progressbar (~> 1.7)
|
35
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
36
|
+
rubocop-ast (1.4.1)
|
37
|
+
parser (>= 2.7.1.5)
|
38
|
+
ruby-progressbar (1.11.0)
|
39
|
+
unf (0.1.4)
|
40
|
+
unf_ext
|
41
|
+
unf_ext (0.0.7.7)
|
42
|
+
unicode-display_width (2.0.0)
|
19
43
|
|
20
44
|
PLATFORMS
|
21
45
|
ruby
|
22
46
|
|
23
47
|
DEPENDENCIES
|
24
|
-
|
25
|
-
pry
|
48
|
+
minitest
|
26
49
|
rake
|
50
|
+
rest-client
|
51
|
+
rubocop
|
52
|
+
|
53
|
+
BUNDLED WITH
|
54
|
+
2.1.4
|