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

[Feature] Order - get capture, refund, cancel, update and delete transaction #6

Merged
merged 8 commits into from
Feb 10, 2025

Conversation

kelvincarvalhosilva
Copy link
Owner

No description provided.

Comment on lines +54 to +56
payload = data&.to_json

@http_client.post(url: @config.api_base_url + uri, data: data.to_json, headers: headers,
timeout: request_options.connection_timeout)
@http_client.post(url: @config.api_base_url + uri, data: payload, headers: headers, timeout: request_options.connection_timeout)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] Aqui vc só extraiu o data.to_json para uma variável? Por que foi necessário colocar o &?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o é em Ruby é uma validação, não um endereço!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

é um bug @andreagostinho-meli, se eu fizer data.to_json independente se data tiver valor ou nao ele vai tentar fazer o to_json e irá enviar para o payload um valor NULL.
com o & se data estiver nulo ele nao tenta fazer o to_json, é quase um if ternário

@kelvincarvalhosilva kelvincarvalhosilva merged commit 875980f into develop Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants