Skip to content

Commit

Permalink
OctopusDeploy release: 10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Aug 22, 2023
1 parent 666e7ce commit f662c3f
Show file tree
Hide file tree
Showing 24 changed files with 404 additions and 403 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

## Latest Version
#### Enhancements:
- [GP-API] Rename PayLink to PayByLink

## v9.0.2 (08/10/2023)
#### Enhancements:
- [GP-API] Improve Open Banking and 3DS tests

#### Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion metadata.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<xml>
<releaseNumber>9.0.2</releaseNumber>
<releaseNumber>10.0.0</releaseNumber>
</xml>
8 changes: 4 additions & 4 deletions src/Builders/ManagementBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ protected function setupValidations()
$this->validations->of(TransactionType::TOKEN_UPDATE)
->check('paymentMethod')->isInstanceOf(CreditCardData::class);

$this->validations->of(TransactionType::PAYLINK_UPDATE)
$this->validations->of(TransactionType::PAYBYLINK_UPDATE)
->check('amount')->isNotNull()
->check('usageMode')->isNotNullInSubProperty('payLinkData')
->check('usageLimit')->isNotNullInSubProperty('payLinkData')
->check('type')->isNotNullInSubProperty('payLinkData');
->check('usageMode')->isNotNullInSubProperty('payByLinkData')
->check('usageLimit')->isNotNullInSubProperty('payByLinkData')
->check('type')->isNotNullInSubProperty('payByLinkData');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use GlobalPayments\Api\Entities\Enums\GatewayProvider;
use GlobalPayments\Api\Entities\Enums\ManualEntryMethod;
use GlobalPayments\Api\Entities\Enums\CaptureMode;
use GlobalPayments\Api\Entities\Enums\PayLinkStatus;
use GlobalPayments\Api\Entities\Enums\PayByLinkStatus;
use GlobalPayments\Api\Entities\Enums\PaymentEntryMode;
use GlobalPayments\Api\Entities\Enums\PaymentProvider;
use GlobalPayments\Api\Entities\Enums\PaymentType;
Expand All @@ -28,7 +28,7 @@
use GlobalPayments\Api\Entities\GpApi\DTO\PaymentMethod;
use GlobalPayments\Api\Entities\GpApi\GpApiRequest;
use GlobalPayments\Api\Entities\IRequestBuilder;
use GlobalPayments\Api\Entities\PayLinkData;
use GlobalPayments\Api\Entities\PayByLinkData;
use GlobalPayments\Api\Entities\PhoneNumber;
use GlobalPayments\Api\Entities\Product;
use GlobalPayments\Api\Gateways\OpenBankingProvider;
Expand Down Expand Up @@ -135,37 +135,37 @@ public function buildRequest(BaseBuilder $builder, $config)
$requestData['payment_method'] = $this->createPaymentMethodParam($builder, $config);
break;
case TransactionType::CREATE:
if ($builder->payLinkData instanceof PayLinkData) {
/** @var PayLinkData $payLink */
$payLink = $builder->payLinkData;
$endpoint = GpApiRequest::PAYLINK_ENDPOINT;
if ($builder->payByLinkData instanceof PayByLinkData) {
/** @var PayByLinkData $payByLink */
$payByLink = $builder->payByLinkData;
$endpoint = GpApiRequest::PAYBYLINK_ENDPOINT;
$verb = 'POST';
$requestData['account_name'] = $config->accessTokenInfo->transactionProcessingAccountName;
$requestData['account_id'] = $config->accessTokenInfo->transactionProcessingAccountID;
$requestData['type'] = $payLink->type;
$requestData['usage_mode'] = $payLink->usageMode;
$requestData['usage_limit'] = (string) $payLink->usageLimit;
$requestData['type'] = $payByLink->type;
$requestData['usage_mode'] = $payByLink->usageMode;
$requestData['usage_limit'] = (string) $payByLink->usageLimit;
$requestData['reference'] = $builder->clientTransactionId;
$requestData['name'] = $payLink->name;
$requestData['name'] = $payByLink->name;
$requestData['description'] = $builder->description;
$requestData['shippable'] = $payLink->isShippable == true ? 'YES' : 'NO';
$requestData['shipping_amount'] = StringUtils::toNumeric($payLink->shippingAmount);
$requestData['expiration_date'] = !empty($payLink->expirationDate) ?
(new \DateTime($payLink->expirationDate))->format('Y-m-d\TH:i:s\Z') : null;
$requestData['shippable'] = $payByLink->isShippable == true ? 'YES' : 'NO';
$requestData['shipping_amount'] = StringUtils::toNumeric($payByLink->shippingAmount);
$requestData['expiration_date'] = !empty($payByLink->expirationDate) ?
(new \DateTime($payByLink->expirationDate))->format('Y-m-d\TH:i:s\Z') : null;
//@TODO - remove status when GP-API will fix the issue (status shouldn't be sent in request)
$requestData['status'] = PayLinkStatus::ACTIVE;
$requestData['images'] = $payLink->images;
$requestData['status'] = PayByLinkStatus::ACTIVE;
$requestData['images'] = $payByLink->images;
$requestData['transactions'] = [
'amount' => StringUtils::toNumeric($builder->amount),
'channel' => $config->channel,
'currency' => $builder->currency,
'country' => $config->country,
'allowed_payment_methods' => $payLink->allowedPaymentMethods
'allowed_payment_methods' => $payByLink->allowedPaymentMethods
];
$requestData['notifications'] = [
'return_url' => $payLink->returnUrl,
'status_url' => $payLink->statusUpdateUrl,
'cancel_url' => $payLink->cancelUrl
'return_url' => $payByLink->returnUrl,
'status_url' => $payByLink->statusUpdateUrl,
'cancel_url' => $payByLink->cancelUrl
];
}
break;
Expand Down
28 changes: 14 additions & 14 deletions src/Builders/RequestBuilder/GpApi/GpApiManagementRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,27 +226,27 @@ public function buildRequest(BaseBuilder $builder, $config)
]
];
break;
case TransactionType::PAYLINK_UPDATE:
$endpoint = GpApiRequest::PAYLINK_ENDPOINT . '/' . $builder->paymentLinkId;
case TransactionType::PAYBYLINK_UPDATE:
$endpoint = GpApiRequest::PAYBYLINK_ENDPOINT . '/' . $builder->paymentLinkId;
$verb = 'PATCH';
$payload = [
'usage_mode'=> $builder->payLinkData->usageMode ?? null,
'usage_limit' => $builder->payLinkData->usageLimit ?? null,
'name' => $builder->payLinkData->name ?? null,
'usage_mode'=> $builder->payByLinkData->usageMode ?? null,
'usage_limit' => $builder->payByLinkData->usageLimit ?? null,
'name' => $builder->payByLinkData->name ?? null,
'description' => $builder->description ?? null,
'type' => $builder->payLinkData->type ?? null,
'status' => $builder->payLinkData->status ?? null,
'shippable' => isset($builder->payLinkData->shippable) ?
json_encode($builder->payLinkData->shippable) : null,
'shipping_amount' => !empty($builder->payLinkData->shippingAmount) ?
StringUtils::toNumeric($builder->payLinkData->shippingAmount) : null,
'type' => $builder->payByLinkData->type ?? null,
'status' => $builder->payByLinkData->status ?? null,
'shippable' => isset($builder->payByLinkData->shippable) ?
json_encode($builder->payByLinkData->shippable) : null,
'shipping_amount' => !empty($builder->payByLinkData->shippingAmount) ?
StringUtils::toNumeric($builder->payByLinkData->shippingAmount) : null,
'transactions' => [
'amount' => !empty($builder->amount) ? StringUtils::toNumeric($builder->amount) : null
],
'expiration_date' => !empty($payLink->expirationDate) ?
(new \DateTime($payLink->expirationDate))->format('Y-m-d\TH:i:s\Z') : null,
'expiration_date' => !empty($builder->payByLinkData->expirationDate) ?
(new \DateTime($builder->payByLinkData->expirationDate))->format('Y-m-d\TH:i:s\Z') : null,

'images' => $builder->payLinkData->images ?? null,
'images' => $builder->payByLinkData->images ?? null,
];
break;
case TransactionType::RELEASE:
Expand Down
12 changes: 6 additions & 6 deletions src/Builders/RequestBuilder/GpApi/GpApiReportRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,21 +213,21 @@ public function buildRequest(BaseBuilder $builder, $config)
'http_response_code' => $builder->searchBuilder->httpResponseCode
];
break;
case ReportType::PAYLINK_DETAIL:
$endpoint = GpApiRequest::PAYLINK_ENDPOINT . '/' . $builder->searchBuilder->payLinkId;
case ReportType::PAYBYLINK_DETAIL:
$endpoint = GpApiRequest::PAYBYLINK_ENDPOINT . '/' . $builder->searchBuilder->payByLinkId;
$verb = 'GET';
break;
case ReportType::FIND_PAYLINK_PAGED:
$endpoint = GpApiRequest::PAYLINK_ENDPOINT;
case ReportType::FIND_PAYBYLINK_PAGED:
$endpoint = GpApiRequest::PAYBYLINK_ENDPOINT;
$verb = 'GET';
$this->addBasicParams($queryParams, $builder);
$queryParams['from_time_created'] = !empty($builder->searchBuilder->startDate) ?
$builder->searchBuilder->startDate->format('Y-m-d') : null;
$queryParams['to_time_created'] = !empty($builder->searchBuilder->endDate) ?
$builder->searchBuilder->endDate->format('Y-m-d') : null;
$queryParams['order'] = $builder->order;
$queryParams['order_by'] = $builder->payLinkOrderBy;
$queryParams['status'] = $builder->searchBuilder->payLinkStatus;
$queryParams['order_by'] = $builder->payByLinkOrderBy;
$queryParams['status'] = $builder->searchBuilder->payByLinkStatus;
$queryParams['usage_mode'] = $builder->searchBuilder->paymentMethodUsageMode;
$queryParams['name'] = $builder->searchBuilder->displayName;
$queryParams['amount'] = StringUtils::toNumeric($builder->searchBuilder->amount);;
Expand Down
12 changes: 6 additions & 6 deletions src/Builders/TransactionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use GlobalPayments\Api\Entities\Enums\TransactionModifier;
use GlobalPayments\Api\Entities\Enums\TransactionType;
use GlobalPayments\Api\Entities\PayLinkData;
use GlobalPayments\Api\Entities\PayByLinkData;
use GlobalPayments\Api\Entities\TransactionApi\TransactionApiData;
use GlobalPayments\Api\PaymentMethods\Interfaces\IPaymentMethod;

