Merge pull request #77 from woocommerce/issue-76-amount-value-should-be-string

Amount value should be a string when send to the api
This commit is contained in:
Emili Castells 2020-11-02 10:46:12 +01:00 committed by GitHub
commit 97c78b02a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ class Amount {
public function to_array(): array {
$amount = array(
'currency_code' => $this->currency_code(),
'value' => $this->value(),
'value' => number_format( $this->value(), 2 ),
);
if ( $this->breakdown() && count( $this->breakdown()->to_array() ) ) {
$amount['breakdown'] = $this->breakdown()->to_array();