Skip to content

Commit d8f9b39

Browse files
Merge pull request #53 from AltaPay/update-customer-info-object
Update customer info object
2 parents aa1a672 + 8838f13 commit d8f9b39

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.4.8] - 2025-03-13
8+
### Added
9+
- Provide `setClientJavaEnabled` and `setClientColorDepth` methods to set `customer_info[client_java_enabled]` and `customer_info[client_color_depth]` for the customer object.
10+
711
## [3.4.7] - 2025-02-06
812
### Added
913
- Provide `setSelectedScheme` method to set `selected_scheme` for `initiatePayment`.

src/AbstractApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ abstract class AbstractApi
5555
/**
5656
* PHP API version
5757
*/
58-
const PHP_API_VERSION = '3.4.7';
58+
const PHP_API_VERSION = '3.4.8';
5959

6060
/**
6161
* Event dispatcher

src/Request/Customer.php

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,24 @@ class Customer extends AbstractSerializer
230230
/**
231231
* The customer's client supports javascript.
232232
*
233-
* @var string
233+
* @var bool
234234
*/
235235
private $clientJavascriptEnabled;
236236

237+
/**
238+
* The customer's client supports java.
239+
*
240+
* @var bool
241+
*/
242+
private $clientJavaEnabled;
243+
244+
/**
245+
* The customer's client screen color depth.
246+
*
247+
* @var string
248+
*/
249+
private $clientColorDepth;
250+
237251
/**
238252
* Client Session ID.
239253
*
@@ -664,7 +678,7 @@ public function setClientScreenHeight($clientScreenWidth)
664678
/**
665679
* Set if client javascript enabled or not
666680
*
667-
* @param string $clientJavascriptEnabled
681+
* @param bool $clientJavascriptEnabled
668682
*
669683
* @return $this
670684
*/
@@ -675,6 +689,34 @@ public function setClientJavascriptEnabled($clientJavascriptEnabled)
675689
return $this;
676690
}
677691

692+
/**
693+
* Set if client java enabled or not
694+
*
695+
* @param bool $clientJavaEnabled
696+
*
697+
* @return $this
698+
*/
699+
public function setClientJavaEnabled($clientJavaEnabled)
700+
{
701+
$this->clientJavaEnabled = $clientJavaEnabled;
702+
703+
return $this;
704+
}
705+
706+
/**
707+
* Set Client Screen Width
708+
*
709+
* @param string $clientColorDepth
710+
*
711+
* @return $this
712+
*/
713+
public function setClientColorDepth($clientColorDepth)
714+
{
715+
$this->clientColorDepth = $clientColorDepth;
716+
717+
return $this;
718+
}
719+
678720
/**
679721
* Set Client Session ID
680722
*
@@ -798,10 +840,18 @@ public function serialize()
798840
$output['client_screen_height'] = $this->clientScreenHeight;
799841
}
800842

801-
if ($this->clientJavascriptEnabled) {
843+
if ($this->clientJavascriptEnabled !== null) {
802844
$output['client_javascript_enabled'] = $this->clientJavascriptEnabled;
803845
}
804846

847+
if ($this->clientJavaEnabled !== null) {
848+
$output['client_java_enabled'] = $this->clientJavaEnabled;
849+
}
850+
851+
if ($this->clientColorDepth) {
852+
$output['client_color_depth'] = $this->clientColorDepth;
853+
}
854+
805855
if ($this->billingRef) {
806856
$output['billing_ref'] = $this->billingRef;
807857
}

0 commit comments

Comments
 (0)