Skip to content

Commit

Permalink
Updated Auto Generated Code
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Apr 10, 2024
1 parent 1b5cec0 commit 4fc9f85
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Definitions/FortifiApiDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FortifiApiDefinition extends ApiDefinition
public function __construct()
{
$this->setTitle('Fortifi API');
$this->setVersion('3.149.1');
$this->setVersion('3.150.0');
$this->setDescription(<<<DESCRIPTION
The second version of the Fortifi API is an exciting step forward towards
making it easier for businesses to have open access to their data. We created it
Expand Down
51 changes: 51 additions & 0 deletions src/Endpoints/CustomersCustomerFidApplyCreditEndpoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
namespace Fortifi\Api\V1\Endpoints;

use Fortifi\Api\V1\Requests\BoolMessageRequest;
use Fortifi\Api\Core\ApiRequestDetail;
use Fortifi\Api\Core\ApiEndpoint;

class CustomersCustomerFidApplyCreditEndpoint extends ApiEndpoint
{
protected $_path = 'customers/{customerFid}/applyCredit';
protected $_replacements = [];

public function __construct($customerFid)
{
$this->_replacements['{customerFid}'] = $customerFid;
}

/**
* @summary Apply credit to a customer
*
* @param $amount
* @param $currency
* @param $reference
* @param $description
*
* @return BoolMessageRequest
*/
public function create($amount, $currency = null, $reference = null, $description = null)
{
$request = new BoolMessageRequest();
$request->setConnection($this->_getConnection());
$request->setEndpoint($this);

$detail = new ApiRequestDetail();
$detail->setRequireAuth(true);
$detail->setUrl($this->_buildUrl(
str_replace(
array_keys($this->_replacements),
array_values($this->_replacements),
'customers/{customerFid}/applyCredit'
)
));
$detail->addPostField('amount', $amount);
$detail->addPostField('currency', $currency);
$detail->addPostField('reference', $reference);
$detail->addPostField('description', $description);
$detail->setMethod('POST');
$request->setRequestDetail($detail);
return $request;
}
}
12 changes: 12 additions & 0 deletions src/Endpoints/CustomersCustomerFidEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ public function orders()
return $endpoint;
}

/**
* @return CustomersCustomerFidApplyCreditEndpoint
*/
public function applyCredit()
{
$endpoint = new CustomersCustomerFidApplyCreditEndpoint(
$this->_replacements['{customerFid}']
);
$endpoint->_buildFromEndpoint($this);
return $endpoint;
}

/**
* @return CustomersCustomerFidSarEndpoint
*/
Expand Down
56 changes: 52 additions & 4 deletions swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
swagger: '2.0'
info:
title: Fortifi API
version: '3.149.1'
version: '3.150.0'
termsOfService: 'https://fortifi.io/legal/terms/api'
description: >
The second version of the Fortifi API is an exciting step forward towards
Expand Down Expand Up @@ -4370,11 +4370,11 @@ paths:
get:
summary: List customer orders
tags:
- Customers
- Customers
security:
- OAuth:
- customer
- accessToken: []
- accessToken: [ ]
parameters:
- $ref: '#/parameters/customerFid'
- name: filter
Expand Down Expand Up @@ -4413,7 +4413,7 @@ paths:
security:
- OAuth:
- customer
- accessToken: []
- accessToken: [ ]
parameters:
- $ref: '#/parameters/customerFid'
- name: billingType
Expand All @@ -4437,6 +4437,54 @@ paths:
description: Error
schema:
$ref: '#/definitions/Envelope'
'/customers/{customerFid}/applyCredit':
post:
summary: Apply credit to a customer
security:
- OAuth:
- customer
- accessToken: [ ]
parameters:
- $ref: '#/parameters/customerFid'
- name: amount
in: formData
type: number
format: float
required: true
description: Amount to apply
- name: currency
in: formData
type: string
required: false
description: Currency code
- name: reference
in: formData
type: string
required: false
description: Payment Reference
- name: description
in: formData
type: string
required: false
description: Payment Description
responses:
200:
description: Credit Applied
schema:
allOf:
- $ref: '#/definitions/Envelope'
- properties:
data:
$ref: '#/definitions/BoolMessage'
x-400:
description: Invalid Payload
x-404:
description: Customer not found
default:
description: Error
schema:
$ref: '#/definitions/Envelope'

'/customers/{customerFid}/sar':
post:
summary: Subject Access Request
Expand Down

0 comments on commit 4fc9f85

Please sign in to comment.