diff --git a/.changeset/chilled-tips-sort.md b/.changeset/chilled-tips-sort.md new file mode 100644 index 00000000..e2dfc10e --- /dev/null +++ b/.changeset/chilled-tips-sort.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +fix(be,api-definitions): Loosen Address validation rules Rebilly/rebilly#17436 diff --git a/.changeset/eighty-foxes-repeat.md b/.changeset/eighty-foxes-repeat.md new file mode 100644 index 00000000..d9e8b949 --- /dev/null +++ b/.changeset/eighty-foxes-repeat.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +fix(backend): Permanently block above and Temporary block above use the independent pool of attributes (#16938) Rebilly/rebilly#17628 diff --git a/.changeset/famous-seas-try.md b/.changeset/famous-seas-try.md new file mode 100644 index 00000000..fe43017e --- /dev/null +++ b/.changeset/famous-seas-try.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(be,api-definitions): Add GetPayoutRequestV2PaymentInstrument endpoint for new payout-request flow Rebilly/rebilly#17540 diff --git a/.changeset/lovely-worms-destroy.md b/.changeset/lovely-worms-destroy.md new file mode 100644 index 00000000..9a02acce --- /dev/null +++ b/.changeset/lovely-worms-destroy.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +revert: fix(backend): Permanently block above and Temporary block above use the independent pool of attributes (#16938) Rebilly/rebilly#17594 diff --git a/.changeset/many-onions-admire.md b/.changeset/many-onions-admire.md new file mode 100644 index 00000000..e44e160c --- /dev/null +++ b/.changeset/many-onions-admire.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-defs): Add POST /payment-request-allocations Rebilly/rebilly#17567 diff --git a/.changeset/old-kangaroos-sort.md b/.changeset/old-kangaroos-sort.md new file mode 100644 index 00000000..7450b39e --- /dev/null +++ b/.changeset/old-kangaroos-sort.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +chore(deps): bump @redocly/cli from 2.14.0 to 2.14.1 in /website/api-definitions Rebilly/rebilly#17705 diff --git a/.changeset/perfect-yaks-try.md b/.changeset/perfect-yaks-try.md new file mode 100644 index 00000000..68220bc3 --- /dev/null +++ b/.changeset/perfect-yaks-try.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +chore(deps): bump @redocly/cli from 2.12.3 to 2.13.0 in /website/api-definitions Rebilly/rebilly#17461 diff --git a/.changeset/poor-schools-relate.md b/.changeset/poor-schools-relate.md new file mode 100644 index 00000000..3dafa716 --- /dev/null +++ b/.changeset/poor-schools-relate.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +chore(deps): bump es-toolkit from 1.42.0 to 1.43.0 in /website/api-definitions Rebilly/rebilly#17460 diff --git a/.changeset/popular-stingrays-talk.md b/.changeset/popular-stingrays-talk.md new file mode 100644 index 00000000..2881ce9f --- /dev/null +++ b/.changeset/popular-stingrays-talk.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-definitions, be, payment-gateways): Implement Powertranz payment gateway adapter Rebilly/rebilly#17587 diff --git a/.changeset/real-plants-develop.md b/.changeset/real-plants-develop.md new file mode 100644 index 00000000..8c882dd1 --- /dev/null +++ b/.changeset/real-plants-develop.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +chore(deps): bump @redocly/cli from 2.13.0 to 2.14.0 in /website/api-definitions Rebilly/rebilly#17658 diff --git a/.changeset/red-sloths-hope.md b/.changeset/red-sloths-hope.md new file mode 100644 index 00000000..6260e350 --- /dev/null +++ b/.changeset/red-sloths-hope.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +chore(api): Revert unintentional API changes Rebilly/rebilly#17423 diff --git a/.changeset/selfish-adults-fry.md b/.changeset/selfish-adults-fry.md new file mode 100644 index 00000000..b7356105 --- /dev/null +++ b/.changeset/selfish-adults-fry.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-definitions): Add payout request reversed and fulfilled to webhooks api definitions Rebilly/rebilly#17632 diff --git a/.changeset/six-windows-joke.md b/.changeset/six-windows-joke.md new file mode 100644 index 00000000..881da9b4 --- /dev/null +++ b/.changeset/six-windows-joke.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-definitions): Payout processing MVP Rebilly/rebilly#17551 diff --git a/.changeset/ten-suits-sleep.md b/.changeset/ten-suits-sleep.md new file mode 100644 index 00000000..db38dc4b --- /dev/null +++ b/.changeset/ten-suits-sleep.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-defs): Add PATCH /payout-request-allocation/{id} Rebilly/rebilly#17591 diff --git a/.changeset/unlucky-poems-knock.md b/.changeset/unlucky-poems-knock.md new file mode 100644 index 00000000..4d0998a5 --- /dev/null +++ b/.changeset/unlucky-poems-knock.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +SDK Generator updated diff --git a/.changeset/wicked-news-dance.md b/.changeset/wicked-news-dance.md new file mode 100644 index 00000000..46a0812b --- /dev/null +++ b/.changeset/wicked-news-dance.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(api-definition, be, payment-gateways): Add delay setting to Paybilt Rebilly/rebilly#17522 diff --git a/src/Api/PayoutRequestAllocationsApi.php b/src/Api/PayoutRequestAllocationsApi.php new file mode 100644 index 00000000..b374d1f3 --- /dev/null +++ b/src/Api/PayoutRequestAllocationsApi.php @@ -0,0 +1,62 @@ + 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestAllocationRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestAllocation::from($data); + } + + public function update( + string $id, + PatchPayoutRequestAllocationRequest $patchPayoutRequestAllocationRequest, + ): PayoutRequestAllocation { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-allocations/{id}'); + + $request = new Request('PATCH', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($patchPayoutRequestAllocationRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestAllocation::from($data); + } +} diff --git a/src/Api/PayoutRequestsApi.php b/src/Api/PayoutRequestsApi.php index 862d4db6..422bed6c 100644 --- a/src/Api/PayoutRequestsApi.php +++ b/src/Api/PayoutRequestsApi.php @@ -19,8 +19,10 @@ use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; use Rebilly\Sdk\Model\GetPayoutRequestPaymentInstrumentsResponse; +use Rebilly\Sdk\Model\PatchPayoutRequestRequest; use Rebilly\Sdk\Model\PayoutRequest; use Rebilly\Sdk\Model\PayoutRequestCancellation; +use Rebilly\Sdk\Model\PayoutRequestTimelineMessage; use Rebilly\Sdk\Paginator; class PayoutRequestsApi @@ -62,6 +64,40 @@ public function create( return PayoutRequest::from($data); } + public function createTimelineComment( + string $id, + PayoutRequestTimelineMessage $payoutRequestTimelineMessage, + ): PayoutRequestTimelineMessage { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/timeline'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($payoutRequestTimelineMessage)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestTimelineMessage::from($data); + } + + public function deleteTimelineMessage( + string $id, + string $messageId, + ): void { + $pathParams = [ + '{id}' => $id, + '{messageId}' => $messageId, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/timeline/{messageId}'); + + $request = new Request('DELETE', $uri); + $this->client->send($request); + } + public function get( string $id, ): PayoutRequest { @@ -133,6 +169,70 @@ public function getAllPaginator( ); } + /** + * @return Collection + */ + public function getAllTimelineMessages( + string $id, + ?int $limit = null, + ?int $offset = null, + ?string $filter = null, + ?array $sort = null, + ?string $q = null, + ): Collection { + $pathParams = [ + '{id}' => $id, + ]; + + $queryParams = [ + 'limit' => $limit, + 'offset' => $offset, + 'filter' => $filter, + 'sort' => $sort ? implode(',', $sort) : null, + 'q' => $q, + ]; + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/timeline?') . http_build_query($queryParams); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return new Collection( + array_map(fn (array $item): PayoutRequestTimelineMessage => PayoutRequestTimelineMessage::from($item), $data), + (int) $response->getHeaderLine(Collection::HEADER_LIMIT), + (int) $response->getHeaderLine(Collection::HEADER_OFFSET), + (int) $response->getHeaderLine(Collection::HEADER_TOTAL), + ); + } + + /** + * @return Paginator + */ + public function getAllTimelineMessagesPaginator( + string $id, + ?int $limit = null, + ?int $offset = null, + ?string $filter = null, + ?array $sort = null, + ?string $q = null, + ): Paginator { + $closure = fn (?int $limit, ?int $offset): Collection => $this->getAllTimelineMessages( + id: $id, + limit: $limit, + offset: $offset, + filter: $filter, + sort: $sort, + q: $q, + ); + + return new Paginator( + $limit !== null || $offset !== null ? $closure(limit: $limit, offset: $offset) : null, + $closure, + ); + } + /** * @return GetPayoutRequestPaymentInstrumentsResponse[] */ @@ -154,6 +254,45 @@ public function getPaymentInstruments( return array_map(fn (array $item): GetPayoutRequestPaymentInstrumentsResponse => GetPayoutRequestPaymentInstrumentsResponse::from($item), $data); } + public function getTimelineMessage( + string $id, + string $messageId, + ): PayoutRequestTimelineMessage { + $pathParams = [ + '{id}' => $id, + '{messageId}' => $messageId, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/timeline/{messageId}'); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestTimelineMessage::from($data); + } + + public function patch( + string $id, + PatchPayoutRequestRequest $patchPayoutRequestRequest, + ): PayoutRequest { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}'); + + $request = new Request('PATCH', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($patchPayoutRequestRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequest::from($data); + } + public function update( string $id, PayoutRequest $payoutRequest, diff --git a/src/Api/PayoutRequestsV2Api.php b/src/Api/PayoutRequestsV2Api.php new file mode 100644 index 00000000..ce905dd5 --- /dev/null +++ b/src/Api/PayoutRequestsV2Api.php @@ -0,0 +1,67 @@ + $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests-v2/{id}/payment-instruments'); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return array_map(fn (array $item): GetPayoutRequestV2PaymentInstrumentsResponse => GetPayoutRequestV2PaymentInstrumentsResponse::from($item), $data); + } + + public function getV2( + string $id, + ): PayoutRequestV2 { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests-v2/{id}'); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestV2::from($data); + } +} diff --git a/src/Api/ReportsApi.php b/src/Api/ReportsApi.php index 0b2fa75c..a2476a4d 100644 --- a/src/Api/ReportsApi.php +++ b/src/Api/ReportsApi.php @@ -363,11 +363,11 @@ public function getJournalSummary( public function getKycAcceptanceSummary( ?DateTimeImmutable $periodStart = null, - mixed $periodEnd = null, + ?DateTimeImmutable $periodEnd = null, ): GetKycAcceptanceSummaryReportResponse { $queryParams = [ 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), - 'periodEnd' => $periodEnd, + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), ]; $uri = '/experimental/reports/kyc-acceptance-summary?' . http_build_query($queryParams); @@ -591,13 +591,13 @@ public function getSubscriptionCancellation( public function getSubscriptionRenewal( ?DateTimeImmutable $periodStart = null, - mixed $periodEnd = null, + ?DateTimeImmutable $periodEnd = null, ?int $limit = null, ?int $offset = null, ): SubscriptionRenewal { $queryParams = [ 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), - 'periodEnd' => $periodEnd, + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), 'limit' => $limit, 'offset' => $offset, ]; diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index ea341645..9bd7d535 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -367,6 +367,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_POST_FINANCE = 'PostFinance'; + public const GATEWAY_NAME_POWERTRANZ = 'Powertranz'; + public const GATEWAY_NAME_PPRO = 'PPRO'; public const GATEWAY_NAME_PROSA = 'Prosa'; @@ -1775,6 +1777,8 @@ public static function from(array $data = []): self return Plugnpay::from($data); case 'PostFinance': return PostFinance::from($data); + case 'Powertranz': + return Powertranz::from($data); case 'PPRO': return PPRO::from($data); case 'Prosa': diff --git a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php index 475a2707..56256698 100644 --- a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php +++ b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php @@ -366,6 +366,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_POST_FINANCE = 'PostFinance'; + public const GATEWAY_NAME_POWERTRANZ = 'Powertranz'; + public const GATEWAY_NAME_PPRO = 'PPRO'; public const GATEWAY_NAME_PROSA = 'Prosa'; diff --git a/src/Model/GetPayoutRequestV2PaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestV2PaymentInstrumentsResponse.php new file mode 100644 index 00000000..c3976166 --- /dev/null +++ b/src/Model/GetPayoutRequestV2PaymentInstrumentsResponse.php @@ -0,0 +1,628 @@ +setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('gatewayName', $data)) { + $this->setGatewayName($data['gatewayName']); + } + if (array_key_exists('gatewayAccountId', $data)) { + $this->setGatewayAccountId($data['gatewayAccountId']); + } + if (array_key_exists('exposureAmount', $data)) { + $this->setExposureAmount($data['exposureAmount']); + } + if (array_key_exists('previousAllocatedAmount', $data)) { + $this->setPreviousAllocatedAmount($data['previousAllocatedAmount']); + } + if (array_key_exists('lastPaymentTime', $data)) { + $this->setLastPaymentTime($data['lastPaymentTime']); + } + if (array_key_exists('lastPayoutTime', $data)) { + $this->setLastPayoutTime($data['lastPayoutTime']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getPaymentInstrumentId(): ?string + { + return $this->fields['paymentInstrumentId'] ?? null; + } + + public function setPaymentInstrumentId(null|string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function getGatewayName(): ?string + { + return $this->fields['gatewayName'] ?? null; + } + + public function setGatewayName(null|string $gatewayName): static + { + $this->fields['gatewayName'] = $gatewayName; + + return $this; + } + + public function getGatewayAccountId(): ?string + { + return $this->fields['gatewayAccountId'] ?? null; + } + + public function setGatewayAccountId(null|string $gatewayAccountId): static + { + $this->fields['gatewayAccountId'] = $gatewayAccountId; + + return $this; + } + + public function getExposureAmount(): ?float + { + return $this->fields['exposureAmount'] ?? null; + } + + public function setExposureAmount(null|float|string $exposureAmount): static + { + if (is_string($exposureAmount)) { + $exposureAmount = (float) $exposureAmount; + } + + $this->fields['exposureAmount'] = $exposureAmount; + + return $this; + } + + public function getPreviousAllocatedAmount(): ?float + { + return $this->fields['previousAllocatedAmount'] ?? null; + } + + public function setPreviousAllocatedAmount(null|float|string $previousAllocatedAmount): static + { + if (is_string($previousAllocatedAmount)) { + $previousAllocatedAmount = (float) $previousAllocatedAmount; + } + + $this->fields['previousAllocatedAmount'] = $previousAllocatedAmount; + + return $this; + } + + public function getLastPaymentTime(): ?DateTimeImmutable + { + return $this->fields['lastPaymentTime'] ?? null; + } + + public function setLastPaymentTime(null|DateTimeImmutable|string $lastPaymentTime): static + { + if ($lastPaymentTime !== null && !($lastPaymentTime instanceof DateTimeImmutable)) { + $lastPaymentTime = new DateTimeImmutable($lastPaymentTime); + } + + $this->fields['lastPaymentTime'] = $lastPaymentTime; + + return $this; + } + + public function getLastPayoutTime(): ?DateTimeImmutable + { + return $this->fields['lastPayoutTime'] ?? null; + } + + public function setLastPayoutTime(null|DateTimeImmutable|string $lastPayoutTime): static + { + if ($lastPayoutTime !== null && !($lastPayoutTime instanceof DateTimeImmutable)) { + $lastPayoutTime = new DateTimeImmutable($lastPayoutTime); + } + + $this->fields['lastPayoutTime'] = $lastPayoutTime; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('gatewayName', $this->fields)) { + $data['gatewayName'] = $this->fields['gatewayName']; + } + if (array_key_exists('gatewayAccountId', $this->fields)) { + $data['gatewayAccountId'] = $this->fields['gatewayAccountId']; + } + if (array_key_exists('exposureAmount', $this->fields)) { + $data['exposureAmount'] = $this->fields['exposureAmount']; + } + if (array_key_exists('previousAllocatedAmount', $this->fields)) { + $data['previousAllocatedAmount'] = $this->fields['previousAllocatedAmount']; + } + if (array_key_exists('lastPaymentTime', $this->fields)) { + $data['lastPaymentTime'] = $this->fields['lastPaymentTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('lastPayoutTime', $this->fields)) { + $data['lastPayoutTime'] = $this->fields['lastPayoutTime']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } +} diff --git a/src/Model/GlobalWebhook.php b/src/Model/GlobalWebhook.php index 3f62a8f3..5d5c6ea5 100644 --- a/src/Model/GlobalWebhook.php +++ b/src/Model/GlobalWebhook.php @@ -104,8 +104,12 @@ class GlobalWebhook implements JsonSerializable public const EVENTS_FILTER_PAYOUT_REQUEST_CREATED = 'payout-request-created'; + public const EVENTS_FILTER_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; + public const EVENTS_FILTER_PAYOUT_REQUEST_MODIFIED = 'payout-request-modified'; + public const EVENTS_FILTER_PAYOUT_REQUEST_REVERSED = 'payout-request-reversed'; + public const EVENTS_FILTER_QUOTE_ACCEPTED = 'quote-accepted'; public const EVENTS_FILTER_QUOTE_CANCELED = 'quote-canceled'; diff --git a/src/Model/PatchPayoutRequestAllocationRequest.php b/src/Model/PatchPayoutRequestAllocationRequest.php new file mode 100644 index 00000000..ec4d958d --- /dev/null +++ b/src/Model/PatchPayoutRequestAllocationRequest.php @@ -0,0 +1,60 @@ +setStatus($data['status']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getStatus(): string + { + return $this->fields['status']; + } + + public function setStatus(string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + + return $data; + } +} diff --git a/src/Model/PatchPayoutRequestRequest.php b/src/Model/PatchPayoutRequestRequest.php new file mode 100644 index 00000000..2087e5f9 --- /dev/null +++ b/src/Model/PatchPayoutRequestRequest.php @@ -0,0 +1,106 @@ +setStatus($data['status']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } + if (array_key_exists('blocked', $data)) { + $this->setBlocked($data['blocked']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + + public function getBlocked(): ?bool + { + return $this->fields['blocked'] ?? null; + } + + public function setBlocked(null|bool $blocked): static + { + $this->fields['blocked'] = $blocked; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } + if (array_key_exists('blocked', $this->fields)) { + $data['blocked'] = $this->fields['blocked']; + } + + return $data; + } +} diff --git a/src/Model/Paybilt.php b/src/Model/Paybilt.php index 6de9ebed..cf64e3d5 100644 --- a/src/Model/Paybilt.php +++ b/src/Model/Paybilt.php @@ -30,6 +30,9 @@ public function __construct(array $data = []) if (array_key_exists('threeDSecureServer', $data)) { $this->setThreeDSecureServer($data['threeDSecureServer']); } + if (array_key_exists('settings', $data)) { + $this->setSettings($data['settings']); + } } public static function from(array $data = []): self @@ -69,6 +72,22 @@ public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeD return $this; } + public function getSettings(): ?PaybiltSettings + { + return $this->fields['settings'] ?? null; + } + + public function setSettings(null|PaybiltSettings|array $settings): static + { + if ($settings !== null && !($settings instanceof PaybiltSettings)) { + $settings = PaybiltSettings::from($settings); + } + + $this->fields['settings'] = $settings; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -78,6 +97,9 @@ public function jsonSerialize(): array if (array_key_exists('threeDSecureServer', $this->fields)) { $data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize(); } + if (array_key_exists('settings', $this->fields)) { + $data['settings'] = $this->fields['settings']?->jsonSerialize(); + } return parent::jsonSerialize() + $data; } diff --git a/src/Model/PaybiltSettings.php b/src/Model/PaybiltSettings.php new file mode 100644 index 00000000..5e027392 --- /dev/null +++ b/src/Model/PaybiltSettings.php @@ -0,0 +1,56 @@ +setDelay($data['delay']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getDelay(): ?int + { + return $this->fields['delay'] ?? null; + } + + public function setDelay(null|int $delay): static + { + $this->fields['delay'] = $delay; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('delay', $this->fields)) { + $data['delay'] = $this->fields['delay']; + } + + return $data; + } +} diff --git a/src/Model/PayoutRequestAllocation.php b/src/Model/PayoutRequestAllocation.php new file mode 100644 index 00000000..b59ac0dd --- /dev/null +++ b/src/Model/PayoutRequestAllocation.php @@ -0,0 +1,294 @@ +setId($data['id']); + } + if (array_key_exists('payoutRequestId', $data)) { + $this->setPayoutRequestId($data['payoutRequestId']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('gatewayAccountId', $data)) { + $this->setGatewayAccountId($data['gatewayAccountId']); + } + if (array_key_exists('gatewayName', $data)) { + $this->setGatewayName($data['gatewayName']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('transactionId', $data)) { + $this->setTransactionId($data['transactionId']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getPayoutRequestId(): string + { + return $this->fields['payoutRequestId']; + } + + public function getPaymentInstrumentId(): string + { + return $this->fields['paymentInstrumentId']; + } + + public function setPaymentInstrumentId(string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function getGatewayAccountId(): string + { + return $this->fields['gatewayAccountId']; + } + + public function setGatewayAccountId(string $gatewayAccountId): static + { + $this->fields['gatewayAccountId'] = $gatewayAccountId; + + return $this; + } + + public function getGatewayName(): ?string + { + return $this->fields['gatewayName'] ?? null; + } + + public function setGatewayName(null|string $gatewayName): static + { + $this->fields['gatewayName'] = $gatewayName; + + return $this; + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + public function getTransactionId(): ?string + { + return $this->fields['transactionId'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('payoutRequestId', $this->fields)) { + $data['payoutRequestId'] = $this->fields['payoutRequestId']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('gatewayAccountId', $this->fields)) { + $data['gatewayAccountId'] = $this->fields['gatewayAccountId']; + } + if (array_key_exists('gatewayName', $this->fields)) { + $data['gatewayName'] = $this->fields['gatewayName']; + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('transactionId', $this->fields)) { + $data['transactionId'] = $this->fields['transactionId']; + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setPayoutRequestId(string $payoutRequestId): static + { + $this->fields['payoutRequestId'] = $payoutRequestId; + + return $this; + } + + private function setTransactionId(null|string $transactionId): static + { + $this->fields['transactionId'] = $transactionId; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PayoutRequestAllocations.php b/src/Model/PayoutRequestAllocations.php index e4646574..67c216e2 100644 --- a/src/Model/PayoutRequestAllocations.php +++ b/src/Model/PayoutRequestAllocations.php @@ -766,6 +766,8 @@ class PayoutRequestAllocations implements JsonSerializable public const GATEWAY_NAME_POST_FINANCE = 'PostFinance'; + public const GATEWAY_NAME_POWERTRANZ = 'Powertranz'; + public const GATEWAY_NAME_PPRO = 'PPRO'; public const GATEWAY_NAME_PROSA = 'Prosa'; diff --git a/src/Model/PayoutRequestTimelineMessage.php b/src/Model/PayoutRequestTimelineMessage.php new file mode 100644 index 00000000..9d372b9e --- /dev/null +++ b/src/Model/PayoutRequestTimelineMessage.php @@ -0,0 +1,188 @@ +setId($data['id']); + } + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } + if (array_key_exists('occurredTime', $data)) { + $this->setOccurredTime($data['occurredTime']); + } + if (array_key_exists('triggeredBy', $data)) { + $this->setTriggeredBy($data['triggeredBy']); + } + if (array_key_exists('message', $data)) { + $this->setMessage($data['message']); + } + if (array_key_exists('extraData', $data)) { + $this->setExtraData($data['extraData']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getId(): string + { + return $this->fields['id']; + } + + public function getType(): string + { + return $this->fields['type']; + } + + public function getOccurredTime(): DateTimeImmutable + { + return $this->fields['occurredTime']; + } + + public function getTriggeredBy(): string + { + return $this->fields['triggeredBy']; + } + + public function getMessage(): string + { + return $this->fields['message']; + } + + public function setMessage(string $message): static + { + $this->fields['message'] = $message; + + return $this; + } + + public function getExtraData(): TimelineExtraData + { + return $this->fields['extraData']; + } + + public function setExtraData(TimelineExtraData|array $extraData): static + { + if (!($extraData instanceof TimelineExtraData)) { + $extraData = TimelineExtraData::from($extraData); + } + + $this->fields['extraData'] = $extraData; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('occurredTime', $this->fields)) { + $data['occurredTime'] = $this->fields['occurredTime']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('triggeredBy', $this->fields)) { + $data['triggeredBy'] = $this->fields['triggeredBy']; + } + if (array_key_exists('message', $this->fields)) { + $data['message'] = $this->fields['message']; + } + if (array_key_exists('extraData', $this->fields)) { + $data['extraData'] = $this->fields['extraData']->jsonSerialize(); + } + + return $data; + } + + private function setId(string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + private function setOccurredTime(DateTimeImmutable|string $occurredTime): static + { + if (!($occurredTime instanceof DateTimeImmutable)) { + $occurredTime = new DateTimeImmutable($occurredTime); + } + + $this->fields['occurredTime'] = $occurredTime; + + return $this; + } + + private function setTriggeredBy(string $triggeredBy): static + { + $this->fields['triggeredBy'] = $triggeredBy; + + return $this; + } +} diff --git a/src/Model/PayoutRequestV2.php b/src/Model/PayoutRequestV2.php new file mode 100644 index 00000000..e74b0eec --- /dev/null +++ b/src/Model/PayoutRequestV2.php @@ -0,0 +1,420 @@ +setId($data['id']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + if (array_key_exists('availableAmount', $data)) { + $this->setAvailableAmount($data['availableAmount']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('blocked', $data)) { + $this->setBlocked($data['blocked']); + } + if (array_key_exists('selectPaymentInstrumentUrl', $data)) { + $this->setSelectPaymentInstrumentUrl($data['selectPaymentInstrumentUrl']); + } + if (array_key_exists('allocations', $data)) { + $this->setAllocations($data['allocations']); + } + if (array_key_exists('selectedPaymentInstrumentRedirectUrl', $data)) { + $this->setSelectedPaymentInstrumentRedirectUrl($data['selectedPaymentInstrumentRedirectUrl']); + } + if (array_key_exists('cancellationReason', $data)) { + $this->setCancellationReason($data['cancellationReason']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getWebsiteId(): string + { + return $this->fields['websiteId']; + } + + public function setWebsiteId(string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + public function getCustomerId(): string + { + return $this->fields['customerId']; + } + + public function setCustomerId(string $customerId): static + { + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getPaymentInstrumentId(): ?string + { + return $this->fields['paymentInstrumentId'] ?? null; + } + + public function setPaymentInstrumentId(null|string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function getCurrency(): string + { + return $this->fields['currency']; + } + + public function setCurrency(string $currency): static + { + $this->fields['currency'] = $currency; + + return $this; + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function getAvailableAmount(): ?float + { + return $this->fields['availableAmount'] ?? null; + } + + public function getDescription(): ?string + { + return $this->fields['description'] ?? null; + } + + public function setDescription(null|string $description): static + { + $this->fields['description'] = $description; + + return $this; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + public function getBlocked(): ?bool + { + return $this->fields['blocked'] ?? null; + } + + public function setBlocked(null|bool $blocked): static + { + $this->fields['blocked'] = $blocked; + + return $this; + } + + public function getSelectPaymentInstrumentUrl(): ?string + { + return $this->fields['selectPaymentInstrumentUrl'] ?? null; + } + + /** + * @return null|PayoutRequestAllocation[] + */ + public function getAllocations(): ?array + { + return $this->fields['allocations'] ?? null; + } + + public function getSelectedPaymentInstrumentRedirectUrl(): ?string + { + return $this->fields['selectedPaymentInstrumentRedirectUrl'] ?? null; + } + + public function setSelectedPaymentInstrumentRedirectUrl(null|string $selectedPaymentInstrumentRedirectUrl): static + { + $this->fields['selectedPaymentInstrumentRedirectUrl'] = $selectedPaymentInstrumentRedirectUrl; + + return $this; + } + + public function getCancellationReason(): ?PayoutRequestCancellation + { + return $this->fields['cancellationReason'] ?? null; + } + + public function setCancellationReason(null|PayoutRequestCancellation|array $cancellationReason): static + { + if ($cancellationReason !== null && !($cancellationReason instanceof PayoutRequestCancellation)) { + $cancellationReason = PayoutRequestCancellation::from($cancellationReason); + } + + $this->fields['cancellationReason'] = $cancellationReason; + + return $this; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('availableAmount', $this->fields)) { + $data['availableAmount'] = $this->fields['availableAmount']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('blocked', $this->fields)) { + $data['blocked'] = $this->fields['blocked']; + } + if (array_key_exists('selectPaymentInstrumentUrl', $this->fields)) { + $data['selectPaymentInstrumentUrl'] = $this->fields['selectPaymentInstrumentUrl']; + } + if (array_key_exists('allocations', $this->fields)) { + $data['allocations'] = $this->fields['allocations'] !== null + ? array_map( + static fn (PayoutRequestAllocation $payoutRequestAllocation) => $payoutRequestAllocation->jsonSerialize(), + $this->fields['allocations'], + ) + : null; + } + if (array_key_exists('selectedPaymentInstrumentRedirectUrl', $this->fields)) { + $data['selectedPaymentInstrumentRedirectUrl'] = $this->fields['selectedPaymentInstrumentRedirectUrl']; + } + if (array_key_exists('cancellationReason', $this->fields)) { + $data['cancellationReason'] = $this->fields['cancellationReason']?->jsonSerialize(); + } + if (array_key_exists('createdTime', $this->fields)) { + $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('updatedTime', $this->fields)) { + $data['updatedTime'] = $this->fields['updatedTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('_links', $this->fields)) { + $data['_links'] = $this->fields['_links'] !== null + ? array_map( + static fn (ResourceLink $resourceLink) => $resourceLink->jsonSerialize(), + $this->fields['_links'], + ) + : null; + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setAvailableAmount(null|float|string $availableAmount): static + { + if (is_string($availableAmount)) { + $availableAmount = (float) $availableAmount; + } + + $this->fields['availableAmount'] = $availableAmount; + + return $this; + } + + private function setSelectPaymentInstrumentUrl(null|string $selectPaymentInstrumentUrl): static + { + $this->fields['selectPaymentInstrumentUrl'] = $selectPaymentInstrumentUrl; + + return $this; + } + + /** + * @param null|array[]|PayoutRequestAllocation[] $allocations + */ + private function setAllocations(null|array $allocations): static + { + $allocations = $allocations !== null ? array_map( + fn ($value) => $value instanceof PayoutRequestAllocation ? $value : PayoutRequestAllocation::from($value), + $allocations, + ) : null; + + $this->fields['allocations'] = $allocations; + + return $this; + } + + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static + { + if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(null|DateTimeImmutable|string $updatedTime): static + { + if ($updatedTime !== null && !($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + /** + * @param null|array[]|ResourceLink[] $links + */ + private function setLinks(null|array $links): static + { + $links = $links !== null ? array_map( + fn ($value) => $value instanceof ResourceLink ? $value : ResourceLink::from($value), + $links, + ) : null; + + $this->fields['_links'] = $links; + + return $this; + } +} diff --git a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php index 27db1e17..dcc0f647 100644 --- a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php +++ b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php @@ -364,6 +364,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_POST_FINANCE = 'PostFinance'; + public const GATEWAY_NAME_POWERTRANZ = 'Powertranz'; + public const GATEWAY_NAME_PPRO = 'PPRO'; public const GATEWAY_NAME_PROSA = 'Prosa'; diff --git a/src/Model/PostPayoutRequestAllocationRequest.php b/src/Model/PostPayoutRequestAllocationRequest.php new file mode 100644 index 00000000..68a5b617 --- /dev/null +++ b/src/Model/PostPayoutRequestAllocationRequest.php @@ -0,0 +1,114 @@ +setPayoutRequestId($data['payoutRequestId']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('gatewayAccountId', $data)) { + $this->setGatewayAccountId($data['gatewayAccountId']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getPayoutRequestId(): string + { + return $this->fields['payoutRequestId']; + } + + public function setPayoutRequestId(string $payoutRequestId): static + { + $this->fields['payoutRequestId'] = $payoutRequestId; + + return $this; + } + + public function getPaymentInstrumentId(): string + { + return $this->fields['paymentInstrumentId']; + } + + public function setPaymentInstrumentId(string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function getGatewayAccountId(): string + { + return $this->fields['gatewayAccountId']; + } + + public function setGatewayAccountId(string $gatewayAccountId): static + { + $this->fields['gatewayAccountId'] = $gatewayAccountId; + + return $this; + } + + public function getAmount(): float + { + return $this->fields['amount']; + } + + public function setAmount(float|string $amount): static + { + if (is_string($amount)) { + $amount = (float) $amount; + } + + $this->fields['amount'] = $amount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('payoutRequestId', $this->fields)) { + $data['payoutRequestId'] = $this->fields['payoutRequestId']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('gatewayAccountId', $this->fields)) { + $data['gatewayAccountId'] = $this->fields['gatewayAccountId']; + } + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + + return $data; + } +} diff --git a/src/Model/Powertranz.php b/src/Model/Powertranz.php new file mode 100644 index 00000000..3736e72d --- /dev/null +++ b/src/Model/Powertranz.php @@ -0,0 +1,62 @@ + 'Powertranz', + ] + $data); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getCredentials(): PowertranzCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(PowertranzCredentials|array $credentials): static + { + if (!($credentials instanceof PowertranzCredentials)) { + $credentials = PowertranzCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('credentials', $this->fields)) { + $data['credentials'] = $this->fields['credentials']->jsonSerialize(); + } + + return parent::jsonSerialize() + $data; + } +} diff --git a/src/Model/PowertranzCredentials.php b/src/Model/PowertranzCredentials.php new file mode 100644 index 00000000..1ffed9f0 --- /dev/null +++ b/src/Model/PowertranzCredentials.php @@ -0,0 +1,74 @@ +setMerchantId($data['merchantId']); + } + if (array_key_exists('password', $data)) { + $this->setPassword($data['password']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getMerchantId(): string + { + return $this->fields['merchantId']; + } + + public function setMerchantId(string $merchantId): static + { + $this->fields['merchantId'] = $merchantId; + + return $this; + } + + public function getPassword(): string + { + return $this->fields['password']; + } + + public function setPassword(string $password): static + { + $this->fields['password'] = $password; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('merchantId', $this->fields)) { + $data['merchantId'] = $this->fields['merchantId']; + } + if (array_key_exists('password', $this->fields)) { + $data['password'] = $this->fields['password']; + } + + return $data; + } +} diff --git a/src/Model/RiskScoreBlocklist.php b/src/Model/RiskScoreBlocklist.php index f98bafd9..70c5181e 100644 --- a/src/Model/RiskScoreBlocklist.php +++ b/src/Model/RiskScoreBlocklist.php @@ -52,6 +52,12 @@ public function __construct(array $data = []) if (array_key_exists('payment-card', $data)) { $this->setPaymentCard($data['payment-card']); } + if (array_key_exists('permanentlyBlockList', $data)) { + $this->setPermanentlyBlockList($data['permanentlyBlockList']); + } + if (array_key_exists('temporaryBlockList', $data)) { + $this->setTemporaryBlockList($data['temporaryBlockList']); + } } public static function from(array $data = []): self @@ -219,6 +225,38 @@ public function setPaymentCard(null|RiskScoreBlocklistType|array $paymentCard): return $this; } + public function getPermanentlyBlockList(): ?RiskScoreBlocklistPermanentRules + { + return $this->fields['permanentlyBlockList'] ?? null; + } + + public function setPermanentlyBlockList(null|RiskScoreBlocklistPermanentRules|array $permanentlyBlockList): static + { + if ($permanentlyBlockList !== null && !($permanentlyBlockList instanceof RiskScoreBlocklistPermanentRules)) { + $permanentlyBlockList = RiskScoreBlocklistPermanentRules::from($permanentlyBlockList); + } + + $this->fields['permanentlyBlockList'] = $permanentlyBlockList; + + return $this; + } + + public function getTemporaryBlockList(): ?RiskScoreBlocklistTemporaryRules + { + return $this->fields['temporaryBlockList'] ?? null; + } + + public function setTemporaryBlockList(null|RiskScoreBlocklistTemporaryRules|array $temporaryBlockList): static + { + if ($temporaryBlockList !== null && !($temporaryBlockList instanceof RiskScoreBlocklistTemporaryRules)) { + $temporaryBlockList = RiskScoreBlocklistTemporaryRules::from($temporaryBlockList); + } + + $this->fields['temporaryBlockList'] = $temporaryBlockList; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -252,6 +290,12 @@ public function jsonSerialize(): array if (array_key_exists('payment-card', $this->fields)) { $data['payment-card'] = $this->fields['payment-card']?->jsonSerialize(); } + if (array_key_exists('permanentlyBlockList', $this->fields)) { + $data['permanentlyBlockList'] = $this->fields['permanentlyBlockList']?->jsonSerialize(); + } + if (array_key_exists('temporaryBlockList', $this->fields)) { + $data['temporaryBlockList'] = $this->fields['temporaryBlockList']?->jsonSerialize(); + } return $data; } diff --git a/src/Model/RiskScoreBlocklistPermanentRule.php b/src/Model/RiskScoreBlocklistPermanentRule.php new file mode 100644 index 00000000..147eeb9b --- /dev/null +++ b/src/Model/RiskScoreBlocklistPermanentRule.php @@ -0,0 +1,56 @@ +setRiskScoreThreshold($data['riskScoreThreshold']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getRiskScoreThreshold(): int + { + return $this->fields['riskScoreThreshold']; + } + + public function setRiskScoreThreshold(int $riskScoreThreshold): static + { + $this->fields['riskScoreThreshold'] = $riskScoreThreshold; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('riskScoreThreshold', $this->fields)) { + $data['riskScoreThreshold'] = $this->fields['riskScoreThreshold']; + } + + return $data; + } +} diff --git a/src/Model/RiskScoreBlocklistPermanentRules.php b/src/Model/RiskScoreBlocklistPermanentRules.php new file mode 100644 index 00000000..4353077b --- /dev/null +++ b/src/Model/RiskScoreBlocklistPermanentRules.php @@ -0,0 +1,258 @@ +setAddress($data['address']); + } + if (array_key_exists('bankAccount', $data)) { + $this->setBankAccount($data['bankAccount']); + } + if (array_key_exists('bin', $data)) { + $this->setBin($data['bin']); + } + if (array_key_exists('country', $data)) { + $this->setCountry($data['country']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('email', $data)) { + $this->setEmail($data['email']); + } + if (array_key_exists('emailDomain', $data)) { + $this->setEmailDomain($data['emailDomain']); + } + if (array_key_exists('fingerprint', $data)) { + $this->setFingerprint($data['fingerprint']); + } + if (array_key_exists('ipAddress', $data)) { + $this->setIpAddress($data['ipAddress']); + } + if (array_key_exists('paymentCard', $data)) { + $this->setPaymentCard($data['paymentCard']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getAddress(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['address'] ?? null; + } + + public function setAddress(null|RiskScoreBlocklistPermanentRule|array $address): static + { + if ($address !== null && !($address instanceof RiskScoreBlocklistPermanentRule)) { + $address = RiskScoreBlocklistPermanentRule::from($address); + } + + $this->fields['address'] = $address; + + return $this; + } + + public function getBankAccount(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['bankAccount'] ?? null; + } + + public function setBankAccount(null|RiskScoreBlocklistPermanentRule|array $bankAccount): static + { + if ($bankAccount !== null && !($bankAccount instanceof RiskScoreBlocklistPermanentRule)) { + $bankAccount = RiskScoreBlocklistPermanentRule::from($bankAccount); + } + + $this->fields['bankAccount'] = $bankAccount; + + return $this; + } + + public function getBin(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['bin'] ?? null; + } + + public function setBin(null|RiskScoreBlocklistPermanentRule|array $bin): static + { + if ($bin !== null && !($bin instanceof RiskScoreBlocklistPermanentRule)) { + $bin = RiskScoreBlocklistPermanentRule::from($bin); + } + + $this->fields['bin'] = $bin; + + return $this; + } + + public function getCountry(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['country'] ?? null; + } + + public function setCountry(null|RiskScoreBlocklistPermanentRule|array $country): static + { + if ($country !== null && !($country instanceof RiskScoreBlocklistPermanentRule)) { + $country = RiskScoreBlocklistPermanentRule::from($country); + } + + $this->fields['country'] = $country; + + return $this; + } + + public function getCustomerId(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['customerId'] ?? null; + } + + public function setCustomerId(null|RiskScoreBlocklistPermanentRule|array $customerId): static + { + if ($customerId !== null && !($customerId instanceof RiskScoreBlocklistPermanentRule)) { + $customerId = RiskScoreBlocklistPermanentRule::from($customerId); + } + + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getEmail(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['email'] ?? null; + } + + public function setEmail(null|RiskScoreBlocklistPermanentRule|array $email): static + { + if ($email !== null && !($email instanceof RiskScoreBlocklistPermanentRule)) { + $email = RiskScoreBlocklistPermanentRule::from($email); + } + + $this->fields['email'] = $email; + + return $this; + } + + public function getEmailDomain(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['emailDomain'] ?? null; + } + + public function setEmailDomain(null|RiskScoreBlocklistPermanentRule|array $emailDomain): static + { + if ($emailDomain !== null && !($emailDomain instanceof RiskScoreBlocklistPermanentRule)) { + $emailDomain = RiskScoreBlocklistPermanentRule::from($emailDomain); + } + + $this->fields['emailDomain'] = $emailDomain; + + return $this; + } + + public function getFingerprint(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['fingerprint'] ?? null; + } + + public function setFingerprint(null|RiskScoreBlocklistPermanentRule|array $fingerprint): static + { + if ($fingerprint !== null && !($fingerprint instanceof RiskScoreBlocklistPermanentRule)) { + $fingerprint = RiskScoreBlocklistPermanentRule::from($fingerprint); + } + + $this->fields['fingerprint'] = $fingerprint; + + return $this; + } + + public function getIpAddress(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['ipAddress'] ?? null; + } + + public function setIpAddress(null|RiskScoreBlocklistPermanentRule|array $ipAddress): static + { + if ($ipAddress !== null && !($ipAddress instanceof RiskScoreBlocklistPermanentRule)) { + $ipAddress = RiskScoreBlocklistPermanentRule::from($ipAddress); + } + + $this->fields['ipAddress'] = $ipAddress; + + return $this; + } + + public function getPaymentCard(): ?RiskScoreBlocklistPermanentRule + { + return $this->fields['paymentCard'] ?? null; + } + + public function setPaymentCard(null|RiskScoreBlocklistPermanentRule|array $paymentCard): static + { + if ($paymentCard !== null && !($paymentCard instanceof RiskScoreBlocklistPermanentRule)) { + $paymentCard = RiskScoreBlocklistPermanentRule::from($paymentCard); + } + + $this->fields['paymentCard'] = $paymentCard; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('address', $this->fields)) { + $data['address'] = $this->fields['address']?->jsonSerialize(); + } + if (array_key_exists('bankAccount', $this->fields)) { + $data['bankAccount'] = $this->fields['bankAccount']?->jsonSerialize(); + } + if (array_key_exists('bin', $this->fields)) { + $data['bin'] = $this->fields['bin']?->jsonSerialize(); + } + if (array_key_exists('country', $this->fields)) { + $data['country'] = $this->fields['country']?->jsonSerialize(); + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']?->jsonSerialize(); + } + if (array_key_exists('email', $this->fields)) { + $data['email'] = $this->fields['email']?->jsonSerialize(); + } + if (array_key_exists('emailDomain', $this->fields)) { + $data['emailDomain'] = $this->fields['emailDomain']?->jsonSerialize(); + } + if (array_key_exists('fingerprint', $this->fields)) { + $data['fingerprint'] = $this->fields['fingerprint']?->jsonSerialize(); + } + if (array_key_exists('ipAddress', $this->fields)) { + $data['ipAddress'] = $this->fields['ipAddress']?->jsonSerialize(); + } + if (array_key_exists('paymentCard', $this->fields)) { + $data['paymentCard'] = $this->fields['paymentCard']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/RiskScoreBlocklistTemporaryRule.php b/src/Model/RiskScoreBlocklistTemporaryRule.php new file mode 100644 index 00000000..91b3a18f --- /dev/null +++ b/src/Model/RiskScoreBlocklistTemporaryRule.php @@ -0,0 +1,74 @@ +setRiskScoreThreshold($data['riskScoreThreshold']); + } + if (array_key_exists('ttl', $data)) { + $this->setTtl($data['ttl']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getRiskScoreThreshold(): int + { + return $this->fields['riskScoreThreshold']; + } + + public function setRiskScoreThreshold(int $riskScoreThreshold): static + { + $this->fields['riskScoreThreshold'] = $riskScoreThreshold; + + return $this; + } + + public function getTtl(): int + { + return $this->fields['ttl']; + } + + public function setTtl(int $ttl): static + { + $this->fields['ttl'] = $ttl; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('riskScoreThreshold', $this->fields)) { + $data['riskScoreThreshold'] = $this->fields['riskScoreThreshold']; + } + if (array_key_exists('ttl', $this->fields)) { + $data['ttl'] = $this->fields['ttl']; + } + + return $data; + } +} diff --git a/src/Model/RiskScoreBlocklistTemporaryRules.php b/src/Model/RiskScoreBlocklistTemporaryRules.php new file mode 100644 index 00000000..327e6b98 --- /dev/null +++ b/src/Model/RiskScoreBlocklistTemporaryRules.php @@ -0,0 +1,258 @@ +setAddress($data['address']); + } + if (array_key_exists('bankAccount', $data)) { + $this->setBankAccount($data['bankAccount']); + } + if (array_key_exists('bin', $data)) { + $this->setBin($data['bin']); + } + if (array_key_exists('country', $data)) { + $this->setCountry($data['country']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('email', $data)) { + $this->setEmail($data['email']); + } + if (array_key_exists('emailDomain', $data)) { + $this->setEmailDomain($data['emailDomain']); + } + if (array_key_exists('fingerprint', $data)) { + $this->setFingerprint($data['fingerprint']); + } + if (array_key_exists('ipAddress', $data)) { + $this->setIpAddress($data['ipAddress']); + } + if (array_key_exists('paymentCard', $data)) { + $this->setPaymentCard($data['paymentCard']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getAddress(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['address'] ?? null; + } + + public function setAddress(null|RiskScoreBlocklistTemporaryRule|array $address): static + { + if ($address !== null && !($address instanceof RiskScoreBlocklistTemporaryRule)) { + $address = RiskScoreBlocklistTemporaryRule::from($address); + } + + $this->fields['address'] = $address; + + return $this; + } + + public function getBankAccount(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['bankAccount'] ?? null; + } + + public function setBankAccount(null|RiskScoreBlocklistTemporaryRule|array $bankAccount): static + { + if ($bankAccount !== null && !($bankAccount instanceof RiskScoreBlocklistTemporaryRule)) { + $bankAccount = RiskScoreBlocklistTemporaryRule::from($bankAccount); + } + + $this->fields['bankAccount'] = $bankAccount; + + return $this; + } + + public function getBin(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['bin'] ?? null; + } + + public function setBin(null|RiskScoreBlocklistTemporaryRule|array $bin): static + { + if ($bin !== null && !($bin instanceof RiskScoreBlocklistTemporaryRule)) { + $bin = RiskScoreBlocklistTemporaryRule::from($bin); + } + + $this->fields['bin'] = $bin; + + return $this; + } + + public function getCountry(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['country'] ?? null; + } + + public function setCountry(null|RiskScoreBlocklistTemporaryRule|array $country): static + { + if ($country !== null && !($country instanceof RiskScoreBlocklistTemporaryRule)) { + $country = RiskScoreBlocklistTemporaryRule::from($country); + } + + $this->fields['country'] = $country; + + return $this; + } + + public function getCustomerId(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['customerId'] ?? null; + } + + public function setCustomerId(null|RiskScoreBlocklistTemporaryRule|array $customerId): static + { + if ($customerId !== null && !($customerId instanceof RiskScoreBlocklistTemporaryRule)) { + $customerId = RiskScoreBlocklistTemporaryRule::from($customerId); + } + + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getEmail(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['email'] ?? null; + } + + public function setEmail(null|RiskScoreBlocklistTemporaryRule|array $email): static + { + if ($email !== null && !($email instanceof RiskScoreBlocklistTemporaryRule)) { + $email = RiskScoreBlocklistTemporaryRule::from($email); + } + + $this->fields['email'] = $email; + + return $this; + } + + public function getEmailDomain(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['emailDomain'] ?? null; + } + + public function setEmailDomain(null|RiskScoreBlocklistTemporaryRule|array $emailDomain): static + { + if ($emailDomain !== null && !($emailDomain instanceof RiskScoreBlocklistTemporaryRule)) { + $emailDomain = RiskScoreBlocklistTemporaryRule::from($emailDomain); + } + + $this->fields['emailDomain'] = $emailDomain; + + return $this; + } + + public function getFingerprint(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['fingerprint'] ?? null; + } + + public function setFingerprint(null|RiskScoreBlocklistTemporaryRule|array $fingerprint): static + { + if ($fingerprint !== null && !($fingerprint instanceof RiskScoreBlocklistTemporaryRule)) { + $fingerprint = RiskScoreBlocklistTemporaryRule::from($fingerprint); + } + + $this->fields['fingerprint'] = $fingerprint; + + return $this; + } + + public function getIpAddress(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['ipAddress'] ?? null; + } + + public function setIpAddress(null|RiskScoreBlocklistTemporaryRule|array $ipAddress): static + { + if ($ipAddress !== null && !($ipAddress instanceof RiskScoreBlocklistTemporaryRule)) { + $ipAddress = RiskScoreBlocklistTemporaryRule::from($ipAddress); + } + + $this->fields['ipAddress'] = $ipAddress; + + return $this; + } + + public function getPaymentCard(): ?RiskScoreBlocklistTemporaryRule + { + return $this->fields['paymentCard'] ?? null; + } + + public function setPaymentCard(null|RiskScoreBlocklistTemporaryRule|array $paymentCard): static + { + if ($paymentCard !== null && !($paymentCard instanceof RiskScoreBlocklistTemporaryRule)) { + $paymentCard = RiskScoreBlocklistTemporaryRule::from($paymentCard); + } + + $this->fields['paymentCard'] = $paymentCard; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('address', $this->fields)) { + $data['address'] = $this->fields['address']?->jsonSerialize(); + } + if (array_key_exists('bankAccount', $this->fields)) { + $data['bankAccount'] = $this->fields['bankAccount']?->jsonSerialize(); + } + if (array_key_exists('bin', $this->fields)) { + $data['bin'] = $this->fields['bin']?->jsonSerialize(); + } + if (array_key_exists('country', $this->fields)) { + $data['country'] = $this->fields['country']?->jsonSerialize(); + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']?->jsonSerialize(); + } + if (array_key_exists('email', $this->fields)) { + $data['email'] = $this->fields['email']?->jsonSerialize(); + } + if (array_key_exists('emailDomain', $this->fields)) { + $data['emailDomain'] = $this->fields['emailDomain']?->jsonSerialize(); + } + if (array_key_exists('fingerprint', $this->fields)) { + $data['fingerprint'] = $this->fields['fingerprint']?->jsonSerialize(); + } + if (array_key_exists('ipAddress', $this->fields)) { + $data['ipAddress'] = $this->fields['ipAddress']?->jsonSerialize(); + } + if (array_key_exists('paymentCard', $this->fields)) { + $data['paymentCard'] = $this->fields['paymentCard']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/TagUntagRule.php b/src/Model/TagUntagRule.php index 7825f824..18b3b634 100644 --- a/src/Model/TagUntagRule.php +++ b/src/Model/TagUntagRule.php @@ -104,8 +104,12 @@ class TagUntagRule implements JsonSerializable public const EVENT_TYPE_PAYOUT_REQUEST_CREATED = 'payout-request-created'; + public const EVENT_TYPE_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; + public const EVENT_TYPE_PAYOUT_REQUEST_MODIFIED = 'payout-request-modified'; + public const EVENT_TYPE_PAYOUT_REQUEST_REVERSED = 'payout-request-reversed'; + public const EVENT_TYPE_QUOTE_ACCEPTED = 'quote-accepted'; public const EVENT_TYPE_QUOTE_CANCELED = 'quote-canceled'; diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 723ec49e..a6bc25b0 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -422,6 +422,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_POST_FINANCE = 'PostFinance'; + public const GATEWAY_NAME_POWERTRANZ = 'Powertranz'; + public const GATEWAY_NAME_PPRO = 'PPRO'; public const GATEWAY_NAME_PROSA = 'Prosa'; diff --git a/src/Model/WebhookTracking.php b/src/Model/WebhookTracking.php index 638c1548..2be12980 100644 --- a/src/Model/WebhookTracking.php +++ b/src/Model/WebhookTracking.php @@ -164,8 +164,12 @@ class WebhookTracking implements JsonSerializable public const EVENT_TYPE_PAYOUT_REQUEST_CREATED = 'payout-request-created'; + public const EVENT_TYPE_PAYOUT_REQUEST_FULFILLED = 'payout-request-fulfilled'; + public const EVENT_TYPE_PAYOUT_REQUEST_MODIFIED = 'payout-request-modified'; + public const EVENT_TYPE_PAYOUT_REQUEST_REVERSED = 'payout-request-reversed'; + public const EVENT_TYPE_QUOTE_ACCEPTED = 'quote-accepted'; public const EVENT_TYPE_QUOTE_CANCELED = 'quote-canceled'; diff --git a/src/Service.php b/src/Service.php index d6c512a0..e7d94b43 100644 --- a/src/Service.php +++ b/src/Service.php @@ -156,6 +156,10 @@ class Service private Api\PayoutRequestsApi $payoutRequests; + private Api\PayoutRequestsV2Api $payoutRequestsV2; + + private Api\PayoutRequestAllocationsApi $payoutRequestAllocations; + private Api\ProfileApi $profile; private Api\PreviewsApi $previews; @@ -259,6 +263,8 @@ public function __construct(?Client $client = null, array $config = []) $this->paymentCardsBankNames = new Api\PaymentCardsBankNamesApi($this->client); $this->paymentMethods = new Api\PaymentMethodsApi($this->client); $this->payoutRequests = new Api\PayoutRequestsApi($this->client); + $this->payoutRequestsV2 = new Api\PayoutRequestsV2Api($this->client); + $this->payoutRequestAllocations = new Api\PayoutRequestAllocationsApi($this->client); $this->profile = new Api\ProfileApi($this->client); $this->previews = new Api\PreviewsApi($this->client); $this->roles = new Api\RolesApi($this->client); @@ -622,6 +628,16 @@ public function payoutRequests(): Api\PayoutRequestsApi return $this->payoutRequests; } + public function payoutRequestsV2(): Api\PayoutRequestsV2Api + { + return $this->payoutRequestsV2; + } + + public function payoutRequestAllocations(): Api\PayoutRequestAllocationsApi + { + return $this->payoutRequestAllocations; + } + public function profile(): Api\ProfileApi { return $this->profile;