{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/omnipay/issues/322","repository_url":"https://api.github.com/repos/thephpleague/omnipay","labels_url":"https://api.github.com/repos/thephpleague/omnipay/issues/322/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/omnipay/issues/322/comments","events_url":"https://api.github.com/repos/thephpleague/omnipay/issues/322/events","html_url":"https://github.com/thephpleague/omnipay/issues/322","id":128159094,"number":322,"title":"[3.0] Money value object","user":{"login":"barryvdh","id":973269,"avatar_url":"https://avatars.githubusercontent.com/u/973269?v=3","gravatar_id":"","url":"https://api.github.com/users/barryvdh","html_url":"https://github.com/barryvdh","followers_url":"https://api.github.com/users/barryvdh/followers","following_url":"https://api.github.com/users/barryvdh/following{/other_user}","gists_url":"https://api.github.com/users/barryvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/barryvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barryvdh/subscriptions","organizations_url":"https://api.github.com/users/barryvdh/orgs","repos_url":"https://api.github.com/users/barryvdh/repos","events_url":"https://api.github.com/users/barryvdh/events{/privacy}","received_events_url":"https://api.github.com/users/barryvdh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thephpleague/omnipay/labels/V3.0","name":"V3.0","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-01-22T13:42:10Z","updated_at":"2016-02-07T13:10:25Z","closed_at":null,"body":"So the de-facto package seems to be this: https://github.com/mathiasverraes/money\r\n\r\nWork is happening on the nextrelease branch: https://github.com/mathiasverraes/money/tree/nextrelease\r\n\r\nMoney has as static 'from string'  method to intialise from string, but we should encourage setting an integer. This could also be used for currency.\r\n\r\nI've asked for the timeframe for 3.0 is, so we might be able to use that."},"comment":{"url":"https://api.github.com/repos/thephpleague/omnipay/issues/comments/181011660","html_url":"https://github.com/thephpleague/omnipay/issues/322#issuecomment-181011660","issue_url":"https://api.github.com/repos/thephpleague/omnipay/issues/322","id":181011660,"user":{"login":"barryvdh","id":973269,"avatar_url":"https://avatars.githubusercontent.com/u/973269?v=3","gravatar_id":"","url":"https://api.github.com/users/barryvdh","html_url":"https://github.com/barryvdh","followers_url":"https://api.github.com/users/barryvdh/followers","following_url":"https://api.github.com/users/barryvdh/following{/other_user}","gists_url":"https://api.github.com/users/barryvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/barryvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barryvdh/subscriptions","organizations_url":"https://api.github.com/users/barryvdh/orgs","repos_url":"https://api.github.com/users/barryvdh/repos","events_url":"https://api.github.com/users/barryvdh/events{/privacy}","received_events_url":"https://api.github.com/users/barryvdh/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T13:10:25Z","updated_at":"2016-02-07T13:10:25Z","body":"Money accepts an integer and returns one. So when we want to allow a string to be used as input, this needs to be converted anyways. (But money has a parser for that, which may be more or less reliable for our use case.\r\nIf we want to output a string, we would still need to convert it ourself.\r\nAnd without calculations, the money object can be pretty much replaced with the integer directly.\r\n\r\nIf developers want to use Money, they still scan, and just pass the amount to Omnipay.\r\n\r\nIf you mean we could just pass a Money object instead of amount and currency, that would be okay with a simple instanceof check and getting the actual value. "}}