Skip to content

Commit

Permalink
feat: Add skip_gateway_rules and eci (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: ProcessOut Fountain <[email protected]>
  • Loading branch information
roshan-gorasia-cko and processout-machine authored Jan 25, 2024
1 parent f185e3d commit 2c7c1d5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The package's installation is done using composer. Simply add these lines to you
```json
{
"require": {
"processout/processout-php": "^6.28.0"
"processout/processout-php": "^6.29.0"
}
}
```
Expand Down
32 changes: 32 additions & 0 deletions src/InvoiceRisk.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ class InvoiceRisk implements \JsonSerializable
*/
protected $isLegit;

/**
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @var boolean
*/
protected $skipGatewayRules;

/**
* InvoiceRisk constructor
* @param ProcessOut\ProcessOut $client
Expand Down Expand Up @@ -85,6 +91,28 @@ public function setIsLegit($value)
return $this;
}

/**
* Get SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @return bool
*/
public function getSkipGatewayRules()
{
return $this->skipGatewayRules;
}

/**
* Set SkipGatewayRules
* Skip payment gateway fraud engine rules (on compatible gateways only.)
* @param bool $value
* @return $this
*/
public function setSkipGatewayRules($value)
{
$this->skipGatewayRules = $value;
return $this;
}


/**
* Fills the current object with the new values pulled from the data
Expand All @@ -99,6 +127,9 @@ public function fillWithData($data)
if(! empty($data['is_legit']))
$this->setIsLegit($data['is_legit']);

if(! empty($data['skip_gateway_rules']))
$this->setSkipGatewayRules($data['skip_gateway_rules']);

return $this;
}

Expand All @@ -110,6 +141,7 @@ public function jsonSerialize() {
return array(
"score" => $this->getScore(),
"is_legit" => $this->getIsLegit(),
"skip_gateway_rules" => $this->getSkipGatewayRules(),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Networking/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function prepare($options, $len = null)
$headers = array(
'API-Version: 1.4.0.0',
'Content-Type: application/json',
'User-Agent: ProcessOut PHP-Bindings/6.28.0'
'User-Agent: ProcessOut PHP-Bindings/6.29.0'
);
if (! empty($options['idempotencyKey']))
$headers[] = 'Idempotency-Key: ' . $options['idempotencyKey'];
Expand Down
32 changes: 32 additions & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ class Transaction implements \JsonSerializable
*/
protected $paymentType;

/**
* The Electronic Commerce Indicator
* @var string
*/
protected $eci;

/**
* Native APM response data
* @var object
Expand Down Expand Up @@ -1836,6 +1842,28 @@ public function setPaymentType($value)
return $this;
}

/**
* Get Eci
* The Electronic Commerce Indicator
* @return string
*/
public function getEci()
{
return $this->eci;
}

/**
* Set Eci
* The Electronic Commerce Indicator
* @param string $value
* @return $this
*/
public function setEci($value)
{
$this->eci = $value;
return $this;
}

/**
* Get NativeApm
* Native APM response data
Expand Down Expand Up @@ -2078,6 +2106,9 @@ public function fillWithData($data)
if(! empty($data['payment_type']))
$this->setPaymentType($data['payment_type']);

if(! empty($data['eci']))
$this->setEci($data['eci']);

if(! empty($data['native_apm']))
$this->setNativeApm($data['native_apm']);

Expand Down Expand Up @@ -2154,6 +2185,7 @@ public function jsonSerialize() {
"initial_scheme_transaction_id" => $this->getInitialSchemeTransactionId(),
"scheme_id" => $this->getSchemeId(),
"payment_type" => $this->getPaymentType(),
"eci" => $this->getEci(),
"native_apm" => $this->getNativeApm(),
"external_details" => $this->getExternalDetails(),
);
Expand Down

0 comments on commit 2c7c1d5

Please sign in to comment.