Skip to content

Commit

Permalink
Money format.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jul 2, 2021
1 parent 68fff75 commit ddcd41c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/Gateway.php
Expand Up @@ -144,7 +144,7 @@ public function start( Payment $payment ) {
// Transaction.
$transaction = new Transaction();
$transaction->set_purchase_id( $purchase_id );
$transaction->set_amount( $payment->get_total_amount()->get_value() );
$transaction->set_amount( $payment->get_total_amount()->number_format( null, '.', '' ) );
$transaction->set_currency( $payment->get_total_amount()->get_currency()->get_alphabetic_code() );
$transaction->set_expiration_period( 'PT30M' );
$transaction->set_description( $payment->get_description() );
Expand Down
37 changes: 0 additions & 37 deletions src/IDeal.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/Transaction.php
Expand Up @@ -37,7 +37,7 @@ class Transaction {
/**
* Amount
*
* @var float|null
* @var string|null
*/
private $amount;

Expand Down Expand Up @@ -164,7 +164,7 @@ public function set_purchase_id( $id ) {
/**
* Get the amount of this transaction
*
* @return float|null
* @return string|null
*/
public function get_amount() {
return $this->amount;
Expand All @@ -173,7 +173,7 @@ public function get_amount() {
/**
* Set the amount of this transaction
*
* @param float|null $amount Amount.
* @param string|null $amount Amount.
* @return void
*/
public function set_amount( $amount ) {
Expand Down
2 changes: 1 addition & 1 deletion src/XML/TransactionRequestMessage.php
Expand Up @@ -110,7 +110,7 @@ public function get_document() {
$element,
array(
'purchaseID' => $transaction->get_purchase_id(),
'amount' => IDeal::format_amount( $amount ),
'amount' => $amount,
'currency' => $transaction->get_currency(),
'expirationPeriod' => $transaction->get_expiration_period(),
'language' => $transaction->get_language(),
Expand Down

0 comments on commit ddcd41c

Please sign in to comment.