Expand Down Expand Up @@ -71,11 +71,11 @@ abstract class TransactionBuilder extends BaseBuilder
public $supplementaryData;

/**
* Entity specific to PayLink service
* Entity specific to PayByLink service
*
* @var PayLinkData
* @var PayByLinkData
*/
public $payLinkData;
public $payByLinkData;

/**
*A unique identifier generated by Global Payments to identify the payment link.
Expand Down Expand Up @@ -180,9 +180,9 @@ public function withSupplementaryData($key, $value = null)
return $this;
}

public function withPayLinkData(PayLinkData $payLinkData)
public function withPayByLinkData(PayByLinkData $payByLinkData)
{
$this->payLinkData = $payLinkData;
$this->payByLinkData = $payByLinkData;

return $this;
}
Expand Down
18 changes: 9 additions & 9 deletions src/Builders/TransactionReportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use GlobalPayments\Api\Entities\Enums\ActionSortProperty;
use GlobalPayments\Api\Entities\Enums\DepositSortProperty;
use GlobalPayments\Api\Entities\Enums\DisputeSortProperty;
use GlobalPayments\Api\Entities\Enums\PayLinkSortProperty;
use GlobalPayments\Api\Entities\Enums\PayByLinkSortProperty;
use GlobalPayments\Api\Entities\Enums\SortDirection;
use GlobalPayments\Api\Entities\Enums\StoredPaymentMethodSortProperty;
use GlobalPayments\Api\Entities\Enums\TransactionModifier;
Expand Down Expand Up @@ -78,8 +78,8 @@ class TransactionReportBuilder extends ReportBuilder
*/
public $actionOrderBy;

