Skip to content

Commit

Permalink
feat: add transaction intent to invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
processout-machine committed Jan 26, 2023
1 parent 4f175fb commit 1a4ef9a
Show file tree
Hide file tree
Showing 3 changed files with 68 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.22.0"
"processout/processout-php": "^6.23.0"
}
}
```
Expand Down
66 changes: 66 additions & 0 deletions src/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ class Invoice implements \JsonSerializable
*/
protected $paymentType;

/**
* Initiation type of invoice
* @var string
*/
protected $initiationType;

/**
* Payment intent of invoice
* @var string
*/
protected $paymentIntent;

/**
* Invoice constructor
* @param ProcessOut\ProcessOut $client
Expand Down Expand Up @@ -1231,6 +1243,50 @@ public function setPaymentType($value)
return $this;
}

/**
* Get InitiationType
* Initiation type of invoice
* @return string
*/
public function getInitiationType()
{
return $this->initiationType;
}

/**
* Set InitiationType
* Initiation type of invoice
* @param string $value
* @return $this
*/
public function setInitiationType($value)
{
$this->initiationType = $value;
return $this;
}

/**
* Get PaymentIntent
* Payment intent of invoice
* @return string
*/
public function getPaymentIntent()
{
return $this->paymentIntent;
}

/**
* Set PaymentIntent
* Payment intent of invoice
* @param string $value
* @return $this
*/
public function setPaymentIntent($value)
{
$this->paymentIntent = $value;
return $this;
}


/**
* Fills the current object with the new values pulled from the data
Expand Down Expand Up @@ -1359,6 +1415,12 @@ public function fillWithData($data)
if(! empty($data['payment_type']))
$this->setPaymentType($data['payment_type']);

if(! empty($data['initiation_type']))
$this->setInitiationType($data['initiation_type']);

if(! empty($data['payment_intent']))
$this->setPaymentIntent($data['payment_intent']);

return $this;
}

Expand Down Expand Up @@ -1408,6 +1470,8 @@ public function jsonSerialize() {
"incremental" => $this->getIncremental(),
"tax" => $this->getTax(),
"payment_type" => $this->getPaymentType(),
"initiation_type" => $this->getInitiationType(),
"payment_intent" => $this->getPaymentIntent(),
);
}

Expand Down Expand Up @@ -1734,6 +1798,8 @@ public function create($options = array())
"challenge_indicator" => $this->getChallengeIndicator(),
"gateway_data" => $this->getGatewayData(),
"merchant_initiator_type" => $this->getMerchantInitiatorType(),
"initiation_type" => $this->getInitiationType(),
"payment_intent" => $this->getPaymentIntent(),
"statement_descriptor" => $this->getStatementDescriptor(),
"statement_descriptor_phone" => $this->getStatementDescriptorPhone(),
"statement_descriptor_city" => $this->getStatementDescriptorCity(),
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.22.0'
'User-Agent: ProcessOut PHP-Bindings/6.23.0'
);
if (! empty($options['idempotencyKey']))
$headers[] = 'Idempotency-Key: ' . $options['idempotencyKey'];
Expand Down

0 comments on commit 1a4ef9a

Please sign in to comment.