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

Understanding fiat_value in Charge::find #2

Open
rvelhote opened this issue Dec 22, 2018 · 1 comment
Open

Understanding fiat_value in Charge::find #2

rvelhote opened this issue Dec 22, 2018 · 1 comment

Comments

@rvelhote
Copy link

Hello,

I am working on a Magento 1.9 module and I am puzzled by the output of Charge::find regarding the fiat_value member.

I created a charge with the following parameters:

object(stdClass)[328]
  public 'description' => string '1xTest Product' (length=14)
  public 'amount' => float 104.99
  public 'currency' => string 'USD' (length=3)
  public 'order_id' => string '100000064' (length=9)
  public 'email' => string 'r@v.com' (length=7)
  public 'name' => string 'R V' (length=3)
  public 'callback_url' => string 'http://localhost/index.php/opennode_bitcoin/callback/index/' (length=59)
  public 'auto_settle' => string '1'

and when invoking Charge::find I get the following (removed some information to be brief):

private 'charge' => 
    array (size=13)
      'id' => string 'aa642947-5e5d-41c3-af16-3b40586ec88c' (length=36)
      'description' => string '1xTest Product' (length=14)
      'amount' => int 2703433
      'status' => string 'unpaid' (length=6)
      'fiat_value' => float 92.328199187348
      'currency' => string 'USD' (length=3)
      'created_at' => int 1545492242
      'order_id' => string '100000064' (length=9)
      'success_url' => string 'https://opennode.co' (length=19)
      'auto_settle' => boolean false

I created the charge with 104.99 USD and got back 92.32 USD. IS it a bug in the value returned by the API or is it some undocumented nuance?

Thank you,
Ricardo

@joaodealmeida
Copy link
Contributor

joaodealmeida commented Dec 24, 2018

Hello @rvelhote ,

The fiat_value you received is the value of the checkout in your account's FIAT, which is probably EUR.
Thanks for letting us know, I'll add the "source_fiat_value" to the response, which is the actual value you passed in USD.

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

No branches or pull requests

2 participants