/** @var PayLinkSortProperty */
public $payLinkOrderBy;
/** @var PayByLinkSortProperty */
public $payByLinkOrderBy;

/**
* @var SortDirection
Expand Down Expand Up @@ -275,9 +275,9 @@ public function withBankPaymentId($bankPaymentId)
return $this;
}

public function withPayLinkId($payLinkId)
public function withPayByLinkId($payByLinkId)
{
$this->searchBuilder->payLinkId = $payLinkId;
$this->searchBuilder->payByLinkId = $payByLinkId;
return $this;
}

Expand Down Expand Up @@ -313,8 +313,8 @@ public function orderBy($sortProperty, $sortDirection = SortDirection::DESC)
case ReportType::FIND_ACTIONS_PAGED:
$this->actionOrderBy = $sortProperty;
break;
case ReportType::FIND_PAYLINK_PAGED:
$this->payLinkOrderBy = $sortProperty;
case ReportType::FIND_PAYBYLINK_PAGED:
$this->payByLinkOrderBy = $sortProperty;
break;
default:
throw new \InvalidArgumentException("Invalid order found");
Expand All @@ -334,7 +334,7 @@ protected function setupValidations()
$this->validations->of(ReportType::DOCUMENT_DISPUTE_DETAIL)
->check('disputeDocumentId')->isNotNullInSubProperty('searchBuilder');

$this->validations->of(ReportType::PAYLINK_DETAIL)
->check('payLinkId')->isNotNullInSubProperty('searchBuilder');
$this->validations->of(ReportType::PAYBYLINK_DETAIL)
->check('payByLinkId')->isNotNullInSubProperty('searchBuilder');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use GlobalPayments\Api\Entities\Enum;

class PayLinkSortProperty extends Enum
class PayByLinkSortProperty extends Enum
{
const TIME_CREATED = 'TIME_CREATED';
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use GlobalPayments\Api\Entities\Enum;

class PayLinkStatus extends Enum
class PayByLinkStatus extends Enum
{
const ACTIVE = 'ACTIVE';
const INACTIVE = 'INACTIVE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace GlobalPayments\Api\Entities\Enums;

class PayLinkType
class PayByLinkType
{
const PAYMENT = 'PAYMENT';
}
4 changes: 2 additions & 2 deletions src/Entities/Enums/ReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class ReportType extends Enum
const STORED_PAYMENT_METHOD_DETAIL = 2097152; // 1 << 21
const FIND_ACTIONS_PAGED = 4194304; // 1 << 22
const ACTION_DETAIL = 8388608; // 1 << 23
const PAYLINK_DETAIL = 16777216; // 1 << 24
const FIND_PAYLINK_PAGED = 33554432; // 1 << 25
const PAYBYLINK_DETAIL = 16777216; // 1 << 24
const FIND_PAYBYLINK_PAGED = 33554432; // 1 << 25
const FIND_MERCHANTS_PAGED = 67108864; // 1 << 26
const FIND_ACCOUNTS_PAGED = 134217728; // 1 << 27
const FIND_ACCOUNT_DETAIL = 268435456; // 1 << 28
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Enums/TransactionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class TransactionType extends Enum
const DISPUTE_CHALLENGE = 18014398509481984; // 1 << 54
const REAUTH = 36028797018963968; // 1 << 55
const CONFIRM = 72057594037927936; // 1 << 56
const PAYLINK_UPDATE = 144115188075855872; // 1 << 57
const PAYBYLINK_UPDATE = 144115188075855872; // 1 << 57
const TRANSFER_FUNDS = 288230376151711744; // 1 << 58
const DEVICE_ORDER = 576460752303423488; // 1 << 59
}
2 changes: 1 addition & 1 deletion src/Entities/GpApi/GpApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GpApiRequest extends Request
const ACTIONS_ENDPOINT = '/actions';
const MERCHANT_MANAGEMENT_ENDPOINT = '/merchants';
const DCC_ENDPOINT = '/currency-conversions';
const PAYLINK_ENDPOINT = '/links';
const PAYBYLINK_ENDPOINT = '/links';
const RISK_ASSESSMENTS = '/risk-assessments';
const ACCOUNTS_ENDPOINT = '/accounts';
const TRANSFER_ENDPOINT = '/transfers';
Expand Down
12 changes: 6 additions & 6 deletions src/Entities/PayLinkData.php → src/Entities/PayByLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

namespace GlobalPayments\Api\Entities;

use GlobalPayments\Api\Entities\Enums\PayLinkStatus;
use GlobalPayments\Api\Entities\Enums\PayLinkType;
use GlobalPayments\Api\Entities\Enums\PayByLinkStatus;
use GlobalPayments\Api\Entities\Enums\PayByLinkType;
use GlobalPayments\Api\Entities\Enums\PaymentMethodUsageMode;
use PHPStanVendor\Nette\Utils\DateTime;

/**
* A PayLink resource.
* A PayByLink resource.
*/
class PayLinkData
class PayByLinkData
{
/**
* Describes the type of link that will be created.
*
* @var PayLinkType
* @var PayByLinkType
*/
public $type;

Expand All @@ -35,7 +35,7 @@ class PayLinkData
*/
public $usageLimit;

/** @var PayLinkStatus */
/** @var PayByLinkStatus */
public $status;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace GlobalPayments\Api\Entities;

use GlobalPayments\Api\Entities\Enums\PayLinkStatus;
use GlobalPayments\Api\Entities\Enums\PayLinkType;
use GlobalPayments\Api\Entities\Enums\PayByLinkStatus;
use GlobalPayments\Api\Entities\Enums\PayByLinkType;
use GlobalPayments\Api\Entities\Enums\PaymentMethodUsageMode;
use PHPStanVendor\Nette\Utils\DateTime;

/** PayLink response data */
class PayLinkResponse
/** PayByLink response data */
class PayByLinkResponse
{
/**
* A unique identifier generated by Global Payments to identify the link.
Expand All @@ -33,14 +33,14 @@ class PayLinkResponse
/**
* Indicates where a link is in its lifecycle.
*
* @var PayLinkStatus
* @var PayByLinkStatus
*/
public $status;

/**
* Describes the type of link that will be created.
*
* @var PayLinkType
* @var PayByLinkType
*/
public $type;

Expand Down
Loading

0 comments on commit f662c3f

Please sign in to comment.