Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Aug 18, 2021
2 parents 5bb23be + e237913 commit 2f58ffd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [3.0.1] - 2021-08-18
- Fixed `chargetotal` number format.

## [3.0.0] - 2021-08-05
- Updated to `pronamic/wp-pay-core` version `3.0.0`.
- Updated to `pronamic/wp-money` version `2.0.0`.
Expand Down Expand Up @@ -58,7 +61,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2016-07-06
- First release.

[unreleased]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/3.0.0...HEAD
[unreleased]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/3.0.1...HEAD
[3.0.1]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/2.1.2...3.0.0
[2.1.2]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/2.1.1...2.1.2
[2.1.1]: https://github.com/wp-pay-gateways/ems-e-commerce/compare/2.1.0...2.1.1
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"require": {
"php": ">=5.6.20",
"pronamic/wp-money": "^2.0",
"wp-pay/core": "^3.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ems-e-commerce",
"version": "3.0.0",
"version": "3.0.1",
"description": "EMS e-Commerce Gateway driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
21 changes: 15 additions & 6 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Pronamic\WordPress\DateTime\DateTime;
use Pronamic\WordPress\DateTime\DateTimeZone;
use Pronamic\WordPress\Money\Money;

/**
* Title: EMS e-Commerce client
Expand All @@ -12,7 +13,7 @@
* Company: Pronamic
*
* @author Reüel van der Steege
* @version 2.0.0
* @version 3.0.1
* @since 1.0.0
*/
class Client {
Expand Down Expand Up @@ -73,9 +74,9 @@ class Client {
private $return_url;

/**
* Amount
* Amount.
*
* @var string N12
* @var Money
*/
private $amount;

Expand Down Expand Up @@ -223,7 +224,7 @@ public function set_return_url( $return_url ) {
/**
* Get amount
*
* @return float
* @return Money
*/
public function get_amount() {
return $this->amount;
Expand All @@ -232,7 +233,7 @@ public function get_amount() {
/**
* Set amount
*
* @param float $amount Amount.
* @param Money $amount Amount.
* @return void
*/
public function set_amount( $amount ) {
Expand Down Expand Up @@ -374,7 +375,15 @@ public function get_data() {
'hash_algorithm' => 'SHA256',
'storename' => $this->get_storename(),
'mode' => 'payonly',
'chargetotal' => number_format( ( $this->get_amount() / 100 ), 2, '.', '' ),
/**
* This is the total amount of the transaction using a dot or comma
* as decimal separator, e. g. 12.34 for an amount of 12 Euro and
* 34 Cent. Group separators like1,000.01 / 1.000,01 are not
* allowed.
*
* @link https://github.com/wp-pay-gateways/ems-e-commerce/blob/5bb23be651fa54ce39244946525416796a5c3342/documentation/EMS-Manual-e-Comm-Gateway-HPP-tech-2017-6.pdf
*/
'chargetotal' => $this->amount->number_format( null, '.', '' ),
'currency' => $this->get_currency_numeric_code(),
);

Expand Down
4 changes: 2 additions & 2 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Company: Pronamic
*
* @author Reüel van der Steege
* @version 2.0.4
* @version 3.0.1
* @since 1.0.0
*/
class Gateway extends Core_Gateway {
Expand Down Expand Up @@ -94,7 +94,7 @@ public function get_output_fields( Payment $payment ) {
$this->client->set_order_id( $payment->format_string( $this->config->order_id ) );
$this->client->set_return_url( home_url( '/' ) );
$this->client->set_notification_url( home_url( '/' ) );
$this->client->set_amount( $payment->get_total_amount()->get_minor_units() );
$this->client->set_amount( $payment->get_total_amount() );
$this->client->set_issuer_id( $payment->get_issuer() );

// Language.
Expand Down

0 comments on commit 2f58ffd

Please sign in to comment.