Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update branch master with new SDK version 3.0.0 #468

Merged
merged 164 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 161 commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
08a3458
Init project structure SDK PHP v3
rhames07 Aug 1, 2023
92ff954
Implement base
rhames07 Aug 3, 2023
7fcf3ce
Implement payment client
rhames07 Aug 3, 2023
ff871c8
Adjust Serializer
rhames07 Aug 3, 2023
4661e7d
Update CI Develop V3
rhames07 Aug 3, 2023
30593b5
Add http client test
rhames07 Aug 3, 2023
4697025
Refactor MercadoPagoClient
rhames07 Aug 4, 2023
fdfc6f4
Refactor PaymentClient
rhames07 Aug 4, 2023
6826d8d
Adjust MPRequestOptions
rhames07 Aug 4, 2023
cf0718f
Refactor MPDefaultHttpClient
rhames07 Aug 4, 2023
de1f92c
PHPDoc to MPRequestOptions
rhames07 Aug 4, 2023
5f1b34f
Update composer.json
rhames07 Aug 4, 2023
06b7d69
Apply Property Promotion to MPRequest
rhames07 Aug 4, 2023
a65d739
Apply Property Promotion to MPResponse
rhames07 Aug 4, 2023
940b434
Apply Property Promotion to MPRequestOptions
rhames07 Aug 4, 2023
050dcde
Adjust code
rhames07 Aug 4, 2023
0d61598
Adjust code
rhames07 Aug 4, 2023
9babb1e
Update MercadoPagoClient
rhames07 Aug 4, 2023
22ad321
Adjust mixed values
rhames07 Aug 4, 2023
d85659c
Adjust code
rhames07 Aug 4, 2023
27ccb1a
Adjust Serializer
rhames07 Aug 4, 2023
5d97d85
Merge with base
rhames07 Aug 4, 2023
c1757c7
Adjust code
rhames07 Aug 7, 2023
0f56356
Adjust code
rhames07 Aug 7, 2023
b3bc9c1
Remove config platform from composer.json
rhames07 Aug 8, 2023
addedd7
Implement base project (#424)
rhames07 Aug 8, 2023
a32956c
Merge develop-v3
rhames07 Aug 8, 2023
05396c3
Adjust property types
rhames07 Aug 9, 2023
010aeed
Adjust property types
rhames07 Aug 9, 2023
c68c35b
Merge pull request #425 from mercadopago/feature/implement-payment-cl…
rhames07 Aug 10, 2023
3388a8e
Adjust property types
rhames07 Aug 11, 2023
a9f0c17
Adjust property types
rhames07 Aug 11, 2023
ffaa843
Merge pull request #427 from mercadopago/feature/adjust-types
rhames07 Aug 11, 2023
be7b8d6
add card token request
edmarSoaress Aug 22, 2023
98a3cea
initial implementation preference
eltinMeli Aug 22, 2023
3ac9921
migrate files payments to common
eltinMeli Aug 22, 2023
5650a1b
add card token resource
edmarSoaress Aug 22, 2023
6610985
Merge pull request #430 from mercadopago/feature/CORECH2-347-add-card…
edmarSoaress Aug 22, 2023
a5d93bd
Merge branch 'develop-v3' into feature/implementation_preference
eltinMeli Aug 22, 2023
a0150f1
adjust code review
eltinMeli Aug 22, 2023
9ead2e3
Merge pull request #431 from mercadopago/feature/implementation_prefe…
eltinMeli Aug 22, 2023
8ac02c4
add payment method list
edmarSoaress Aug 23, 2023
2c8d431
add code review sugestion
edmarSoaress Aug 25, 2023
e3aa967
removing credentials test
edmarSoaress Aug 25, 2023
175b048
merge develop-v3 into feature/CORECH2-353-add-payment-method
edmarSoaress Aug 25, 2023
4f3418f
change file
edmarSoaress Aug 25, 2023
fd82814
change file
edmarSoaress Aug 25, 2023
a1ac5b2
change file
edmarSoaress Aug 25, 2023
a0823cb
change file
edmarSoaress Aug 25, 2023
332b37b
corrige file path
edmarSoaress Aug 25, 2023
c626508
initial implementation
eltinMeli Aug 25, 2023
39db3e9
add integrated tests
eltinMeli Aug 25, 2023
1130264
Merge pull request #433 from mercadopago/feature/CORECH2-353-add-paym…
edmarSoaress Aug 25, 2023
df95dc3
migrate variabels camel case to snake case
eltinMeli Aug 25, 2023
6d83ca1
adjust conflicts develop
eltinMeli Aug 25, 2023
0d7dff2
adjust folder card token
eltinMeli Aug 25, 2023
7b40abc
adjust folder card token
eltinMeli Aug 25, 2023
761cb5d
adjust folder card token return
eltinMeli Aug 25, 2023
3765ce2
Merge pull request #434 from mercadopago/feature/implementation_refunds
eltinMeli Aug 25, 2023
30175b2
implements customer cards
eltinMeli Aug 28, 2023
c18145f
change camelCase to snake_case
eltinMeli Aug 28, 2023
cb364bf
Merge pull request #435 from mercadopago/feature/implementation_custo…
eltinMeli Aug 28, 2023
96941a0
Adjusts and add properties preference
eltinMeli Aug 28, 2023
8aae341
add coding guidelines and how to contribute sections
taliyada Sep 1, 2023
0eaf189
Initial implementation PreApproval
rhames07 Sep 4, 2023
a5e395f
implements customers and it tests customers cards
eltinMeli Sep 4, 2023
5e4f914
implements customers and it tests customers cards
eltinMeli Sep 4, 2023
ca4f31a
exclude it tests customer and customer card run
eltinMeli Sep 4, 2023
7d61777
exclude comment
eltinMeli Sep 5, 2023
aadab7c
Merge pull request #438 from mercadopago/feature/implementation_custo…
eltinMeli Sep 5, 2023
c7057c2
Initial implementation PreApprovalPlan
rhames07 Sep 5, 2023
d9900f2
Merge branch 'develop-v3' into feature/implementation-preapproval
rhames07 Sep 5, 2023
41ec9e9
Update integration tests
rhames07 Sep 5, 2023
e4d15fc
initial implements
eltinMeli Sep 5, 2023
78722a0
exclude test it run git
eltinMeli Sep 5, 2023
afb913c
Update PreApproval DTO and tests
rhames07 Sep 5, 2023
c654f86
Merge branch 'feature/implementation-preapproval' into feature/implem…
rhames07 Sep 5, 2023
9afcc57
fix text
taliyada Sep 6, 2023
5d77e6b
Initial implementation Invoices
rhames07 Sep 6, 2023
e2d8ad7
Merge pull request #437 from mercadopago/feature/implementation-preap…
rhames07 Sep 6, 2023
e3c34ec
Merge pull request #439 from mercadopago/feature/implementation-plans
rhames07 Sep 6, 2023
db3f547
Merge pull request #441 from mercadopago/feature/implementation_ident…
eltinMeli Sep 6, 2023
b6b326e
Merge pull request #436 from mercadopago/feature/add-how-to-contribute
taliyada Sep 8, 2023
9675436
Adjust InvoiceClient and InvoiceClientUnitTest
rhames07 Sep 8, 2023
f2ef1bd
Initial implementation User
rhames07 Sep 8, 2023
39b0802
Update test suit Unit Tests
rhames07 Sep 8, 2023
9ecbeee
Update InvoiceClient exception handling
rhames07 Sep 11, 2023
e9c9d34
Merge pull request #443 from mercadopago/feature/implementation-invoices
rhames07 Sep 11, 2023
0efc6c0
Merge branch 'feature/implementation-invoices' into feature/implement…
rhames07 Sep 11, 2023
aa51012
Merge branch 'develop-v3' into feature/implementation-user
rhames07 Sep 11, 2023
4499664
Update UserClient exception handling
rhames07 Sep 11, 2023
4ff5994
Fix InvoiceClient
rhames07 Sep 11, 2023
fba43bb
Fix InvoiceClient
rhames07 Sep 11, 2023
73eb4a7
Update resource User/Phone
rhames07 Sep 11, 2023
433bdee
Merge pull request #444 from mercadopago/feature/implementation-user
rhames07 Sep 11, 2023
6c993a2
Improve exception handling
rhames07 Sep 11, 2023
95c6984
Merge pull request #445 from mercadopago/feature/improve-exception-ha…
rhames07 Sep 11, 2023
5fb683c
Improve autoloading for tests
rhames07 Sep 12, 2023
0dc3308
Merge pull request #446 from mercadopago/feature/improve-autoloading
rhames07 Sep 12, 2023
5bae78d
Initial implementation OAuth
rhames07 Sep 12, 2023
9725c39
Merge pull request #447 from mercadopago/feature/implementation-oauth
rhames07 Sep 12, 2023
c00b1ff
Implements merchant order
eltinMeli Sep 12, 2023
a61bca5
exclude test it github ci
eltinMeli Sep 12, 2023
bf33271
adjust constant
eltinMeli Sep 13, 2023
958e9b7
Merge pull request #448 from mercadopago/feature/implementation_merch…
eltinMeli Sep 13, 2023
dce80de
Initial implementation Point
rhames07 Sep 14, 2023
3fd345e
Merge branch 'develop-v3' into feature/implementation-point
rhames07 Sep 14, 2023
bc0a73b
Update phpunit.xml
rhames07 Sep 14, 2023
927811a
Merge pull request #449 from mercadopago/feature/implementation-point
rhames07 Sep 15, 2023
639cccd
Add Idempotency Key
rhames07 Sep 18, 2023
28a9198
Remove var_dump
rhames07 Sep 19, 2023
17bc63d
Merge pull request #450 from mercadopago/feature/add-idempotency-key
rhames07 Sep 19, 2023
8c5fb8d
Refactor request options
rhames07 Sep 21, 2023
0cca378
Refactor test structure
rhames07 Sep 21, 2023
2704d50
Update request options comments
rhames07 Sep 21, 2023
8cc7a9d
Merge pull request #452 from mercadopago/feature/refactor-request-opt…
rhames07 Sep 22, 2023
b957956
Merge pull request #453 from mercadopago/feature/refactor-test-structure
rhames07 Sep 22, 2023
d6f5803
Add retry logic to default http client
rhames07 Sep 25, 2023
26c6089
Retry if server error
rhames07 Sep 25, 2023
4f3711f
Reset retries
rhames07 Sep 25, 2023
5223735
Fix IdentificationType test namespace
rhames07 Sep 25, 2023
cddf0b8
Fix resources mapping
rhames07 Sep 25, 2023
14864a6
Map Payment search
rhames07 Sep 26, 2023
4da9c01
Update send function
rhames07 Sep 26, 2023
6b56fa7
Add exponential backoff strategy
rhames07 Sep 27, 2023
e233eb5
Merge pull request #455 from mercadopago/feature/implementation-retries
rhames07 Sep 27, 2023
cf42402
Merge pull request #456 from mercadopago/fix/adjust-autoloading
rhames07 Sep 27, 2023
895b86d
Merge pull request #457 from mercadopago/fix/deprecated-properties
rhames07 Sep 27, 2023
72b20dc
Map search lists
rhames07 Sep 28, 2023
a0c97ac
Adjust types
rhames07 Sep 28, 2023
4e230b0
Adjust consts
rhames07 Sep 28, 2023
699eee1
Adjust comments
rhames07 Sep 28, 2023
1444d18
Add tracking headers
rhames07 Sep 29, 2023
3d0e223
Add tracking headers
rhames07 Sep 29, 2023
cb7733f
Add README.md
rhames07 Sep 29, 2023
60fcd9a
Update README.md
rhames07 Sep 29, 2023
307e2e7
Update master CI workflow
rhames07 Sep 29, 2023
8f71eb4
Update master CI workflow
rhames07 Sep 29, 2023
dae195c
Update master CI workflow
rhames07 Sep 29, 2023
ab65417
Update README.md
rhames07 Sep 29, 2023
b4891da
Update README.md
rhames07 Sep 29, 2023
6fabf8a
Merge pull request #460 from mercadopago/feature/mapping-lists
rhames07 Sep 29, 2023
da5852a
Merge pull request #461 from mercadopago/feature/standardization
rhames07 Sep 29, 2023
766b97d
Merge pull request #462 from mercadopago/feature/add-tracking-headers
rhames07 Sep 29, 2023
ae2946b
Merge pull request #463 from mercadopago/feature/add-readme
rhames07 Sep 29, 2023
63a9dbf
Adjust optional fields
rhames07 Sep 29, 2023
001a88a
Remove get CardToken from client
rhames07 Sep 29, 2023
3c800c2
Merge pull request #466 from mercadopago/feature/optional-response-fi…
rhames07 Sep 29, 2023
9b195eb
Merge pull request #467 from mercadopago/feature/remove-get-cardtoken
rhames07 Sep 29, 2023
1193934
Merge master
rhames07 Sep 29, 2023
00dbc8b
Fix use mapper
rhames07 Sep 29, 2023
ab5062a
Merge pull request #469 from mercadopago/feature/adjust-mapper
rhames07 Sep 29, 2023
1fe108a
Merge pull request #465 from mercadopago/feature/update-workflow-v3
rhames07 Sep 29, 2023
89d594d
Use assertSame
rhames07 Sep 29, 2023
a57cf72
Merge pull request #470 from mercadopago/feature/add-assertsame
rhames07 Sep 29, 2023
ab1e032
Adjust code
rhames07 Sep 29, 2023
a812f7f
Merge pull request #471 from mercadopago/feature/minor-adjustments
rhames07 Sep 29, 2023
0c63f34
Update PaymentMethod get method
rhames07 Oct 2, 2023
b8562f8
Merge pull request #472 from mercadopago/feature/list-payment-methods
rhames07 Oct 2, 2023
c7222bf
Fix OAuth client
rhames07 Oct 2, 2023
804e6df
Merge pull request #473 from mercadopago/fix/oauth-client
rhames07 Oct 2, 2023
ae83636
Add custom http client per client
rhames07 Oct 2, 2023
1d26299
Update doc
rhames07 Oct 2, 2023
a6b60ea
Merge pull request #474 from mercadopago/feature/custom-http-client-p…
rhames07 Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 0 additions & 31 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI master V3

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Install dependencies
run: composer install

- name: Run unit tests
run: vendor/bin/phpunit --testsuite "Unit Tests"
52 changes: 0 additions & 52 deletions .github/workflows/php.yml

This file was deleted.

27 changes: 6 additions & 21 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
#SOs
Thumbs.db
*~
._*
.DS_Store

#IDEs
nbproject
/.idea

#Vagrant
/.vagrant
/Vagrantfile.local

#Project
/vendor
/composer.lock

#Samples Vendor
/samples/vendor

.env
/vendor/
.phpunit.cache
.php-cs-fixer.cache
.phpunit.result.cache
.vscode
.php-cs-fixer.cache
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/digitalpulp/pre-commit-php.git
rev: 1.4.0
hooks:
- id: php-lint
- id: php-lint-all
- id: php-cs
files: \.(php)$
args: [--standard=PSR1 -p]
- id: php-cs-fixer
files: \.(php)$
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

104 changes: 104 additions & 0 deletions CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Coding Guidelines

The Mercado Pago PHP SDK is a collaborative effort from the start. The SDK team thinks that contributions from
different developer will enrich its feature set and make it more relevant to the community.

However, absorbing all contributions as-is, while expedient, might lead to difficulties in maintenance of the codebase
is left unchecked. A collaborative codebase 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.

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.

## Language Guidelines

We use **english** language. This is to be consistent everywhere, and to be considerate with developers that do not
speak our native language.

Therefore: source code, comments, documentation, commit messages, review comments, and any other kind of contribution *
MUST* use english language.

Typos are unavoidable, but try to reduce them by using a spellchecker. Most IDEs can be configured to run one
automatically.

## Code Guidelines

To contribute to the project you need to have installed in your machine [pre-commit tool](https://pre-commit.com/) to
check the code style and formatting.

1. To check if pre-commit is installed, you must run the command below successfully:

```
$ pre-commit --version
pre-commit 2.17.0
```

2. After pre-commit is installed at your machine, inside the SDK project folder, you must run the command below to set
up the git hook scripts of the project:

```
$ pre-commit install
```

After that, git hooks will run automatically before every commit command.

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!

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.

## Comment Guidelines

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

As a general rule you would have to comment on decisions you made while coding that are not part of any specification.

In particular, you should always comment any decision that:

* Departs from common wisdom or convention (The **why's** are necessary).
* 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.
* Need to preserve properties of the implementation. This is the case of performance sensitive portions of the codebase, implementations of security primitives, congestion control algorithms, etc.

As a general rule of what not to comment you should avoid:

* Commenting on structure of programs that is already part of a convention, specified or otherwise.
* Having pedantic explanations of behavior that can be found by immediate examination of the surrounding code artifacts.
* Commenting on behavior you cannot attest.

### Branching Guidelines

Currently `master` is our only long term branch, below a few suggestions of short term branches naming:

* `hotfix/something-needs-fix`: Small routine patches in code to feature already there.
* `feature/something-new`: A new feature or a change in an existent feature. Beware of breaking changes that would
require a major version bump.
* `doc/improves-documentation-for-this-feature`: If you add or change documentation with no impact to the source code.

### Git Guidelines

All commits **SHOULD** follow the [seven rules of a great Git commit message](https://chris.beams.io/posts/git-commit):

1. Separate subject from body with a blank line.
2. Limit the subject line to 72 characters.
3. Capitalize the subject line.
4. Do not end the subject line with a period.
5. Use the imperative mood in the subject line.
6. Wrap the body at 72 characters.
7. Use the body to explain what and why vs. how.

Commits such as "fix tests", "now it's working", and many other common messages we find usually in code **WON'T** be
accepted.

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.

Please avoid taking too much time to deliver code, and always [rebase](https://git-scm.com/docs/git-rebase) your code to
avoid reverse merge commits.
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to the Mercado Pago PHP SDK

Thank you for your interest in contributing to the Mercado Pago PHP SDK!

## How to contribute

In order to contribute to the Mercado Pago PHP SDK effectively we provide guidelines to address common case for
contributions. Presently we have guides for the following type of changes.

* 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.
* Bug Reports: These are reports of noncompliance behavior with the SDK specification and other blatantly wrong behavior of the Mercado Pago PHP SDK.

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 many resources to process the contribution.

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.

## Coding Guidance

All contributions *MUST* follow the [Coding Guidelines](CODING_GUIDELINES.md). Contributions that fail to follow these
guidelines will be disregarded and told to make the required modifications to do so.

## Request For Change / Feature Request

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 SDK.

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.

Please prepend your issue title with `[RFC]` so that's easier to filter.

## Bug Reports

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.

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.

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.

Opening an issue is as easy as
following [this link](https://github.com/mercadopago/sdk-nodejs/issues/new?assignees=&labels=&template=bug_report.md) and
filling out the given template.

Bug reports may also be sent in the form of a [pull request](#pull-request) containing a failing test.

## Pull Request

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).

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.

Your basic steps to get going:

* Fork the corresponding SDK repository and create a branch from master for the issue you are working on.
* Commit as you go following our git conventions.
* Include tests that cover all non-trivial code. The existing tests should provide a template on how to test the SDK correctly.
* Make sure all test passes.
* All code changes are expected to comply with the formatting style.
* Push your commits to GitHub and create a pull request against the corresponding SDK component master branch.

If taking too 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.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

Loading
Loading