-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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) |
There was a problem hiding this comment.
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 &
?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
No description provided.