Skip to content

Commit b938d91

Browse files
feat: add auto_capture_at field within the invoice object (#20)
Co-authored-by: ProcessOut Fountain <internal@processout.com>
1 parent 30b9f10 commit b938d91

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The package's installation is done using composer. Simply add these lines to you
2020
```json
2121
{
2222
"require": {
23-
"processout/processout-php": "^6.32.0"
23+
"processout/processout-php": "^6.33.0"
2424
}
2525
}
2626
```

src/Invoice.php

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ class Invoice implements \JsonSerializable
298298
*/
299299
protected $verification;
300300

301+
/**
302+
* A timestamp to indicate when an auto capture should take place following an authorization. This takes priority over the value sent in the authorization request.
303+
* @var string
304+
*/
305+
protected $autoCaptureAt;
306+
301307
/**
302308
* Invoice constructor
303309
* @param ProcessOut\ProcessOut $client
@@ -1448,6 +1454,28 @@ public function setVerification($value)
14481454
return $this;
14491455
}
14501456

1457+
/**
1458+
* Get AutoCaptureAt
1459+
* A timestamp to indicate when an auto capture should take place following an authorization. This takes priority over the value sent in the authorization request.
1460+
* @return string
1461+
*/
1462+
public function getAutoCaptureAt()
1463+
{
1464+
return $this->autoCaptureAt;
1465+
}
1466+
1467+
/**
1468+
* Set AutoCaptureAt
1469+
* A timestamp to indicate when an auto capture should take place following an authorization. This takes priority over the value sent in the authorization request.
1470+
* @param string $value
1471+
* @return $this
1472+
*/
1473+
public function setAutoCaptureAt($value)
1474+
{
1475+
$this->autoCaptureAt = $value;
1476+
return $this;
1477+
}
1478+
14511479

14521480
/**
14531481
* Fills the current object with the new values pulled from the data
@@ -1597,6 +1625,9 @@ public function fillWithData($data)
15971625
if(! empty($data['verification']))
15981626
$this->setVerification($data['verification']);
15991627

1628+
if(! empty($data['auto_capture_at']))
1629+
$this->setAutoCaptureAt($data['auto_capture_at']);
1630+
16001631
return $this;
16011632
}
16021633

@@ -1653,6 +1684,7 @@ public function jsonSerialize() {
16531684
"billing" => $this->getBilling(),
16541685
"unsupported_feature_bypass" => $this->getUnsupportedFeatureBypass(),
16551686
"verification" => $this->getVerification(),
1687+
"auto_capture_at" => $this->getAutoCaptureAt(),
16561688
);
16571689
}
16581690

@@ -2101,7 +2133,8 @@ public function create($options = array())
21012133
"payment_type" => $this->getPaymentType(),
21022134
"billing" => $this->getBilling(),
21032135
"unsupported_feature_bypass" => $this->getUnsupportedFeatureBypass(),
2104-
"verification" => $this->getVerification()
2136+
"verification" => $this->getVerification(),
2137+
"auto_capture_at" => $this->getAutoCaptureAt()
21052138
);
21062139

21072140
$response = $request->post($path, $data, $options);

src/Networking/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function prepare($options, $len = null)
3131
$headers = array(
3232
'API-Version: 1.4.0.0',
3333
'Content-Type: application/json',
34-
'User-Agent: ProcessOut PHP-Bindings/6.32.0'
34+
'User-Agent: ProcessOut PHP-Bindings/6.33.0'
3535
);
3636
if (! empty($options['idempotencyKey']))
3737
$headers[] = 'Idempotency-Key: ' . $options['idempotencyKey'];

0 commit comments

Comments
 (0)