diff --git a/.changeset/big-rivers-yawn.md b/.changeset/big-rivers-yawn.md new file mode 100644 index 000000000..97047ef5e --- /dev/null +++ b/.changeset/big-rivers-yawn.md @@ -0,0 +1,33 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/bright-coins-retire.md b/.changeset/bright-coins-retire.md new file mode 100644 index 000000000..02f3f713d --- /dev/null +++ b/.changeset/bright-coins-retire.md @@ -0,0 +1,39 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided`, `transaction-reconciled` — `POST /tags-rules`, `PUT /tags-rules/{id}` + 11 more +- Enum value added on request `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `POST /previews/webhooks`, `POST /webhooks` + 1 more +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `POST /customers/{id}/timeline`, `POST /invoices/{id}/timeline` + 12 more +- Enum value added on response `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /tags-rules`, `POST /tags-rules` + 4 more +- Enum value added on response `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /webhooks`, `POST /webhooks` + 2 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `GET /customers/{id}/timeline`, `POST /customers/{id}/timeline` + 20 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- webhook-added (3x) — e.g. webhook `transaction-partially-refunded` added +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/clean-seahorses-invent.md b/.changeset/clean-seahorses-invent.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/clean-seahorses-invent.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/forty-insects-fail.md b/.changeset/forty-insects-fail.md new file mode 100644 index 000000000..16bbdcd39 --- /dev/null +++ b/.changeset/forty-insects-fail.md @@ -0,0 +1,14 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Enum changes + +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more diff --git a/.changeset/nervous-falcons-stare.md b/.changeset/nervous-falcons-stare.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/nervous-falcons-stare.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/perfect-numbers-battle.md b/.changeset/perfect-numbers-battle.md new file mode 100644 index 000000000..81cd3c1c4 --- /dev/null +++ b/.changeset/perfect-numbers-battle.md @@ -0,0 +1,27 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/quick-zebras-sell.md b/.changeset/quick-zebras-sell.md new file mode 100644 index 000000000..a42acf295 --- /dev/null +++ b/.changeset/quick-zebras-sell.md @@ -0,0 +1,34 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/rotten-tools-protect.md b/.changeset/rotten-tools-protect.md new file mode 100644 index 000000000..a42acf295 --- /dev/null +++ b/.changeset/rotten-tools-protect.md @@ -0,0 +1,34 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/sharp-bottles-repair.md b/.changeset/sharp-bottles-repair.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/sharp-bottles-repair.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/slimy-ducks-melt.md b/.changeset/slimy-ducks-melt.md new file mode 100644 index 000000000..30c56cdc9 --- /dev/null +++ b/.changeset/slimy-ducks-melt.md @@ -0,0 +1,9 @@ +--- +"@rebilly/client-php": minor +--- + +### Enum changes + +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more diff --git a/.changeset/slow-adults-drive.md b/.changeset/slow-adults-drive.md new file mode 100644 index 000000000..f8cacb7a1 --- /dev/null +++ b/.changeset/slow-adults-drive.md @@ -0,0 +1,29 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/spec-diff.md b/.changeset/spec-diff.md new file mode 100644 index 000000000..d7764c1b5 --- /dev/null +++ b/.changeset/spec-diff.md @@ -0,0 +1,229 @@ +--- +"@rebilly/client-php": patch +--- + +### Endpoints +- Added endpoint `endpoint added` + +### Added +- Added `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` **(breaking)** +- Added `CryptocurrencyToken` on `CryptocurrencyToken` (response only) **(breaking)** +- Added `FlexiblePlan` on `FlexiblePlan, OneTimeSale, Subscription` **(breaking)** +- Added `UsersDataExport` on `UsersDataExport` **(breaking)** +- Added `method` on `OneTimeOrder, RecurringOrder` **(breaking)** +- Added `paymentInstrumentId` on `OneTimeOrder, RecurringOrder` **(breaking)** +- Added `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` **(breaking)** +- Added error status `409` (response only) +- Added error status `422` (response only) +- Added `_links` (response only) +- Added `amount` (response only) +- Added `annualComplianceScreening` on `Organization` +- Added `automaticReadinessLastExecutedAt` on `OneTimeOrder, RecurringOrder` (response only) +- Added `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` +- Added `batchId` (response only) +- Added `billingManagementToken` (response only) +- Added `canWithdraw` (response only) +- Added `checkList` +- Added `coinPricing` +- Added `coinPurchase` +- Added `createdTime` (response only) +- Added `currency` (response only) +- Added `defaultPaymentInstrumentId` on `OneTimeOrder, RecurringOrder, StorefrontAccount` (request only) +- Added `description` +- Added `documentMatches` on `StorefrontProofOfFundsKycDocument` (response only) +- Added `documentNumber` on `KycSettingsIdentity` +- Added `exposureAmount` (response only) +- Added `failureReason` on `AmlChecksDataExport, CustomersDataExport, DisputesDataExport, InvoiceItemsDataExport, InvoicesDataExport, JournalRecordsDataExport, PayoutRequestAllocationsDataExport, PayoutRequestsDataExport, SubscriptionsDataExport, TransactionsDataExport` (response only) +- Added `gatewayAccountId` (response only) +- Added `gatewayName` (response only) +- Added `gatewayPayoutInstruction` (response only) +- Added `hasCardOnFile` (response only) +- Added `id` (response only) +- Added `includeUnpaidInvoices` on `StorefrontReactivationQuote` +- Added `isPayoutable` (response only) +- Added `issuanceCountry` on `KycSettingsIdentity` +- Added `issuanceRegion` on `KycSettingsIdentity` +- Added `parsedData` (response only) +- Added `pastDueInvoice` (response only) +- Added `paymentMethod` (response only) +- Added `payoutLimits` +- Added `payoutRequestId` (response only) +- Added `periodEnd` (response only) +- Added `periodStart` (response only) +- Added `plan` +- Added `preset` +- Added `quantityFilled` on `QuoteSubscriptionItem` +- Added optional parameter `query` (request only) +- Added `recordCount` (request only) +- Added `requiresCardOnFile` (response only) +- Added `score` +- Added `splitReason` +- Added `status` +- Added `sticky` (response only) +- Added `title` +- Added `transactionId` (response only) +- Added `transactionResult` (response only) +- Added `transactionStatus` (response only) +- Added `type` (response only) +- Added `updatedTime` (response only) +- Added `version` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` (response only) + +### Removed +- Removed `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` (request only) **(breaking)** +- Removed `CheckInstrument` on `CheckInstrument, OneTimeOrder, RecurringOrder` **(breaking)** +- Removed `FlexiblePlan` on `OneTimeSale, Subscription` (request only) **(breaking)** +- Removed `schemas` on `DashboardMetric` (request only) **(breaking)** +- Removed `subschema #1, subschema #2` (request only) **(breaking)** +- Removed `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` (request only) **(breaking)** +- Removed schema `PayoutRequestSplit` +- Removed `RebillyShipping` on `RebillyShipping, StorefrontChangeQuote, StorefrontReactivationQuote` +- Removed schema `StorefrontProofOfCreditFileKycDocument` +- Removed `balance` (request only) +- Removed `bonusBalance` (request only) +- Removed `discountAmount` on `OneTimeOrder, RecurringOrder, StorefrontInvoice` (response only) +- Removed `failureCount` (response only) +- Removed `isDigitallyTampered` on `StorefrontProofOfIdentityKycDocument` +- Removed `isPhotocopy` on `StorefrontProofOfIdentityKycDocument` +- Removed `isPublishedOnline` on `StorefrontProofOfIdentityKycDocument` +- Removed `isTampered` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Removed `matchingImages` on `StorefrontProofOfIdentityKycDocument` (response only) +- Removed `mrzChecksumValid` on `StorefrontProofOfIdentityKycDocument` (response only) +- Removed `pendingPayoutTotal` (request only) +- Removed `planId` on `OneTimeOrder, OneTimeSaleItem, SubscriptionItem` +- Removed `score` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Removed `subaggregate` (response only) +- Removed `successCount` (response only) +- Removed `value` (response only) + +### Changed +- Type changed `date` on `StorefrontProofOfAddressKycDocument` **(breaking)** +- Made nullable `dateRange` **(breaking)** +- Made nullable `defaultPaymentInstrument` on `StorefrontAccount` **(breaking)** +- Made nullable `documentMatches` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` **(breaking)** +- Made nullable `hasMatchingFaceProof` on `StorefrontProofOfIdentityKycDocument` **(breaking)** +- Type changed `metric` (request only) **(breaking)** +- Made optional `planId` **(breaking)** +- Made required `quantity` **(breaking)** +- Type changed `subaggregates` (response only) **(breaking)** +- Made required `type` on `QuoteOneTimeSaleItem, QuoteSubscriptionItem` **(breaking)** +- Discriminator mapping added `IMerchant, PayGlocal` (request only) +- Discriminator mapping added `PayGlocal, IMerchant` (response only) +- Discriminator mapping changed `avalara` on `PostAvalaraCredential` (request only) +- Discriminator mapping changed `aws-ses` on `PostAwsSesCredential` (request only) +- Made required `collectedAmount` (response only) +- Made required `currency` (response only) +- Became read-only `defaultPaymentInstrument` on `OneTimeOrder, RecurringOrder, StorefrontAccount` +- Discriminator mapping changed `experian` on `PostExperianCredential` (request only) +- Made nullable `fileId` (request only) +- Made required `invoiceCount` (response only) +- Made required `invoicedAmount` (response only) +- Discriminator mapping changed `mailgun` on `PostMailgunCredential` (request only) +- Pattern changed `name` on `OneTimeOrder, RecurringOrder` +- Discriminator mapping changed `oauth2` on `PostOAuth2Credential` (request only) +- Made required `paymentInstrumentId` on `StorefrontAccount` +- Discriminator mapping changed `plaid` on `PostPlaidCredential` (request only) +- Discriminator mapping changed `postmark` on `PostPostmarkCredential` (request only) +- Discriminator mapping changed `sendgrid` on `PostSendGridCredential` (request only) +- Discriminator mapping changed `smtp` on `PostSmtpCredential` (request only) +- Discriminator mapping changed `taxjar` on `PostTaxJarCredential` (request only) +- Discriminator mapping added `users` +- Discriminator mapping changed `webhook` on `PostWebhookCredential` (request only) + +### Deprecated +- Deprecated `ignoreRecurring` (request only) +- Deprecated `keepTrial` on `StorefrontChangeQuote` +- Deprecated `planId` + +### Enum changes +- `acquirerName` on `AcquirerName` accepts new values: `PayGlocal` +- `eventType` on `GlobalEventType` accepts new values: `data-export-failed`, `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided`, `transaction-reconciled` +- `eventsFilter` accepts new values: `data-export-failed`, `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` **(breaking)** +- `gatewayName` on `GatewayName` accepts new values: `IMerchant`, `PayGlocal` **(breaking)** +- `method` on `AlternativePaymentMethods, PaymentMethod, ReadyToPayMethods, StorefrontAccount, StorefrontInvoice, StorefrontTransaction` accepts new values: `PIX-Automatico` **(breaking)** +- `methods` on `PaymentInstruction` accepts new values: `PIX-Automatico` +- `name` accepts new values: `documentNumber`, `issuanceCountry`, `issuanceRegion` **(breaking)** +- `not` accepts new values: `data-export-failed` +- `paymentMethod` on `PaymentMethod` accepts new values: `PIX-Automatico` +- `paymentMethods` accepts new values: `PIX-Automatico` **(breaking)** +- `reason` accepts new values: `gateway-unreachable` **(breaking)** +- `rejectionReason` (response only) accepts new values: `document-was-valid-but-expired`, `name-and-dob-mismatch` **(breaking)** +- `relatedType` accepts new values: `credit-memo-timeline-comment`, `payout-request-timeline-comment`, `quote-timeline-comment` **(breaking)** +- `renewalPolicy` on `StorefrontChangeQuote` accepts new values: `resetToRecurring`, `retainRecurring`, `retainTrialThenRecurring`, `retainTrialOnly` **(breaking)** +- `status` on `AmlChecksDataExport, CustomersDataExport, DisputesDataExport, InvoiceItemsDataExport, InvoicesDataExport, JournalRecordsDataExport, PayoutRequestAllocationsDataExport, PayoutRequestsDataExport, SubscriptionsDataExport, TransactionsDataExport` accepts new values: `failed`, `approved`, `canceled`, `merged`, `ready`, `split` **(breaking)** +- `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` accepts new values: `subscription-pause-created`, `subscription-pause-revoked`, `transaction-partially-refunded`, `gateway-account-carding-circuit-opened`, `document-was-valid-but-expired`, `name-and-dob-mismatch` + 1 more **(breaking)** +- `documentType` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument` no longer accepts: `credit-file-proof` **(breaking)** +- `rel` (response only) no longer accepts: `documents` + +### Schema composition refactors +- Refactored under `_embedded/quote/oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `POST webhook:quote-accepted`, `POST webhook:quote-canceled` + 6 more +- Refactored under `_embedded/quote/oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `POST webhook:quote-accepted`, `POST webhook:quote-canceled` + 6 more +- Refactored under `currency` to compose `CurrencyCode` — `POST /invoices/{id}/allocate-credit-balance` +- Refactored under `customerId` to compose `CustomerId` — `POST /storefront/kyc-liveness-sessions`, `GET /storefront/kyc-liveness-sessions/{id}` + 1 more +- Refactored under `items/oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `GET /quotes` +- Refactored under `items/oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `GET /quotes` +- Refactored under `oneOf[#/components/schemas/StorefrontChangeQuote]/order/shipping` to compose `Shipping`, `StorefrontChangeQuote` — `GET /storefront/quotes/{id}`, `POST /storefront/quotes/{id}/accept` + 1 more +- Refactored under `oneOf[#/components/schemas/StorefrontReactivationQuote]/order/shipping` to compose `Shipping`, `StorefrontReactivationQuote` — `GET /storefront/quotes/{id}`, `POST /storefront/quotes/{id}/accept` + 1 more +- Refactored under `oneOf[subschema #2: ChangeQuote]/order/shipping` to compose `Shipping` — `POST /quotes`, `PUT /quotes/{id}` + 7 more +- Refactored under `oneOf[subschema #3: ReactivationQuote]/order/shipping` to compose `Shipping` — `POST /quotes`, `PUT /quotes/{id}` + 7 more +- Refactored under `order/shipping` to compose `Shipping` — `POST /storefront/subscription-reactivations`, `POST /storefront/subscriptions/{id}/change-items` + +### Other +- all-of-removed-annotation-only on `subschema #1: Validation error` (response only) +- Uncomposed schema from `schemas` on `BaseProblem, PayoutRequestAllocation` (response only) +- Removed union member from `AlternativeInstrument` on `AlternativeInstrument, OneTimeOrder, RecurringOrder` (response only) +- Removed union member from `CryptocurrencyToken` on `CryptocurrencyToken` +- Removed union member from `FlexiblePlan` on `FlexiblePlan, OneTimeSale, Subscription` (response only) +- Removed union member from `KycAddressMatches` on `KycAddressMatches` (request only) +- Removed union member from `PatchTaxJarCredential` on `PatchTaxJarCredential` (request only) +- Removed union member from `schemas` on `DashboardMetric` (response only) +- Removed union member from `subschema #1, subschema #2` (response only) +- Removed union member from `subschema #1, subschema #2, subschema #3` on `FlexiblePlan` +- api-path-removed-without-deprecation (2x) — e.g. api path removed without deprecation +- api-removed-without-deprecation (1x) — e.g. api removed without deprecation +- Made not nullable `city` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `firstName` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Made not nullable `lastName` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfIdentityKycDocument` +- Made not nullable `line1` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `phone` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `postalCode` on `StorefrontProofOfAddressKycDocument` +- Made not nullable `region` on `StorefrontProofOfAddressKycDocument` +- became-required (1x) — e.g. request body became required +- default-value-changed on `renewalPolicy` +- Default removed on `pendingPeriodHours` +- discriminator-added (2x) — e.g. added request discriminator +- Added discriminator mapping for `IMerchant, PayGlocal` +- Added discriminator mapping for `PayGlocal, IMerchant` (response only) +- Added discriminator mapping for `users` +- Removed discriminator mapping for `credit-file-proof` +- discriminator-removed on `shipping` on `StorefrontChangeQuote, StorefrontReactivationQuote` +- max-length-unset on `currency` (response only) +- max-length-unset on `customerId` (response only) +- max-set on `quantity` (request only) +- Raised minimum on `pendingPeriodHours` on `OneTimeOrder, RecurringOrder` (request only) +- Shortened minimum length on `currency` (response only) +- Raised minimum length on `cancellationDescription` (request only) +- min-set on `quantity` (request only) +- Added discriminator variant to `AlternativeInstrument` on `AlternativeInstrument` (response only) +- Added discriminator variant to `CryptocurrencyToken` on `CryptocurrencyToken` +- Added discriminator variant to `DataExportLimitExceeded` on `DataExportLimitExceeded` (response only) +- Added discriminator variant to `KycFundsMatchesOverwrite` on `KycFundsMatchesOverwrite` (request only) +- Added discriminator variant to `PatchTaxJarCredential` on `PatchTaxJarCredential` (request only) +- Added discriminator variant to `PostPlaidCredential` on `PostPlaidCredential` (request only) +- Added discriminator variant to `UsersDataExport` on `UsersDataExport` +- Added discriminator variant to `subschema #1, subschema #2, subschema #3` +- Removed discriminator variant from `PlaidCredential` on `PlaidCredential` (request only) +- Removed discriminator variant from `StorefrontProofOfCreditFileKycDocument` on `StorefrontProofOfCreditFileKycDocument` +- optional-property-became-not-write-only on `billingAddress` +- optional-property-became-not-write-only on `deliveryAddress` +- optional-write-only-property-added on `defaultPaymentInstrumentId` on `OneTimeOrder, RecurringOrder` (response only) +- parameter-max-decreased on `query` (request only) +- required-property-became-read-only on `balance` (response only) +- required-property-became-read-only on `bonusBalance` (response only) +- required-property-became-read-only on `pendingPayoutTotal` (response only) +- type-generalized on `shipping` (request only) +- type-specialized on `items/` (response only) +- type-specialized on `metric` (response only) +- webhook-added on `data-export-failed` (response only) +- webhook-added on `transaction-partially-refunded` (response only) +- webhook-added on `transaction-refunded` (response only) +- webhook-added on `transaction-voided` (response only) diff --git a/.changeset/stupid-trainers-develop.md b/.changeset/stupid-trainers-develop.md new file mode 100644 index 000000000..8d66480ec --- /dev/null +++ b/.changeset/stupid-trainers-develop.md @@ -0,0 +1,26 @@ +--- +"@rebilly/client-php": minor +--- + +### Added + +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `POST /kyc-documents`, `PUT /kyc-documents/{id}` + 9 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `name-and-dob-mismatch` — `GET /kyc-documents`, `POST /kyc-documents` + 11 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.changeset/two-days-tap.md b/.changeset/two-days-tap.md new file mode 100644 index 000000000..4421b39cf --- /dev/null +++ b/.changeset/two-days-tap.md @@ -0,0 +1,41 @@ +--- +"@rebilly/client-php": major +--- + +### Added + +- Added required request property `splitReason` — `POST /payout-requests/{id}/split` **(breaking)** +- Added optional response property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional request property `automaticReadinessTime` on `OneTimeOrder, RecurringOrder` — `POST /orders`, `PUT /orders/{id}` + 3 more +- Added optional response property `isPayoutable` on `OneTimeOrder, RecurringOrder` — `GET /orders`, `POST /orders` + 9 more +- Added optional response property `quantityFilled` on `QuoteSubscriptionItem` — `GET /quotes`, `POST /quotes` + 13 more +- Added optional request property `quantityFilled` on `QuoteSubscriptionItem` — `POST /quotes`, `PUT /quotes/{id}` + 8 more +- Added optional request property `splitDescription` — `POST /payout-requests/{id}/split` +- Added optional response property `splitReason` — `GET /payout-requests`, `POST /payout-requests` + 5 more +- Added optional request property `splitReason` — `POST /payout-requests`, `PUT /payout-requests/{id}` + 4 more +- Added optional response property `sticky` on `FlexiblePlan` — `GET /orders`, `POST /orders` + 34 more +- Added optional request property `sticky` on `FlexiblePlan` — `POST /orders`, `PUT /orders/{id}` + 72 more + +### Changed + +- Discriminator mapping added response property `IMerchant` — `GET /gateway-accounts` +- Discriminator mapping added request property `IMerchant` — `POST webhook:gateway-account-downtime-ended`, `POST webhook:gateway-account-downtime-started` + 3 more + +### Enum changes + +- Enum value added on request `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided`, `transaction-reconciled` — `POST /tags-rules`, `PUT /tags-rules/{id}` + 11 more +- Enum value added on request `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `POST /previews/webhooks`, `POST /webhooks` + 1 more +- Enum value added on request `gatewayName` on `GatewayName`: `IMerchant` — `POST /gateway-accounts`, `PATCH /gateway-accounts/{id}` + 46 more +- Enum value added on request `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `POST /customers/{id}/timeline`, `POST /invoices/{id}/timeline` + 12 more +- Enum value added on response `eventType` on `GlobalEventType`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /tags-rules`, `POST /tags-rules` + 4 more +- Enum value added on response `eventsFilter`: `transaction-partially-refunded`, `transaction-refunded`, `transaction-voided` — `GET /webhooks`, `POST /webhooks` + 2 more +- Enum value added on response `gatewayName` on `GatewayName`: `IMerchant` — `GET /gateway-accounts`, `POST /gateway-accounts` + 47 more +- Enum value added on response `rejectionReason`: `name-and-dob-mismatch` — `GET /experimental/reports/kyc-rejection-summary` +- Enum value added on response `type` on `StorefrontProofOfAddressKycDocument, StorefrontProofOfCreditFileKycDocument, StorefrontProofOfFundsKycDocument, StorefrontProofOfIdentityKycDocument, StorefrontProofOfPurchaseKycDocument`: `transaction-partially-refunded`, `name-and-dob-mismatch` — `GET /customers/{id}/timeline`, `POST /customers/{id}/timeline` + 20 more + +### Other + +- response-body-discriminator-mapping-added (8x) — e.g. added `IMerchant` mapping keys to the response discriminator for the response status `201` +- request-property-min-increased (7x) — e.g. the `oneOf[#/components/schemas/OneTimeOrder]/_embedded/website/settings/payoutRequest/pendingPeriodHours` request prope +- webhook-added (3x) — e.g. webhook `transaction-partially-refunded` added +- request-body-discriminator-mapping-added (3x) — e.g. added `IMerchant` mapping keys to the request discriminator diff --git a/.openapi-snapshot.yaml b/.openapi-snapshot.yaml index 8b2c0fa88..ca64531c8 100644 --- a/.openapi-snapshot.yaml +++ b/.openapi-snapshot.yaml @@ -28,8 +28,6 @@ info: # Authentication - This topic describes the different forms of authentication that are available in the Rebilly API, and how to use them. - Rebilly offers four forms of authentication: secret key, publishable key, JSON Web Tokens, and public signature key. - Secret API key: Use to make requests from the server side. @@ -38,8 +36,6 @@ info: - Publishable API key: Use in your client-side code to tokenize payment information. - JWT: Use to make short-life tokens that expire after a set period of time. - - ## Manage API keys To create or manage API keys, select one of the following: @@ -4393,6 +4389,43 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + /customers/{id}/compliance-screening-report: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-products: + - Core + tags: + - Customers + summary: Create a compliance screening report + operationId: PostCustomerComplianceScreeningReport + x-sdk-operation-name: generateComplianceScreeningReport + description: |- + Creates a compliance screening report that includes Know Your Customer (KYC) and Anti-Money Laundering (AML) results for a customer. + The report is stored as a PDF customer attachment. + Requires the KYC and AML products to be enabled for the organization. + responses: + '201': + description: Compliance screening report generated. + headers: + Location: + $ref: '#/components/headers/Location' + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' /disputes: get: x-products: @@ -5929,7 +5962,7 @@ paths: parameters: - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' - - $ref: '#/components/parameters/collectionLimit' + - $ref: '#/components/parameters/invoiceCollectionLimit' - $ref: '#/components/parameters/collectionOffset' - $ref: '#/components/parameters/collectionQuery' - $ref: '#/components/parameters/collectionExpand' @@ -6212,7 +6245,9 @@ paths: summary: Upsert an invoice operationId: PutInvoice x-sdk-operation-name: update - description: Creates or updates (upserts) an invoice with a specified ID. + description: |- + Creates or updates (upserts) an invoice with a specified ID. + Returns a conflict error if the specified ID belongs to an upcoming invoice. requestBody: $ref: '#/components/requestBodies/Invoice' responses: @@ -6246,6 +6281,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -8219,7 +8256,7 @@ paths: pass the customer's first name to the `accept` field. If an incorrect first name is passed, the document is rejected. value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: credit-file-proof @@ -8230,7 +8267,7 @@ paths: identity-with-face-proof: summary: Identity with face proof value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: identity-proof @@ -8240,7 +8277,7 @@ paths: identity-and-address: summary: Identity and address value: - customerId: 123_456789 + customerId: '123_456789' redirectUrl: https://example.com/return-here/ documents: - type: identity-proof @@ -8342,7 +8379,6 @@ paths: requestBody: $ref: '#/components/requestBodies/PatchKycRequest' description: KYC document resource. - required: true responses: '200': description: KYC request updated. @@ -8633,14 +8669,30 @@ paths: Updates the document matches of a KYC document with a specified ID. > **Note:** Use this operation for manual overrides. + + The request body schema depends on the KYC document `documentType`. + The operation rejects unknown fields. + + Send `type` with one of: + `identity-proof`, `address-proof`, `purchase-proof`, or `funds-proof`. + The specified value identifies the `type` of the document match. requestBody: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/KycIdentityMatches' - - $ref: '#/components/schemas/KycAddressMatches' - description: Kyc document resource. + oneOf: + - $ref: '#/components/schemas/KycIdentityMatchesOverwrite' + - $ref: '#/components/schemas/KycAddressMatchesOverwrite' + - $ref: '#/components/schemas/KycPurchaseMatchesOverwrite' + - $ref: '#/components/schemas/KycFundsMatchesOverwrite' + discriminator: + propertyName: type + mapping: + identity-proof: '#/components/schemas/KycIdentityMatchesOverwrite' + address-proof: '#/components/schemas/KycAddressMatchesOverwrite' + purchase-proof: '#/components/schemas/KycPurchaseMatchesOverwrite' + funds-proof: '#/components/schemas/KycFundsMatchesOverwrite' + description: KYC document matches overwrite payload. required: true responses: '204': @@ -8656,6 +8708,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /kyc-documents/{id}/rejection: @@ -9778,14 +9832,14 @@ paths: source: |- $service = new \Rebilly\Sdk\Service($client); - $plan = \Rebilly\Sdk\Model\SubscriptionPlan::from([]) + $plan = \Rebilly\Sdk\Model\PlanSubscriptionPlan::from([]) ->setProductId('productId') ->setName('Test plan') ->setCurrency('USD') ->setPricing(new \Rebilly\Sdk\Model\PlanFormulaFlatRate(['price' => 9.99])) ->setRecurringInterval( - \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::from() - ->setUnit(\Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_MONTH) + \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::from() + ->setUnit(\Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_MONTH) ->setLength(1), ); @@ -9925,9 +9979,9 @@ paths: source: |- $service = new \Rebilly\Sdk\Service($client); - $plan = new \Rebilly\Sdk\Model\SubscriptionPlan([ + $plan = new \Rebilly\Sdk\Model\PlanSubscriptionPlan([ 'recurringInterval' => [ - 'unit' => \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_WEEK, + 'unit' => \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_WEEK, 'length' => 2, ], ]); @@ -9941,8 +9995,8 @@ paths: // OR $plan = $service->plans()->get('planId'); - $plan->setRecurringInterval(new \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval([ - 'unit' => \Rebilly\Sdk\Model\SubscriptionPlanRecurringInterval::UNIT_WEEK, + $plan->setRecurringInterval(new \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval([ + 'unit' => \Rebilly\Sdk\Model\PlanSubscriptionPlanRecurringInterval::UNIT_WEEK, 'length' => 2, ])); @@ -10375,6 +10429,8 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -10464,6 +10520,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -10544,6 +10602,8 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /quotes/{id}/cancel: @@ -11207,8 +11267,6 @@ paths: console.log(request.response.status); // 204 /orders: get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11249,8 +11307,6 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11287,8 +11343,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11317,8 +11371,6 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11363,8 +11415,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11395,8 +11445,6 @@ paths: $ref: '#/components/responses/NotFound' /order-pauses: get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11431,13 +11479,11 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: - Orders experimental - summary: Pause a order + summary: Pause an order operationId: PostOrderPause x-sdk-operation-name: pause description: Pauses an order with a specified ID. @@ -11474,8 +11520,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11498,8 +11542,6 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11547,8 +11589,6 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11580,8 +11620,6 @@ paths: $ref: '#/components/responses/TooManyRequests' /order-cancellations: get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11616,8 +11654,6 @@ paths: '403': $ref: '#/components/responses/Forbidden' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11659,8 +11695,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11683,8 +11717,6 @@ paths: '404': $ref: '#/components/responses/NotFound' put: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11734,8 +11766,6 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' patch: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11780,8 +11810,6 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' delete: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11813,8 +11841,6 @@ paths: $ref: '#/components/responses/TooManyRequests' /order-reactivations: get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11861,8 +11887,6 @@ paths: // access the collection items, each item is a Member secondCollection.items.forEach(order => console.log(order.fields.customerId)); post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11919,8 +11943,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' get: - x-badges: - - name: Experimental x-products: - Core tags: @@ -11970,7 +11992,7 @@ paths: - $ref: '#/components/parameters/subscriptionExpand' responses: '200': - description: List of subscriptions retrieved. + description: List of orders retrieved. headers: Pagination-Total: $ref: '#/components/headers/Pagination-Total' @@ -12473,8 +12495,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -12558,8 +12578,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -12604,7 +12622,7 @@ paths: - $ref: '#/components/parameters/resourceId' - name: itemId in: path - description: ID of subscription item. + description: ID of the subscription item. required: true schema: type: string @@ -12670,8 +12688,6 @@ paths: schema: type: string patch: - x-badges: - - name: Experimental x-products: - Core tags: @@ -12775,8 +12791,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -13580,8 +13594,6 @@ paths: parameters: - $ref: '#/components/parameters/resourceId' post: - x-badges: - - name: Experimental x-products: - Core tags: @@ -13796,7 +13808,7 @@ paths: summary: Retrieve an order timeline message operationId: GetSubscriptionTimeline x-sdk-operation-name: getTimelineMessage - description: Retrieves a order message with a specified ID. + description: Retrieves an order timeline message with a specified ID. responses: '200': description: Order timeline message retrieved. @@ -17517,17 +17529,13 @@ paths: '429': $ref: '#/components/responses/TooManyRequests' requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ServiceCredential' - description: Service credential resource. - required: true + $ref: '#/components/requestBodies/PostCredential' x-codeSamples: - lang: JavaScript source: | // first set the required properties for the new service credential const data = { + type: 'webhook', host: 'foobar.test.com', auth: { type: 'none' @@ -17606,6 +17614,7 @@ paths: source: | // first set the status to update for the service credential const data = { + type: 'webhook', status: 'deactivated' }; @@ -21242,7 +21251,7 @@ paths: description: |- Retrieves a list of payout requests. - Filter by: `id`, `customerId`, `websiteId`, `batchId`, `status`, `blocked`, `blockReason`, `createdTime`, `updatedTime`, `currency`, `amount`. + Filter by: `id`, `customerId`, `websiteId`, `batchId`, `status`, `blocked`, `blockReason`, `splitReason`, `createdTime`, `updatedTime`, `currency`, `amount`. parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' @@ -21431,111 +21440,6 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' - /payout-requests/{id}/cancel: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Cancel a payout request - operationId: PostPayoutRequestCancellation - x-sdk-operation-name: cancel - description: Cancels a payout request with a specified ID. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestCancellation' - description: Payout request resource. - required: true - responses: - '200': - description: Payout request canceled. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' - /payout-requests/{id}/split: - parameters: - - $ref: '#/components/parameters/resourceId' - post: - x-badges: - - name: Experimental - x-products: - - Core - tags: - - Transactions - summary: Request a payout request split - operationId: PostPayoutRequestSplit - x-sdk-operation-name: split - description: |- - Splits a pending payout request into two or more separate requests. - - Use this operation when the full amount cannot be processed due to amount restrictions, but a smaller amount can be processed. - For example, if a payout request for `$4,000` cannot be processed, but `$3,000` can be processed, split the request into two. This allows you to approve and process `$3,000` instead of blocking the entire request. - - Provide an array of at least two amounts; one new payout request is created per amount. - The sum of the amounts must equal the original payout request amount. - The original request transitions to the `split` status. - This operation returns the newly created payout requests. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PayoutRequestSplit' - description: Payout request split parameters. - required: true - responses: - '201': - description: Payout requests created by the split operation. - headers: - Location: - $ref: '#/components/headers/Location' - X-RateLimit-Limit: - $ref: '#/components/headers/X-RateLimit-Limit' - X-RateLimit-Remaining: - $ref: '#/components/headers/X-RateLimit-Remaining' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PayoutRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '404': - $ref: '#/components/responses/NotFound' - '409': - $ref: '#/components/responses/Conflict' - '422': - $ref: '#/components/responses/ValidationError' - '429': - $ref: '#/components/responses/TooManyRequests' /payout-requests/{id}/payment-instruments: parameters: - $ref: '#/components/parameters/resourceId' @@ -21763,6 +21667,100 @@ paths: $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' + /payout-request-splits: + post: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Create a payout request split + operationId: PostPayoutRequestSplit + x-sdk-operation-name: create + description: |- + Splits a payout request that is in `pending`, `ready`, or `approved` status into two or more separate requests. + + Use this operation when the full amount cannot be processed due to amount restrictions, but a smaller amount can be processed. + For example, if a payout request for `$4,000` cannot be processed, but `$3,000` can be processed, split the request into two. This allows you to approve and process `$3,000` instead of blocking the entire request. + + Provide an array of at least two amounts; one new payout request is created per amount. + The sum of the amounts must equal the original payout request amount. + Each new payout request is created in `pending` status. + The original request transitions to the `split` status. + This operation returns the newly created payout requests. + requestBody: + content: + application/json: + schema: + type: object + properties: + payoutRequestId: + type: string + description: ID of the payout request to split. + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + amounts: + description: |- + Amounts for each new payout request. + One request is created per amount. + Provide at least two amounts. + Each amount must be greater than zero. + The sum must equal the original payout request amount. + type: array + minItems: 2 + maxItems: 100 + items: + type: number + format: double + x-type: Money + exclusiveMinimum: 0 + example: + - 50 + - 30 + - 20 + splitReason: + $ref: '#/components/schemas/PayoutRequestSplitReason' + splitDescription: + description: Additional description for splitting the payout request. + type: + - string + - 'null' + maxLength: 255 + required: + - payoutRequestId + - amounts + - splitReason + description: Payout request split resource. + required: true + responses: + '201': + description: Payout requests created by the split operation. + headers: + Location: + $ref: '#/components/headers/Location' + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PayoutRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' /payout-request-allocations: get: x-badges: @@ -21795,16 +21793,7 @@ paths: schema: type: array items: - allOf: - - $ref: '#/components/schemas/PayoutRequestAllocation' - - type: object - properties: - exposureAmount: - description: Total approved sales and captures minus approved payouts for the customer, gateway account, and payment instrument, in the allocation currency. - readOnly: true - type: number - format: double - example: 2 + $ref: '#/components/schemas/PayoutRequestAllocation' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -22039,6 +22028,8 @@ paths: Only allocations with status `pending` are processed. Each allocation is processed by creating a transaction. + Rejects the request without queueing allocations when any allocation uses an inactive gateway account + or a gateway account with payout instruction `none`. requestBody: content: application/json: @@ -22089,6 +22080,7 @@ paths: parameters: - $ref: '#/components/parameters/collectionLimit' - $ref: '#/components/parameters/collectionOffset' + - $ref: '#/components/parameters/collectionQuery' - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' responses: @@ -22293,6 +22285,36 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' + delete: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Delete a payout request batch + operationId: DeletePayoutRequestBatch + x-sdk-operation-name: delete + description: |- + Deletes a payout request batch with a specified ID and clears the `batchId` field from every payout request in the batch. + This operation preserves every payout request, status, and blocked state. + This operation is atomic. It clears all `batchId` fields or leaves them all unchanged. + responses: + '204': + description: Payout request batch deleted. + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' /payout-request-batches/{id}/auto-allocate: parameters: - $ref: '#/components/parameters/resourceId' @@ -22433,6 +22455,225 @@ paths: $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' + /payout-request-batches/{id}/payout-requests: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Add requests to a payout request batch + operationId: PostPayoutRequestsToBatch + x-sdk-operation-name: addPayoutRequests + description: |- + Adds payout requests to a batch with a specified ID. + Accepts payout requests in any status, with or without allocations. + A batch contains a maximum of 1000 payout requests. + + Provide exactly one of the following fields: + - `payoutRequestIds` to add specific payout requests. + - `filter` to add payout requests that match the filter when the operation runs. + + If any explicitly specified payout request is already associated with a batch, + the operation returns a `409 Conflict` response. + Filter results exclude payout requests that are already associated with a batch. + If more payout requests match the filter than the batch can contain, + the operation adds only the oldest matching requests up to the batch limit, + sorted by creation time. + If adding explicitly specified payout requests would increase the batch to more than 1000 requests, + the operation returns a `409 Conflict` response. + If the batch has reached its payout request limit, + the operation returns a `409 Conflict` response for either selection method. + This operation is atomic. If a conflict occurs, the operation adds no payout requests to the batch. + requestBody: + required: true + description: Selection of payout requests to add to the batch. + content: + application/json: + schema: + type: object + oneOf: + - title: Explicit IDs + additionalProperties: false + required: + - payoutRequestIds + properties: + payoutRequestIds: + description: IDs of the payout requests to add to the batch. + type: array + minItems: 1 + maxItems: 1000 + uniqueItems: true + items: + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + - title: Filter-based + additionalProperties: false + required: + - filter + properties: + filter: + description: |- + Filter string that selects payout requests to add to the batch. + This field uses the same format as filter parameters for collections. + Use semicolons to separate multiple filter conditions. + + Available fields for filtering: `id`, `status`, `websiteId`, `customerId`, `currency`, `amount`, `createdTime`, `updatedTime`. + + This operation ignores a `batchId` filter. + Filter results always exclude payout requests that are already associated with a batch. + If the filter matches more payout requests than the batch can contain, + the operation adds only the oldest matching requests up to the batch limit, + sorted by creation time. + type: string + minLength: 1 + example: status:pending;websiteId:ws_0YVDMDE2BMC6KBB5MX76RF6T80 + responses: + '200': + description: Payout requests added to the batch. + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestBatch' + '400': + description: Invalid filter provided or no payout requests match the filter. + content: + application/json: + schema: + $ref: '#/components/schemas/Problem' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + description: Batch limit reached or would be exceeded, or one or more explicitly specified payout requests are already associated with a batch. + content: + application/json: + schema: + $ref: '#/components/schemas/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /payout-request-batches/{id}/payout-requests/remove: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Remove requests from a payout request batch + operationId: PostRemovePayoutRequestsFromBatch + x-sdk-operation-name: removePayoutRequests + description: |- + Removes specified payout requests from a batch with a specified ID by clearing `batchId` on each request. + This operation preserves each payout request, status, and blocked state. + Removes requests regardless of status or allocations. + + This operation is atomic. + If any payout request is not associated with the specified batch, + the operation clears no associations with the batch. + requestBody: + required: true + description: Payout requests to remove from the batch. + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - payoutRequestIds + properties: + payoutRequestIds: + description: IDs of the payout requests to remove from the batch. + type: array + minItems: 1 + maxItems: 1000 + uniqueItems: true + items: + type: string + maxLength: 50 + example: pout_req_0YVDMDE2BMC6KBB5MX76RF6T80 + responses: + '200': + description: Payout requests removed from the batch. + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestBatch' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '409': + description: One or more payout requests are not associated with the specified batch. + content: + application/json: + schema: + $ref: '#/components/schemas/Conflict' + '422': + $ref: '#/components/responses/ValidationError' + '429': + $ref: '#/components/responses/TooManyRequests' + /payout-request-batches/{id}/unblock: + parameters: + - $ref: '#/components/parameters/resourceId' + post: + x-badges: + - name: Experimental + x-products: + - Core + tags: + - Transactions + summary: Unblock payout requests in a batch + operationId: PostPayoutRequestBatchUnblock + x-sdk-operation-name: unblock + description: |- + Unblocks every blocked payout request in a batch with a specified ID. + Leaves payout requests without a block unchanged. + Processes all requests in the batch, up to the 1000-request batch limit, without changing batch membership. + This operation is atomic. + responses: + '200': + description: Payout requests in the batch unblocked. + headers: + X-RateLimit-Limit: + $ref: '#/components/headers/X-RateLimit-Limit' + X-RateLimit-Remaining: + $ref: '#/components/headers/X-RateLimit-Remaining' + content: + application/json: + schema: + $ref: '#/components/schemas/PayoutRequestBatch' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '429': + $ref: '#/components/responses/TooManyRequests' /payout-request-batches/preview: get: x-badges: @@ -24570,7 +24811,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' '422': - $ref: '#/components/responses/ValidationError' + $ref: '#/components/responses/DataExportValidationError' '429': $ref: '#/components/responses/TooManyRequests' x-codeSamples: @@ -24774,7 +25015,7 @@ paths: '403': $ref: '#/components/responses/Forbidden' '422': - $ref: '#/components/responses/ValidationError' + $ref: '#/components/responses/DataExportValidationError' '429': $ref: '#/components/responses/TooManyRequests' x-codeSamples: @@ -25301,6 +25542,74 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' + /experimental/reports/aml-audit-reports: + get: + x-badges: + - name: Experimental + x-products: + - Reports + tags: + - Reports + summary: Retrieve an AML audit report + operationId: GetAmlAuditReport + x-sdk-operation-name: getAmlAuditReport + description: |- + Retrieves an Anti-Money Laundering (AML) audit report for a person with a specified ID. + The maximum reporting period is 180 days. + + The report includes linked customers, screening summary metrics, screening history, and related transactions for the selected period. + + Use the `Accept` header to select the response format: `application/json` (default), `application/pdf`, or `text/csv`. + + Each section of the report includes at most 10,000 records, and the `truncated` property is `true` when a section reaches that limit. + parameters: + - name: personId + in: query + required: true + description: ID of the person for the report. + schema: + type: string + maxLength: 50 + - name: periodStart + in: query + description: |- + Date and time when the report starts. + If this value is not provided or is `null`, the report starts 90 days before the current date and time at midnight utc. + schema: + type: string + format: date-time + - name: periodEnd + in: query + description: |- + Date and time when the report ends. + If this value is not provided or is `null`, the report ends at the current date and time. + schema: + type: string + format: date-time + - $ref: '#/components/parameters/collectionFilter' + - $ref: '#/components/parameters/mediaTypeJsonPdfCsv' + responses: + '200': + description: Report retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/ReportAmlAuditReport' + application/pdf: + schema: + type: string + format: binary + text/csv: + schema: + type: string + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' /experimental/reports/cumulative-subscriptions: get: x-badges: @@ -27231,11 +27540,15 @@ paths: summary: Retrieve a time series transactions report operationId: GetTimeSeriesTransactionReport x-sdk-operation-name: getTimeSeriesTransaction - description: Retrieves a transactions report that is aggregated by time periods. + description: |- + Retrieves a report of sale and capture transactions, with one row for each day of the period. + Each row holds an aggregation of every transaction of the day, + and a breakdown of that day by the `subaggregate` field. + Transactions occur on the day of the `processedTime` value. parameters: - name: type in: query - description: Type of report aggregation. + description: Aggregate the transactions of each day by count, sum of amounts, approval rate, or incomplete rate. schema: type: string default: count @@ -27246,7 +27559,7 @@ paths: - incomplete-rate - name: subaggregate in: query - description: Report subaggregate. + description: Group the transactions of each day by this field, one subaggregate for each value. schema: type: string default: gateway-account @@ -28204,40 +28517,6 @@ paths: '404': $ref: '#/components/responses/NotFound' /storefront/kyc-documents: - get: - x-products: - - Storefront - tags: - - Storefront KYC documents - summary: Retrieve KYC documents - operationId: StorefrontGetKycDocumentCollection - x-sdk-operation-name: getAll - security: - - CustomerJWT: [] - description: Retrieves a list of KYC documents. - parameters: - - $ref: '#/components/parameters/collectionLimit' - - $ref: '#/components/parameters/collectionOffset' - responses: - '200': - description: List of KYC documents retrieved. - headers: - Pagination-Total: - $ref: '#/components/headers/Pagination-Total' - Pagination-Limit: - $ref: '#/components/headers/Pagination-Limit' - Pagination-Offset: - $ref: '#/components/headers/Pagination-Offset' - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/StorefrontKycDocument' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' post: x-products: - Storefront @@ -28389,7 +28668,6 @@ paths: requestBody: $ref: '#/components/requestBodies/PostKycLivenessSession' description: KYC request resource. - required: true responses: '201': description: KYC liveness session created. @@ -28553,7 +28831,7 @@ paths: x-sdk-operation-name: getAll security: - CustomerJWT: [] - description: Retrieve a list of orders. + description: Retrieves a list of orders. parameters: - $ref: '#/components/parameters/collectionFilter' - $ref: '#/components/parameters/collectionSort' @@ -28596,7 +28874,7 @@ paths: - CustomerJWT: [] parameters: - $ref: '#/components/parameters/collectionExpand' - description: Retrieve an order with a specified ID. + description: Retrieves an order with a specified ID. responses: '200': description: Order retrieved. @@ -28774,6 +29052,8 @@ paths: $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '409': + $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/ValidationError' '429': @@ -28793,6 +29073,7 @@ paths: - CustomerJWT: [] description: |- Creates a quote for requested reactivation. + The quote invoice includes items from outstanding unpaid and past-due invoices for the related order. This operation applies the requested reactivation to the subscription when the quote invoice is paid. requestBody: content: @@ -29594,6 +29875,8 @@ paths: $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' + '422': + $ref: '#/components/responses/ValidationError' '429': $ref: '#/components/responses/TooManyRequests' /storefront/quotes/{id}/reject: @@ -32280,6 +32563,45 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + transaction-partially-refunded: + post: + summary: Transaction partially refunded + operationId: transaction-partially-refunded + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + transaction-refunded: + post: + summary: Transaction refunded + operationId: transaction-refunded + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. + transaction-voided: + post: + summary: Transaction voided + operationId: transaction-voided + x-products: + - Core + tags: + - Transactions + requestBody: + $ref: '#/components/requestBodies/TransactionWithChildWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. transaction-timeout-resolved: post: summary: Transaction timeout resolved @@ -32345,6 +32667,19 @@ webhooks: responses: 2xx: description: Returns any 2xx status to indicate that data is received. + data-export-failed: + post: + summary: Data export failed + operationId: data-export-failed + x-products: + - Reports + tags: + - Data exports + requestBody: + $ref: '#/components/requestBodies/DataExportWebhook' + responses: + 2xx: + description: Returns any 2xx status to indicate that data is received. order-delinquency-reached: post: summary: Order delinquency time reached @@ -32434,7 +32769,9 @@ components: collectionLimit: name: limit in: query - description: Limits the number of collection items to be returned. + description: |- + Limit the number of collection items to be returned. + Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`. schema: type: integer minimum: 0 @@ -32588,6 +32925,17 @@ components: type: string maxLength: 50 pattern: ^[@~\-\.\w]+$ + invoiceCollectionLimit: + name: limit + in: query + description: |- + Limit the number of invoices to return. + Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`. + Cap values greater than `100` at `100`. + schema: + type: integer + minimum: 0 + maximum: 100 mediaTypeJsonPdf: name: Accept in: header @@ -32649,7 +32997,7 @@ components: required: true schema: type: string - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ customerId: name: customerId in: path @@ -32729,6 +33077,17 @@ components: description: Criteria parameter for requesting a collection. schema: type: string + mediaTypeJsonPdfCsv: + name: Accept + in: header + description: Type of response media. + schema: + type: string + enum: + - application/json + - application/pdf + - text/csv + default: application/json storefrontCustomFieldResource: name: resource in: path @@ -32743,7 +33102,9 @@ components: - transactions headers: Pagination-Total: - description: Total number of items. + description: |- + Total number of items that match the request. + The value is independent of `limit`, including when `limit` is `0`. schema: type: integer example: 332 @@ -33479,7 +33840,7 @@ components: Tag names are not case-sensitive. type: string maxLength: 255 - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ example: New type: description: |- @@ -33945,6 +34306,7 @@ components: description: Linked object type. type: string enum: + - credit-memo-timeline-comment - customer - customer-timeline-comment - dispute @@ -33954,8 +34316,10 @@ components: - order-timeline-comment - organization - payment + - payout-request-timeline-comment - plan - product + - quote-timeline-comment - subscription - transaction - transaction-timeline-comment @@ -34188,7 +34552,6 @@ components: - PostFile - StorefrontGetAccount - StorefrontGetWebsite - - StorefrontGetKycDocumentCollection - StorefrontGetKycDocument - StorefrontPostKycDocument Acl: @@ -35467,32 +35830,6 @@ components: For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id). maxLength: 50 example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG - VaultedInstrument: - title: Vaulted payment instrument - description: |- - Vaulted payment instrument. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - required: - - method - - paymentInstrumentId - properties: - method: - description: |- - Payment method supported vault. - For more information, see [Payment instrument](https://www.rebilly.com/catalog/all/payment-instruments). - type: string - enum: - - payment-card - - ach - - paypal - paymentInstrumentId: - type: string - description: ID of the payment instrument. - maxLength: 50 - example: inst_0YVB8KPKNXCBR9EDX7JHSED75N PaymentMethod: type: string description: Payment method. @@ -35637,6 +35974,7 @@ components: - Perfect-money - Piastrix - PIX + - PIX-Automatico - PinPay - phone - PhonePe @@ -35695,78 +36033,6 @@ components: - Zotapay - Zimpler - Zip - AlternativePaymentInstrument: - title: Alternative instrument - description: |- - Alternative payment method instrument. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - allOf: - - $ref: '#/components/schemas/PaymentMethod' - - not: - enum: - - payment-card - - ach - - paypal - - cash - - check - paymentInstrumentId: - type: string - description: ID of the payment instrument. - maxLength: 50 - example: inst_0YVB8KPKNXCBR9EDX7JHSED75N - reference: - description: |- - Reference data. - This field is available only for the `bank-transfer` payment method. - type: - - string - - 'null' - CashInstrument: - title: Cash - description: |- - Cash payment instrument object. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - type: string - enum: - - cash - receivedBy: - description: Individual or entity that received the payment. - type: string - CheckInstrument: - title: Check - description: |- - Check payment instrument object. - - To use this payment instrument for automatic subscription renewals, - and for transactions when no specific payment instrument is provided by the user, - set this as the default payment instrument. - type: object - required: - - method - properties: - method: - type: string - enum: - - check - reference: - description: Reference data. - type: string ResourceCustomFields: description: |- Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. @@ -36203,18 +36469,42 @@ components: writeOnly: true description: |- Write-only payment token. - If supplied, the token is converted into a payment instrument and set as the `defaultPaymentInstrument` value. - If both are supplied, the value of this property overrides the `defaultPaymentInstrument` value. - The token expires after first use. + If supplied, the token is converted into a payment instrument, and its ID is assigned to `defaultPaymentInstrumentId` value. + The value of this property overrides the `defaultPaymentInstrumentId` if both are supplied. + This token may only be used once before it expires. defaultPaymentInstrument: type: - object - 'null' - oneOf: - - $ref: '#/components/schemas/VaultedInstrument' - - $ref: '#/components/schemas/AlternativePaymentInstrument' - - $ref: '#/components/schemas/CashInstrument' - - $ref: '#/components/schemas/CheckInstrument' + description: |- + Default payment instrument of the customer. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + readOnly: true + required: + - method + - paymentInstrumentId + properties: + method: + $ref: '#/components/schemas/PaymentMethod' + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + defaultPaymentInstrumentId: + type: + - string + - 'null' + description: |- + ID of the customer's default payment instrument. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + writeOnly: true preferredPayoutInstrumentId: type: - string @@ -36319,7 +36609,10 @@ components: example: prs_0YV7DDSDD1C8DA64KHH2W33CPF notificationEmails: type: array - description: Additional email addresses for notification delivery. + description: |- + Email addresses for notification delivery in event-based email notifications. + When you configure event-based email notifications, you can send to these addresses, the customer's primary email address, or another email address you specify. + For more information, see [Manage notification emails](https://www.rebilly.com/docs/data-tables/manage-customer-information#manage-notification-emails). items: type: string format: email @@ -36699,6 +36992,8 @@ components: - quote-rejected - quote-updated - refund-was-reflected-in-invoices + - subscription-pause-created + - subscription-pause-revoked - subscription-paused - subscription-resumed - subscription-trial-end-changed @@ -36710,6 +37005,7 @@ components: - transaction-discrepancy-found - transaction-disputed - transaction-reconciled + - transaction-partially-refunded - transaction-refunded - transaction-voided - transaction-waiting-gateway @@ -37912,11 +38208,6 @@ components: maxLength: 50 readOnly: true example: sub_01HRF27SATGE4Z6PBJE6PD8328 - discountAmount: - description: Discount amount applied to the invoice item. - type: number - format: double - readOnly: true periodStartTime: description: Date and time when the billing period starts. type: @@ -38095,6 +38386,7 @@ components: - iCheque - iDebit - Ilixium + - IMerchant - Ingenico - INOVAPAY - Inovio @@ -38157,6 +38449,7 @@ components: - PayEcards - Payeezy - Payflow + - PayGlocal - Paynote - PaymentAsia - PaymenTechnologies @@ -38382,6 +38675,7 @@ components: - PayCash - PayClub - PayEcards + - PayGlocal - PaymentAsia - PaymenTechnologies - PaymentsOS @@ -38450,6 +38744,104 @@ components: - XPay - Zimpler - Zotapay + VaultedInstrument: + title: Vaulted payment instrument + description: |- + Vaulted payment instrument. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + required: + - method + - paymentInstrumentId + properties: + method: + description: |- + Payment method supported vault. + For more information, see [Payment instrument](https://www.rebilly.com/catalog/all/payment-instruments). + type: string + enum: + - payment-card + - ach + - paypal + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + AlternativePaymentInstrument: + title: Alternative instrument + description: |- + Alternative payment method instrument. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + allOf: + - $ref: '#/components/schemas/PaymentMethod' + - not: + enum: + - payment-card + - ach + - paypal + - cash + - check + paymentInstrumentId: + type: string + description: ID of the payment instrument. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + reference: + description: |- + Reference data. + This field is available only for the `bank-transfer` payment method. + type: + - string + - 'null' + CashInstrument: + title: Cash + description: |- + Cash payment instrument object. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + type: string + enum: + - cash + receivedBy: + description: Individual or entity that received the payment. + type: string + CheckInstrument: + title: Check + description: |- + Check payment instrument object. + + To use this payment instrument for automatic subscription renewals, + and for transactions when no specific payment instrument is provided by the user, + set this as the default payment instrument. + type: object + required: + - method + properties: + method: + type: string + enum: + - check + reference: + description: Reference data. + type: string MoneyAmount: type: number format: double @@ -40164,8 +40556,9 @@ components: maxLength: 50 example: in_0YVF9605RKC62BP14NE2R7V2XT currency: - $ref: '#/components/schemas/CurrencyCode' readOnly: true + allOf: + - $ref: '#/components/schemas/CurrencyCode' appliedCreditMemos: type: array readOnly: true @@ -40233,6 +40626,7 @@ components: - transaction-canceled - transaction-declined - transaction-initiated + - transaction-partially-refunded - transaction-refunded - transaction-voided triggeredBy: @@ -41055,8 +41449,8 @@ components: - 3 default: 2 x-enumDescriptions: - '1': Strict verification requirements. This option is used for credit transactions. - '2': Moderate verification requirements. This option is used for sale transactions. + '1': Moderate verification requirements. This option is used for sale transactions. + '2': Strict verification requirements. This option is used for credit transactions. '3': Basic verification requirements. This option is used when a high level of verification is not required. KycRequest: type: object @@ -41195,6 +41589,7 @@ components: enum: - document-unreadable - document-expired + - document-was-valid-but-expired - document-not-matching - document-duplicate - document-invalid @@ -41206,6 +41601,7 @@ components: - subtype-missing - dob-mismatch - name-mismatch + - name-and-dob-mismatch - critical-info-missing - old-address-on-id - tampered-document @@ -41226,6 +41622,11 @@ components: type: string maxLength: 255 example: Provided document is unreadable + KycDocumentMatchesVersion: + type: string + description: Version of the document matches. + readOnly: true + example: '2.0' KycDocumentMatchesScore: type: integer description: Calculated score that represents the percentage of confidence that this ID document represents the customer. @@ -41246,6 +41647,7 @@ components: - dateIsInvalid - dateOfBirth - decision + - documentNumber - documentSubtype - expirationDate - firstName @@ -41254,6 +41656,8 @@ components: - isIdentityDocument - isPublishedOnline - isTampered + - issuanceCountry + - issuanceRegion - issueDate - lastName - line1 @@ -41537,6 +41941,21 @@ components: minimum: 0 maximum: 100 description: Weight added when MRZ check digits fail validation. + documentNumber: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if a document number is not detected on the document. + issuanceCountry: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if the country that issued the document is not detected. + issuanceRegion: + type: integer + minimum: 0 + maximum: 100 + description: Weight added if the region, state, province, or territory that issued the document is not detected. thresholds: type: object description: Pass and fail threshold definition for the document verification process. @@ -41733,6 +42152,8 @@ components: readOnly: true description: Proof of identity document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -41746,6 +42167,8 @@ components: readOnly: true description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -41852,8 +42275,8 @@ components: type: - string - 'null' - format: date - example: '2021-01-01' + format: date-time + example: '2021-01-01T00:00:00+00:00' phone: description: Phone number of the company or agency that issued the document. type: @@ -42082,6 +42505,8 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -42094,6 +42519,8 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' score: $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: @@ -42298,6 +42725,12 @@ components: readOnly: true description: Proof of funds document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/FundsMatches' parsedData: @@ -42305,7 +42738,14 @@ components: - object - 'null' readOnly: true + description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/FundsMatches' _links: @@ -42508,6 +42948,12 @@ components: readOnly: true description: Proof of purchase document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/PurchaseMatches' parsedData: @@ -42517,6 +42963,12 @@ components: readOnly: true description: Parsed data. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/PurchaseMatches' _links: @@ -42849,10 +43301,29 @@ components: - 'null' readOnly: true properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' + checkList: + $ref: '#/components/schemas/KycDocumentCheckList' data: $ref: '#/components/schemas/CreditFileMatches' + parsedData: + type: + - object + - 'null' + readOnly: true + description: Parsed data. + properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + score: + $ref: '#/components/schemas/KycDocumentMatchesScore' checkList: $ref: '#/components/schemas/KycDocumentCheckList' + data: + $ref: '#/components/schemas/CreditFileMatches' _links: type: array description: Related links. @@ -42897,6 +43368,74 @@ components: - $ref: '#/components/schemas/ProofOfFundsKycDocument' - $ref: '#/components/schemas/ProofOfPurchaseKycDocument' - $ref: '#/components/schemas/ProofOfCreditFileKycDocument' + KycIdentityMatchesOverwrite: + type: object + description: Request body for overwriting identity KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `identity-proof`. + type: string + enum: + - identity-proof + example: identity-proof + - $ref: '#/components/schemas/KycIdentityMatches' + KycAddressMatchesOverwrite: + type: object + description: Request body for overwriting address KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `address-proof`. + type: string + enum: + - address-proof + example: address-proof + - $ref: '#/components/schemas/KycAddressMatches' + KycPurchaseMatchesOverwrite: + type: object + description: Request body for overwriting purchase KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `purchase-proof`. + type: string + enum: + - purchase-proof + example: purchase-proof + - $ref: '#/components/schemas/PurchaseMatches' + KycFundsMatchesOverwrite: + type: object + description: Request body for overwriting funds KYC document matches. + allOf: + - type: object + required: + - type + properties: + type: + description: |- + Type of KYC document matches. + This value identifies the document match type as `funds-proof`. + type: string + enum: + - funds-proof + example: funds-proof + - $ref: '#/components/schemas/FundsMatches' KycSettings: type: object description: Settings for KYC score calculation. @@ -43065,6 +43604,13 @@ components: description: Bank name of the payment instrument. type: string readOnly: true + isPayoutable: + description: |- + Specifies if payouts are supported for cards with this BIN. + Defaults to `true`. + This value is `false` if the BIN does not support payouts. + type: boolean + readOnly: true billingAddress: description: Contact's billing address. $ref: '#/components/schemas/ContactObject' @@ -43588,6 +44134,7 @@ components: - Perfect-money - Piastrix - PIX + - PIX-Automatico - plaid-account - PayTabs - Paysafecard @@ -43891,7 +44438,7 @@ components: Yandex-money: '#/components/schemas/AlternativeInstrument' Zotapay: '#/components/schemas/AlternativeInstrument' Zimpler: '#/components/schemas/AlternativeInstrument' - anyOf: + oneOf: - $ref: '#/components/schemas/PaymentCard' - $ref: '#/components/schemas/BankAccount' - $ref: '#/components/schemas/PayPalAccount' @@ -44631,8 +45178,17 @@ components: Compare this value with materialized subscription item revision values. isTrialOnly: type: boolean + const: false description: Specifies if a plan is a trial that does not have recurring instructions. readOnly: true + recurringInterval: + type: 'null' + description: Service interval settings. + readOnly: true + trial: + type: 'null' + description: Trial configuration setting. + readOnly: true createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -44813,6 +45369,7 @@ components: - currency - productId - pricing + - recurringInterval properties: name: description: |- @@ -44871,12 +45428,11 @@ components: Compare this value with materialized subscription item revision values. isTrialOnly: type: boolean + const: false description: Specifies if a plan is a trial that does not have recurring instructions. readOnly: true recurringInterval: - description: |- - Service interval settings. - For a one-time sale, set this value to `null`. + description: Service interval settings. type: object required: - unit @@ -44957,6 +45513,15 @@ components: - 'null' format: float minimum: 0.01 + sticky: + description: |- + When enabled, if no usage is reported during a service period, + the plan bills the last known reported quantity from a previous period instead of zero. + This is suitable for hosted or persistent resources whose usage does not change every period. + Only supported with `strategy`: `last`. + type: boolean + default: false + example: false invoiceTimeShift: readOnly: true deprecated: true @@ -45049,8 +45614,13 @@ components: Compare this value with materialized subscription item revision values. isTrialOnly: type: boolean + const: true description: Specifies if a plan is a trial that does not have recurring instructions. readOnly: true + recurringInterval: + type: 'null' + description: Service interval settings. + readOnly: true trial: description: Trial configuration settings. $ref: '#/components/schemas/PlanTrial' @@ -45084,7 +45654,7 @@ components: - self - attachments Plan: - anyOf: + oneOf: - allOf: - type: object required: @@ -45220,12 +45790,13 @@ components: To create a new plan, see [Create a plan](https://www.rebilly.com/catalog/all/plans/postplan). required: - id + additionalProperties: false properties: id: description: ID of the plan. $ref: '#/components/schemas/ResourceId' FlexiblePlan: - anyOf: + oneOf: - allOf: - type: object required: @@ -45271,7 +45842,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is triggered. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -45303,6 +45878,10 @@ components: When the total usage reaches the hard limit quantity, or amount values, metered billing plan usages can no longer be reported. + Plans with a minimum quantity, fixed fee, or flat stairstep bracket set a minimum billable quantity and amount. + A `quantity` value below the minimum billable quantity is invalid. + An `amount` value below the minimum billable amount is invalid. + A `0` value remains valid even on plans with minimum billing. minProperties: 1 maxProperties: 1 properties: @@ -45332,6 +45911,7 @@ components: type: object required: - plan + - type properties: id: description: ID of the quote item. @@ -45352,6 +45932,15 @@ components: default: 1 minimum: 0 maximum: 1000000000 + quantityFilled: + description: |- + Number of filled product units. + This field is not used for metered billing plans. + type: + - number + - 'null' + format: double + example: 5.125 plan: description: Plan details. oneOf: @@ -45384,6 +45973,7 @@ components: type: object required: - plan + - type properties: id: description: ID of the quote item. @@ -45848,6 +46438,8 @@ components: description: |- Type of the quote. When a quote is accepted, quote items and settings are applied to the related order. + Change quotes can only be created for orders with `active` or `trial-ended` status. + For `trial-ended` orders, use this quote type to convert a trial-only order to a regular recurring order. type: string enum: - change @@ -45934,16 +46526,39 @@ components: items: $ref: '#/components/schemas/QuoteItem' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + Policy for managing service periods and trial state of the related order when the quote is accepted. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` flag is ignored unless `retain` is used, or this field is omitted. + If this field is omitted, this value defaults to `retainRecurring`. + If this field is omitted and `keepTrial` is `true`, `renewalPolicy` is set to `retainTrialThenRecurring`. type: string - default: retain + default: retainRecurring enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring` or `retainTrialThenRecurring` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring` or `retainTrialThenRecurring`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period length. type: boolean effectiveTime: @@ -45955,9 +46570,14 @@ components: - 'null' format: date-time keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`, or omitted. + If `renewalPolicy` is omitted and this field is `true`, `renewalPolicy` is set to `retainTrialThenRecurring`. type: boolean default: false interimOnly: @@ -46006,7 +46626,11 @@ components: or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -46428,8 +47052,20 @@ components: If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at `paymentInstrumentId`, or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. + includeUnpaidInvoices: + type: boolean + default: false + example: false + description: |- + Specifies whether the quote invoice includes items from outstanding unpaid and past-due invoices for the related order. + When this value is `true`, the quote invoice includes charges for eligible items from those invoices. + When the quote is accepted, only invoices included in the quote that remain unpaid or past due and can be voided are voided. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -46746,6 +47382,7 @@ components: - quote-updated - quote-expired - quote-order-attached + - timeline-comment-created triggeredBy: description: Specifies who, or what, triggered the timeline message. type: string @@ -46840,6 +47477,13 @@ components: type: string pattern: ^[A-Z]{2}$ example: US + DigitalWalletCountry: + description: |- + ISO 3166 alpha-2 country code where the payment is processed. + This is often the location for settling the payment. + Consult with your Payment Service Provider (PSP) to determine the + appropriate country code. + $ref: '#/components/schemas/Country' ApplePayFeature: type: object title: Apple Pay Digital Wallet @@ -46857,7 +47501,7 @@ components: type: string example: Test Merchant country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' GooglePayFeature: type: object title: Google Pay Digital Wallet @@ -46878,7 +47522,7 @@ components: type: string example: www.example.com country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' SamsungPayFeature: type: object title: Samsung Pay Digital Wallet @@ -47284,7 +47928,10 @@ components: readOnly: true maxLength: 50 planId: - description: ID of the plan. + description: |- + ID of the plan. + + > **Note:** This field is deprecated. Use the `plan.id` field instead. deprecated: true x-basic: true type: string @@ -47301,7 +47948,7 @@ components: format: double example: 5.125 plan: - anyOf: + oneOf: - $ref: '#/components/schemas/OriginalPlan' - $ref: '#/components/schemas/FlexiblePlan' usageLimits: @@ -47426,6 +48073,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -48202,12 +48850,6 @@ components: type: string x-basic: true const: one-time-sale - planId: - description: ID of the plan. - x-basic: true - type: string - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X productId: type: string description: ID of the related product. @@ -48305,12 +48947,6 @@ components: - 'null' readOnly: true x-sortable: true - planId: - description: ID of the plan. - x-basic: true - type: string - maxLength: 50 - example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X productId: type: string description: ID of the related product. @@ -48670,13 +49306,34 @@ components: automaticReadinessEnabled: type: boolean default: false - description: Specifies whether pending payout requests are automatically marked as ready after the pending period. + description: |- + Specifies whether pending payout requests are automatically marked as `ready`. + When this value is `false`, payout requests are created in the `ready` status and automatic transition is not used. + When this value is `true`, payout requests remain in the `pending` status until the pending period elapses and the configured transition time is reached. pendingPeriodHours: type: integer - description: Number of hours a payout request stays pending before the automatic readiness job can set it to ready. - minimum: 0 + description: |- + Minimum number of hours a payout request stays in the `pending` status before it can be automatically set to `ready`. + Required when `automaticReadinessEnabled` is `true`. + minimum: 1 maximum: 8760 - default: 48 + example: 48 + automaticReadinessTime: + description: |- + Time of day when the automatic readiness job processes eligible pending payout requests. + Required when `automaticReadinessEnabled` is `true`. + Use extended ISO-8601 time format (`HH:MM:SS`) with an optional timezone offset. + When the timezone offset is omitted, the server timezone is used. + allOf: + - $ref: '#/components/schemas/TimeIso8601Extended' + example: 10:00:00Z + automaticReadinessLastExecutedAt: + type: + - string + - 'null' + format: date-time + readOnly: true + description: Date and time when the automatic readiness job last completed successfully for this website. logoId: type: - string @@ -48790,6 +49447,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -49368,7 +50026,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -49379,9 +50037,9 @@ components: description: |- Date and time when the pause ends and the order resumes billing. - To resume a order from this point in time, + To resume an order from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the order is indefinitely paused. type: - string @@ -49678,16 +50336,41 @@ components: usageLimits: $ref: '#/components/schemas/UsageLimits' renewalPolicy: - description: Specifies if the subscription retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + How the service periods and trial state of the subscription order are managed when its items change. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` and `ignoreRecurring` are ignored unless `reset` or `retain` is used. type: string enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring + - retainTrialOnly - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + retainTrialOnly: |- + Retains the trial and keeps the item as trial-only. + Returns a validation error if the order is not trial-only. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring`, `retainTrialThenRecurring` or `retainTrialOnly`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period size. type: boolean effectiveTime: @@ -49703,16 +50386,24 @@ components: type: boolean default: false keepTrial: + deprecated: true description: |- - Specifies if the subscription order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + Deprecated. + Use the `retainTrialThenRecurring` or `retainTrialOnly` value of `renewalPolicy` instead. + + Specifies if the order must retain its active trial. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false ignoreRecurring: + deprecated: true description: |- - Specifies if the subscription order must ignore the recurring settings of items in the order. - This field is only applicable if the subscription is trial-only and the `keepTrial` value is `true`. - For more information, see [Trial-only subscription](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). + Deprecated. + Use the `retainTrialOnly` value of `renewalPolicy` instead. + + Specifies if the order must ignore the recurring settings of its items. + This field is only applicable if the order is trial-only and the `keepTrial` value is `true`. + For more information, see [Trial-only order](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). type: boolean default: false OrderChange: @@ -49745,16 +50436,41 @@ components: usageLimits: $ref: '#/components/schemas/UsageLimits' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + How the service periods and trial state of the subscription order are managed when its items change. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` and `ignoreRecurring` are ignored unless `reset` or `retain` is used. type: string enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring + - retainTrialOnly - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + retainTrialOnly: |- + Retains the trial and keeps the item as trial-only. + Returns a validation error if the order is not trial-only. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring`, `retainTrialThenRecurring`, or `retainTrialOnly` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring`, `retainTrialThenRecurring` or `retainTrialOnly`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period size. type: boolean effectiveTime: @@ -49770,13 +50486,21 @@ components: type: boolean default: false keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` or `retainTrialOnly` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false ignoreRecurring: + deprecated: true description: |- + Deprecated. + Use the `retainTrialOnly` value of `renewalPolicy` instead. + Specifies if the order must ignore the recurring settings of its items. This field is only applicable if the order is trial-only and the `keepTrial` value is `true`. For more information, see [Trial-only order](https://www.rebilly.com/docs/dev-docs/subscriptions#trial-only-subscription). @@ -49859,7 +50583,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -49872,7 +50596,7 @@ components: To resume a subscription from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the subscription is indefinitely paused. type: - string @@ -49975,7 +50699,7 @@ components: - completed - revoked x-enumDescriptions: - draft: Creates a daft cancellation so that the cancellation and charge can be previewed. + draft: Creates a draft cancellation so that the cancellation and charge can be previewed. confirmed: |- Confirms a subscription cancellation. Sets the subscription to cancel when the `churnTime` is reached. @@ -51494,7 +52218,7 @@ components: Yandex-money: '#/components/schemas/AlternativePaymentToken' Zotapay: '#/components/schemas/AlternativePaymentToken' Zimpler: '#/components/schemas/AlternativePaymentToken' - anyOf: + oneOf: - $ref: '#/components/schemas/PaymentCardToken' - $ref: '#/components/schemas/PayPalToken' - $ref: '#/components/schemas/BankAccountToken' @@ -51737,6 +52461,7 @@ components: - transaction-disputed - transaction-initiated - transaction-payment-method-changed + - transaction-partially-refunded - transaction-process-requested - transaction-processed - transaction-queried @@ -52871,6 +53596,97 @@ components: enum: - draft - archived + CoinPricingFlatRate: + title: Flat rate + description: |- + Flat-rate coin pricing that multiplies the full paid amount in minor units by `coinsPerFiatMinor`. + For example, if `coinsPerFiatMinor` is `10`, + a `$10.00` deposit credits `10,000` coins and a `$10.01` deposit credits `10,010` coins. + type: object + additionalProperties: false + required: + - formula + - coinsPerFiatMinor + properties: + formula: + type: string + description: Flat-rate formula for converting the paid fiat amount into coins. + enum: + - flat-rate + coinsPerFiatMinor: + type: integer + minimum: 1 + maximum: 1000000 + example: 10 + description: |- + Number of coins credited for each minor unit of the paid currency. + For example, a value of `10` means 10 coins for each US cent. + CoinPricingVolumeBracket: + title: Volume bracket + description: Amount range and coin rate for volume pricing. + type: object + additionalProperties: false + required: + - coinsPerFiatMinor + properties: + coinsPerFiatMinor: + type: integer + minimum: 1 + maximum: 1000000 + example: 10 + description: |- + Number of coins credited for each minor unit of the paid currency when the paid amount falls in this range. + For example, a value of `10` means 10 coins for each US cent. + maxAmount: + type: + - number + - 'null' + format: double + minimum: 0 + maximum: 9999999 + example: 50 + description: |- + Highest paid amount in this range, in major units of the currency for the deposit request. + This value is inclusive and must be exact at that currency scale for the deposit amount strategy. + A `null` value means this range has no upper limit. + CoinPricingVolume: + title: Volume + description: |- + Volume-based coin pricing that multiplies the full paid amount in minor units by `coinsPerFiatMinor` from the matching bracket. + For example, if `coinsPerFiatMinor` is `10` for amounts up to `$10.00` and `12` for amounts from `$10.01` through `$50.00`, + a `$10.00` deposit credits `10,000` coins and a `$10.01` deposit credits `12,012` coins. + type: object + additionalProperties: false + required: + - formula + - brackets + properties: + formula: + type: string + description: Volume-based formula for converting the paid fiat amount into coins. + enum: + - volume + brackets: + type: array + minItems: 1 + description: |- + Amount ranges that define the coin rate for a paid amount. + The first range matches amounts less than or equal to `maxAmount`. + Each subsequent range matches amounts greater than the previous `maxAmount` and less than or equal to the current `maxAmount`. + A final range with a `null` `maxAmount` has no upper limit. + items: + $ref: '#/components/schemas/CoinPricingVolumeBracket' + CoinPricing: + description: Formula for calculating the number of coins to credit to the coin balance based on a paid amount in fiat currency. + type: object + discriminator: + propertyName: formula + mapping: + flat-rate: '#/components/schemas/CoinPricingFlatRate' + volume: '#/components/schemas/CoinPricingVolume' + oneOf: + - $ref: '#/components/schemas/CoinPricingFlatRate' + - $ref: '#/components/schemas/CoinPricingVolume' DepositRequest: type: object required: @@ -52918,6 +53734,22 @@ components: attempted: A funds deposit transaction was attempted and declined. This is a temporary state. completed: A funds deposit transaction has been approved and completed. This is a permanent state. expired: Request expired without an approved deposit transaction. This is a permanent state. + coinPurchase: + type: boolean + deprecated: true + readOnly: true + description: |- + Specifies if the deposit is a coin purchase that credits the coin balance instead of the cash balance. + Determined by the deposit amount strategy that is applied to the deposit request. + Use the `coinPricing` field instead. + coinPricing: + readOnly: true + description: |- + Formula copied from the deposit amount strategy when the deposit request is created. + A `null` value means the deposit credits the cash balance instead of the coin balance. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' currency: $ref: '#/components/schemas/CurrencyCode' amounts: @@ -53126,7 +53958,7 @@ components: calculator: absolute baseAmount: 10 increments: [10, 20] - adjustBaseToLastDeposit: true + adjustBaseToLastDeposit: false customAmount: minimum: 1 multipleOf: 1 @@ -53276,18 +54108,6 @@ components: - 'null' maxLength: 2083 format: uri - balance: - description: Current cash balance of the customer. - type: number - format: double - minimum: 0 - example: 1500 - bonusBalance: - description: Bonus balance available to the customer. - type: number - format: double - minimum: 0 - example: 0 depositLimits: type: object writeOnly: true @@ -53323,14 +54143,6 @@ components: - 'null' maxLength: 2083 format: uri - pendingPayoutTotal: - type: number - format: double - minimum: 0 - description: |- - Sum of all payout requests that are currently in a pending state. - This value is also the maximum possible "reverse withdrawal" amount. - example: 100 Cashier: type: object required: @@ -53343,6 +54155,7 @@ components: - balance - bonusBalance - pendingPayoutTotal + - canWithdraw - notificationUrl properties: id: @@ -53371,12 +54184,14 @@ components: format: double minimum: 0 description: Customer's current balance. + readOnly: true example: 1500 bonusBalance: type: number format: double minimum: 0 description: Bonus balance available to the customer. + readOnly: true example: 0 notificationUrl: description: |- @@ -53410,7 +54225,12 @@ components: description: |- Sum of all payout requests that are currently in a pending state. This value is also the maximum possible "reverse withdrawal" amount. + readOnly: true example: 100 + canWithdraw: + type: boolean + readOnly: true + description: Specifies if the customer can initiate a withdrawal. lastDepositRequestId: type: string description: ID of the last deposit request that is made for this cashier. @@ -53587,6 +54407,28 @@ components: type: boolean description: Specifies if the deposit amount strategy is active. default: true + coinPurchase: + type: boolean + deprecated: true + description: |- + Specifies if deposits created from this strategy are coin purchases that credit the coin balance instead of the cash balance. + Use the `coinPricing` field instead. + default: false + coinPricing: + description: |- + Formula that converts the paid fiat amount into coins credited to the coin balance. + A `null` value means deposits created from this strategy credit the cash balance. + If both `coinPricing` and `coinPurchase` are provided, `coinPricing` takes precedence. + Setting a `coinPricing` object requires the Replay add-on. + For `volume`, every configured deposit amount must match a bracket, + and the last bracket has a `null` `maxAmount` when `customAmount` has a value or `adjustBaseToLastDeposit` is `true`. + For deposit amount strategies with `coinPurchase: true` and no `coinPricing`, responses include default flat-rate pricing with `coinsPerFiatMinor: 10`. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' + example: + formula: flat-rate + coinsPerFiatMinor: 10 createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -54818,10 +55660,198 @@ components: - $ref: '#/components/schemas/TaxJarCredential' - $ref: '#/components/schemas/AvalaraCredential' - $ref: '#/components/schemas/PlaidCredential' + PostSmtpCredential: + allOf: + - $ref: '#/components/schemas/SmtpCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - smtp + readOnly: false + PostWebhookCredential: + allOf: + - $ref: '#/components/schemas/WebhookCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - webhook + readOnly: false + PostExperianCredential: + allOf: + - $ref: '#/components/schemas/ExperianCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - experian + readOnly: false + PostMailgunCredential: + allOf: + - $ref: '#/components/schemas/MailgunCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - mailgun + readOnly: false + PostOAuth2Credential: + allOf: + - $ref: '#/components/schemas/OAuth2Credential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - oauth2 + readOnly: false + PostPostmarkCredential: + allOf: + - $ref: '#/components/schemas/PostmarkCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - postmark + readOnly: false + PostSendGridCredential: + allOf: + - $ref: '#/components/schemas/SendGridCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - sendgrid + readOnly: false + PostAwsSesCredential: + allOf: + - $ref: '#/components/schemas/SESCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - aws-ses + readOnly: false + PostTaxJarCredential: + allOf: + - $ref: '#/components/schemas/TaxJarCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - taxjar + readOnly: false + PostAvalaraCredential: + allOf: + - $ref: '#/components/schemas/AvalaraCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - avalara + readOnly: false + PostPlaidCredential: + allOf: + - $ref: '#/components/schemas/PlaidCredential' + - type: object + required: + - type + properties: + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - plaid + readOnly: false PatchServiceCredential: type: object required: - status + - type properties: status: description: Status of the credential. @@ -54834,9 +55864,28 @@ components: active: Credential is active and can be used. inactive: Credential is temporarily inactivated and cannot be used until reactivated. deactivated: Credential is permanently deactivated and cannot be reactivated. + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - smtp + - webhook + - mailgun + - sendgrid + - aws-ses + - oauth2 + - postmark + - experian + - avalara PatchPlaidCredential: type: object description: Plaid credential. + required: + - type properties: status: description: Status of the credential. @@ -54872,11 +55921,21 @@ components: This setting enables the creation of Stripe bank account tokens. default: false example: true + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - plaid PatchTaxJarCredential: type: object description: TaxJar credential. required: - status + - type properties: status: description: Status of the credential. @@ -54895,6 +55954,15 @@ components: Specifies if `from_` address fields must be omitted in TaxJar request. For more information, see [TaxJar API guide](https://developers.taxjar.com/api/guides/#when-to-use-from_-address-information). example: false + type: + description: |- + Type of the credential. + Value that matches the `{type}` path parameter. + For backward compatibility, when this field is absent, + the `{type}` path parameter supplies the credential type. + type: string + enum: + - taxjar GoogleSpreadsheet: type: object properties: @@ -55799,7 +56867,7 @@ components: Yandex-money: '#/components/schemas/AdjustReadyToPayoutGeneric' Zotapay: '#/components/schemas/AdjustReadyToPayoutGeneric' Zimpler: '#/components/schemas/AdjustReadyToPayoutGeneric' - anyOf: + oneOf: - $ref: '#/components/schemas/AdjustReadyToPayoutGeneric' RuleActionAdjustReadyToPayout: allOf: @@ -57036,6 +58104,7 @@ components: ICEPAY: '#/components/schemas/ICEPAY' INOVAPAY: '#/components/schemas/INOVAPAY' Ilixium: '#/components/schemas/Ilixium' + IMerchant: '#/components/schemas/IMerchant' Ingenico: '#/components/schemas/Ingenico' Inovio: '#/components/schemas/Inovio' InstaDebit: '#/components/schemas/InstaDebit' @@ -57099,6 +58168,7 @@ components: PayPal: '#/components/schemas/PayPal' Payeezy: '#/components/schemas/Payeezy' Payflow: '#/components/schemas/Payflow' + PayGlocal: '#/components/schemas/PayGlocal' PaymentAsia: '#/components/schemas/PaymentAsia' PaymenTechnologies: '#/components/schemas/PaymenTechnologies' PaymentsOS: '#/components/schemas/PaymentsOS' @@ -57375,6 +58445,16 @@ components: The customer must have a previously approved transaction, in the same currency, on this gateway. none: Do not allow any payouts with this gateway. This is the default value, merchants must opt into payouts. + payoutLimits: + description: |- + Payout limits for the gateway account applied during payout request auto-allocation. + These limits do not apply to manual allocations. + + This field is distinct from deposit and sale + [volume limits](https://www.rebilly.com/catalog/all/gateway-accounts/getgatewayaccountlimitcollection/). + oneOf: + - $ref: '#/components/schemas/GatewayAccountPayoutLimits' + - type: 'null' transactionEmailAliasTemplate: description: |- Email address template used in place of a customer's real email address when sending transaction data to a processor. @@ -57680,6 +58760,12 @@ components: levelTwoThreeDataCustomField: type: string description: Name of the transaction custom field that holds the Level 2/3 data. + mastercardDpaId: + type: string + description: ID of the Digital Payment Application (DPA) for Mastercard Secure Card on File (SCOF). + mastercardServiceId: + type: string + description: ID of the Mastercard Secure Card on File (SCOF) service. required: - url threeDSecureServer: @@ -58159,9 +59245,6 @@ components: useRestApi: type: boolean description: Specifies whether to use REST API. - paymentCode: - type: string - description: Awepay payment code. methodType: type: string description: Awepay method type. @@ -60410,6 +61493,27 @@ components: type: string enum: - Ilixium3dsServer + IMerchant: + description: IMerchant gateway configuration. + allOf: + - $ref: '#/components/schemas/GatewayAccount' + - type: object + required: + - credentials + properties: + credentials: + type: object + description: Credentials of the IMerchant gateway. + properties: + apiKey: + type: string + description: IMerchant API key. + format: password + writeOnly: true + required: + - apiKey + threeDSecureServer: + $ref: '#/components/schemas/ThreeDSecureIO3dsServer' Ingenico: description: Ingenico gateway configuration. allOf: @@ -62156,6 +63260,11 @@ components: description: Paybilt API key. format: password writeOnly: true + hmacKey: + type: string + description: Paybilt HMAC key used to verify webhook signatures. + format: password + writeOnly: true required: - tokenId - tokenApiKey @@ -62446,6 +63555,43 @@ components: - user - vendor - password + PayGlocal: + description: PayGlocal gateway configuration. + allOf: + - $ref: '#/components/schemas/GatewayAccount' + - type: object + required: + - credentials + properties: + credentials: + type: object + description: PayGlocal credentials object. + properties: + merchantId: + type: string + description: ID of the PayGlocal merchant (MID). + privateKeyId: + type: string + description: Key ID of the merchant RSA private key used to sign payment API requests. + publicKeyId: + type: string + description: Key ID of the PayGlocal RSA public key used to encrypt payment API request payloads. + publicKey: + type: string + description: PayGlocal RSA public key used to encrypt payment API request payloads and verify merchant callback token signatures. + x-multiline: true + privateKey: + type: string + description: Merchant RSA private key used to sign payment API requests. + format: password + x-multiline: true + writeOnly: true + required: + - merchantId + - privateKeyId + - publicKeyId + - publicKey + - privateKey PaymentAsia: description: PaymentAsia gateway configuration. allOf: @@ -64567,11 +65713,15 @@ components: description: API key for Viva basic authentication. format: password writeOnly: true + ipnKey: + type: string + description: Key of the Viva IPN validation. required: - clientId - clientSecret - merchantId - apiKey + - ipnKey settings: type: object description: Viva settings object. @@ -65203,7 +66353,7 @@ components: - 'null' example: Test merchant country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' googlePay: type: object description: |- @@ -65231,7 +66381,122 @@ components: - 'null' example: www.example.com country: - $ref: '#/components/schemas/Country' + $ref: '#/components/schemas/DigitalWalletCountry' + GatewayAccountPayoutLimits: + description: |- + Payout method limits for payout request auto-allocation. + Limits apply to auto-allocation only. + Manual allocations are uncapped. + + Validation is per currency. + When multiple limit types contain + an entry for the same currency, the following requirements apply: + - `minPerTransaction.amount < maxPerTransaction.amount`. + - `minPerTransaction.amount <= maxPerPeriod.amount`. + type: object + minProperties: 1 + properties: + maxPerTransaction: + description: |- + Maximum amount limit for single allocation. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 3000 + currency: + $ref: '#/components/schemas/CurrencyCode' + example: + - amount: 3000 + currency: CAD + minPerTransaction: + description: |- + Minimum amount limit for single allocation. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 100 + currency: + $ref: '#/components/schemas/CurrencyCode' + example: + - amount: 100 + currency: CAD + maxPerPeriod: + description: |- + Maximum amount limit for a rolling period. + At most one entry per each currency that this gateway account supports. + type: + - array + - 'null' + minItems: 1 + uniqueItems: true + items: + type: object + required: + - amount + - currency + - period + properties: + amount: + description: Limit amount. + type: number + format: double + exclusiveMinimum: 0 + x-type: Money + example: 10000 + currency: + $ref: '#/components/schemas/CurrencyCode' + period: + description: Rolling period for the amount limit. + type: string + enum: + - 24-hours + x-enumDescriptions: + 24-hours: Rolling 24-hour period. + example: + - amount: 10000 + currency: CAD + period: 24-hours + example: + maxPerTransaction: + - amount: 3000 + currency: CAD + minPerTransaction: + - amount: 100 + currency: CAD + maxPerPeriod: + - amount: 10000 + currency: CAD + period: 24-hours ValidationErrorExtensions: type: object properties: @@ -65289,6 +66554,7 @@ components: - scheduled-maintenance - daily-limit-reached - monthly-limit-reached + - gateway-unreachable startTime: description: Date and time when the gateway account scheduled downtime starts. type: string @@ -65392,6 +66658,7 @@ components: - gateway-account-limit-reset - gateway-account-onboarding-completed - gateway-account-onboarding-failed + - gateway-account-carding-circuit-opened triggeredBy: description: Specifies who, or what, triggered the timeline event. type: string @@ -66003,6 +67270,28 @@ components: type: string format: email default: [] + annualComplianceScreening: + description: |- + Settings for annual compliance screening of all active customers. + When enabled, a compliance screening report is generated for every active customer + on the configured month and day each year. + type: object + properties: + enabled: + description: Specifies whether annual compliance screening is enabled for the organization. + type: boolean + default: false + monthDay: + description: |- + Month and day when annual compliance screening runs, in `MM-DD` format. + Required when `enabled` is `true`. + Valid calendar date only. Leap day `02-29` is not allowed. + type: + - string + - 'null' + pattern: ^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$ + example: 02-15 + default: null payoutRequestAllocationOrder: description: |- Default order for auto-allocation of payout requests. @@ -66493,6 +67782,17 @@ components: - insufficient-documentation - risk-review - other + PayoutRequestSplitReason: + type: string + description: Reason for splitting the payout request. + enum: + - payment-instrument-limit + - processor-limit + - risk-review + - compliance-review + - partial-processing + - operational-reconciliation + - other PayoutRequestAllocation: type: object required: @@ -66570,6 +67870,15 @@ components: type: number format: double x-type: Money + exposureAmount: + description: |- + Total approved sales and captures minus approved payouts for the customer, + gateway account, and payment instrument, in the allocation currency. + readOnly: true + type: number + format: double + x-type: Money + example: 2 currency: description: Currency of the payout request allocation. $ref: '#/components/schemas/CurrencyCode' @@ -66760,16 +68069,26 @@ components: - split - merged x-enumDescriptions: - pending: Request was created by the customer. - ready: Request was assessed, deemed eligible for processing and is ready for approval. - approved: Request was approved and is ready for processing. + pending: |- + Request was created by the customer and is in a pending state for the [configured pending period](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/pendingperiodhours), unless it is marked as ready by a member of your organization. + When automatic readiness is enabled, the payout request transitions to the `ready` state after the pending period elapses and the configured [transition time](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinesstime) is reached. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests, or this status may not be used. + ready: |- + Request was created by the customer and is ready for review. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests. + approved: Request was reviewed, approved, and is ready for processing. in-progress: Request has allocations and is being processed. fulfilled: Request is fully paid out. canceled: Request is canceled by merchant or customer. split: Request was split into two or more payout requests. merged: Request was merged into another payout request. blocked: - description: Specifies whether the payout request is blocked or unblocked. + description: |- + Specifies whether the payout request is blocked or unblocked. + + When blocked, the payout request cannot transition to `ready`, `approved`, `in-progress`, `merged`, `split`, or `canceled`. + Allocation creation, allocation processing, and cancellation of pending allocations are also prevented. + A blocked payout request can still transition to the `fulfilled` status if allocation processing starts before the payout request is blocked. type: boolean readOnly: false example: false @@ -66777,6 +68096,10 @@ components: oneOf: - $ref: '#/components/schemas/PayoutRequestBlockReason' - type: 'null' + splitReason: + oneOf: + - $ref: '#/components/schemas/PayoutRequestSplitReason' + - type: 'null' batchId: description: ID of the payout request batch that contains this request. type: @@ -66830,30 +68153,6 @@ components: - splitFrom - mergedInto - paymentInstrument - PayoutRequestSplit: - type: object - required: - - amounts - properties: - amounts: - description: |- - Amounts for each new payout request. - One request is created per amount. - Provide at least two amounts. - Each amount must be greater than zero. - The sum must equal the original payout request amount. - type: array - minItems: 2 - maxItems: 100 - items: - type: number - format: double - x-type: Money - exclusiveMinimum: 0 - example: - - 50 - - 30 - - 20 PayoutRequestTimelineMessage: type: object properties: @@ -66925,18 +68224,6 @@ components: readOnly: true minimum: 0 example: 10 - successCount: - description: Number of payout requests successfully processed. - type: integer - readOnly: true - minimum: 0 - example: 8 - failureCount: - description: Number of payout requests that failed to process. - type: integer - readOnly: true - minimum: 0 - example: 2 customerCount: description: Number of unique customers in the batch. type: integer @@ -67063,25 +68350,50 @@ components: items: type: object required: - - planId + - quantity properties: planId: type: string - description: ID of the plan. + description: |- + ID of the plan. + Either this field or the `plan` object must be provided. + Use `plan.id` instead. maxLength: 50 example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + deprecated: true + plan: + description: |- + Details of the plan. + Either this object or the deprecated `planId` field must be provided. + oneOf: + - $ref: '#/components/schemas/OriginalPlan' + - $ref: '#/components/schemas/FlexiblePlan' quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 + oneOf: + - required: + - plan + properties: + planId: + not: {} + - required: + - planId + properties: + plan: + not: {} + - required: + - plan + - planId billingAddress: description: Billing address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' deliveryAddress: description: Delivery address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -67297,6 +68609,7 @@ components: - customer-tax-number-validated - customer-updated - data-export-completed + - data-export-failed - dispute-created - dispute-modified - experian-check-performed @@ -67385,7 +68698,10 @@ components: - transaction-process-requested - transaction-processed - transaction-reconciled + - transaction-partially-refunded + - transaction-refunded - transaction-timeout-resolved + - transaction-voided - trial-usage-limit-reached - waiting-gateway-transaction-completed GlobalWebhook: @@ -67586,6 +68902,68 @@ components: type: string description: Unique hash value that represents the user. readOnly: true + requiresCardOnFile: + type: boolean + description: Specifies whether the current organization must have a payment card on file before it can transact in the live environment. + readOnly: true + default: false + hasCardOnFile: + type: boolean + description: Specifies whether the current organization has an active payment card on file. + readOnly: true + default: false + billingManagementToken: + type: + - string + - 'null' + format: password + description: |- + Session token used to manage the payment method on file for a Rebilly subscription. + This value is returned only to organization owners. + + {% admonition type="warning" %} + Treat as a secret. + Do not log, do not expose in URLs, do not store in shared client storage. + {% /admonition %} + readOnly: true + pastDueInvoice: + type: + - object + - 'null' + description: |- + Details of the oldest past-due invoice for the Rebilly subscription associated with the current organization. + This value is returned to all organization members to support consistent enforcement of the billing gate. + The `token` is returned only to organization owners. + readOnly: true + required: + - invoiceId + - websiteId + - token + properties: + invoiceId: + type: string + description: ID of the past-due invoice. + maxLength: 50 + readOnly: true + websiteId: + type: string + description: ID of the website for the invoice. + maxLength: 50 + readOnly: true + token: + type: + - string + - 'null' + format: password + description: |- + JWT that is used to authorize payment of the invoice through the Rebilly Instruments JavaScript library. + This value is `null` for non-owners, who cannot pay the invoice. + + {% admonition type="warning" %} + Treat as a secret. + Do not log, do not expose in URLs, do not store in shared client storage. + {% /admonition %} + readOnly: true _links: $ref: '#/components/schemas/SelfLink' ProfileMfa: @@ -68153,73 +69531,37 @@ components: readOnly: true type: number format: double - DashboardMetric: - type: string - description: Type of dashboard metric. - enum: - - approvalRate - - salesCount - - salesValue - - refundsValue - - chargebacksCount - - chargebacksValue - - transactionsCount - - redeemedCouponsCount - - newLeadsCount - - newCustomersCount - - appliedCouponsCount - - trialConversionsCount - - trialConversionsRate - - renewalSuccessRate - - renewalsCount - - newTrialsCount - - reactivationsCount - - successfulRetriesCount - - invoicedRevenue - - churnCount - - churnRate - - cancellationsCount - - cancellationsRate - - activeSubscriptionsCount - - newSubscriptionsCount - - upgradesCount - - downgradesCount - - monthlyRecurringRevenue - - annualRecurringRevenue - - averageRevenuePerCustomer - - customerLifetimeValue - - addressProofAcceptanceRate - - identityProofAcceptanceRate - - fundsProofAcceptanceRate - - purchaseProofAcceptanceRate - - creditFileProofAcceptanceRate - - kycAcceptanceRate - - kycReviewTime - - kycRejectionRate - - kycAccuracyRate - - addressProofAccuracyRate - - identityProofAccuracyRate - - creditFileProofAccuracyRate - - kycRequestCount - - kycRequestAbandonmentRate - - kycRequestAttemptedRate - - kycRequestFailureRate - - kycRequestFulfillmentRate - - kycRequestExpirationRate DashboardTile: type: object required: - metric properties: metric: - description: Metric displayed in the tile. - anyOf: - - $ref: '#/components/schemas/DashboardMetric' - - type: string - dateRange: type: string description: |- - Date range of the tile, in ISO-8601 interval format, extended with `NOW` and `NOW-P*` values for relative dates. + Metric displayed in the tile. + Publicly supported values are defined in `DashboardMetric`. + Additional values are accepted. + title: + type: + - string + - 'null' + description: Custom tile title. + minLength: 2 + maxLength: 36 + description: + type: + - string + - 'null' + description: Custom tile description. + minLength: 2 + maxLength: 48 + dateRange: + type: + - string + - 'null' + description: |- + Date range of the tile, in ISO-8601 interval format, extended with `NOW` and relative anchor tokens for relative dates. When omitted, the dashboard `dateRange` is used. Supported formats: @@ -68228,12 +69570,39 @@ components: - Duration and end: `P1M/2024-02-01T00:00:00Z`. - Now and duration: `NOW-P1M/NOW`. This format represents the last month. - Month before last month: `NOW-P2M/NOW-P1M`. + - Anchor tokens: `NOW_D`, `NOW_W`, `NOW_M` and `NOW_Y` resolve to the start of the current day, week, month or year when used as the start of the range, and to the end of that period when used as the end of the range. + Combine an anchor with a signed duration, for example `NOW_M-P1M`, to shift the period after snapping to the boundary. + - Today: `NOW_D/NOW_D`. + - Yesterday: `NOW_D-P1D/NOW_D-P1D`. + - This week: `NOW_W/NOW_D`. + - Last week: `NOW_W-P1W/NOW_W-P1W`. + - Last month: `NOW_M-P1M/NOW_M-P1M`. columnsWidth: type: integer description: Number of dashboard columns that the tile occupies. minimum: 1 maximum: 2 default: 1 + periodStart: + type: + - string + - 'null' + format: date-time + readOnly: true + description: |- + Date and time when the tile period starts. + The value is resolved from the tile `dateRange`. + This value is `null` when the tile does not define its own `dateRange`. + periodEnd: + type: + - string + - 'null' + format: date-time + readOnly: true + description: |- + Date and time when the tile period ends. + The value is resolved from the tile `dateRange`. + This value is `null` when the tile does not define its own `dateRange`. DashboardTab: type: object required: @@ -68252,6 +69621,17 @@ components: maxItems: 20 items: $ref: '#/components/schemas/DashboardTile' + preset: + type: + - string + - 'null' + description: |- + Specifies which preset the tab is associated with. + The preset is independent of the tiles configured on the tab. + enum: + - Payments + - Billing + - KYC ProfileDashboard: type: object required: @@ -68260,7 +69640,7 @@ components: dateRange: type: string description: |- - Date range of the dashboard, in ISO-8601 interval format, extended with `NOW` and `NOW-P*` values for relative dates. + Date range of the dashboard, in ISO-8601 interval format, extended with `NOW` and relative anchor tokens for relative dates. This range applies to every tile that does not define its own `dateRange`. Supported formats: @@ -68269,6 +69649,13 @@ components: - Duration and end: `P1M/2024-02-01T00:00:00Z`. - Now and duration: `NOW-P1M/NOW`. This format represents the last month. - Month before last month: `NOW-P2M/NOW-P1M`. + - Anchor tokens: `NOW_D`, `NOW_W`, `NOW_M` and `NOW_Y` resolve to the start of the current day, week, month or year when used as the start of the range, and to the end of that period when used as the end of the range. + Combine an anchor with a signed duration, for example `NOW_M-P1M`, to shift the period after snapping to the boundary. + - Today: `NOW_D/NOW_D`. + - Yesterday: `NOW_D-P1D/NOW_D-P1D`. + - This week: `NOW_W/NOW_D`. + - Last week: `NOW_W-P1W/NOW_W-P1W`. + - Last month: `NOW_M-P1M/NOW_M-P1M`. default: NOW-P1M/NOW periodStart: type: string @@ -68290,6 +69677,59 @@ components: maxItems: 10 items: $ref: '#/components/schemas/DashboardTab' + DashboardMetric: + type: string + description: Type of dashboard metric. + enum: + - approvalRate + - salesCount + - salesValue + - refundsValue + - chargebacksCount + - chargebacksValue + - transactionsCount + - redeemedCouponsCount + - newLeadsCount + - newCustomersCount + - appliedCouponsCount + - trialConversionsCount + - trialConversionsRate + - renewalSuccessRate + - renewalsCount + - newTrialsCount + - reactivationsCount + - successfulRetriesCount + - invoicedRevenue + - churnCount + - churnRate + - cancellationsCount + - cancellationsRate + - activeSubscriptionsCount + - newSubscriptionsCount + - upgradesCount + - downgradesCount + - monthlyRecurringRevenue + - annualRecurringRevenue + - averageRevenuePerCustomer + - customerLifetimeValue + - addressProofAcceptanceRate + - identityProofAcceptanceRate + - fundsProofAcceptanceRate + - purchaseProofAcceptanceRate + - creditFileProofAcceptanceRate + - kycAcceptanceRate + - kycReviewTime + - kycRejectionRate + - kycAccuracyRate + - addressProofAccuracyRate + - identityProofAccuracyRate + - creditFileProofAccuracyRate + - kycRequestCount + - kycRequestAbandonmentRate + - kycRequestAttemptedRate + - kycRequestFailureRate + - kycRequestFulfillmentRate + - kycRequestExpirationRate DashboardTileReport: type: object properties: @@ -68377,6 +69817,41 @@ components: description: |- Date and time when the first scheduled recurring export occurs. The default value is now. + DataExportFileId: + type: + - string + - 'null' + description: |- + ID of the data export file. + If the export contains more than 1,000,000 records, + the file is a ZIP archive. + The archive contains numbered part files, + such as `example-part1.csv` and `example-part2.csv`, + each with a maximum of 1,000,000 records. + Each part file can be processed independently: + + - `csv` and `detailed-csv` part files repeat the header row. + - `json` and `json-api` part files contain a complete array. + - `xml` part files contain their own root element. + + `pdf` exports are always a ZIP archive that contains one PDF per record, + and are never split into part files. + readOnly: true + maxLength: 50 + example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + DataExportFailureReason: + description: Reason the export failed, if the export status is `failed`. + readOnly: true + type: + - string + - 'null' + enum: + - record-limit-exceeded + - max-retries-reached + - null + x-enumDescriptions: + record-limit-exceeded: Export exceeded the maximum number of records allowed for a single export. + max-retries-reached: Export failed after the maximum number of retry attempts. DataExportDateRange: type: object description: |- @@ -68458,13 +69933,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68485,6 +69954,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68577,13 +70049,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68604,6 +70070,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68696,13 +70165,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68723,6 +70186,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68817,13 +70283,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68844,6 +70304,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68936,13 +70399,123 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' + recordCount: + description: Total number of records in the export, excluding the header row. + readOnly: true + type: integer + scheduledTime: + description: Date and time when the data export is scheduled to generate a file. + $ref: '#/components/schemas/ServerTimestamp' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + status: + description: Status of export request. + readOnly: true + type: string + enum: + - pending + - queued + - processing + - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' + dateRange: + allOf: + - $ref: '#/components/schemas/DataExportDateRange' + - type: object + properties: + field: + type: string + default: issuedTime + example: issuedTime + _links: + type: array + description: Related links. + readOnly: true + items: + type: object + properties: + href: + description: Link URL. + type: string + rel: + description: Type of link. + type: string + enum: + - self + - user + - download + - signedLink + _embedded: + type: object + description: Embedded objects that are requested by the `expand` query parameter. + readOnly: true + properties: + file: + type: object + user: + type: object + AmlChecksDataExport: + type: object + description: AML checks resource to export. + required: + - name + - format + - resource + properties: + id: + type: string + description: ID of the export. + readOnly: true + maxLength: 50 + example: exp_0YVCNQ2C1AD1RA3HXKP492GNZB + name: + description: Name of the export. + type: string + maxLength: 50 + resource: + description: Type of resource to export. + type: string + enum: + - amlChecks + format: + description: Output format of the export. + type: string + enum: + - csv + - json + - json-api + - xml + - detailed-csv + arguments: + $ref: '#/components/schemas/DataExportArguments' + emailNotification: + description: List of email addresses to notify when an export is completed. + type: array + items: + type: string + format: email + fields: + description: |- + List of fields to include in the export. + For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). + type: array + items: + type: string + recurring: + $ref: '#/components/schemas/DataExportRecurring' + userId: + description: ID of the user who requested the data export. + readOnly: true + type: string + maxLength: 50 + example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 + fileId: + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -68963,6 +70536,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -68970,8 +70546,8 @@ components: properties: field: type: string - default: issuedTime - example: issuedTime + default: createdTime + example: createdTime _links: type: array description: Related links. @@ -68999,9 +70575,9 @@ components: type: object user: type: object - AmlChecksDataExport: + DisputesDataExport: type: object - description: AML checks resource to export. + description: Dispute resource to export. required: - name - format @@ -69021,7 +70597,7 @@ components: description: Type of resource to export. type: string enum: - - amlChecks + - disputes format: description: Output format of the export. type: string @@ -69030,7 +70606,6 @@ components: - json - json-api - xml - - detailed-csv arguments: $ref: '#/components/schemas/DataExportArguments' emailNotification: @@ -69055,13 +70630,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69074,7 +70643,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of export request. + description: Status of the export request. readOnly: true type: string enum: @@ -69082,6 +70651,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69118,9 +70690,9 @@ components: type: object user: type: object - DisputesDataExport: + JournalRecordsDataExport: type: object - description: Dispute resource to export. + description: Journal record resource to export. required: - name - format @@ -69140,7 +70712,7 @@ components: description: Type of resource to export. type: string enum: - - disputes + - journalRecords format: description: Output format of the export. type: string @@ -69160,7 +70732,7 @@ components: fields: description: |- List of fields to include in the export. - For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). + For more information, see [Fields](https://www.rebilly.com/docs/dev-docs/transaction-reconciliation/#fields). type: array items: type: string @@ -69173,13 +70745,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69192,7 +70758,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of the export request. + description: Status of export request. readOnly: true type: string enum: @@ -69200,6 +70766,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69236,9 +70805,9 @@ components: type: object user: type: object - JournalRecordsDataExport: + PayoutRequestsDataExport: type: object - description: Journal record resource to export. + description: Payout requests resource to export. required: - name - format @@ -69258,7 +70827,7 @@ components: description: Type of resource to export. type: string enum: - - journalRecords + - payoutRequests format: description: Output format of the export. type: string @@ -69278,7 +70847,7 @@ components: fields: description: |- List of fields to include in the export. - For more information, see [Fields](https://www.rebilly.com/docs/dev-docs/transaction-reconciliation/#fields). + For more information, see [Fields](/docs/dev-docs/export-configuration/#fields). type: array items: type: string @@ -69291,13 +70860,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69310,7 +70873,7 @@ components: updatedTime: $ref: '#/components/schemas/UpdatedTime' status: - description: Status of export request. + description: Status of the export request. readOnly: true type: string enum: @@ -69318,12 +70881,16 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' - type: object properties: field: + x-sortable: true type: string default: createdTime example: createdTime @@ -69354,9 +70921,9 @@ components: type: object user: type: object - PayoutRequestsDataExport: + PayoutRequestAllocationsDataExport: type: object - description: Payout requests resource to export. + description: Payout request allocations resource to export. required: - name - format @@ -69376,7 +70943,7 @@ components: description: Type of resource to export. type: string enum: - - payoutRequests + - payoutRequestAllocations format: description: Output format of the export. type: string @@ -69409,13 +70976,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69436,6 +70997,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69473,9 +71037,9 @@ components: type: object user: type: object - PayoutRequestAllocationsDataExport: + UsersDataExport: type: object - description: Payout request allocations resource to export. + description: Users resource to export. required: - name - format @@ -69495,15 +71059,13 @@ components: description: Type of resource to export. type: string enum: - - payoutRequestAllocations + - users format: description: Output format of the export. type: string enum: - csv - json - - json-api - - xml arguments: $ref: '#/components/schemas/DataExportArguments' emailNotification: @@ -69528,13 +71090,7 @@ components: maxLength: 50 example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4 fileId: - type: - - string - - 'null' - description: ID of the data export file. - readOnly: true - maxLength: 50 - example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + $ref: '#/components/schemas/DataExportFileId' recordCount: description: Total number of records in the export, excluding the header row. readOnly: true @@ -69555,6 +71111,9 @@ components: - queued - processing - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' dateRange: allOf: - $ref: '#/components/schemas/DataExportDateRange' @@ -69607,6 +71166,7 @@ components: journalRecords: '#/components/schemas/JournalRecordsDataExport' payoutRequests: '#/components/schemas/PayoutRequestsDataExport' payoutRequestAllocations: '#/components/schemas/PayoutRequestAllocationsDataExport' + users: '#/components/schemas/UsersDataExport' oneOf: - $ref: '#/components/schemas/CustomersDataExport' - $ref: '#/components/schemas/SubscriptionsDataExport' @@ -69618,6 +71178,38 @@ components: - $ref: '#/components/schemas/JournalRecordsDataExport' - $ref: '#/components/schemas/PayoutRequestsDataExport' - $ref: '#/components/schemas/PayoutRequestAllocationsDataExport' + - $ref: '#/components/schemas/UsersDataExport' + DataExportLimitExceeded: + allOf: + - title: Data export limit exceeded + - type: object + required: + - type + properties: + type: + type: string + description: Machine-readable error code for this problem type, which consumers use to handle the failure programmatically. + enum: + - data-export-limit-exceeded + status: + type: integer + description: HTTP status code. + minimum: 422 + maximum: 422 + - $ref: '#/components/schemas/DetailedProblem' + - type: object + required: + - matchedRecords + - maxRecords + properties: + matchedRecords: + type: integer + description: Number of records that match the export request. + example: 12500000 + maxRecords: + type: integer + description: Maximum number of records for a single export. + example: 10000000 OrganizationExport: type: object properties: @@ -69833,6 +71425,197 @@ components: required: - totalInherited - categories + ReportAmlAuditReport: + type: object + description: AML audit report for a person. + properties: + personId: + type: string + description: ID of the person associated with the report. + maxLength: 50 + status: + type: + - string + - 'null' + description: Person-level AML screening status for the selected period. + enum: + - clear + - confirmed-match + - pending-review + linkedCustomers: + type: array + description: Customers linked to the person. + items: + type: object + properties: + id: + $ref: '#/components/schemas/CustomerId' + websiteId: + $ref: '#/components/schemas/WebsiteId' + required: + - id + - websiteId + summary: + type: object + description: Screening summary metrics for the selected period. + properties: + totalChecks: + type: integer + description: Total number of AML checks in the selected period. + hitCount: + type: integer + description: Number of AML hits across all checks in the selected period. + lastCheckTime: + type: + - string + - 'null' + format: date-time + description: Date and time of the most recent AML check in the selected period. + required: + - totalChecks + - hitCount + - lastCheckTime + screeningHistory: + type: array + description: AML screening history for the selected period. + items: + type: object + properties: + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + customerId: + $ref: '#/components/schemas/CustomerId' + source: + type: string + description: Source of the AML check. + enum: + - sign-up + - recurring + - purchase + hitSources: + type: + - string + - 'null' + description: |- + Comma-separated list of AML Hit sources for the AML check. + + The value is `null` if the AML Check did not find any hits. + result: + type: string + description: Screening result for the AML check. + enum: + - clear + - confirmed-match + - pending-review + reviewer: + type: + - string + - 'null' + description: Name of the reviewer, `bot` for checks that run automatically, or `null` when the check hasn't been reviewed yet. + required: + - createdTime + - updatedTime + - customerId + - source + - hitSources + - result + - reviewer + transactions: + type: array + description: Transactions for customers linked to the person in the selected period. + items: + type: object + properties: + id: + $ref: '#/components/schemas/TransactionId' + customerId: + $ref: '#/components/schemas/CustomerId' + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + amount: + type: number + description: Transaction amount converted to the report currency of the organization. + currency: + $ref: '#/components/schemas/CurrencyCode' + type: + description: Type of transaction. + type: string + x-basic: true + readOnly: true + enum: + - 3ds-authentication + - authorize + - capture + - credit + - refund + - sale + - setup + - void + status: + description: Status of the transaction. + type: string + readOnly: true + enum: + - completed + - conn-error + - disputed + - never-sent + - offsite + - partially-refunded + - pending + - refunded + - sending + - timeout + - voided + - waiting-approval + - waiting-capture + - waiting-gateway + - waiting-refund + result: + description: Result of the transaction. + type: string + x-basic: true + readOnly: true + enum: + - approved + - canceled + - declined + - unknown + required: + - id + - customerId + - createdTime + - updatedTime + - amount + - currency + - type + - status + - result + periodStart: + type: string + format: date-time + description: Start date time of the report period. + periodEnd: + type: string + format: date-time + description: End date time of the report period. + truncated: + type: boolean + description: Indicates whether any list within the report is truncated due to too many results. + required: + - personId + - status + - linkedCustomers + - summary + - screeningHistory + - transactions + - periodStart + - periodEnd + - truncated CumulativeSubscriptions: type: object properties: @@ -70857,22 +72640,40 @@ components: properties: date: type: string - description: Date in `YYYY-MM-DD` format . + description: Date in `YYYY-MM-DD` format. total: type: number format: double - description: Total number of all transactions within the aggregation. + description: |- + Aggregated value for all transactions for the day, in the unit specified by the `type` parameter: + - `count`: Total number of transactions. + - `amount`: Total amount of approved transactions in the merchant reporting currency. + - `approval-rate`: Ratio of approved transactions to all transactions. + - `incomplete-rate`: Ratio of incomplete transactions to all transactions. + + This value does not depend on the `subaggregate` parameter and is not the sum of the values in `subaggregates`. + Each transaction is included once, even if the `subaggregate` field contains multiple values for the transaction. + Transactions with no value for the `subaggregate` field are also included. subaggregates: - type: object - description: Subaggregates that have transactions within the range. - properties: - subaggregate: - type: string - description: ID of the subaggregate. - value: - type: number - format: double - description: Total number of all subaggregate transactions within the aggregation. + type: array + description: |- + Breakdown by the `subaggregate` field for the day. + Each element contains one `subaggregate` value and its aggregated value. + Each `subaggregate` value found in the report has an element, + in the same order for each day. + items: + type: object + properties: + subaggregate: + type: string + description: One value of the `subaggregate` field, such as a website ID, a currency code, or a lead source. + value: + type: number + format: double + description: |- + Aggregated value for transactions that have this `subaggregate` value, + in the same unit as `total`. + This value is `0` if no transactions have this `subaggregate` value. ReportDisputeDelays: type: object properties: @@ -70962,6 +72763,11 @@ components: format: double SubscriptionSummaryMetrics: type: object + required: + - currency + - invoicedAmount + - collectedAmount + - invoiceCount properties: currency: description: Currency code in ISO 4217 format. @@ -71006,17 +72812,22 @@ components: writeOnly: true description: |- Write-only payment token. - If this value is supplied, it converts into a payment instrument and set as the `defaultPaymentInstrument`. - The value of this property overrides the `defaultPaymentInstrument` if both are supplied. + If supplied, the token is converted into a payment instrument, and its ID is assigned to `defaultPaymentInstrumentId` value. + The value of this property overrides the `defaultPaymentInstrumentId` if both are supplied. This token may only be used once before it expires. defaultPaymentInstrument: - type: object + type: + - object + - 'null' description: |- - Default payment instrument. + Default payment instrument of the customer. + The default payment instrument is used to automatically pay subscription renewals, and for transaction requests where a specific payment instrument is not provided. + readOnly: true required: - method + - paymentInstrumentId properties: method: $ref: '#/components/schemas/PaymentMethod' @@ -71025,6 +72836,18 @@ components: description: ID of the payment instrument. maxLength: 50 example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + defaultPaymentInstrumentId: + type: + - string + - 'null' + description: |- + ID of the customer's default payment instrument. + + The default payment instrument is used to automatically pay subscription renewals, + and for transaction requests where a specific payment instrument is not provided. + maxLength: 50 + example: inst_0YVB8KPKNXCBR9EDX7JHSED75N + writeOnly: true preferredPayoutInstrumentId: type: - string @@ -71050,7 +72873,10 @@ components: $ref: '#/components/schemas/TaxNumber' notificationEmails: type: array - description: Additional email addresses for notification delivery. + description: |- + Email addresses for notification delivery in event-based email notifications. + When you configure event-based email notifications, you can send to these addresses, the customer's primary email address, or another email address you specify. + For more information, see [Manage notification emails](https://www.rebilly.com/docs/data-tables/manage-customer-information#manage-notification-emails). items: type: string format: email @@ -71192,11 +73018,14 @@ components: - balance - bonusBalance - pendingPayoutTotal + - canWithdraw - depositAmounts - defaultDepositAmount - depositCustomAmount - depositMethods - payoutMethods + - coinPurchase + - coinPricing properties: id: type: string @@ -71221,12 +73050,14 @@ components: format: double minimum: 0 description: Customer's current balance. + readOnly: true example: 1500 bonusBalance: type: number format: double minimum: 0 description: Bonus balance available to the customer. + readOnly: true example: 1500 pendingPayoutTotal: type: number @@ -71235,7 +73066,12 @@ components: description: |- Sum of all payout requests that are currently in a pending state. This value is also the maximum possible "reverse withdrawal" amount. + readOnly: true example: 100 + canWithdraw: + type: boolean + readOnly: true + description: Specifies if the customer can initiate a withdrawal. depositMethods: type: array items: @@ -71324,6 +73160,22 @@ components: description: |- Value of the default amount in the `depositAmounts` list. This value is calculated from the `defaultIndex` property of the deposit strategy that is applied to the deposit request. + coinPurchase: + type: boolean + deprecated: true + readOnly: true + description: |- + Specifies if the deposit is a coin purchase that credits the coin balance instead of the cash balance. + Determined by the deposit amount strategy that is applied to the deposit request. + Use the `coinPricing` field instead. + coinPricing: + readOnly: true + description: |- + Formula copied from the deposit amount strategy when the deposit request is created. + A `null` value means the deposit credits the cash balance instead of the coin balance. + oneOf: + - $ref: '#/components/schemas/CoinPricing' + - type: 'null' lastDepositRequestId: type: string description: ID of the last deposit request that is made for this cashier. @@ -72224,6 +74076,138 @@ components: type: string enum: - self + StorefrontKycDocumentTypes: + type: string + enum: + - identity-proof + - address-proof + - funds-proof + - purchase-proof + StorefrontKycIdentityMatches: + type: object + description: Matched identity data returned to the customer. + properties: + containsImage: + description: Specifies if the document includes an image that contains a face. + type: boolean + example: true + isIdentityDocument: + description: Specifies if the document resembles an ID. + type: boolean + example: true + firstName: + description: |- + First name of the customer. + This value is an empty string if no match is found. + type: string + example: John + lastName: + description: |- + Last name of the customer. + This value is an empty string if no match is found. + type: string + example: Doe + dateOfBirth: + description: |- + Date of birth detected on the document. + This value is `null` if no match is detected. + type: + - string + - 'null' + format: date-time + expirationDate: + description: |- + Expiration date detected on the document. + This value is `null` if no expiration date is detected. + type: + - string + - 'null' + format: date-time + issueDate: + description: |- + Issue date detected on the document. + This value is `null` if no issue date is detected. + type: + - string + - 'null' + format: date-time + hasMinimalAge: + description: |- + Specifies that the individual is older than the minimal age limit. + The minimal age is 21+ for the USA and 18+ for all other countries. + This value is `null` if `dateOfBirth` is not determined. + type: + - boolean + - 'null' + readOnly: true + example: true + nationality: + description: |- + Nationality detected on a passport or citizenship document. + This value is `null` if no nationality is detected. + type: + - string + - 'null' + example: US + maxLength: 3 + issuanceCountry: + description: Country that issued the document. + type: + - string + - 'null' + example: CA + minLength: 2 + maxLength: 2 + issuanceRegion: + description: Region, state, province, or territory that issued the document. + type: + - string + - 'null' + example: Ontario + documentNumber: + description: |- + Unique number on the identity document. + This value may contain alphanumeric characters. + type: + - string + - 'null' + example: '1234567890' + sex: + description: |- + MRZ sex code (ICAO 9303). + `M`, `F`, or `X`. + This value is `null` if not extracted. + type: + - string + - 'null' + pattern: ^[MFX]$ + example: M + documentSubtype: + description: Interpreted subtype of the uploaded document. + type: + - string + - 'null' + $ref: '#/components/schemas/KycDocumentSubtypes' + hasMatchingFaceProof: + description: |- + Specifies if an identity document has matching face proof. + This value is `null` if face proof is not required or not performed. + type: + - boolean + - 'null' + example: false + hasCompletedFaceLiveness: + description: Specifies if the face liveness session completed. + type: boolean + readOnly: true + example: false + expiryDate: + description: Use `expirationDate` field instead. + type: + - string + - 'null' + format: date-time + deprecated: true StorefrontProofOfIdentityKycDocument: type: object required: @@ -72248,7 +74232,7 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72288,19 +74272,87 @@ components: format: date-time readOnly: true documentMatches: - type: object + type: + - object + - 'null' readOnly: true description: Document matches. properties: - score: - description: Calculated score that represents the percentage of confidence that this ID represents the customer. - type: number - format: double - example: 0.75 + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/KycIdentityMatches' + $ref: '#/components/schemas/StorefrontKycIdentityMatches' _links: $ref: '#/components/schemas/SelfLink' + StorefrontKycAddressMatches: + type: object + description: Matched address data returned to the customer. + properties: + firstName: + description: |- + First name of the customer. + This value is an empty string if no match is found. + type: string + example: John + lastName: + description: |- + Last name of the customer. + This value is an empty string if no match is found. + type: string + example: Doe + line1: + description: |- + Address of the customer's residence. + This value is an empty string if no match is found. + type: string + example: 36 Craven St + city: + description: |- + Customer's city of residence. + This value is an empty string if no match is found. + type: string + example: London + region: + description: |- + Customer's region of residence. + This value is an empty string if no match is found. + type: string + example: London + postalCode: + description: |- + Postal code of the customer's residence. + This value is an empty string if no match is found. + type: string + example: WC2N 5NF + wordCount: + description: Total number of words in the document. + type: integer + example: 350 + uniqueWords: + description: Total number of unique words in the document. + type: integer + example: 175 + date: + description: |- + Date detected on the document. + Use this field to determine if the document is recent. + type: + - string + - 'null' + format: date-time + example: '2021-01-01T00:00:00+00:00' + phone: + description: |- + Phone number of the company or agency that issued the document. + This value is an empty string if no phone number is detected. + type: string + example: (123) 456-7890 + documentSubtype: + description: Interpreted subtype of the uploaded document. + type: + - string + - 'null' + $ref: '#/components/schemas/KycDocumentSubtypes' StorefrontProofOfAddressKycDocument: type: object required: @@ -72325,7 +74377,83 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' + documentSubtype: + description: Document subtype submitted for validation. + $ref: '#/components/schemas/KycDocumentSubtypes' + status: + description: Status of the validation. + type: string + readOnly: true + enum: + - pending + - in-progress + - accepted + - rejected + - archived + x-enumDescriptions: + pending: Waiting to be reviewed or analyzed. + in-progress: Being analyzed by the Rebilly AI. + accepted: Accepted by AI or a human. + rejected: Rejected by AI or a human. + archived: Archived by the Rebilly AI. + rejectionReason: + $ref: '#/components/schemas/KycDocumentRejection' + requestId: + readOnly: true + type: + - string + - 'null' + description: ID of the KYC request. + maxLength: 50 + example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 + createdTime: + $ref: '#/components/schemas/CreatedTime' + updatedTime: + $ref: '#/components/schemas/UpdatedTime' + processedTime: + description: Date and time when the KYC document is processed. + type: string + format: date-time + readOnly: true + documentMatches: + description: Document matches. + type: + - object + - 'null' + readOnly: true + properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' + data: + $ref: '#/components/schemas/StorefrontKycAddressMatches' + _links: + $ref: '#/components/schemas/SelfLink' + StorefrontProofOfFundsKycDocument: + type: object + required: + - documentType + - status + properties: + id: + readOnly: true + $ref: '#/components/schemas/ResourceId' + fileIds: + description: |- + IDs of linked file objects. + + Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: + `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. + + Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. + type: array + items: + $ref: '#/components/schemas/ResourceId' + documentType: + description: |- + Document type submitted for validation. + Only the `identity-proof` and `address-proof` types are analyzed automatically. + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72365,157 +74493,19 @@ components: format: date-time readOnly: true documentMatches: - description: Document matches. - type: object - readOnly: true - properties: - score: - description: Calculated score that represents the percentage of confidence that this proof of address represents the customer. - type: number - format: double - example: 0.75 - data: - $ref: '#/components/schemas/KycAddressMatches' - _links: - $ref: '#/components/schemas/SelfLink' - StorefrontProofOfFundsKycDocument: - type: object - required: - - documentType - - status - properties: - id: - readOnly: true - $ref: '#/components/schemas/ResourceId' - fileIds: - description: |- - IDs of linked file objects. - - Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: - `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. - - Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. - type: array - items: - $ref: '#/components/schemas/ResourceId' - documentType: - description: |- - Document type submitted for validation. - Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' - documentSubtype: - description: Document subtype submitted for validation. - $ref: '#/components/schemas/KycDocumentSubtypes' - status: - description: Status of the validation. - type: string - readOnly: true - enum: - - pending - - in-progress - - accepted - - rejected - - archived - x-enumDescriptions: - pending: Waiting to be reviewed or analyzed. - in-progress: Being analyzed by the Rebilly AI. - accepted: Accepted by AI or a human. - rejected: Rejected by AI or a human. - archived: Archived by the Rebilly AI. - rejectionReason: - $ref: '#/components/schemas/KycDocumentRejection' - requestId: - readOnly: true - type: - - string - - 'null' - description: ID of the KYC request. - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - processedTime: - description: Date and time when the KYC document is processed. - type: string - format: date-time - readOnly: true - _links: - $ref: '#/components/schemas/SelfLink' - StorefrontProofOfPurchaseKycDocument: - type: object - required: - - documentType - - status - properties: - id: - readOnly: true - $ref: '#/components/schemas/ResourceId' - fileIds: - description: |- - IDs of linked file objects. - - Uploaded `identity-proof` files must have the following tags attached to be used for KYC purposes: - `['kyc', 'id-front']`, `['kyc', 'id-back']`, `['kyc', 'face-proof']`. - - Permitted file types for `identity-proof` files: `.jpg`, `.png`, and `.pdf`. - type: array - items: - $ref: '#/components/schemas/ResourceId' - documentType: - description: |- - Document type submitted for validation. - Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' - documentSubtype: - description: Document subtype submitted for validation. - $ref: '#/components/schemas/KycDocumentSubtypes' - status: - description: Status of the validation. - type: string - readOnly: true - enum: - - pending - - in-progress - - accepted - - rejected - - archived - x-enumDescriptions: - pending: Waiting to be reviewed or analyzed. - in-progress: Being analyzed by the Rebilly AI. - accepted: Accepted by AI or a human. - rejected: Rejected by AI or a human. - archived: Archived by the Rebilly AI. - rejectionReason: - $ref: '#/components/schemas/KycDocumentRejection' - requestId: - readOnly: true type: - - string + - object - 'null' - description: ID of the KYC request. - maxLength: 50 - example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21 - createdTime: - $ref: '#/components/schemas/CreatedTime' - updatedTime: - $ref: '#/components/schemas/UpdatedTime' - processedTime: - description: Date and time when the KYC document is processed. - type: string - format: date-time - readOnly: true - documentMatches: - type: object readOnly: true description: Document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/PurchaseMatches' + $ref: '#/components/schemas/FundsMatches' _links: $ref: '#/components/schemas/SelfLink' - StorefrontProofOfCreditFileKycDocument: + StorefrontProofOfPurchaseKycDocument: type: object required: - documentType @@ -72539,7 +74529,7 @@ components: description: |- Document type submitted for validation. Only the `identity-proof` and `address-proof` types are analyzed automatically. - $ref: '#/components/schemas/KycDocumentTypes' + $ref: '#/components/schemas/StorefrontKycDocumentTypes' documentSubtype: description: Document subtype submitted for validation. $ref: '#/components/schemas/KycDocumentSubtypes' @@ -72579,12 +74569,16 @@ components: format: date-time readOnly: true documentMatches: - type: object + type: + - object + - 'null' readOnly: true description: Document matches. properties: + version: + $ref: '#/components/schemas/KycDocumentMatchesVersion' data: - $ref: '#/components/schemas/CreditFileMatches' + $ref: '#/components/schemas/PurchaseMatches' _links: $ref: '#/components/schemas/SelfLink' StorefrontKycDocument: @@ -72593,7 +74587,6 @@ components: - $ref: '#/components/schemas/StorefrontProofOfAddressKycDocument' - $ref: '#/components/schemas/StorefrontProofOfFundsKycDocument' - $ref: '#/components/schemas/StorefrontProofOfPurchaseKycDocument' - - $ref: '#/components/schemas/StorefrontProofOfCreditFileKycDocument' discriminator: propertyName: documentType mapping: @@ -72601,7 +74594,6 @@ components: address-proof: '#/components/schemas/StorefrontProofOfAddressKycDocument' funds-proof: '#/components/schemas/StorefrontProofOfFundsKycDocument' purchase-proof: '#/components/schemas/StorefrontProofOfPurchaseKycDocument' - credit-file-proof: '#/components/schemas/StorefrontProofOfCreditFileKycDocument' StorefrontKycRequest: type: object description: KYC request information. @@ -72702,7 +74694,6 @@ components: type: string enum: - self - - documents _embedded: type: object description: Embedded objects that are requested by the `expand` query parameter. @@ -72723,8 +74714,9 @@ components: maxLength: 50 example: kyc_liv_01HXBZ0MS1GPS6S34MPQXYT5TZ customerId: - $ref: '#/components/schemas/CustomerId' readOnly: true + allOf: + - $ref: '#/components/schemas/CustomerId' kycRequestId: type: string description: ID of the KYC request that the liveness session is associated with. @@ -72836,7 +74828,7 @@ components: format: double example: 5.125 plan: - anyOf: + oneOf: - $ref: '#/components/schemas/OriginalPlan' - $ref: '#/components/schemas/FlexiblePlan' usageLimits: @@ -73081,6 +75073,7 @@ components: endTime: description: |- Time and date when the trial ends. + If the order churns during the trial, this value is the time when the order churned. If a trial is enabled on this subscription, a value must be provided. If the specified trial end time is in the past, the current time is used. @@ -73486,6 +75479,15 @@ components: description: Number of units of the product on the given plan. type: integer minimum: 0 + quantityFilled: + description: |- + Number of filled product units. + This field is not used for metered billing plans. + type: + - number + - 'null' + format: double + example: 5.125 usageLimits: oneOf: - $ref: '#/components/schemas/UsageLimits' @@ -73534,6 +75536,8 @@ components: description: |- Type of the quote. When a quote is accepted, quote items and settings are applied to the related order. + Change quotes can only be created for orders with `active` or `trial-ended` status. + For `trial-ended` orders, use this quote type to convert a trial-only order to a regular recurring order. type: string enum: - change @@ -73614,16 +75618,38 @@ components: items: $ref: '#/components/schemas/QuoteItem' renewalPolicy: - description: Specifies if the order retains its current `renewalTime` or resets it to a newly calculated `renewalTime`. + description: |- + Policy for managing service periods and trial state of the related order when the quote is accepted. + + The `reset` and `retain` values are deprecated. + The deprecated `keepTrial` flag is ignored unless `reset` or `retain` is used. + In responses, the value is `reset` or `retain`. type: string - default: retain + default: retainRecurring enum: + - resetToRecurring + - retainRecurring + - retainTrialThenRecurring - reset - retain + x-enumDescriptions: + resetToRecurring: Resets the service periods, ends any trial, and converts trial-only items to recurring. + retainRecurring: Retains the current service periods, ends any trial, and converts trial-only items to recurring. + retainTrialThenRecurring: |- + Retains the trial until it ends, then converts the item to recurring. + Returns a validation error if the order has no trial. + reset: |- + Deprecated. + Use `resetToRecurring` instead. + Resets the `renewalTime` to a newly calculated value. + retain: |- + Deprecated. + Use `retainRecurring` or `retainTrialThenRecurring` instead. + Retains the current `renewalTime`. prorated: description: |- Specifies whether to give a pro rata credit for the amount of time remaining between the `effectiveTime` and the end of the current period. - In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retain`, + In addition, if the `renewalTime` is retained, by setting the `renewalPolicy` to `retainRecurring` or `retainTrialThenRecurring`, a pro rata debit occurs for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period length. type: boolean effectiveTime: @@ -73635,9 +75661,13 @@ components: - 'null' format: date-time keepTrial: + deprecated: true description: |- + Deprecated. + Use the `retainTrialThenRecurring` value of `renewalPolicy` instead. + Specifies if the order must retain its active trial. - This field is only applicable if `renewalPolicy` is set to `retain`. + This field is only applicable if `renewalPolicy` is set to the deprecated value `retain`. type: boolean default: false interimOnly: @@ -73686,7 +75716,11 @@ components: or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -74128,8 +76162,21 @@ components: If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at `paymentInstrumentId`, or the default payment instrument on the order. If this value is `null`, the related order autopay is not affected. + includeUnpaidInvoices: + type: boolean + default: false + example: false + readOnly: true + description: |- + Specifies whether the quote invoice includes items from outstanding unpaid and past-due invoices for the related order. + When this value is `true`, the quote invoice includes charges for eligible items from those invoices. + When the quote is accepted, only invoices included in the quote that remain unpaid or past due and can be voided are voided. shipping: - $ref: '#/components/schemas/Shipping' + description: |- + Shipping settings of the order. + If this value is omitted, the order shipping is not affected. + allOf: + - $ref: '#/components/schemas/Shipping' deliveryAddress: description: |- Delivery address of the order. @@ -74502,6 +76549,13 @@ components: description: Bank name of the payment instrument. type: string readOnly: true + isPayoutable: + description: |- + Specifies if payouts are supported for cards with this BIN. + Defaults to `true`. + This value is `false` if the BIN does not support payouts. + type: boolean + readOnly: true billingAddress: description: Contact's billing address. $ref: '#/components/schemas/ContactObject' @@ -74819,12 +76873,27 @@ components: readOnly: true enum: - pending + - ready + - approved - in-progress - fulfilled + - canceled + - split + - merged x-enumDescriptions: - pending: Request is awaiting fulfillment. + pending: |- + Request was created by the customer and is in a pending state for the [configured pending period](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/pendingperiodhours), unless it is marked as ready by a member of your organization. + When automatic readiness is enabled, the payout request transitions to the `ready` state after the pending period elapses and the configured [transition time](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinesstime) is reached. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests, or this status may not be used. + ready: |- + Request was created by the customer and is ready for review. + Depending on the configured [`automaticReadinessEnabled`](https://www.rebilly.com/catalog/all/websites/putwebsite#websites/putwebsite/t=request&path=settings/payoutrequest/automaticreadinessenabled) setting, this may be the initial status assigned to new payout requests. + approved: Request was reviewed, approved, and is ready for processing. in-progress: Request has allocations and is being processed. - fulfilled: Request is fully paid out when `availableAmount` reaches zero. + fulfilled: Request is fully paid out. + canceled: Request is canceled by merchant or customer. + split: Request was split into two or more payout requests. + merged: Request was merged into another payout request. createdTime: description: Date and time when the payout request is created. $ref: '#/components/schemas/ServerTimestamp' @@ -74860,6 +76929,22 @@ components: description: ID of the plan. maxLength: 50 example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X + type: + description: |- + Variant of the plan. + The variant is `subscription` when `recurringInterval` is present. + The variant is `trial-only` when `trial` is present without `recurringInterval`. + The variant is `one-time-sale` when both fields are omitted. + type: string + readOnly: true + enum: + - subscription + - one-time-sale + - trial-only + x-enumDescriptions: + subscription: Recurring plan. + one-time-sale: Non-recurring, one-time sale plan. + trial-only: Trial plan without recurring interval settings. name: description: |- Name of the plan. @@ -74982,6 +77067,15 @@ components: - 'null' format: float minimum: 0.01 + sticky: + description: |- + When enabled, if no usage is reported during a service period, + the plan bills the last known reported quantity from a previous period instead of zero. + This is suitable for hosted or persistent resources whose usage does not change every period. + Only supported with `strategy`: `last`. + type: boolean + default: false + example: false createdTime: $ref: '#/components/schemas/CreatedTime' updatedTime: @@ -75105,6 +77199,7 @@ components: type: object required: - planId + - quantity properties: planId: type: string @@ -75114,6 +77209,8 @@ components: quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 billingAddress: description: Billing address details. writeOnly: true @@ -75210,6 +77307,7 @@ components: type: object required: - planId + - quantity properties: planId: type: string @@ -75219,15 +77317,15 @@ components: quantity: description: Number of product units in the specified plan. type: integer + minimum: 0 + maximum: 1000000000 billingAddress: description: Billing address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' deliveryAddress: description: Delivery address details. - writeOnly: true oneOf: - $ref: '#/components/schemas/ContactObject' - type: 'null' @@ -76077,7 +78175,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -76189,11 +78291,20 @@ components: value: type: integer description: Value added to the risk score of the transaction. - anyOf: + oneOf: - required: - start + properties: + end: + not: {} - required: - end + properties: + start: + not: {} + - required: + - start + - end RiskScoreRules: type: object description: Risk score rules. @@ -76510,6 +78621,7 @@ components: - transaction-timeout-resolved - waiting-gateway-transaction-completed - data-export-completed + - data-export-failed - hard-usage-limit-reached - soft-usage-limit-reached - subscription-quantity-filled-limit-reached @@ -76633,6 +78745,14 @@ components: application/json: schema: $ref: '#/components/schemas/BadRequest' + DataExportValidationError: + description: Invalid data sent, or the export exceeds the maximum record limit. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ValidationError' + - $ref: '#/components/schemas/DataExportLimitExceeded' NoContent: description: |- Request accepted. @@ -77043,6 +79163,8 @@ components: customerId: readOnly: true - $ref: '#/components/schemas/KycRequest' + description: KYC request resource. + required: true PostPaymentInstrument: content: application/json: @@ -77106,7 +79228,7 @@ components: Tag names are not case-sensitive. type: string maxLength: 255 - pattern: ^[@~\-\.\w\s]+$ + pattern: ^[@~\-\.\w\s+]+$ example: New description: Tag resource. required: true @@ -77418,14 +79540,60 @@ components: $ref: '#/components/schemas/ApiKey' description: ApiKey resource. required: true + PostCredential: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/PostSmtpCredential' + - $ref: '#/components/schemas/PostWebhookCredential' + - $ref: '#/components/schemas/PostExperianCredential' + - $ref: '#/components/schemas/PostMailgunCredential' + - $ref: '#/components/schemas/PostOAuth2Credential' + - $ref: '#/components/schemas/PostPostmarkCredential' + - $ref: '#/components/schemas/PostSendGridCredential' + - $ref: '#/components/schemas/PostAwsSesCredential' + - $ref: '#/components/schemas/PostTaxJarCredential' + - $ref: '#/components/schemas/PostAvalaraCredential' + - $ref: '#/components/schemas/PostPlaidCredential' + discriminator: + propertyName: type + mapping: + smtp: '#/components/schemas/PostSmtpCredential' + webhook: '#/components/schemas/PostWebhookCredential' + experian: '#/components/schemas/PostExperianCredential' + mailgun: '#/components/schemas/PostMailgunCredential' + oauth2: '#/components/schemas/PostOAuth2Credential' + postmark: '#/components/schemas/PostPostmarkCredential' + sendgrid: '#/components/schemas/PostSendGridCredential' + aws-ses: '#/components/schemas/PostAwsSesCredential' + taxjar: '#/components/schemas/PostTaxJarCredential' + avalara: '#/components/schemas/PostAvalaraCredential' + plaid: '#/components/schemas/PostPlaidCredential' + description: Service credential resource. + required: true PatchCredential: content: application/json: schema: - anyOf: + oneOf: - $ref: '#/components/schemas/PatchServiceCredential' - $ref: '#/components/schemas/PatchPlaidCredential' - $ref: '#/components/schemas/PatchTaxJarCredential' + discriminator: + propertyName: type + mapping: + smtp: '#/components/schemas/PatchServiceCredential' + webhook: '#/components/schemas/PatchServiceCredential' + mailgun: '#/components/schemas/PatchServiceCredential' + sendgrid: '#/components/schemas/PatchServiceCredential' + aws-ses: '#/components/schemas/PatchServiceCredential' + oauth2: '#/components/schemas/PatchServiceCredential' + postmark: '#/components/schemas/PatchServiceCredential' + experian: '#/components/schemas/PatchServiceCredential' + avalara: '#/components/schemas/PatchServiceCredential' + plaid: '#/components/schemas/PatchPlaidCredential' + taxjar: '#/components/schemas/PatchTaxJarCredential' description: Service credential resource. required: true RuleSet: @@ -77521,6 +79689,7 @@ components: type: - string - 'null' + minLength: 1 maxLength: 255 description: description: Description of the payout request. @@ -77534,10 +79703,12 @@ components: `pending`, `ready`, `approved`, or `in-progress`. When a payout request is blocked, it cannot: - - Move to the next status in the workflow. - For example: `pending` → `ready` → `approved` → `in-progress`. + - Transition to `ready`, `approved`, `in-progress`, `merged`, `split`, or `canceled`. - Have allocations created. - - Have allocations processed. + - Start allocation processing. + - Cancel pending allocations. + + A blocked payout request can still transition to the `fulfilled` status if allocation processing starts before the payout request is blocked. type: boolean example: false blockReason: @@ -77769,7 +79940,11 @@ components: Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. - When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired. + When metered usage equals or exceeds the configured soft limit, the `soft-usage-limit-reached` event is triggered. + The quantity limit applies to the larger of the reported and billed quantity. + If a minimum billable quantity results in a billed quantity that is higher than the reported quantity, the billed quantity applies to the limit. + If a maximum billable quantity results in a billed quantity that is lower than the reported quantity, the reported quantity applies to the limit. + The amount limit applies to the billed amount. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. @@ -77872,7 +80047,7 @@ components: Date and time when the service period pauses. This time must be later than the current time. - If this time is earlier then the current time, the current time is used. + If this time is earlier than the current time, the current time is used. If this field is omitted, this value defaults to the current time. type: @@ -77885,7 +80060,7 @@ components: To resume a subscription from this point in time, use the current time or an earlier time. - If `endTime` is earlier then the current time, the current time is used. + If `endTime` is earlier than the current time, the current time is used. If this field is empty, the subscription is indefinitely paused. type: - string @@ -78634,10 +80809,10 @@ components: usageAmount: type: number format: double - description: Reported usage amount. + description: Billed usage amount. currency: type: string - description: Currency of the reported usage amount. + description: Currency of the billed usage amount. eventType: type: string description: Type of event that triggered the webhook. @@ -78802,6 +80977,7 @@ components: - transaction-discrepancy-found - transaction-process-requested - transaction-processed + - transaction-reconciled - transaction-timeout-resolved - waiting-gateway-transaction-completed - autodeposit-lookup-performed @@ -79518,6 +81694,44 @@ components: - subscription - pause description: Payload of subscription pause-related webhook event. + TransactionWithChildWebhook: + content: + application/json: + schema: + properties: + transactionId: + $ref: '#/components/schemas/TransactionId' + eventType: + type: string + description: Type of event that triggered the webhook. + enum: + - transaction-partially-refunded + - transaction-refunded + - transaction-voided + _embedded: + type: object + description: Embedded objects related to the transaction event. + properties: + transaction: + $ref: '#/components/schemas/Transaction' + childTransaction: + $ref: '#/components/schemas/Transaction' + _links: + type: array + description: Links to related resources. + items: + type: object + properties: + href: + description: URL of the link. + type: string + rel: + description: Relationship type of the link. + type: string + enum: + - transaction + - childTransaction + description: Payload of transaction-related webhook event. DataExportWebhook: content: application/json: @@ -79529,15 +81743,37 @@ components: maxLength: 50 example: exp_0YVCNQ2C1AD1RA3HXKP492GNZB fileId: - type: string - description: ID of the data export file. + type: + - string + - 'null' + description: |- + ID of the data export file. + This value is `null` if the export failed. maxLength: 50 example: file_0YV7HZ7KDCC5WBV9Q7WRKG1H6N + recordCount: + type: integer + description: |- + Total number of records in the export, excluding the header row. + This value is `0` if the export failed. + example: 1500 + status: + type: string + description: |- + Status of the data export. + This webhook is sent only when the data export reaches a terminal status. + This value is never `pending`, `queued`, or `processing`. + enum: + - completed + - failed + failureReason: + $ref: '#/components/schemas/DataExportFailureReason' eventType: type: string description: Type of event that triggered the webhook. enum: - data-export-completed + - data-export-failed _embedded: type: object description: Embedded objects related to the data export event. diff --git a/src/Api/CustomersApi.php b/src/Api/CustomersApi.php index 24c3f5df8..5ec40bca2 100644 --- a/src/Api/CustomersApi.php +++ b/src/Api/CustomersApi.php @@ -18,6 +18,7 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; +use Rebilly\Sdk\Model\Attachment; use Rebilly\Sdk\Model\Customer; use Rebilly\Sdk\Model\CustomerCreditBalance; use Rebilly\Sdk\Model\CustomerInformation; @@ -111,6 +112,24 @@ public function deleteTimelineMessage( $this->client->send($request); } + public function generateComplianceScreeningReport( + string $id, + ): Attachment { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/customers/{id}/compliance-screening-report'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return Attachment::from($data, ['headers' => $response->getHeaders()]); + } + public function get( string $id, ?string $expand = null, diff --git a/src/Api/PayoutRequestAllocationsApi.php b/src/Api/PayoutRequestAllocationsApi.php index df8de05c0..0fe53b3bf 100644 --- a/src/Api/PayoutRequestAllocationsApi.php +++ b/src/Api/PayoutRequestAllocationsApi.php @@ -18,7 +18,6 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; use Rebilly\Sdk\Collection; -use Rebilly\Sdk\Model\GetPayoutRequestAllocationCollectionResponse; use Rebilly\Sdk\Model\PatchPayoutRequestAllocationRequest; use Rebilly\Sdk\Model\PayoutRequestAllocation; use Rebilly\Sdk\Model\PostPayoutRequestAllocationRequest; @@ -74,7 +73,7 @@ public function get( } /** - * @return Collection + * @return Collection */ public function getAll( ?int $limit = null, @@ -97,7 +96,7 @@ public function getAll( $data = Utils::jsonDecode((string) $response->getBody(), true); return new Collection( - array_map(fn (array $item): GetPayoutRequestAllocationCollectionResponse => GetPayoutRequestAllocationCollectionResponse::from($item, ['headers' => $response->getHeaders()]), $data), + array_map(fn (array $item): PayoutRequestAllocation => PayoutRequestAllocation::from($item, ['headers' => $response->getHeaders()]), $data), (int) $response->getHeaderLine(Collection::HEADER_LIMIT), (int) $response->getHeaderLine(Collection::HEADER_OFFSET), (int) $response->getHeaderLine(Collection::HEADER_TOTAL), @@ -108,7 +107,7 @@ public function getAll( } /** - * @return Paginator + * @return Paginator */ public function getAllPaginator( ?int $limit = null, diff --git a/src/Api/PayoutRequestBatchesApi.php b/src/Api/PayoutRequestBatchesApi.php index bf4b19afe..02c2d4093 100644 --- a/src/Api/PayoutRequestBatchesApi.php +++ b/src/Api/PayoutRequestBatchesApi.php @@ -23,6 +23,8 @@ use Rebilly\Sdk\Model\PayoutRequestBatch; use Rebilly\Sdk\Model\PostPayoutRequestBatchBlockRequest; use Rebilly\Sdk\Model\PostPayoutRequestBatchRequest; +use Rebilly\Sdk\Model\PostPayoutRequestsToBatchRequest; +use Rebilly\Sdk\Model\PostRemovePayoutRequestsFromBatchRequest; use Rebilly\Sdk\Paginator; class PayoutRequestBatchesApi @@ -31,6 +33,25 @@ public function __construct(protected ?ClientInterface $client) { } + public function addPayoutRequests( + string $id, + PostPayoutRequestsToBatchRequest $postPayoutRequestsToBatchRequest, + ): PayoutRequestBatch { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/payout-requests'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestsToBatchRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); + } + public function approve( string $id, ): PayoutRequestBatch { @@ -100,6 +121,19 @@ public function create( return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); } + public function delete( + string $id, + ): void { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}'); + + $request = new Request('DELETE', $uri); + $this->client->send($request); + } + public function get( string $id, ): PayoutRequestBatch { @@ -124,12 +158,14 @@ public function get( public function getAll( ?int $limit = null, ?int $offset = null, + ?string $q = null, ?string $filter = null, ?array $sort = null, ): Collection { $queryParams = [ 'limit' => $limit, 'offset' => $offset, + 'q' => $q, 'filter' => $filter, 'sort' => $sort ? implode(',', $sort) : null, ]; @@ -158,12 +194,14 @@ public function getAll( public function getAllPaginator( ?int $limit = null, ?int $offset = null, + ?string $q = null, ?string $filter = null, ?array $sort = null, ): Paginator { $closure = fn (?int $limit, ?int $offset): Collection => $this->getAll( limit: $limit, offset: $offset, + q: $q, filter: $filter, sort: $sort, ); @@ -209,4 +247,41 @@ public function preview( return GetPayoutRequestBatchPreviewResponse::from($data, ['headers' => $response->getHeaders()]); } + + public function removePayoutRequests( + string $id, + PostRemovePayoutRequestsFromBatchRequest $postRemovePayoutRequestsFromBatchRequest, + ): PayoutRequestBatch { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/payout-requests/remove'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ], body: Utils::jsonEncode($postRemovePayoutRequestsFromBatchRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); + } + + public function unblock( + string $id, + ): PayoutRequestBatch { + $pathParams = [ + '{id}' => $id, + ]; + + $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-request-batches/{id}/unblock'); + + $request = new Request('POST', $uri, headers: [ + 'Accept' => 'application/json', + ]); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return PayoutRequestBatch::from($data, ['headers' => $response->getHeaders()]); + } } diff --git a/src/Api/PayoutRequestSplitsApi.php b/src/Api/PayoutRequestSplitsApi.php new file mode 100644 index 000000000..3208eeab4 --- /dev/null +++ b/src/Api/PayoutRequestSplitsApi.php @@ -0,0 +1,45 @@ + 'application/json', + ], body: Utils::jsonEncode($postPayoutRequestSplitRequest)); + $response = $this->client->send($request); + $data = Utils::jsonDecode((string) $response->getBody(), true); + + return array_map(fn (array $item): PayoutRequest => PayoutRequest::from($item, ['headers' => $response->getHeaders()]), $data); + } +} diff --git a/src/Api/PayoutRequestsApi.php b/src/Api/PayoutRequestsApi.php index 8a9370168..18aa8c150 100644 --- a/src/Api/PayoutRequestsApi.php +++ b/src/Api/PayoutRequestsApi.php @@ -21,8 +21,6 @@ use Rebilly\Sdk\Model\GetPayoutRequestPaymentInstrumentsResponse; use Rebilly\Sdk\Model\PatchPayoutRequestRequest; use Rebilly\Sdk\Model\PayoutRequest; -use Rebilly\Sdk\Model\PayoutRequestCancellation; -use Rebilly\Sdk\Model\PayoutRequestSplit; use Rebilly\Sdk\Model\PayoutRequestTimelineMessage; use Rebilly\Sdk\Paginator; @@ -32,25 +30,6 @@ public function __construct(protected ?ClientInterface $client) { } - public function cancel( - string $id, - PayoutRequestCancellation $payoutRequestCancellation, - ): PayoutRequest { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/cancel'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($payoutRequestCancellation)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return PayoutRequest::from($data, ['headers' => $response->getHeaders()]); - } - public function create( PayoutRequest $payoutRequest, ): PayoutRequest { @@ -300,28 +279,6 @@ public function patch( return PayoutRequest::from($data, ['headers' => $response->getHeaders()]); } - /** - * @return PayoutRequest[] - */ - public function split( - string $id, - PayoutRequestSplit $payoutRequestSplit, - ): array { - $pathParams = [ - '{id}' => $id, - ]; - - $uri = str_replace(array_keys($pathParams), array_values($pathParams), '/payout-requests/{id}/split'); - - $request = new Request('POST', $uri, headers: [ - 'Accept' => 'application/json', - ], body: Utils::jsonEncode($payoutRequestSplit)); - $response = $this->client->send($request); - $data = Utils::jsonDecode((string) $response->getBody(), true); - - return array_map(fn (array $item): PayoutRequest => PayoutRequest::from($item, ['headers' => $response->getHeaders()]), $data); - } - public function update( string $id, PayoutRequest $payoutRequest, diff --git a/src/Api/ReportsApi.php b/src/Api/ReportsApi.php index e995f8e5d..7f8a61d05 100644 --- a/src/Api/ReportsApi.php +++ b/src/Api/ReportsApi.php @@ -18,6 +18,7 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Utils; +use Psr\Http\Message\StreamInterface; use Rebilly\Sdk\Model\ApiLogSummary; use Rebilly\Sdk\Model\CumulativeSubscriptions; use Rebilly\Sdk\Model\DashboardResponse; @@ -26,6 +27,7 @@ use Rebilly\Sdk\Model\GetKycAcceptanceSummaryReportResponse; use Rebilly\Sdk\Model\JournalSummaryReport; use Rebilly\Sdk\Model\RenewalSales; +use Rebilly\Sdk\Model\ReportAmlAuditReport; use Rebilly\Sdk\Model\ReportAmlChecks; use Rebilly\Sdk\Model\ReportAmlChecksInheritedSummary; use Rebilly\Sdk\Model\ReportAnnualRecurringRevenue; @@ -54,6 +56,53 @@ public function __construct(protected ?ClientInterface $client) { } + public function getAmlAuditReport( + string $personId, + ?DateTimeImmutable $periodStart = null, + ?DateTimeImmutable $periodEnd = null, + ?string $filter = null, + ?string $accept = null, + ): ReportAmlAuditReport { + $queryParams = [ + 'personId' => $personId, + 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), + 'filter' => $filter, + ]; + $uri = '/experimental/reports/aml-audit-reports?' . 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 ReportAmlAuditReport::from($data, ['headers' => $response->getHeaders()]); + } + + public function getAmlAuditReportPdf( + string $personId, + ?DateTimeImmutable $periodStart = null, + ?DateTimeImmutable $periodEnd = null, + ?string $filter = null, + ?string $accept = null, + ): StreamInterface { + $queryParams = [ + 'personId' => $personId, + 'periodStart' => $periodStart->format('Y-m-d\TH:i:s\Z'), + 'periodEnd' => $periodEnd->format('Y-m-d\TH:i:s\Z'), + 'filter' => $filter, + ]; + $uri = '/experimental/reports/aml-audit-reports?' . http_build_query($queryParams); + + $request = new Request('GET', $uri, headers: [ + 'Accept' => 'application/pdf', + ]); + $response = $this->client->send($request, ['allow_redirects' => ['refer' => true]]); + + return $response->getBody(); + } + public function getAmlChecks( ?DateTimeImmutable $periodStart = null, ?DateTimeImmutable $periodEnd = null, diff --git a/src/Api/ServiceCredentialsApi.php b/src/Api/ServiceCredentialsApi.php index c57c22d2c..f454edf74 100644 --- a/src/Api/ServiceCredentialsApi.php +++ b/src/Api/ServiceCredentialsApi.php @@ -20,6 +20,7 @@ use Rebilly\Sdk\Collection; use Rebilly\Sdk\Model\GoogleSpreadsheet; use Rebilly\Sdk\Model\PatchServiceCredentialRequest; +use Rebilly\Sdk\Model\PostServiceCredentialRequest; use Rebilly\Sdk\Model\ServiceCredential; use Rebilly\Sdk\Model\ServiceCredentialFactory; use Rebilly\Sdk\Paginator; @@ -32,7 +33,7 @@ public function __construct(protected ?ClientInterface $client) public function create( string $type, - ServiceCredential $serviceCredential, + PostServiceCredentialRequest $postServiceCredentialRequest, ): ServiceCredential { $pathParams = [ '{type}' => $type, @@ -42,7 +43,7 @@ public function create( $request = new Request('POST', $uri, headers: [ 'Accept' => 'application/json', - ], body: Utils::jsonEncode($serviceCredential)); + ], body: Utils::jsonEncode($postServiceCredentialRequest)); $response = $this->client->send($request); $data = Utils::jsonDecode((string) $response->getBody(), true); diff --git a/src/Model/AdjustReadyToPayGeneric.php b/src/Model/AdjustReadyToPayGeneric.php index 7271a2cac..53c61c607 100644 --- a/src/Model/AdjustReadyToPayGeneric.php +++ b/src/Model/AdjustReadyToPayGeneric.php @@ -230,6 +230,8 @@ class AdjustReadyToPayGeneric implements AdjustPaymentMethod public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PAY_TABS = 'PayTabs'; public const PAYMENT_METHOD_PAYSAFECARD = 'Paysafecard'; diff --git a/src/Model/AdjustReadyToPayoutGeneric.php b/src/Model/AdjustReadyToPayoutGeneric.php index 1a4d522ef..1cdd5b07f 100644 --- a/src/Model/AdjustReadyToPayoutGeneric.php +++ b/src/Model/AdjustReadyToPayoutGeneric.php @@ -230,6 +230,8 @@ class AdjustReadyToPayoutGeneric implements AdjustReadyToPayoutPaymentMethod public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PAY_TABS = 'PayTabs'; public const PAYMENT_METHOD_PAYSAFECARD = 'Paysafecard'; diff --git a/src/Model/AdyenSettings.php b/src/Model/AdyenSettings.php index fbdef9990..fce70846c 100644 --- a/src/Model/AdyenSettings.php +++ b/src/Model/AdyenSettings.php @@ -46,6 +46,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('levelTwoThreeDataCustomField', $data)) { $this->setLevelTwoThreeDataCustomField($data['levelTwoThreeDataCustomField']); } + if (array_key_exists('mastercardDpaId', $data)) { + $this->setMastercardDpaId($data['mastercardDpaId']); + } + if (array_key_exists('mastercardServiceId', $data)) { + $this->setMastercardServiceId($data['mastercardServiceId']); + } $this->setMetadata($metadata); } @@ -153,6 +159,30 @@ public function setLevelTwoThreeDataCustomField(null|string $levelTwoThreeDataCu return $this; } + public function getMastercardDpaId(): ?string + { + return $this->fields['mastercardDpaId'] ?? null; + } + + public function setMastercardDpaId(null|string $mastercardDpaId): static + { + $this->fields['mastercardDpaId'] = $mastercardDpaId; + + return $this; + } + + public function getMastercardServiceId(): ?string + { + return $this->fields['mastercardServiceId'] ?? null; + } + + public function setMastercardServiceId(null|string $mastercardServiceId): static + { + $this->fields['mastercardServiceId'] = $mastercardServiceId; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -182,6 +212,12 @@ public function jsonSerialize(): array if (array_key_exists('levelTwoThreeDataCustomField', $this->fields)) { $data['levelTwoThreeDataCustomField'] = $this->fields['levelTwoThreeDataCustomField']; } + if (array_key_exists('mastercardDpaId', $this->fields)) { + $data['mastercardDpaId'] = $this->fields['mastercardDpaId']; + } + if (array_key_exists('mastercardServiceId', $this->fields)) { + $data['mastercardServiceId'] = $this->fields['mastercardServiceId']; + } return $data; } diff --git a/src/Model/AlternativeInstrument.php b/src/Model/AlternativeInstrument.php index 47d216639..34a0c842d 100644 --- a/src/Model/AlternativeInstrument.php +++ b/src/Model/AlternativeInstrument.php @@ -236,6 +236,8 @@ class AlternativeInstrument implements PaymentInstrument, PostPaymentInstrumentR public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PLAID_ACCOUNT = 'plaid-account'; public const METHOD_PAY_TABS = 'PayTabs'; diff --git a/src/Model/AlternativePaymentInstrument.php b/src/Model/AlternativePaymentInstrument.php index 215c1073b..e33d394c3 100644 --- a/src/Model/AlternativePaymentInstrument.php +++ b/src/Model/AlternativePaymentInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class AlternativePaymentInstrument implements TransactionPaymentInstrument { use HasMetadata; @@ -290,6 +290,8 @@ class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument, public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; diff --git a/src/Model/AlternativePaymentToken.php b/src/Model/AlternativePaymentToken.php index 5c6da8cec..f06362e71 100644 --- a/src/Model/AlternativePaymentToken.php +++ b/src/Model/AlternativePaymentToken.php @@ -232,6 +232,8 @@ class AlternativePaymentToken implements CompositeToken public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PAY_TABS = 'PayTabs'; public const METHOD_PAYSAFECARD = 'Paysafecard'; diff --git a/src/Model/AmlChecksDataExport.php b/src/Model/AmlChecksDataExport.php index ad408db7a..01467964d 100644 --- a/src/Model/AmlChecksDataExport.php +++ b/src/Model/AmlChecksDataExport.php @@ -40,6 +40,14 @@ class AmlChecksDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?AmlChecksDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/Attachment.php b/src/Model/Attachment.php index 92370d772..557dd3ee0 100644 --- a/src/Model/Attachment.php +++ b/src/Model/Attachment.php @@ -23,6 +23,8 @@ class Attachment implements JsonSerializable { use HasMetadata; + public const RELATED_TYPE_CREDIT_MEMO_TIMELINE_COMMENT = 'credit-memo-timeline-comment'; + public const RELATED_TYPE_CUSTOMER = 'customer'; public const RELATED_TYPE_CUSTOMER_TIMELINE_COMMENT = 'customer-timeline-comment'; @@ -41,10 +43,14 @@ class Attachment implements JsonSerializable public const RELATED_TYPE_PAYMENT = 'payment'; + public const RELATED_TYPE_PAYOUT_REQUEST_TIMELINE_COMMENT = 'payout-request-timeline-comment'; + public const RELATED_TYPE_PLAN = 'plan'; public const RELATED_TYPE_PRODUCT = 'product'; + public const RELATED_TYPE_QUOTE_TIMELINE_COMMENT = 'quote-timeline-comment'; + public const RELATED_TYPE_SUBSCRIPTION = 'subscription'; public const RELATED_TYPE_TRANSACTION = 'transaction'; diff --git a/src/Model/AwepaySettings.php b/src/Model/AwepaySettings.php index cb46e321f..ac599a02b 100644 --- a/src/Model/AwepaySettings.php +++ b/src/Model/AwepaySettings.php @@ -31,9 +31,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('useRestApi', $data)) { $this->setUseRestApi($data['useRestApi']); } - if (array_key_exists('paymentCode', $data)) { - $this->setPaymentCode($data['paymentCode']); - } if (array_key_exists('methodType', $data)) { $this->setMethodType($data['methodType']); } @@ -69,18 +66,6 @@ public function setUseRestApi(null|bool $useRestApi): static return $this; } - public function getPaymentCode(): ?string - { - return $this->fields['paymentCode'] ?? null; - } - - public function setPaymentCode(null|string $paymentCode): static - { - $this->fields['paymentCode'] = $paymentCode; - - return $this; - } - public function getMethodType(): ?string { return $this->fields['methodType'] ?? null; @@ -102,9 +87,6 @@ public function jsonSerialize(): array if (array_key_exists('useRestApi', $this->fields)) { $data['useRestApi'] = $this->fields['useRestApi']; } - if (array_key_exists('paymentCode', $this->fields)) { - $data['paymentCode'] = $this->fields['paymentCode']; - } if (array_key_exists('methodType', $this->fields)) { $data['methodType'] = $this->fields['methodType']; } diff --git a/src/Model/CashInstrument.php b/src/Model/CashInstrument.php index 1671c953b..1d4d15d82 100644 --- a/src/Model/CashInstrument.php +++ b/src/Model/CashInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class CashInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class CashInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/Cashier.php b/src/Model/Cashier.php index 6663d31dd..b4bcb824d 100644 --- a/src/Model/Cashier.php +++ b/src/Model/Cashier.php @@ -57,6 +57,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('pendingPayoutTotal', $data)) { $this->setPendingPayoutTotal($data['pendingPayoutTotal']); } + if (array_key_exists('canWithdraw', $data)) { + $this->setCanWithdraw($data['canWithdraw']); + } if (array_key_exists('lastDepositRequestId', $data)) { $this->setLastDepositRequestId($data['lastDepositRequestId']); } @@ -138,33 +141,11 @@ public function getBalance(): float return $this->fields['balance']; } - public function setBalance(float|string $balance): static - { - if (is_string($balance)) { - $balance = (float) $balance; - } - - $this->fields['balance'] = $balance; - - return $this; - } - public function getBonusBalance(): float { return $this->fields['bonusBalance']; } - public function setBonusBalance(float|string $bonusBalance): static - { - if (is_string($bonusBalance)) { - $bonusBalance = (float) $bonusBalance; - } - - $this->fields['bonusBalance'] = $bonusBalance; - - return $this; - } - public function getNotificationUrl(): ?string { return $this->fields['notificationUrl'] ?? null; @@ -198,15 +179,9 @@ public function getPendingPayoutTotal(): float return $this->fields['pendingPayoutTotal']; } - public function setPendingPayoutTotal(float|string $pendingPayoutTotal): static + public function getCanWithdraw(): bool { - if (is_string($pendingPayoutTotal)) { - $pendingPayoutTotal = (float) $pendingPayoutTotal; - } - - $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; - - return $this; + return $this->fields['canWithdraw']; } public function getLastDepositRequestId(): ?string @@ -277,6 +252,9 @@ public function jsonSerialize(): array if (array_key_exists('pendingPayoutTotal', $this->fields)) { $data['pendingPayoutTotal'] = $this->fields['pendingPayoutTotal']; } + if (array_key_exists('canWithdraw', $this->fields)) { + $data['canWithdraw'] = $this->fields['canWithdraw']; + } if (array_key_exists('lastDepositRequestId', $this->fields)) { $data['lastDepositRequestId'] = $this->fields['lastDepositRequestId']; } @@ -308,6 +286,46 @@ private function setId(string $id): static return $this; } + private function setBalance(float|string $balance): static + { + if (is_string($balance)) { + $balance = (float) $balance; + } + + $this->fields['balance'] = $balance; + + return $this; + } + + private function setBonusBalance(float|string $bonusBalance): static + { + if (is_string($bonusBalance)) { + $bonusBalance = (float) $bonusBalance; + } + + $this->fields['bonusBalance'] = $bonusBalance; + + return $this; + } + + private function setPendingPayoutTotal(float|string $pendingPayoutTotal): static + { + if (is_string($pendingPayoutTotal)) { + $pendingPayoutTotal = (float) $pendingPayoutTotal; + } + + $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; + + return $this; + } + + private function setCanWithdraw(bool $canWithdraw): static + { + $this->fields['canWithdraw'] = $canWithdraw; + + return $this; + } + private function setCashierToken(null|string $cashierToken): static { $this->fields['cashierToken'] = $cashierToken; diff --git a/src/Model/ChangeQuoteOrder.php b/src/Model/ChangeQuoteOrder.php index 0a218bfe6..cc24deec8 100644 --- a/src/Model/ChangeQuoteOrder.php +++ b/src/Model/ChangeQuoteOrder.php @@ -23,6 +23,12 @@ class ChangeQuoteOrder implements JsonSerializable { use HasMetadata; + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + public const RENEWAL_POLICY_RESET = 'reset'; public const RENEWAL_POLICY_RETAIN = 'retain'; @@ -209,15 +215,15 @@ public function setAutopay(null|bool $autopay): static return $this; } - public function getShipping(): ?Shipping + public function getShipping(): ?ChangeQuoteOrderShipping { return $this->fields['shipping'] ?? null; } - public function setShipping(null|Shipping|array $shipping): static + public function setShipping(null|ChangeQuoteOrderShipping|array $shipping): static { - if ($shipping !== null && !($shipping instanceof Shipping)) { - $shipping = ShippingFactory::from($shipping); + if ($shipping !== null && !($shipping instanceof ChangeQuoteOrderShipping)) { + $shipping = ChangeQuoteOrderShipping::from($shipping); } $this->fields['shipping'] = $shipping; diff --git a/src/Model/ChangeQuoteOrderShipping.php b/src/Model/ChangeQuoteOrderShipping.php new file mode 100644 index 000000000..369c67238 --- /dev/null +++ b/src/Model/ChangeQuoteOrderShipping.php @@ -0,0 +1,35 @@ + '', + ] + $data, $metadata); + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } +} diff --git a/src/Model/CheckInstrument.php b/src/Model/CheckInstrument.php index 43413279d..bcf960e5a 100644 --- a/src/Model/CheckInstrument.php +++ b/src/Model/CheckInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class CheckInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class CheckInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/CheckoutForm.php b/src/Model/CheckoutForm.php index b73393060..bc09f491d 100644 --- a/src/Model/CheckoutForm.php +++ b/src/Model/CheckoutForm.php @@ -293,6 +293,8 @@ class CheckoutForm implements JsonSerializable public const PAYMENT_METHODS_PIX = 'PIX'; + public const PAYMENT_METHODS_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHODS_PIN_PAY = 'PinPay'; public const PAYMENT_METHODS_PHONE = 'phone'; diff --git a/src/Model/CoinPricing.php b/src/Model/CoinPricing.php new file mode 100644 index 000000000..0179cd90e --- /dev/null +++ b/src/Model/CoinPricing.php @@ -0,0 +1,22 @@ + CoinPricingFlatRate::from($data, $metadata), + 'volume' => CoinPricingVolume::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/CoinPricingFlatRate.php b/src/Model/CoinPricingFlatRate.php new file mode 100644 index 000000000..a5ac8afb1 --- /dev/null +++ b/src/Model/CoinPricingFlatRate.php @@ -0,0 +1,66 @@ +setCoinsPerFiatMinor($data['coinsPerFiatMinor']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFormula(): string + { + return 'flat-rate'; + } + + public function getCoinsPerFiatMinor(): int + { + return $this->fields['coinsPerFiatMinor']; + } + + public function setCoinsPerFiatMinor(int $coinsPerFiatMinor): static + { + $this->fields['coinsPerFiatMinor'] = $coinsPerFiatMinor; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'formula' => 'flat-rate', + ]; + if (array_key_exists('coinsPerFiatMinor', $this->fields)) { + $data['coinsPerFiatMinor'] = $this->fields['coinsPerFiatMinor']; + } + + return $data; + } +} diff --git a/src/Model/CoinPricingVolume.php b/src/Model/CoinPricingVolume.php new file mode 100644 index 000000000..b2b82b62e --- /dev/null +++ b/src/Model/CoinPricingVolume.php @@ -0,0 +1,80 @@ +setBrackets($data['brackets']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFormula(): string + { + return 'volume'; + } + + /** + * @return CoinPricingVolumeBracket[] + */ + public function getBrackets(): array + { + return $this->fields['brackets']; + } + + /** + * @param array[]|CoinPricingVolumeBracket[] $brackets + */ + public function setBrackets(array $brackets): static + { + $brackets = array_map( + fn ($value) => $value instanceof CoinPricingVolumeBracket ? $value : CoinPricingVolumeBracket::from($value), + $brackets, + ); + + $this->fields['brackets'] = $brackets; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'formula' => 'volume', + ]; + if (array_key_exists('brackets', $this->fields)) { + $data['brackets'] = array_map( + static fn (CoinPricingVolumeBracket $coinPricingVolumeBracket) => $coinPricingVolumeBracket->jsonSerialize(), + $this->fields['brackets'], + ); + } + + return $data; + } +} diff --git a/src/Model/CoinPricingVolumeBracket.php b/src/Model/CoinPricingVolumeBracket.php new file mode 100644 index 000000000..f71e39256 --- /dev/null +++ b/src/Model/CoinPricingVolumeBracket.php @@ -0,0 +1,82 @@ +setCoinsPerFiatMinor($data['coinsPerFiatMinor']); + } + if (array_key_exists('maxAmount', $data)) { + $this->setMaxAmount($data['maxAmount']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCoinsPerFiatMinor(): int + { + return $this->fields['coinsPerFiatMinor']; + } + + public function setCoinsPerFiatMinor(int $coinsPerFiatMinor): static + { + $this->fields['coinsPerFiatMinor'] = $coinsPerFiatMinor; + + return $this; + } + + public function getMaxAmount(): ?float + { + return $this->fields['maxAmount'] ?? null; + } + + public function setMaxAmount(null|float|string $maxAmount): static + { + if (is_string($maxAmount)) { + $maxAmount = (float) $maxAmount; + } + + $this->fields['maxAmount'] = $maxAmount; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('coinsPerFiatMinor', $this->fields)) { + $data['coinsPerFiatMinor'] = $this->fields['coinsPerFiatMinor']; + } + if (array_key_exists('maxAmount', $this->fields)) { + $data['maxAmount'] = $this->fields['maxAmount']; + } + + return $data; + } +} diff --git a/src/Model/Customer.php b/src/Model/Customer.php index 0b03c731c..c4ec01c6b 100644 --- a/src/Model/Customer.php +++ b/src/Model/Customer.php @@ -48,6 +48,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('defaultPaymentInstrument', $data)) { $this->setDefaultPaymentInstrument($data['defaultPaymentInstrument']); } + if (array_key_exists('defaultPaymentInstrumentId', $data)) { + $this->setDefaultPaymentInstrumentId($data['defaultPaymentInstrumentId']); + } if (array_key_exists('preferredPayoutInstrumentId', $data)) { $this->setPreferredPayoutInstrumentId($data['preferredPayoutInstrumentId']); } @@ -174,7 +177,7 @@ public function getDefaultPaymentInstrument(): ?CustomerDefaultPaymentInstrument public function setDefaultPaymentInstrument(null|CustomerDefaultPaymentInstrument|array $defaultPaymentInstrument): static { if ($defaultPaymentInstrument !== null && !($defaultPaymentInstrument instanceof CustomerDefaultPaymentInstrument)) { - $defaultPaymentInstrument = CustomerDefaultPaymentInstrumentFactory::from($defaultPaymentInstrument); + $defaultPaymentInstrument = CustomerDefaultPaymentInstrument::from($defaultPaymentInstrument); } $this->fields['defaultPaymentInstrument'] = $defaultPaymentInstrument; @@ -182,6 +185,18 @@ public function setDefaultPaymentInstrument(null|CustomerDefaultPaymentInstrumen return $this; } + public function getDefaultPaymentInstrumentId(): ?string + { + return $this->fields['defaultPaymentInstrumentId'] ?? null; + } + + public function setDefaultPaymentInstrumentId(null|string $defaultPaymentInstrumentId): static + { + $this->fields['defaultPaymentInstrumentId'] = $defaultPaymentInstrumentId; + + return $this; + } + public function getPreferredPayoutInstrumentId(): ?string { return $this->fields['preferredPayoutInstrumentId'] ?? null; @@ -447,6 +462,9 @@ public function jsonSerialize(): array if (array_key_exists('defaultPaymentInstrument', $this->fields)) { $data['defaultPaymentInstrument'] = $this->fields['defaultPaymentInstrument']?->jsonSerialize(); } + if (array_key_exists('defaultPaymentInstrumentId', $this->fields)) { + $data['defaultPaymentInstrumentId'] = $this->fields['defaultPaymentInstrumentId']; + } if (array_key_exists('preferredPayoutInstrumentId', $this->fields)) { $data['preferredPayoutInstrumentId'] = $this->fields['preferredPayoutInstrumentId']; } diff --git a/src/Model/CustomerDefaultPaymentInstrument.php b/src/Model/CustomerDefaultPaymentInstrument.php index 80f92288e..4dcb715eb 100644 --- a/src/Model/CustomerDefaultPaymentInstrument.php +++ b/src/Model/CustomerDefaultPaymentInstrument.php @@ -15,7 +15,452 @@ namespace Rebilly\Sdk\Model; use JsonSerializable; +use Rebilly\Sdk\Trait\HasMetadata; -interface CustomerDefaultPaymentInstrument extends JsonSerializable +class CustomerDefaultPaymentInstrument implements JsonSerializable { + use HasMetadata; + + public const METHOD_ADV_CASH = 'AdvCash'; + + public const METHOD_AERA = 'Aera'; + + public const METHOD_AFFIRM = 'Affirm'; + + public const METHOD_AFTERPAY = 'Afterpay'; + + public const METHOD_AIRCASH = 'Aircash'; + + public const METHOD_AIRPAY = 'Airpay'; + + public const METHOD_ALFA_CLICK = 'Alfa-click'; + + public const METHOD_ALIPAY = 'Alipay'; + + public const METHOD_AMAZON_PAY = 'AmazonPay'; + + public const METHOD_APPLE_PAY = 'Apple Pay'; + + public const METHOD_ASTRO_PAY_CARD = 'AstroPay Card'; + + public const METHOD_ASTRO_PAY_GO = 'AstroPay-GO'; + + public const METHOD_BANK_SEND = 'BankSEND'; + + public const METHOD_BANK_REFERENCED = 'BankReferenced'; + + public const METHOD_BANK_TRANSFER = 'bank-transfer'; + + public const METHOD_BANK_TRANSFER2 = 'bank-transfer-2'; + + public const METHOD_BANK_TRANSFER3 = 'bank-transfer-3'; + + public const METHOD_BANK_TRANSFER4 = 'bank-transfer-4'; + + public const METHOD_BANK_TRANSFER5 = 'bank-transfer-5'; + + public const METHOD_BANK_TRANSFER6 = 'bank-transfer-6'; + + public const METHOD_BANK_TRANSFER7 = 'bank-transfer-7'; + + public const METHOD_BANK_TRANSFER8 = 'bank-transfer-8'; + + public const METHOD_BANK_TRANSFER9 = 'bank-transfer-9'; + + public const METHOD_BALOTO = 'Baloto'; + + public const METHOD_BEELINE = 'Beeline'; + + public const METHOD_BELFIUS_DIRECT_NET = 'Belfius-direct-net'; + + public const METHOD_BITCOIN = 'bitcoin'; + + public const METHOD_BIZUM = 'Bizum'; + + public const METHOD_BLIK = 'Blik'; + + public const METHOD_BOLETO = 'Boleto'; + + public const METHOD_BOLETO2 = 'Boleto-2'; + + public const METHOD_BOLETO3 = 'Boleto-3'; + + public const METHOD_CASH_DEPOSIT = 'cash-deposit'; + + public const METHOD_CAS_HLIB = 'CASHlib'; + + public const METHOD_CASH_TO_CODE = 'CashToCode'; + + public const METHOD_CC_AVENUE = 'CCAvenue'; + + public const METHOD_CHINA_UNION_PAY = 'China UnionPay'; + + public const METHOD_CLEARPAY = 'Clearpay'; + + public const METHOD_CLEO = 'Cleo'; + + public const METHOD_COD_VOUCHER = 'CODVoucher'; + + public const METHOD_CONEKTA_OXXO = 'Conekta-oxxo'; + + public const METHOD_CONEKTA_SPEI = 'Conekta-spei'; + + public const METHOD_CRYPTOCURRENCY = 'cryptocurrency'; + + public const METHOD_CUPON_DE_PAGOS = 'Cupon-de-pagos'; + + public const METHOD_CYBER_SOURCE = 'CyberSource'; + + public const METHOD_DIMOCO_PAY_SMART = 'Dimoco-pay-smart'; + + public const METHOD_DIRECTA24_CARD = 'Directa24Card'; + + public const METHOD_DOMESTIC_CARDS = 'domestic-cards'; + + public const METHOD_EFECTY = 'Efecty'; + + public const METHOD_ECHECK = 'echeck'; + + public const METHOD_ECO_PAYZ = 'ecoPayz'; + + public const METHOD_ECO_PAYZ_TURKEY = 'ecoPayzTurkey'; + + public const METHOD_ECO_VOUCHER = 'ecoVoucher'; + + public const METHOD_EPS = 'EPS'; + + public const METHOD_E_PAY_BG = 'ePay.bg'; + + public const METHOD_ETHEREUM = 'Ethereum'; + + public const METHOD_E_WALLET = 'e-wallet'; + + public const METHOD_EZY_EFT = 'ezyEFT'; + + public const METHOD_E_ZEE_WALLET = 'eZeeWallet'; + + public const METHOD_FASTER_PAY = 'FasterPay'; + + public const METHOD_FLEXEPIN = 'Flexepin'; + + public const METHOD_GIROPAY = 'Giropay'; + + public const METHOD_GOOGLE_PAY = 'Google Pay'; + + public const METHOD_GPAYSAFE = 'Gpaysafe'; + + public const METHOD_I_CASH_ONE_VOUCHER = 'iCashOne Voucher'; + + public const METHOD_I_DEBIT = 'iDebit'; + + public const METHOD_I_DEAL = 'iDEAL'; + + public const METHOD_ING_HOMEPAY = 'ING-homepay'; + + public const METHOD_INOVAPAY_PIN = 'INOVAPAY-pin'; + + public const METHOD_INOVAPAY_WALLET = 'INOVAPAY-wallet'; + + public const METHOD_INSTA_DEBIT = 'InstaDebit'; + + public const METHOD_INSTANT_PAYMENTS = 'InstantPayments'; + + public const METHOD_INSTANT_BANK_TRANSFER = 'instant-bank-transfer'; + + public const METHOD_INTERAC_ONLINE = 'Interac-online'; + + public const METHOD_INTERAC_E_TRANSFER = 'Interac-eTransfer'; + + public const METHOD_INTERAC_EXPRESS_CONNECT = 'Interac-express-connect'; + + public const METHOD_INTERAC = 'Interac'; + + public const METHOD_INVOICE = 'invoice'; + + public const METHOD_I_WALLET = 'iWallet'; + + public const METHOD_JETON = 'Jeton'; + + public const METHOD_JETON_CASH = 'JetonCash'; + + public const METHOD_JPAY = 'jpay'; + + public const METHOD_KAKAO_PAY = 'KakaoPay'; + + public const METHOD_KHELOCARD = 'Khelocard'; + + public const METHOD_KLARNA = 'Klarna'; + + public const METHOD_KNOT = 'KNOT'; + + public const METHOD_LITECOIN = 'Litecoin'; + + public const METHOD_LOONIE = 'loonie'; + + public const METHOD_LPG_ONLINE = 'LPG-online'; + + public const METHOD_LPG_PAYMENT_CARD = 'LPG-payment-card'; + + public const METHOD_MATRIX = 'Matrix'; + + public const METHOD_MAXI_CASH = 'MaxiCash'; + + public const METHOD_MEGAFON = 'Megafon'; + + public const METHOD_MERCADO_PAGO = 'MercadoPago'; + + public const METHOD_MI_FINITY_E_WALLET = 'MiFinity-eWallet'; + + public const METHOD_MISCELLANEOUS = 'miscellaneous'; + + public const METHOD_MOBILE_PAY = 'MobilePay'; + + public const METHOD_MOLLIE = 'Mollie'; + + public const METHOD_MULTIBANCO = 'Multibanco'; + + public const METHOD_BANCONTACT = 'Bancontact'; + + public const METHOD_BANCONTACT_MOBILE = 'Bancontact-mobile'; + + public const METHOD_MTS = 'MTS'; + + public const METHOD_MUCH_BETTER = 'MuchBetter'; + + public const METHOD_MUCH_BETTER_VOUCHER = 'MuchBetterVoucher'; + + public const METHOD_MY_FATOORAH = 'MyFatoorah'; + + public const METHOD_NEOSURF = 'Neosurf'; + + public const METHOD_NETBANKING = 'Netbanking'; + + public const METHOD_NETELLER = 'Neteller'; + + public const METHOD_NORDEA_SOLO = 'Nordea-Solo'; + + public const METHOD_NORDIK_COIN = 'NordikCoin'; + + public const METHOD_OCHA_PAY = 'OchaPay'; + + public const METHOD_ONLINE_BANK_TRANSFER = 'online-bank-transfer'; + + public const METHOD_ONLINEUEBERWEISEN = 'Onlineueberweisen'; + + public const METHOD_ORIENTAL_WALLET = 'oriental-wallet'; + + public const METHOD_OXXO = 'OXXO'; + + public const METHOD_P24 = 'P24'; + + public const METHOD_PAGADITO = 'Pagadito'; + + public const METHOD_PAGO_EFFECTIVO = 'PagoEffectivo'; + + public const METHOD_PAGSMILE_LOTTERY = 'Pagsmile-lottery'; + + public const METHOD_PAGSMILE_DEPOSIT_EXPRESS = 'Pagsmile-deposit-express'; + + public const METHOD_PAY_CASH = 'PayCash'; + + public const METHOD_PAYCO = 'Payco'; + + public const METHOD_PAYEER = 'Payeer'; + + public const METHOD_PAYMENT_ASIA_CRYPTO = 'PaymentAsia-crypto'; + + public const METHOD_PAYSAFECARD = 'Paysafecard'; + + public const METHOD_PAY_TABS = 'PayTabs'; + + public const METHOD_PAY4_FUN = 'Pay4Fun'; + + public const METHOD_PAYNOTE = 'Paynote'; + + public const METHOD_PAYMERO = 'Paymero'; + + public const METHOD_PAYMERO_QR = 'Paymero-QR'; + + public const METHOD_PAY_U = 'PayU'; + + public const METHOD_PAY_U_LATAM = 'PayULatam'; + + public const METHOD_PERFECT_MONEY = 'Perfect-money'; + + public const METHOD_PIASTRIX = 'Piastrix'; + + public const METHOD_PIX = 'PIX'; + + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + + public const METHOD_PIN_PAY = 'PinPay'; + + public const METHOD_PHONE = 'phone'; + + public const METHOD_PHONE_PE = 'PhonePe'; + + public const METHOD_PO_LI = 'POLi'; + + public const METHOD_POST_FINANCE_CARD = 'PostFinance-card'; + + public const METHOD_POST_FINANCE_E_FINANCE = 'PostFinance-e-finance'; + + public const METHOD_QIWI = 'QIWI'; + + public const METHOD_Q_PAY = 'QPay'; + + public const METHOD_QQ_PAY = 'QQPay'; + + public const METHOD_QUICKPAY = 'Quickpay'; + + public const METHOD_RAPYD_CHECKOUT = 'rapyd-checkout'; + + public const METHOD_REBILLY_HOSTED_PAYMENT_FORM = 'rebilly-hosted-payment-form'; + + public const METHOD_RESURS = 'Resurs'; + + public const METHOD_REVERSE_WITHDRAWAL = 'reverse-withdrawal'; + + public const METHOD_RIPPLE = 'Ripple'; + + public const METHOD_SAFETY_PAY = 'SafetyPay'; + + public const METHOD_SAMSUNG_PAY = 'Samsung Pay'; + + public const METHOD_SEPA = 'SEPA'; + + public const METHOD_SIIRTO = 'Siirto'; + + public const METHOD_SKRILL = 'Skrill'; + + public const METHOD_SKRILL_RAPID_TRANSFER = 'Skrill Rapid Transfer'; + + public const METHOD_SMS_VOUCHER = 'SMSVoucher'; + + public const METHOD_SOFORT = 'Sofort'; + + public const METHOD_SPARK_PAY = 'SparkPay'; + + public const METHOD_SPEI = 'SPEI'; + + public const METHOD_SWIFT_DBT = 'swift-dbt'; + + public const METHOD_TELE2 = 'Tele2'; + + public const METHOD_TELR = 'Telr'; + + public const METHOD_TERMINALY_RF = 'Terminaly-RF'; + + public const METHOD_TETHER = 'Tether'; + + public const METHOD_TODITO_CASH_CARD = 'ToditoCash-card'; + + public const METHOD_TRUSTLY = 'Trustly'; + + public const METHOD_TUPAY = 'Tupay'; + + public const METHOD_TWINT = 'TWINT'; + + public const METHOD_UNI_CRYPT = 'UniCrypt'; + + public const METHOD_U_PAY_CARD = 'UPayCard'; + + public const METHOD_UPI = 'UPI'; + + public const METHOD_USD_COIN = 'USD-coin'; + + public const METHOD_V_CREDITOS = 'VCreditos'; + + public const METHOD_VEGA_WALLET = 'VegaWallet'; + + public const METHOD_VENUS_POINT = 'VenusPoint'; + + public const METHOD_VIVA = 'Viva'; + + public const METHOD_VOUCHER = 'voucher'; + + public const METHOD_VOUCHER2 = 'voucher-2'; + + public const METHOD_VOUCHER3 = 'voucher-3'; + + public const METHOD_VOUCHER4 = 'voucher-4'; + + public const METHOD_WALLET88 = 'Wallet88'; + + public const METHOD_WEBMONEY = 'Webmoney'; + + public const METHOD_WEBPAY = 'Webpay'; + + public const METHOD_WEBPAY2 = 'Webpay-2'; + + public const METHOD_WEBPAY_CARD = 'Webpay Card'; + + public const METHOD_WE_CHAT_PAY = 'WeChat Pay'; + + public const METHOD_X_PAY_P2_P = 'XPay-P2P'; + + public const METHOD_X_PAY_QR = 'XPay-QR'; + + public const METHOD_YANDEX_MONEY = 'Yandex-money'; + + public const METHOD_ZOTAPAY = 'Zotapay'; + + public const METHOD_ZIMPLER = 'Zimpler'; + + public const METHOD_ZIP = 'Zip'; + + private array $fields = []; + + public function __construct(array $data = [], array $metadata = []) + { + if (array_key_exists('method', $data)) { + $this->setMethod($data['method']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getMethod(): string + { + return $this->fields['method']; + } + + public function setMethod(string $method): static + { + $this->fields['method'] = $method; + + return $this; + } + + public function getPaymentInstrumentId(): string + { + return $this->fields['paymentInstrumentId']; + } + + public function setPaymentInstrumentId(string $paymentInstrumentId): static + { + $this->fields['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('method', $this->fields)) { + $data['method'] = $this->fields['method']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + + return $data; + } } diff --git a/src/Model/CustomerDefaultPaymentInstrumentFactory.php b/src/Model/CustomerDefaultPaymentInstrumentFactory.php deleted file mode 100644 index c31d14711..000000000 --- a/src/Model/CustomerDefaultPaymentInstrumentFactory.php +++ /dev/null @@ -1,226 +0,0 @@ - AlternativePaymentInstrument::from($data, $metadata), - 'Aera' => AlternativePaymentInstrument::from($data, $metadata), - 'Affirm' => AlternativePaymentInstrument::from($data, $metadata), - 'Afterpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Aircash' => AlternativePaymentInstrument::from($data, $metadata), - 'Airpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Alfa-click' => AlternativePaymentInstrument::from($data, $metadata), - 'Alipay' => AlternativePaymentInstrument::from($data, $metadata), - 'AmazonPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Apple Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'AstroPay Card' => AlternativePaymentInstrument::from($data, $metadata), - 'AstroPay-GO' => AlternativePaymentInstrument::from($data, $metadata), - 'Baloto' => AlternativePaymentInstrument::from($data, $metadata), - 'Bancontact' => AlternativePaymentInstrument::from($data, $metadata), - 'Bancontact-mobile' => AlternativePaymentInstrument::from($data, $metadata), - 'BankReferenced' => AlternativePaymentInstrument::from($data, $metadata), - 'BankSEND' => AlternativePaymentInstrument::from($data, $metadata), - 'Beeline' => AlternativePaymentInstrument::from($data, $metadata), - 'Belfius-direct-net' => AlternativePaymentInstrument::from($data, $metadata), - 'Bizum' => AlternativePaymentInstrument::from($data, $metadata), - 'Blik' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto-2' => AlternativePaymentInstrument::from($data, $metadata), - 'Boleto-3' => AlternativePaymentInstrument::from($data, $metadata), - 'CASHlib' => AlternativePaymentInstrument::from($data, $metadata), - 'CCAvenue' => AlternativePaymentInstrument::from($data, $metadata), - 'CODVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'CashToCode' => AlternativePaymentInstrument::from($data, $metadata), - 'China UnionPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Clearpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Cleo' => AlternativePaymentInstrument::from($data, $metadata), - 'Conekta-oxxo' => AlternativePaymentInstrument::from($data, $metadata), - 'Conekta-spei' => AlternativePaymentInstrument::from($data, $metadata), - 'Cupon-de-pagos' => AlternativePaymentInstrument::from($data, $metadata), - 'CyberSource' => AlternativePaymentInstrument::from($data, $metadata), - 'Dimoco-pay-smart' => AlternativePaymentInstrument::from($data, $metadata), - 'Directa24Card' => AlternativePaymentInstrument::from($data, $metadata), - 'EPS' => AlternativePaymentInstrument::from($data, $metadata), - 'Efecty' => AlternativePaymentInstrument::from($data, $metadata), - 'Ethereum' => AlternativePaymentInstrument::from($data, $metadata), - 'FasterPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Flexepin' => AlternativePaymentInstrument::from($data, $metadata), - 'Giropay' => AlternativePaymentInstrument::from($data, $metadata), - 'Google Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Gpaysafe' => AlternativePaymentInstrument::from($data, $metadata), - 'ING-homepay' => AlternativePaymentInstrument::from($data, $metadata), - 'INOVAPAY-pin' => AlternativePaymentInstrument::from($data, $metadata), - 'INOVAPAY-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'InstaDebit' => AlternativePaymentInstrument::from($data, $metadata), - 'InstantPayments' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-eTransfer' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-express-connect' => AlternativePaymentInstrument::from($data, $metadata), - 'Interac-online' => AlternativePaymentInstrument::from($data, $metadata), - 'Jeton' => AlternativePaymentInstrument::from($data, $metadata), - 'JetonCash' => AlternativePaymentInstrument::from($data, $metadata), - 'KNOT' => AlternativePaymentInstrument::from($data, $metadata), - 'KakaoPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Khelocard' => AlternativePaymentInstrument::from($data, $metadata), - 'Klarna' => AlternativePaymentInstrument::from($data, $metadata), - 'LPG-online' => AlternativePaymentInstrument::from($data, $metadata), - 'LPG-payment-card' => AlternativePaymentInstrument::from($data, $metadata), - 'Litecoin' => AlternativePaymentInstrument::from($data, $metadata), - 'MTS' => AlternativePaymentInstrument::from($data, $metadata), - 'Matrix' => AlternativePaymentInstrument::from($data, $metadata), - 'MaxiCash' => AlternativePaymentInstrument::from($data, $metadata), - 'Megafon' => AlternativePaymentInstrument::from($data, $metadata), - 'MercadoPago' => AlternativePaymentInstrument::from($data, $metadata), - 'MiFinity-eWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'MobilePay' => AlternativePaymentInstrument::from($data, $metadata), - 'Mollie' => AlternativePaymentInstrument::from($data, $metadata), - 'MuchBetter' => AlternativePaymentInstrument::from($data, $metadata), - 'MuchBetterVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'Multibanco' => AlternativePaymentInstrument::from($data, $metadata), - 'MyFatoorah' => AlternativePaymentInstrument::from($data, $metadata), - 'Neosurf' => AlternativePaymentInstrument::from($data, $metadata), - 'Netbanking' => AlternativePaymentInstrument::from($data, $metadata), - 'Neteller' => AlternativePaymentInstrument::from($data, $metadata), - 'Nordea-Solo' => AlternativePaymentInstrument::from($data, $metadata), - 'NordikCoin' => AlternativePaymentInstrument::from($data, $metadata), - 'OXXO' => AlternativePaymentInstrument::from($data, $metadata), - 'OchaPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Onlineueberweisen' => AlternativePaymentInstrument::from($data, $metadata), - 'P24' => AlternativePaymentInstrument::from($data, $metadata), - 'PIX' => AlternativePaymentInstrument::from($data, $metadata), - 'POLi' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagadito' => AlternativePaymentInstrument::from($data, $metadata), - 'PagoEffectivo' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagsmile-deposit-express' => AlternativePaymentInstrument::from($data, $metadata), - 'Pagsmile-lottery' => AlternativePaymentInstrument::from($data, $metadata), - 'Pay4Fun' => AlternativePaymentInstrument::from($data, $metadata), - 'PayCash' => AlternativePaymentInstrument::from($data, $metadata), - 'PayTabs' => AlternativePaymentInstrument::from($data, $metadata), - 'PayU' => AlternativePaymentInstrument::from($data, $metadata), - 'PayULatam' => AlternativePaymentInstrument::from($data, $metadata), - 'Payco' => AlternativePaymentInstrument::from($data, $metadata), - 'Payeer' => AlternativePaymentInstrument::from($data, $metadata), - 'PaymentAsia-crypto' => AlternativePaymentInstrument::from($data, $metadata), - 'Paymero' => AlternativePaymentInstrument::from($data, $metadata), - 'Paymero-QR' => AlternativePaymentInstrument::from($data, $metadata), - 'Paynote' => AlternativePaymentInstrument::from($data, $metadata), - 'Paysafecard' => AlternativePaymentInstrument::from($data, $metadata), - 'Perfect-money' => AlternativePaymentInstrument::from($data, $metadata), - 'PhonePe' => AlternativePaymentInstrument::from($data, $metadata), - 'Piastrix' => AlternativePaymentInstrument::from($data, $metadata), - 'PinPay' => AlternativePaymentInstrument::from($data, $metadata), - 'PostFinance-card' => AlternativePaymentInstrument::from($data, $metadata), - 'PostFinance-e-finance' => AlternativePaymentInstrument::from($data, $metadata), - 'QIWI' => AlternativePaymentInstrument::from($data, $metadata), - 'QPay' => AlternativePaymentInstrument::from($data, $metadata), - 'QQPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Quickpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Resurs' => AlternativePaymentInstrument::from($data, $metadata), - 'Ripple' => AlternativePaymentInstrument::from($data, $metadata), - 'SEPA' => AlternativePaymentInstrument::from($data, $metadata), - 'SMSVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'SPEI' => AlternativePaymentInstrument::from($data, $metadata), - 'SafetyPay' => AlternativePaymentInstrument::from($data, $metadata), - 'Samsung Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Siirto' => AlternativePaymentInstrument::from($data, $metadata), - 'Skrill' => AlternativePaymentInstrument::from($data, $metadata), - 'Skrill Rapid Transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'Sofort' => AlternativePaymentInstrument::from($data, $metadata), - 'SparkPay' => AlternativePaymentInstrument::from($data, $metadata), - 'TWINT' => AlternativePaymentInstrument::from($data, $metadata), - 'Tele2' => AlternativePaymentInstrument::from($data, $metadata), - 'Telr' => AlternativePaymentInstrument::from($data, $metadata), - 'Terminaly-RF' => AlternativePaymentInstrument::from($data, $metadata), - 'Tether' => AlternativePaymentInstrument::from($data, $metadata), - 'ToditoCash-card' => AlternativePaymentInstrument::from($data, $metadata), - 'Trustly' => AlternativePaymentInstrument::from($data, $metadata), - 'Tupay' => AlternativePaymentInstrument::from($data, $metadata), - 'UPI' => AlternativePaymentInstrument::from($data, $metadata), - 'UPayCard' => AlternativePaymentInstrument::from($data, $metadata), - 'USD-coin' => AlternativePaymentInstrument::from($data, $metadata), - 'UniCrypt' => AlternativePaymentInstrument::from($data, $metadata), - 'VCreditos' => AlternativePaymentInstrument::from($data, $metadata), - 'VegaWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'VenusPoint' => AlternativePaymentInstrument::from($data, $metadata), - 'Viva' => AlternativePaymentInstrument::from($data, $metadata), - 'Wallet88' => AlternativePaymentInstrument::from($data, $metadata), - 'WeChat Pay' => AlternativePaymentInstrument::from($data, $metadata), - 'Webmoney' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay Card' => AlternativePaymentInstrument::from($data, $metadata), - 'Webpay-2' => AlternativePaymentInstrument::from($data, $metadata), - 'XPay-P2P' => AlternativePaymentInstrument::from($data, $metadata), - 'XPay-QR' => AlternativePaymentInstrument::from($data, $metadata), - 'Yandex-money' => AlternativePaymentInstrument::from($data, $metadata), - 'Zimpler' => AlternativePaymentInstrument::from($data, $metadata), - 'Zip' => AlternativePaymentInstrument::from($data, $metadata), - 'Zotapay' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-2' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-3' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-4' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-5' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-6' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-7' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-8' => AlternativePaymentInstrument::from($data, $metadata), - 'bank-transfer-9' => AlternativePaymentInstrument::from($data, $metadata), - 'bitcoin' => AlternativePaymentInstrument::from($data, $metadata), - 'cash-deposit' => AlternativePaymentInstrument::from($data, $metadata), - 'cryptocurrency' => AlternativePaymentInstrument::from($data, $metadata), - 'domestic-cards' => AlternativePaymentInstrument::from($data, $metadata), - 'e-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'ePay.bg' => AlternativePaymentInstrument::from($data, $metadata), - 'eZeeWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'echeck' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoPayz' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoPayzTurkey' => AlternativePaymentInstrument::from($data, $metadata), - 'ecoVoucher' => AlternativePaymentInstrument::from($data, $metadata), - 'ezyEFT' => AlternativePaymentInstrument::from($data, $metadata), - 'iCashOne Voucher' => AlternativePaymentInstrument::from($data, $metadata), - 'iDEAL' => AlternativePaymentInstrument::from($data, $metadata), - 'iDebit' => AlternativePaymentInstrument::from($data, $metadata), - 'iWallet' => AlternativePaymentInstrument::from($data, $metadata), - 'instant-bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'invoice' => AlternativePaymentInstrument::from($data, $metadata), - 'jpay' => AlternativePaymentInstrument::from($data, $metadata), - 'loonie' => AlternativePaymentInstrument::from($data, $metadata), - 'miscellaneous' => AlternativePaymentInstrument::from($data, $metadata), - 'online-bank-transfer' => AlternativePaymentInstrument::from($data, $metadata), - 'oriental-wallet' => AlternativePaymentInstrument::from($data, $metadata), - 'phone' => AlternativePaymentInstrument::from($data, $metadata), - 'rapyd-checkout' => AlternativePaymentInstrument::from($data, $metadata), - 'rebilly-hosted-payment-form' => AlternativePaymentInstrument::from($data, $metadata), - 'reverse-withdrawal' => AlternativePaymentInstrument::from($data, $metadata), - 'swift-dbt' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-2' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-3' => AlternativePaymentInstrument::from($data, $metadata), - 'voucher-4' => AlternativePaymentInstrument::from($data, $metadata), - 'cash' => CashInstrument::from($data, $metadata), - 'check' => CheckInstrument::from($data, $metadata), - default => throw new UnknownDiscriminatorValueException(), - }; - } -} diff --git a/src/Model/CustomerTimeline.php b/src/Model/CustomerTimeline.php index c0b8395ff..3ad103a35 100644 --- a/src/Model/CustomerTimeline.php +++ b/src/Model/CustomerTimeline.php @@ -165,6 +165,10 @@ class CustomerTimeline implements JsonSerializable public const TYPE_REFUND_WAS_REFLECTED_IN_INVOICES = 'refund-was-reflected-in-invoices'; + public const TYPE_SUBSCRIPTION_PAUSE_CREATED = 'subscription-pause-created'; + + public const TYPE_SUBSCRIPTION_PAUSE_REVOKED = 'subscription-pause-revoked'; + public const TYPE_SUBSCRIPTION_PAUSED = 'subscription-paused'; public const TYPE_SUBSCRIPTION_RESUMED = 'subscription-resumed'; @@ -187,6 +191,8 @@ class CustomerTimeline implements JsonSerializable public const TYPE_TRANSACTION_RECONCILED = 'transaction-reconciled'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; public const TYPE_TRANSACTION_VOIDED = 'transaction-voided'; diff --git a/src/Model/CustomersDataExport.php b/src/Model/CustomersDataExport.php index 32e7bc5d7..adfeb3194 100644 --- a/src/Model/CustomersDataExport.php +++ b/src/Model/CustomersDataExport.php @@ -40,6 +40,14 @@ class CustomersDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?CustomersDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/DashboardTab.php b/src/Model/DashboardTab.php index b6cda8cd0..14ca352c9 100644 --- a/src/Model/DashboardTab.php +++ b/src/Model/DashboardTab.php @@ -21,6 +21,12 @@ class DashboardTab implements JsonSerializable { use HasMetadata; + public const PRESET_PAYMENTS = 'Payments'; + + public const PRESET_BILLING = 'Billing'; + + public const PRESET_KYC = 'KYC'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -31,6 +37,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('tiles', $data)) { $this->setTiles($data['tiles']); } + if (array_key_exists('preset', $data)) { + $this->setPreset($data['preset']); + } $this->setMetadata($metadata); } @@ -74,6 +83,18 @@ public function setTiles(array $tiles): static return $this; } + public function getPreset(): ?string + { + return $this->fields['preset'] ?? null; + } + + public function setPreset(null|string $preset): static + { + $this->fields['preset'] = $preset; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -86,6 +107,9 @@ public function jsonSerialize(): array $this->fields['tiles'], ); } + if (array_key_exists('preset', $this->fields)) { + $data['preset'] = $this->fields['preset']; + } return $data; } diff --git a/src/Model/DashboardTile.php b/src/Model/DashboardTile.php index b87601c5b..bd45252a7 100644 --- a/src/Model/DashboardTile.php +++ b/src/Model/DashboardTile.php @@ -14,6 +14,8 @@ namespace Rebilly\Sdk\Model; +use DateTimeImmutable; +use DateTimeInterface; use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; @@ -28,12 +30,24 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('metric', $data)) { $this->setMetric($data['metric']); } + if (array_key_exists('title', $data)) { + $this->setTitle($data['title']); + } + if (array_key_exists('description', $data)) { + $this->setDescription($data['description']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } if (array_key_exists('columnsWidth', $data)) { $this->setColumnsWidth($data['columnsWidth']); } + if (array_key_exists('periodStart', $data)) { + $this->setPeriodStart($data['periodStart']); + } + if (array_key_exists('periodEnd', $data)) { + $this->setPeriodEnd($data['periodEnd']); + } $this->setMetadata($metadata); } @@ -54,6 +68,30 @@ public function setMetric(string $metric): static return $this; } + public function getTitle(): ?string + { + return $this->fields['title'] ?? null; + } + + public function setTitle(null|string $title): static + { + $this->fields['title'] = $title; + + 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 getDateRange(): ?string { return $this->fields['dateRange'] ?? null; @@ -78,19 +116,63 @@ public function setColumnsWidth(null|int $columnsWidth): static return $this; } + public function getPeriodStart(): ?DateTimeImmutable + { + return $this->fields['periodStart'] ?? null; + } + + public function getPeriodEnd(): ?DateTimeImmutable + { + return $this->fields['periodEnd'] ?? null; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('metric', $this->fields)) { $data['metric'] = $this->fields['metric']; } + if (array_key_exists('title', $this->fields)) { + $data['title'] = $this->fields['title']; + } + if (array_key_exists('description', $this->fields)) { + $data['description'] = $this->fields['description']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']; } if (array_key_exists('columnsWidth', $this->fields)) { $data['columnsWidth'] = $this->fields['columnsWidth']; } + if (array_key_exists('periodStart', $this->fields)) { + $data['periodStart'] = $this->fields['periodStart']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('periodEnd', $this->fields)) { + $data['periodEnd'] = $this->fields['periodEnd']?->format(DateTimeInterface::RFC3339); + } return $data; } + + private function setPeriodStart(null|DateTimeImmutable|string $periodStart): static + { + if ($periodStart !== null && !($periodStart instanceof DateTimeImmutable)) { + $periodStart = new DateTimeImmutable($periodStart); + } + + $this->fields['periodStart'] = $periodStart; + + return $this; + } + + private function setPeriodEnd(null|DateTimeImmutable|string $periodEnd): static + { + if ($periodEnd !== null && !($periodEnd instanceof DateTimeImmutable)) { + $periodEnd = new DateTimeImmutable($periodEnd); + } + + $this->fields['periodEnd'] = $periodEnd; + + return $this; + } } diff --git a/src/Model/DataExport.php b/src/Model/DataExport.php index 34678bec1..183476215 100644 --- a/src/Model/DataExport.php +++ b/src/Model/DataExport.php @@ -73,7 +73,9 @@ public function getUpdatedTime(): ?DateTimeImmutable; public function getStatus(): ?string; - public function getDateRange(): null|AmlChecksDataExportDateRange|CustomersDataExportDateRange|DisputesDataExportDateRange|InvoiceItemsDataExportDateRange|InvoicesDataExportDateRange|JournalRecordsDataExportDateRange|PayoutRequestAllocationsDataExportDateRange|PayoutRequestsDataExportDateRange|SubscriptionsDataExportDateRange|TransactionsDataExportDateRange; + public function getFailureReason(): ?string; + + public function getDateRange(): null|AmlChecksDataExportDateRange|CustomersDataExportDateRange|DisputesDataExportDateRange|InvoiceItemsDataExportDateRange|InvoicesDataExportDateRange|JournalRecordsDataExportDateRange|PayoutRequestAllocationsDataExportDateRange|PayoutRequestsDataExportDateRange|SubscriptionsDataExportDateRange|TransactionsDataExportDateRange|UsersDataExportDateRange; public function setDateRange(null|array $dateRange): static; @@ -82,7 +84,7 @@ public function setDateRange(null|array $dateRange): static; */ public function getLinks(): ?array; - public function getEmbedded(): null|AmlChecksDataExportEmbedded|CustomersDataExportEmbedded|DisputesDataExportEmbedded|InvoiceItemsDataExportEmbedded|InvoicesDataExportEmbedded|JournalRecordsDataExportEmbedded|PayoutRequestAllocationsDataExportEmbedded|PayoutRequestsDataExportEmbedded|SubscriptionsDataExportEmbedded|TransactionsDataExportEmbedded; + public function getEmbedded(): null|AmlChecksDataExportEmbedded|CustomersDataExportEmbedded|DisputesDataExportEmbedded|InvoiceItemsDataExportEmbedded|InvoicesDataExportEmbedded|JournalRecordsDataExportEmbedded|PayoutRequestAllocationsDataExportEmbedded|PayoutRequestsDataExportEmbedded|SubscriptionsDataExportEmbedded|TransactionsDataExportEmbedded|UsersDataExportEmbedded; public function setEmbedded(null|array $embedded): static; } diff --git a/src/Model/DataExportFactory.php b/src/Model/DataExportFactory.php index af68afea1..8b030222b 100644 --- a/src/Model/DataExportFactory.php +++ b/src/Model/DataExportFactory.php @@ -31,6 +31,7 @@ public static function from(array $data = [], array $metadata = []): DataExport 'payoutRequests' => PayoutRequestsDataExport::from($data, $metadata), 'subscriptions' => SubscriptionsDataExport::from($data, $metadata), 'transactions' => TransactionsDataExport::from($data, $metadata), + 'users' => UsersDataExport::from($data, $metadata), default => throw new UnknownDiscriminatorValueException(), }; } diff --git a/src/Model/DepositRequest.php b/src/Model/DepositRequest.php index 6fdb4cca3..0c6582f39 100644 --- a/src/Model/DepositRequest.php +++ b/src/Model/DepositRequest.php @@ -54,6 +54,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('coinPurchase', $data)) { + $this->setCoinPurchase($data['coinPurchase']); + } + if (array_key_exists('coinPricing', $data)) { + $this->setCoinPricing($data['coinPricing']); + } if (array_key_exists('currency', $data)) { $this->setCurrency($data['currency']); } @@ -159,6 +165,16 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getCoinPurchase(): ?bool + { + return $this->fields['coinPurchase'] ?? null; + } + + public function getCoinPricing(): ?CoinPricing + { + return $this->fields['coinPricing'] ?? null; + } + public function getCurrency(): string { return $this->fields['currency']; @@ -348,6 +364,12 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('coinPurchase', $this->fields)) { + $data['coinPurchase'] = $this->fields['coinPurchase']; + } + if (array_key_exists('coinPricing', $this->fields)) { + $data['coinPricing'] = $this->fields['coinPricing']?->jsonSerialize(); + } if (array_key_exists('currency', $this->fields)) { $data['currency'] = $this->fields['currency']; } @@ -418,6 +440,24 @@ private function setStatus(null|string $status): static return $this; } + private function setCoinPurchase(null|bool $coinPurchase): static + { + $this->fields['coinPurchase'] = $coinPurchase; + + return $this; + } + + private function setCoinPricing(null|CoinPricing|array $coinPricing): static + { + if ($coinPricing !== null && !($coinPricing instanceof CoinPricing)) { + $coinPricing = CoinPricingFactory::from($coinPricing); + } + + $this->fields['coinPricing'] = $coinPricing; + + return $this; + } + private function setPropertiesSchema(null|array $propertiesSchema): static { $this->fields['propertiesSchema'] = $propertiesSchema; diff --git a/src/Model/DepositStrategy.php b/src/Model/DepositStrategy.php index 9fb2b829a..73aa820a3 100644 --- a/src/Model/DepositStrategy.php +++ b/src/Model/DepositStrategy.php @@ -48,6 +48,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isActive', $data)) { $this->setIsActive($data['isActive']); } + if (array_key_exists('coinPurchase', $data)) { + $this->setCoinPurchase($data['coinPurchase']); + } + if (array_key_exists('coinPricing', $data)) { + $this->setCoinPricing($data['coinPricing']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -150,6 +156,34 @@ public function setIsActive(null|bool $isActive): static return $this; } + public function getCoinPurchase(): ?bool + { + return $this->fields['coinPurchase'] ?? null; + } + + public function setCoinPurchase(null|bool $coinPurchase): static + { + $this->fields['coinPurchase'] = $coinPurchase; + + return $this; + } + + public function getCoinPricing(): ?CoinPricing + { + return $this->fields['coinPricing'] ?? null; + } + + public function setCoinPricing(null|CoinPricing|array $coinPricing): static + { + if ($coinPricing !== null && !($coinPricing instanceof CoinPricing)) { + $coinPricing = CoinPricingFactory::from($coinPricing); + } + + $this->fields['coinPricing'] = $coinPricing; + + return $this; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -192,6 +226,12 @@ public function jsonSerialize(): array if (array_key_exists('isActive', $this->fields)) { $data['isActive'] = $this->fields['isActive']; } + if (array_key_exists('coinPurchase', $this->fields)) { + $data['coinPurchase'] = $this->fields['coinPurchase']; + } + if (array_key_exists('coinPricing', $this->fields)) { + $data['coinPricing'] = $this->fields['coinPricing']?->jsonSerialize(); + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } diff --git a/src/Model/DisputesDataExport.php b/src/Model/DisputesDataExport.php index d51ffedb4..a1e5b69b7 100644 --- a/src/Model/DisputesDataExport.php +++ b/src/Model/DisputesDataExport.php @@ -38,6 +38,14 @@ class DisputesDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?DisputesDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/FlexiblePlan.php b/src/Model/FlexiblePlan.php index e06c73811..fdeba0d7c 100644 --- a/src/Model/FlexiblePlan.php +++ b/src/Model/FlexiblePlan.php @@ -66,6 +66,10 @@ public function getRevision(): ?int; public function getIsTrialOnly(): ?bool; + public function getRecurringInterval(): ?FlexiblePlanSubscriptionPlanRecurringInterval; + + public function getTrial(): ?PlanTrial; + public function getCreatedTime(): ?DateTimeImmutable; public function getUpdatedTime(): ?DateTimeImmutable; diff --git a/src/Model/FlexiblePlanOneTimeSalePlan.php b/src/Model/FlexiblePlanOneTimeSalePlan.php index a4aaaea5f..c9af73d7e 100644 --- a/src/Model/FlexiblePlanOneTimeSalePlan.php +++ b/src/Model/FlexiblePlanOneTimeSalePlan.php @@ -65,6 +65,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -234,6 +240,16 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): null + { + return $this->fields['trial'] ?? null; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -308,6 +324,12 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']; + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } @@ -350,6 +372,20 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setTrial(null $trial): static + { + $this->fields['trial'] = $trial; + + return $this; + } + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/FlexiblePlanSubscriptionPlan.php b/src/Model/FlexiblePlanSubscriptionPlan.php index 50b6b1f1d..082494bc6 100644 --- a/src/Model/FlexiblePlanSubscriptionPlan.php +++ b/src/Model/FlexiblePlanSubscriptionPlan.php @@ -246,14 +246,14 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getRecurringInterval(): ?FlexiblePlanSubscriptionPlanRecurringInterval + public function getRecurringInterval(): FlexiblePlanSubscriptionPlanRecurringInterval { - return $this->fields['recurringInterval'] ?? null; + return $this->fields['recurringInterval']; } - public function setRecurringInterval(null|FlexiblePlanSubscriptionPlanRecurringInterval|array $recurringInterval): static + public function setRecurringInterval(FlexiblePlanSubscriptionPlanRecurringInterval|array $recurringInterval): static { - if ($recurringInterval !== null && !($recurringInterval instanceof FlexiblePlanSubscriptionPlanRecurringInterval)) { + if (!($recurringInterval instanceof FlexiblePlanSubscriptionPlanRecurringInterval)) { $recurringInterval = FlexiblePlanSubscriptionPlanRecurringInterval::from($recurringInterval); } @@ -374,7 +374,7 @@ public function jsonSerialize(): array $data['isTrialOnly'] = $this->fields['isTrialOnly']; } if (array_key_exists('recurringInterval', $this->fields)) { - $data['recurringInterval'] = $this->fields['recurringInterval']?->jsonSerialize(); + $data['recurringInterval'] = $this->fields['recurringInterval']->jsonSerialize(); } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']?->jsonSerialize(); diff --git a/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php b/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php index 0bf5d87a8..72ebc611e 100644 --- a/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php +++ b/src/Model/FlexiblePlanSubscriptionPlanMeteredBilling.php @@ -38,6 +38,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('max', $data)) { $this->setMax($data['max']); } + if (array_key_exists('sticky', $data)) { + $this->setSticky($data['sticky']); + } $this->setMetadata($metadata); } @@ -90,6 +93,18 @@ public function setMax(null|float|string $max): static return $this; } + public function getSticky(): ?bool + { + return $this->fields['sticky'] ?? null; + } + + public function setSticky(null|bool $sticky): static + { + $this->fields['sticky'] = $sticky; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -102,6 +117,9 @@ public function jsonSerialize(): array if (array_key_exists('max', $this->fields)) { $data['max'] = $this->fields['max']; } + if (array_key_exists('sticky', $this->fields)) { + $data['sticky'] = $this->fields['sticky']; + } return $data; } diff --git a/src/Model/FlexiblePlanTrialOnlyPlan.php b/src/Model/FlexiblePlanTrialOnlyPlan.php index db754f61a..edf6f456e 100644 --- a/src/Model/FlexiblePlanTrialOnlyPlan.php +++ b/src/Model/FlexiblePlanTrialOnlyPlan.php @@ -62,6 +62,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } if (array_key_exists('trial', $data)) { $this->setTrial($data['trial']); } @@ -221,6 +224,11 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + public function getTrial(): PlanTrial { return $this->fields['trial']; @@ -313,6 +321,9 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']->jsonSerialize(); } @@ -361,6 +372,13 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static { if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index 279b64753..82e270b44 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -206,6 +206,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -330,6 +332,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -768,6 +772,8 @@ abstract class GatewayAccount implements JsonSerializable public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; @@ -1174,6 +1180,8 @@ abstract class GatewayAccount implements JsonSerializable public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; @@ -1433,6 +1441,9 @@ protected function __construct(array $data = [], array $metadata = []) if (array_key_exists('readyToPayoutInstruction', $data)) { $this->setReadyToPayoutInstruction($data['readyToPayoutInstruction']); } + if (array_key_exists('payoutLimits', $data)) { + $this->setPayoutLimits($data['payoutLimits']); + } if (array_key_exists('transactionEmailAliasTemplate', $data)) { $this->setTransactionEmailAliasTemplate($data['transactionEmailAliasTemplate']); } @@ -1637,6 +1648,8 @@ public static function from(array $data = [], array $metadata = []): self return IDebit::from($data, $metadata); case 'Ilixium': return Ilixium::from($data, $metadata); + case 'IMerchant': + return IMerchant::from($data, $metadata); case 'Ingenico': return Ingenico::from($data, $metadata); case 'INOVAPAY': @@ -1761,6 +1774,8 @@ public static function from(array $data = [], array $metadata = []): self return Payeezy::from($data, $metadata); case 'Payflow': return Payflow::from($data, $metadata); + case 'PayGlocal': + return PayGlocal::from($data, $metadata); case 'PaymentAsia': return PaymentAsia::from($data, $metadata); case 'PaymenTechnologies': @@ -2257,6 +2272,22 @@ public function setReadyToPayoutInstruction(null|string $readyToPayoutInstructio return $this; } + public function getPayoutLimits(): ?GatewayAccountPayoutLimits + { + return $this->fields['payoutLimits'] ?? null; + } + + public function setPayoutLimits(null|GatewayAccountPayoutLimits|array $payoutLimits): static + { + if ($payoutLimits !== null && !($payoutLimits instanceof GatewayAccountPayoutLimits)) { + $payoutLimits = GatewayAccountPayoutLimits::from($payoutLimits); + } + + $this->fields['payoutLimits'] = $payoutLimits; + + return $this; + } + public function getTransactionEmailAliasTemplate(): ?string { return $this->fields['transactionEmailAliasTemplate'] ?? null; @@ -2394,6 +2425,9 @@ public function jsonSerialize(): array if (array_key_exists('readyToPayoutInstruction', $this->fields)) { $data['readyToPayoutInstruction'] = $this->fields['readyToPayoutInstruction']; } + if (array_key_exists('payoutLimits', $this->fields)) { + $data['payoutLimits'] = $this->fields['payoutLimits']?->jsonSerialize(); + } if (array_key_exists('transactionEmailAliasTemplate', $this->fields)) { $data['transactionEmailAliasTemplate'] = $this->fields['transactionEmailAliasTemplate']; } diff --git a/src/Model/GatewayAccountDowntimeSchedule.php b/src/Model/GatewayAccountDowntimeSchedule.php index 120ee5a9e..a100d1ec4 100644 --- a/src/Model/GatewayAccountDowntimeSchedule.php +++ b/src/Model/GatewayAccountDowntimeSchedule.php @@ -35,6 +35,8 @@ class GatewayAccountDowntimeSchedule implements JsonSerializable public const REASON_MONTHLY_LIMIT_REACHED = 'monthly-limit-reached'; + public const REASON_GATEWAY_UNREACHABLE = 'gateway-unreachable'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) diff --git a/src/Model/GatewayAccountPayoutLimits.php b/src/Model/GatewayAccountPayoutLimits.php new file mode 100644 index 000000000..041e1738d --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimits.php @@ -0,0 +1,144 @@ +setMaxPerTransaction($data['maxPerTransaction']); + } + if (array_key_exists('minPerTransaction', $data)) { + $this->setMinPerTransaction($data['minPerTransaction']); + } + if (array_key_exists('maxPerPeriod', $data)) { + $this->setMaxPerPeriod($data['maxPerPeriod']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + /** + * @return null|GatewayAccountPayoutLimitsMaxPerTransaction[] + */ + public function getMaxPerTransaction(): ?array + { + return $this->fields['maxPerTransaction'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMaxPerTransaction[] $maxPerTransaction + */ + public function setMaxPerTransaction(null|array $maxPerTransaction): static + { + $maxPerTransaction = $maxPerTransaction !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMaxPerTransaction ? $value : GatewayAccountPayoutLimitsMaxPerTransaction::from($value), + $maxPerTransaction, + ) : null; + + $this->fields['maxPerTransaction'] = $maxPerTransaction; + + return $this; + } + + /** + * @return null|GatewayAccountPayoutLimitsMinPerTransaction[] + */ + public function getMinPerTransaction(): ?array + { + return $this->fields['minPerTransaction'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMinPerTransaction[] $minPerTransaction + */ + public function setMinPerTransaction(null|array $minPerTransaction): static + { + $minPerTransaction = $minPerTransaction !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMinPerTransaction ? $value : GatewayAccountPayoutLimitsMinPerTransaction::from($value), + $minPerTransaction, + ) : null; + + $this->fields['minPerTransaction'] = $minPerTransaction; + + return $this; + } + + /** + * @return null|GatewayAccountPayoutLimitsMaxPerPeriod[] + */ + public function getMaxPerPeriod(): ?array + { + return $this->fields['maxPerPeriod'] ?? null; + } + + /** + * @param null|array[]|GatewayAccountPayoutLimitsMaxPerPeriod[] $maxPerPeriod + */ + public function setMaxPerPeriod(null|array $maxPerPeriod): static + { + $maxPerPeriod = $maxPerPeriod !== null ? array_map( + fn ($value) => $value instanceof GatewayAccountPayoutLimitsMaxPerPeriod ? $value : GatewayAccountPayoutLimitsMaxPerPeriod::from($value), + $maxPerPeriod, + ) : null; + + $this->fields['maxPerPeriod'] = $maxPerPeriod; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('maxPerTransaction', $this->fields)) { + $data['maxPerTransaction'] = $this->fields['maxPerTransaction'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMaxPerTransaction $gatewayAccountPayoutLimitsMaxPerTransaction) => $gatewayAccountPayoutLimitsMaxPerTransaction->jsonSerialize(), + $this->fields['maxPerTransaction'], + ) + : null; + } + if (array_key_exists('minPerTransaction', $this->fields)) { + $data['minPerTransaction'] = $this->fields['minPerTransaction'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMinPerTransaction $gatewayAccountPayoutLimitsMinPerTransaction) => $gatewayAccountPayoutLimitsMinPerTransaction->jsonSerialize(), + $this->fields['minPerTransaction'], + ) + : null; + } + if (array_key_exists('maxPerPeriod', $this->fields)) { + $data['maxPerPeriod'] = $this->fields['maxPerPeriod'] !== null + ? array_map( + static fn (GatewayAccountPayoutLimitsMaxPerPeriod $gatewayAccountPayoutLimitsMaxPerPeriod) => $gatewayAccountPayoutLimitsMaxPerPeriod->jsonSerialize(), + $this->fields['maxPerPeriod'], + ) + : null; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php b/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php new file mode 100644 index 000000000..f71b5231d --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimitsMaxPerPeriod.php @@ -0,0 +1,102 @@ +setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('period', $data)) { + $this->setPeriod($data['period']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + 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 getPeriod(): string + { + return $this->fields['period']; + } + + public function setPeriod(string $period): static + { + $this->fields['period'] = $period; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + 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('period', $this->fields)) { + $data['period'] = $this->fields['period']; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php b/src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php new file mode 100644 index 000000000..c62b28519 --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimitsMaxPerTransaction.php @@ -0,0 +1,82 @@ +setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + 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 jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php b/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php new file mode 100644 index 000000000..7506e3c0b --- /dev/null +++ b/src/Model/GatewayAccountPayoutLimitsMinPerTransaction.php @@ -0,0 +1,82 @@ +setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + 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 jsonSerialize(): array + { + $data = []; + if (array_key_exists('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + + return $data; + } +} diff --git a/src/Model/GatewayAccountTimeline.php b/src/Model/GatewayAccountTimeline.php index 2443348f6..459815eb0 100644 --- a/src/Model/GatewayAccountTimeline.php +++ b/src/Model/GatewayAccountTimeline.php @@ -45,6 +45,8 @@ class GatewayAccountTimeline implements JsonSerializable public const TYPE_ONBOARDING_FAILED = 'gateway-account-onboarding-failed'; + public const TYPE_CARDING_CIRCUIT_OPENED = 'gateway-account-carding-circuit-opened'; + public const TRIGGERED_BY_REBILLY = 'rebilly'; public const TRIGGERED_BY_APP = 'app'; diff --git a/src/Model/GetPayoutRequestAllocationCollectionResponse.php b/src/Model/GetPayoutRequestAllocationCollectionResponse.php deleted file mode 100644 index d45d56e2e..000000000 --- a/src/Model/GetPayoutRequestAllocationCollectionResponse.php +++ /dev/null @@ -1,856 +0,0 @@ -setId($data['id']); - } - if (array_key_exists('payoutRequestId', $data)) { - $this->setPayoutRequestId($data['payoutRequestId']); - } - if (array_key_exists('batchId', $data)) { - $this->setBatchId($data['batchId']); - } - if (array_key_exists('paymentInstrumentId', $data)) { - $this->setPaymentInstrumentId($data['paymentInstrumentId']); - } - if (array_key_exists('paymentMethod', $data)) { - $this->setPaymentMethod($data['paymentMethod']); - } - if (array_key_exists('gatewayAccountId', $data)) { - $this->setGatewayAccountId($data['gatewayAccountId']); - } - if (array_key_exists('gatewayName', $data)) { - $this->setGatewayName($data['gatewayName']); - } - if (array_key_exists('gatewayPayoutInstruction', $data)) { - $this->setGatewayPayoutInstruction($data['gatewayPayoutInstruction']); - } - 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('transactionResult', $data)) { - $this->setTransactionResult($data['transactionResult']); - } - if (array_key_exists('transactionStatus', $data)) { - $this->setTransactionStatus($data['transactionStatus']); - } - 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']); - } - if (array_key_exists('exposureAmount', $data)) { - $this->setExposureAmount($data['exposureAmount']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getId(): ?string - { - return $this->fields['id'] ?? null; - } - - public function getPayoutRequestId(): string - { - return $this->fields['payoutRequestId']; - } - - public function getBatchId(): ?string - { - return $this->fields['batchId'] ?? null; - } - - public function getPaymentInstrumentId(): string - { - return $this->fields['paymentInstrumentId']; - } - - public function setPaymentInstrumentId(string $paymentInstrumentId): static - { - $this->fields['paymentInstrumentId'] = $paymentInstrumentId; - - return $this; - } - - public function getPaymentMethod(): ?string - { - return $this->fields['paymentMethod'] ?? null; - } - - 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 getGatewayPayoutInstruction(): ?string - { - return $this->fields['gatewayPayoutInstruction'] ?? null; - } - - 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 getTransactionResult(): ?string - { - return $this->fields['transactionResult'] ?? null; - } - - public function getTransactionStatus(): ?string - { - return $this->fields['transactionStatus'] ?? 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 getExposureAmount(): ?float - { - return $this->fields['exposureAmount'] ?? 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('batchId', $this->fields)) { - $data['batchId'] = $this->fields['batchId']; - } - if (array_key_exists('paymentInstrumentId', $this->fields)) { - $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; - } - if (array_key_exists('paymentMethod', $this->fields)) { - $data['paymentMethod'] = $this->fields['paymentMethod']; - } - 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('gatewayPayoutInstruction', $this->fields)) { - $data['gatewayPayoutInstruction'] = $this->fields['gatewayPayoutInstruction']; - } - 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('transactionResult', $this->fields)) { - $data['transactionResult'] = $this->fields['transactionResult']; - } - if (array_key_exists('transactionStatus', $this->fields)) { - $data['transactionStatus'] = $this->fields['transactionStatus']; - } - 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; - } - if (array_key_exists('exposureAmount', $this->fields)) { - $data['exposureAmount'] = $this->fields['exposureAmount']; - } - - 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 setBatchId(null|string $batchId): static - { - $this->fields['batchId'] = $batchId; - - return $this; - } - - private function setPaymentMethod(null|string $paymentMethod): static - { - $this->fields['paymentMethod'] = $paymentMethod; - - return $this; - } - - private function setGatewayPayoutInstruction(null|string $gatewayPayoutInstruction): static - { - $this->fields['gatewayPayoutInstruction'] = $gatewayPayoutInstruction; - - return $this; - } - - private function setTransactionId(null|string $transactionId): static - { - $this->fields['transactionId'] = $transactionId; - - return $this; - } - - private function setTransactionResult(null|string $transactionResult): static - { - $this->fields['transactionResult'] = $transactionResult; - - return $this; - } - - private function setTransactionStatus(null|string $transactionStatus): static - { - $this->fields['transactionStatus'] = $transactionStatus; - - 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; - } - - private function setExposureAmount(null|float|string $exposureAmount): static - { - if (is_string($exposureAmount)) { - $exposureAmount = (float) $exposureAmount; - } - - $this->fields['exposureAmount'] = $exposureAmount; - - return $this; - } -} diff --git a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php index 49ad9e874..4cbd44d51 100644 --- a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php +++ b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php @@ -205,6 +205,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -329,6 +331,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; diff --git a/src/Model/GlobalWebhook.php b/src/Model/GlobalWebhook.php index 04f359f56..f9aa8e7f5 100644 --- a/src/Model/GlobalWebhook.php +++ b/src/Model/GlobalWebhook.php @@ -161,6 +161,12 @@ class GlobalWebhook implements JsonSerializable public const EVENTS_FILTER_TRANSACTION_PROCESSED = 'transaction-processed'; + public const EVENTS_FILTER_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + + public const EVENTS_FILTER_TRANSACTION_REFUNDED = 'transaction-refunded'; + + public const EVENTS_FILTER_TRANSACTION_VOIDED = 'transaction-voided'; + public const EVENTS_FILTER_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; public const STATUS_ACTIVE = 'active'; diff --git a/src/Model/IMerchant.php b/src/Model/IMerchant.php new file mode 100644 index 000000000..eca992d03 --- /dev/null +++ b/src/Model/IMerchant.php @@ -0,0 +1,89 @@ + 'IMerchant', + ] + $data, $metadata); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + if (array_key_exists('threeDSecureServer', $data)) { + $this->setThreeDSecureServer($data['threeDSecureServer']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCredentials(): IMerchantCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(IMerchantCredentials|array $credentials): static + { + if (!($credentials instanceof IMerchantCredentials)) { + $credentials = IMerchantCredentials::from($credentials); + } + + $this->fields['credentials'] = $credentials; + + return $this; + } + + public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer + { + return $this->fields['threeDSecureServer'] ?? null; + } + + public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static + { + if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) { + $threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer); + } + + $this->fields['threeDSecureServer'] = $threeDSecureServer; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('credentials', $this->fields)) { + $data['credentials'] = $this->fields['credentials']->jsonSerialize(); + } + if (array_key_exists('threeDSecureServer', $this->fields)) { + $data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize(); + } + + return parent::jsonSerialize() + $data; + } +} diff --git a/src/Model/IMerchantCredentials.php b/src/Model/IMerchantCredentials.php new file mode 100644 index 000000000..554964e61 --- /dev/null +++ b/src/Model/IMerchantCredentials.php @@ -0,0 +1,60 @@ +setApiKey($data['apiKey']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + + return $data; + } +} diff --git a/src/Model/InvoiceItem.php b/src/Model/InvoiceItem.php index 74ebc7332..c1e13a316 100644 --- a/src/Model/InvoiceItem.php +++ b/src/Model/InvoiceItem.php @@ -58,9 +58,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('subscriptionId', $data)) { $this->setSubscriptionId($data['subscriptionId']); } - if (array_key_exists('discountAmount', $data)) { - $this->setDiscountAmount($data['discountAmount']); - } if (array_key_exists('periodStartTime', $data)) { $this->setPeriodStartTime($data['periodStartTime']); } @@ -177,11 +174,6 @@ public function getSubscriptionId(): ?string return $this->fields['subscriptionId'] ?? null; } - public function getDiscountAmount(): ?float - { - return $this->fields['discountAmount'] ?? null; - } - public function getPeriodStartTime(): ?DateTimeImmutable { return $this->fields['periodStartTime'] ?? null; @@ -295,9 +287,6 @@ public function jsonSerialize(): array if (array_key_exists('subscriptionId', $this->fields)) { $data['subscriptionId'] = $this->fields['subscriptionId']; } - if (array_key_exists('discountAmount', $this->fields)) { - $data['discountAmount'] = $this->fields['discountAmount']; - } if (array_key_exists('periodStartTime', $this->fields)) { $data['periodStartTime'] = $this->fields['periodStartTime']?->format(DateTimeInterface::RFC3339); } @@ -363,17 +352,6 @@ private function setSubscriptionId(null|string $subscriptionId): static return $this; } - private function setDiscountAmount(null|float|string $discountAmount): static - { - if (is_string($discountAmount)) { - $discountAmount = (float) $discountAmount; - } - - $this->fields['discountAmount'] = $discountAmount; - - return $this; - } - private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/InvoiceItemsDataExport.php b/src/Model/InvoiceItemsDataExport.php index 6b8dc3cad..a316852fa 100644 --- a/src/Model/InvoiceItemsDataExport.php +++ b/src/Model/InvoiceItemsDataExport.php @@ -40,6 +40,14 @@ class InvoiceItemsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?InvoiceItemsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/InvoiceTimeline.php b/src/Model/InvoiceTimeline.php index 252986030..faceee5b5 100644 --- a/src/Model/InvoiceTimeline.php +++ b/src/Model/InvoiceTimeline.php @@ -79,6 +79,8 @@ class InvoiceTimeline implements JsonSerializable public const TYPE_TRANSACTION_INITIATED = 'transaction-initiated'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; public const TYPE_TRANSACTION_VOIDED = 'transaction-voided'; diff --git a/src/Model/InvoicesDataExport.php b/src/Model/InvoicesDataExport.php index 0b92fb6c8..82845459c 100644 --- a/src/Model/InvoicesDataExport.php +++ b/src/Model/InvoicesDataExport.php @@ -42,6 +42,14 @@ class InvoicesDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -88,6 +96,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -242,6 +253,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?InvoicesDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -329,6 +345,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -415,6 +434,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/JournalRecordsDataExport.php b/src/Model/JournalRecordsDataExport.php index b83c9125d..7deada600 100644 --- a/src/Model/JournalRecordsDataExport.php +++ b/src/Model/JournalRecordsDataExport.php @@ -38,6 +38,14 @@ class JournalRecordsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?JournalRecordsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/KycAddressMatches.php b/src/Model/KycAddressMatches.php index 941388b1f..de79f000a 100644 --- a/src/Model/KycAddressMatches.php +++ b/src/Model/KycAddressMatches.php @@ -15,9 +15,11 @@ namespace Rebilly\Sdk\Model; use DateTimeImmutable; +use DateTimeInterface; +use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class KycAddressMatches implements PostKycDocumentMatchesRequest +class KycAddressMatches implements JsonSerializable { use HasMetadata; @@ -299,7 +301,7 @@ public function jsonSerialize(): array $data['uniqueWords'] = $this->fields['uniqueWords']; } if (array_key_exists('date', $this->fields)) { - $data['date'] = $this->fields['date']?->format('Y-m-d'); + $data['date'] = $this->fields['date']?->format(DateTimeInterface::RFC3339); } if (array_key_exists('phone', $this->fields)) { $data['phone'] = $this->fields['phone']; diff --git a/src/Model/KycAddressMatchesOverwrite.php b/src/Model/KycAddressMatchesOverwrite.php new file mode 100644 index 000000000..85c33a5f9 --- /dev/null +++ b/src/Model/KycAddressMatchesOverwrite.php @@ -0,0 +1,324 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('line1', $data)) { + $this->setLine1($data['line1']); + } + if (array_key_exists('city', $data)) { + $this->setCity($data['city']); + } + if (array_key_exists('region', $data)) { + $this->setRegion($data['region']); + } + if (array_key_exists('postalCode', $data)) { + $this->setPostalCode($data['postalCode']); + } + if (array_key_exists('wordCount', $data)) { + $this->setWordCount($data['wordCount']); + } + if (array_key_exists('uniqueWords', $data)) { + $this->setUniqueWords($data['uniqueWords']); + } + if (array_key_exists('date', $data)) { + $this->setDate($data['date']); + } + if (array_key_exists('phone', $data)) { + $this->setPhone($data['phone']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + if (array_key_exists('isTampered', $data)) { + $this->setIsTampered($data['isTampered']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'address-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getLine1(): ?string + { + return $this->fields['line1'] ?? null; + } + + public function setLine1(null|string $line1): static + { + $this->fields['line1'] = $line1; + + return $this; + } + + public function getCity(): ?string + { + return $this->fields['city'] ?? null; + } + + public function setCity(null|string $city): static + { + $this->fields['city'] = $city; + + return $this; + } + + public function getRegion(): ?string + { + return $this->fields['region'] ?? null; + } + + public function setRegion(null|string $region): static + { + $this->fields['region'] = $region; + + return $this; + } + + public function getPostalCode(): ?string + { + return $this->fields['postalCode'] ?? null; + } + + public function setPostalCode(null|string $postalCode): static + { + $this->fields['postalCode'] = $postalCode; + + return $this; + } + + public function getWordCount(): ?int + { + return $this->fields['wordCount'] ?? null; + } + + public function setWordCount(null|int $wordCount): static + { + $this->fields['wordCount'] = $wordCount; + + return $this; + } + + public function getUniqueWords(): ?int + { + return $this->fields['uniqueWords'] ?? null; + } + + public function setUniqueWords(null|int $uniqueWords): static + { + $this->fields['uniqueWords'] = $uniqueWords; + + return $this; + } + + public function getDate(): ?DateTimeImmutable + { + return $this->fields['date'] ?? null; + } + + public function setDate(null|DateTimeImmutable|string $date): static + { + if ($date !== null && !($date instanceof DateTimeImmutable)) { + $date = new DateTimeImmutable($date); + } + + $this->fields['date'] = $date; + + return $this; + } + + public function getPhone(): ?string + { + return $this->fields['phone'] ?? null; + } + + public function setPhone(null|string $phone): static + { + $this->fields['phone'] = $phone; + + return $this; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function getIsTampered(): ?bool + { + return $this->fields['isTampered'] ?? null; + } + + public function setIsTampered(null|bool $isTampered): static + { + $this->fields['isTampered'] = $isTampered; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'address-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('line1', $this->fields)) { + $data['line1'] = $this->fields['line1']; + } + if (array_key_exists('city', $this->fields)) { + $data['city'] = $this->fields['city']; + } + if (array_key_exists('region', $this->fields)) { + $data['region'] = $this->fields['region']; + } + if (array_key_exists('postalCode', $this->fields)) { + $data['postalCode'] = $this->fields['postalCode']; + } + if (array_key_exists('wordCount', $this->fields)) { + $data['wordCount'] = $this->fields['wordCount']; + } + if (array_key_exists('uniqueWords', $this->fields)) { + $data['uniqueWords'] = $this->fields['uniqueWords']; + } + if (array_key_exists('date', $this->fields)) { + $data['date'] = $this->fields['date']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('phone', $this->fields)) { + $data['phone'] = $this->fields['phone']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + if (array_key_exists('isTampered', $this->fields)) { + $data['isTampered'] = $this->fields['isTampered']; + } + + return $data; + } +} diff --git a/src/Model/KycDocument.php b/src/Model/KycDocument.php index 375d57216..603818daa 100644 --- a/src/Model/KycDocument.php +++ b/src/Model/KycDocument.php @@ -86,6 +86,10 @@ public function getDocumentMatches(): null|ProofOfAddressKycDocumentDocumentMatc public function setDocumentMatches(null|array $documentMatches): static; + public function getParsedData(): null|ProofOfAddressKycDocumentParsedData|ProofOfCreditFileKycDocumentParsedData|ProofOfFundsKycDocumentParsedData|ProofOfIdentityKycDocumentParsedData|ProofOfPurchaseKycDocumentParsedData; + + public function setParsedData(null|array $parsedData): static; + public function getSettings(): null|KycSettingsAddress|KycSettingsIdentity|array; /** diff --git a/src/Model/KycDocumentCheck.php b/src/Model/KycDocumentCheck.php index 56551a5fa..8cb09dea7 100644 --- a/src/Model/KycDocumentCheck.php +++ b/src/Model/KycDocumentCheck.php @@ -33,6 +33,8 @@ class KycDocumentCheck implements JsonSerializable public const NAME_DECISION = 'decision'; + public const NAME_DOCUMENT_NUMBER = 'documentNumber'; + public const NAME_DOCUMENT_SUBTYPE = 'documentSubtype'; public const NAME_EXPIRATION_DATE = 'expirationDate'; @@ -49,6 +51,10 @@ class KycDocumentCheck implements JsonSerializable public const NAME_IS_TAMPERED = 'isTampered'; + public const NAME_ISSUANCE_COUNTRY = 'issuanceCountry'; + + public const NAME_ISSUANCE_REGION = 'issuanceRegion'; + public const NAME_ISSUE_DATE = 'issueDate'; public const NAME_LAST_NAME = 'lastName'; diff --git a/src/Model/KycDocumentRejection.php b/src/Model/KycDocumentRejection.php index bc477f554..c856dc6f6 100644 --- a/src/Model/KycDocumentRejection.php +++ b/src/Model/KycDocumentRejection.php @@ -25,6 +25,8 @@ class KycDocumentRejection implements JsonSerializable public const TYPE_DOCUMENT_EXPIRED = 'document-expired'; + public const TYPE_DOCUMENT_WAS_VALID_BUT_EXPIRED = 'document-was-valid-but-expired'; + public const TYPE_DOCUMENT_NOT_MATCHING = 'document-not-matching'; public const TYPE_DOCUMENT_DUPLICATE = 'document-duplicate'; @@ -47,6 +49,8 @@ class KycDocumentRejection implements JsonSerializable public const TYPE_NAME_MISMATCH = 'name-mismatch'; + public const TYPE_NAME_AND_DOB_MISMATCH = 'name-and-dob-mismatch'; + public const TYPE_CRITICAL_INFO_MISSING = 'critical-info-missing'; public const TYPE_OLD_ADDRESS_ON_ID = 'old-address-on-id'; diff --git a/src/Model/KycFundsMatchesOverwrite.php b/src/Model/KycFundsMatchesOverwrite.php new file mode 100644 index 000000000..028cde94e --- /dev/null +++ b/src/Model/KycFundsMatchesOverwrite.php @@ -0,0 +1,156 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'funds-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'funds-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + + return $data; + } +} diff --git a/src/Model/KycIdentityMatches.php b/src/Model/KycIdentityMatches.php index bb0524903..7a95ae454 100644 --- a/src/Model/KycIdentityMatches.php +++ b/src/Model/KycIdentityMatches.php @@ -16,9 +16,10 @@ use DateTimeImmutable; use DateTimeInterface; +use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class KycIdentityMatches implements PostKycDocumentMatchesRequest +class KycIdentityMatches implements JsonSerializable { use HasMetadata; diff --git a/src/Model/KycIdentityMatchesOverwrite.php b/src/Model/KycIdentityMatchesOverwrite.php new file mode 100644 index 000000000..534157f10 --- /dev/null +++ b/src/Model/KycIdentityMatchesOverwrite.php @@ -0,0 +1,540 @@ +setContainsImage($data['containsImage']); + } + if (array_key_exists('isIdentityDocument', $data)) { + $this->setIsIdentityDocument($data['isIdentityDocument']); + } + if (array_key_exists('isPublishedOnline', $data)) { + $this->setIsPublishedOnline($data['isPublishedOnline']); + } + if (array_key_exists('matchingImages', $data)) { + $this->setMatchingImages($data['matchingImages']); + } + if (array_key_exists('firstName', $data)) { + $this->setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('dateOfBirth', $data)) { + $this->setDateOfBirth($data['dateOfBirth']); + } + if (array_key_exists('expirationDate', $data)) { + $this->setExpirationDate($data['expirationDate']); + } + if (array_key_exists('issueDate', $data)) { + $this->setIssueDate($data['issueDate']); + } + if (array_key_exists('hasMinimalAge', $data)) { + $this->setHasMinimalAge($data['hasMinimalAge']); + } + if (array_key_exists('nationality', $data)) { + $this->setNationality($data['nationality']); + } + if (array_key_exists('issuanceCountry', $data)) { + $this->setIssuanceCountry($data['issuanceCountry']); + } + if (array_key_exists('issuanceRegion', $data)) { + $this->setIssuanceRegion($data['issuanceRegion']); + } + if (array_key_exists('documentNumber', $data)) { + $this->setDocumentNumber($data['documentNumber']); + } + if (array_key_exists('sex', $data)) { + $this->setSex($data['sex']); + } + if (array_key_exists('mrzChecksumValid', $data)) { + $this->setMrzChecksumValid($data['mrzChecksumValid']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + if (array_key_exists('hasMatchingFaceProof', $data)) { + $this->setHasMatchingFaceProof($data['hasMatchingFaceProof']); + } + if (array_key_exists('isTampered', $data)) { + $this->setIsTampered($data['isTampered']); + } + if (array_key_exists('isDigitallyTampered', $data)) { + $this->setIsDigitallyTampered($data['isDigitallyTampered']); + } + if (array_key_exists('isPhotocopy', $data)) { + $this->setIsPhotocopy($data['isPhotocopy']); + } + if (array_key_exists('hasCompletedFaceLiveness', $data)) { + $this->setHasCompletedFaceLiveness($data['hasCompletedFaceLiveness']); + } + if (array_key_exists('expiryDate', $data)) { + $this->setExpiryDate($data['expiryDate']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'identity-proof'; + } + + public function getContainsImage(): ?bool + { + return $this->fields['containsImage'] ?? null; + } + + public function setContainsImage(null|bool $containsImage): static + { + $this->fields['containsImage'] = $containsImage; + + return $this; + } + + public function getIsIdentityDocument(): ?bool + { + return $this->fields['isIdentityDocument'] ?? null; + } + + public function setIsIdentityDocument(null|bool $isIdentityDocument): static + { + $this->fields['isIdentityDocument'] = $isIdentityDocument; + + return $this; + } + + public function getIsPublishedOnline(): ?bool + { + return $this->fields['isPublishedOnline'] ?? null; + } + + public function setIsPublishedOnline(null|bool $isPublishedOnline): static + { + $this->fields['isPublishedOnline'] = $isPublishedOnline; + + return $this; + } + + /** + * @return null|string[] + */ + public function getMatchingImages(): ?array + { + return $this->fields['matchingImages'] ?? null; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + return $this; + } + + public function getDateOfBirth(): ?DateTimeImmutable + { + return $this->fields['dateOfBirth'] ?? null; + } + + public function setDateOfBirth(null|DateTimeImmutable|string $dateOfBirth): static + { + if ($dateOfBirth !== null && !($dateOfBirth instanceof DateTimeImmutable)) { + $dateOfBirth = new DateTimeImmutable($dateOfBirth); + } + + $this->fields['dateOfBirth'] = $dateOfBirth; + + return $this; + } + + public function getExpirationDate(): ?DateTimeImmutable + { + return $this->fields['expirationDate'] ?? null; + } + + public function setExpirationDate(null|DateTimeImmutable|string $expirationDate): static + { + if ($expirationDate !== null && !($expirationDate instanceof DateTimeImmutable)) { + $expirationDate = new DateTimeImmutable($expirationDate); + } + + $this->fields['expirationDate'] = $expirationDate; + + return $this; + } + + public function getIssueDate(): ?DateTimeImmutable + { + return $this->fields['issueDate'] ?? null; + } + + public function setIssueDate(null|DateTimeImmutable|string $issueDate): static + { + if ($issueDate !== null && !($issueDate instanceof DateTimeImmutable)) { + $issueDate = new DateTimeImmutable($issueDate); + } + + $this->fields['issueDate'] = $issueDate; + + return $this; + } + + public function getHasMinimalAge(): ?bool + { + return $this->fields['hasMinimalAge'] ?? null; + } + + public function getNationality(): ?string + { + return $this->fields['nationality'] ?? null; + } + + public function setNationality(null|string $nationality): static + { + $this->fields['nationality'] = $nationality; + + return $this; + } + + public function getIssuanceCountry(): ?string + { + return $this->fields['issuanceCountry'] ?? null; + } + + public function setIssuanceCountry(null|string $issuanceCountry): static + { + $this->fields['issuanceCountry'] = $issuanceCountry; + + return $this; + } + + public function getIssuanceRegion(): ?string + { + return $this->fields['issuanceRegion'] ?? null; + } + + public function setIssuanceRegion(null|string $issuanceRegion): static + { + $this->fields['issuanceRegion'] = $issuanceRegion; + + return $this; + } + + public function getDocumentNumber(): ?string + { + return $this->fields['documentNumber'] ?? null; + } + + public function setDocumentNumber(null|string $documentNumber): static + { + $this->fields['documentNumber'] = $documentNumber; + + return $this; + } + + public function getSex(): ?string + { + return $this->fields['sex'] ?? null; + } + + public function setSex(null|string $sex): static + { + $this->fields['sex'] = $sex; + + return $this; + } + + public function getMrzChecksumValid(): ?bool + { + return $this->fields['mrzChecksumValid'] ?? null; + } + + public function getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function getHasMatchingFaceProof(): ?bool + { + return $this->fields['hasMatchingFaceProof'] ?? null; + } + + public function setHasMatchingFaceProof(null|bool $hasMatchingFaceProof): static + { + $this->fields['hasMatchingFaceProof'] = $hasMatchingFaceProof; + + return $this; + } + + public function getIsTampered(): ?bool + { + return $this->fields['isTampered'] ?? null; + } + + public function setIsTampered(null|bool $isTampered): static + { + $this->fields['isTampered'] = $isTampered; + + return $this; + } + + public function getIsDigitallyTampered(): ?bool + { + return $this->fields['isDigitallyTampered'] ?? null; + } + + public function setIsDigitallyTampered(null|bool $isDigitallyTampered): static + { + $this->fields['isDigitallyTampered'] = $isDigitallyTampered; + + return $this; + } + + public function getIsPhotocopy(): ?bool + { + return $this->fields['isPhotocopy'] ?? null; + } + + public function setIsPhotocopy(null|bool $isPhotocopy): static + { + $this->fields['isPhotocopy'] = $isPhotocopy; + + return $this; + } + + public function getHasCompletedFaceLiveness(): ?bool + { + return $this->fields['hasCompletedFaceLiveness'] ?? null; + } + + public function getExpiryDate(): ?DateTimeImmutable + { + return $this->fields['expiryDate'] ?? null; + } + + public function setExpiryDate(null|DateTimeImmutable|string $expiryDate): static + { + if ($expiryDate !== null && !($expiryDate instanceof DateTimeImmutable)) { + $expiryDate = new DateTimeImmutable($expiryDate); + } + + $this->fields['expiryDate'] = $expiryDate; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'identity-proof', + ]; + if (array_key_exists('containsImage', $this->fields)) { + $data['containsImage'] = $this->fields['containsImage']; + } + if (array_key_exists('isIdentityDocument', $this->fields)) { + $data['isIdentityDocument'] = $this->fields['isIdentityDocument']; + } + if (array_key_exists('isPublishedOnline', $this->fields)) { + $data['isPublishedOnline'] = $this->fields['isPublishedOnline']; + } + if (array_key_exists('matchingImages', $this->fields)) { + $data['matchingImages'] = $this->fields['matchingImages']; + } + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('dateOfBirth', $this->fields)) { + $data['dateOfBirth'] = $this->fields['dateOfBirth']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('expirationDate', $this->fields)) { + $data['expirationDate'] = $this->fields['expirationDate']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('issueDate', $this->fields)) { + $data['issueDate'] = $this->fields['issueDate']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('hasMinimalAge', $this->fields)) { + $data['hasMinimalAge'] = $this->fields['hasMinimalAge']; + } + if (array_key_exists('nationality', $this->fields)) { + $data['nationality'] = $this->fields['nationality']; + } + if (array_key_exists('issuanceCountry', $this->fields)) { + $data['issuanceCountry'] = $this->fields['issuanceCountry']; + } + if (array_key_exists('issuanceRegion', $this->fields)) { + $data['issuanceRegion'] = $this->fields['issuanceRegion']; + } + if (array_key_exists('documentNumber', $this->fields)) { + $data['documentNumber'] = $this->fields['documentNumber']; + } + if (array_key_exists('sex', $this->fields)) { + $data['sex'] = $this->fields['sex']; + } + if (array_key_exists('mrzChecksumValid', $this->fields)) { + $data['mrzChecksumValid'] = $this->fields['mrzChecksumValid']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + if (array_key_exists('hasMatchingFaceProof', $this->fields)) { + $data['hasMatchingFaceProof'] = $this->fields['hasMatchingFaceProof']; + } + if (array_key_exists('isTampered', $this->fields)) { + $data['isTampered'] = $this->fields['isTampered']; + } + if (array_key_exists('isDigitallyTampered', $this->fields)) { + $data['isDigitallyTampered'] = $this->fields['isDigitallyTampered']; + } + if (array_key_exists('isPhotocopy', $this->fields)) { + $data['isPhotocopy'] = $this->fields['isPhotocopy']; + } + if (array_key_exists('hasCompletedFaceLiveness', $this->fields)) { + $data['hasCompletedFaceLiveness'] = $this->fields['hasCompletedFaceLiveness']; + } + if (array_key_exists('expiryDate', $this->fields)) { + $data['expiryDate'] = $this->fields['expiryDate']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } + + /** + * @param null|string[] $matchingImages + */ + private function setMatchingImages(null|array $matchingImages): static + { + $this->fields['matchingImages'] = $matchingImages; + + return $this; + } + + private function setHasMinimalAge(null|bool $hasMinimalAge): static + { + $this->fields['hasMinimalAge'] = $hasMinimalAge; + + return $this; + } + + private function setMrzChecksumValid(null|bool $mrzChecksumValid): static + { + $this->fields['mrzChecksumValid'] = $mrzChecksumValid; + + return $this; + } + + private function setHasCompletedFaceLiveness(null|bool $hasCompletedFaceLiveness): static + { + $this->fields['hasCompletedFaceLiveness'] = $hasCompletedFaceLiveness; + + return $this; + } +} diff --git a/src/Model/KycPurchaseMatchesOverwrite.php b/src/Model/KycPurchaseMatchesOverwrite.php new file mode 100644 index 000000000..aa99ed92e --- /dev/null +++ b/src/Model/KycPurchaseMatchesOverwrite.php @@ -0,0 +1,174 @@ +setFirstName($data['firstName']); + } + if (array_key_exists('lastName', $data)) { + $this->setLastName($data['lastName']); + } + if (array_key_exists('paymentInstrumentId', $data)) { + $this->setPaymentInstrumentId($data['paymentInstrumentId']); + } + if (array_key_exists('documentSubtype', $data)) { + $this->setDocumentSubtype($data['documentSubtype']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'purchase-proof'; + } + + public function getFirstName(): ?string + { + return $this->fields['firstName'] ?? null; + } + + public function setFirstName(null|string $firstName): static + { + $this->fields['firstName'] = $firstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->fields['lastName'] ?? null; + } + + public function setLastName(null|string $lastName): static + { + $this->fields['lastName'] = $lastName; + + 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 getDocumentSubtype(): ?string + { + return $this->fields['documentSubtype'] ?? null; + } + + public function setDocumentSubtype(null|string $documentSubtype): static + { + $this->fields['documentSubtype'] = $documentSubtype; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'purchase-proof', + ]; + if (array_key_exists('firstName', $this->fields)) { + $data['firstName'] = $this->fields['firstName']; + } + if (array_key_exists('lastName', $this->fields)) { + $data['lastName'] = $this->fields['lastName']; + } + if (array_key_exists('paymentInstrumentId', $this->fields)) { + $data['paymentInstrumentId'] = $this->fields['paymentInstrumentId']; + } + if (array_key_exists('documentSubtype', $this->fields)) { + $data['documentSubtype'] = $this->fields['documentSubtype']; + } + + return $data; + } +} diff --git a/src/Model/KycSettingsIdentityWeights.php b/src/Model/KycSettingsIdentityWeights.php index cb3990f7c..c64bbbf3b 100644 --- a/src/Model/KycSettingsIdentityWeights.php +++ b/src/Model/KycSettingsIdentityWeights.php @@ -70,6 +70,15 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('mrzChecksum', $data)) { $this->setMrzChecksum($data['mrzChecksum']); } + if (array_key_exists('documentNumber', $data)) { + $this->setDocumentNumber($data['documentNumber']); + } + if (array_key_exists('issuanceCountry', $data)) { + $this->setIssuanceCountry($data['issuanceCountry']); + } + if (array_key_exists('issuanceRegion', $data)) { + $this->setIssuanceRegion($data['issuanceRegion']); + } $this->setMetadata($metadata); } @@ -258,6 +267,42 @@ public function setMrzChecksum(null|int $mrzChecksum): static return $this; } + public function getDocumentNumber(): ?int + { + return $this->fields['documentNumber'] ?? null; + } + + public function setDocumentNumber(null|int $documentNumber): static + { + $this->fields['documentNumber'] = $documentNumber; + + return $this; + } + + public function getIssuanceCountry(): ?int + { + return $this->fields['issuanceCountry'] ?? null; + } + + public function setIssuanceCountry(null|int $issuanceCountry): static + { + $this->fields['issuanceCountry'] = $issuanceCountry; + + return $this; + } + + public function getIssuanceRegion(): ?int + { + return $this->fields['issuanceRegion'] ?? null; + } + + public function setIssuanceRegion(null|int $issuanceRegion): static + { + $this->fields['issuanceRegion'] = $issuanceRegion; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -306,6 +351,15 @@ public function jsonSerialize(): array if (array_key_exists('mrzChecksum', $this->fields)) { $data['mrzChecksum'] = $this->fields['mrzChecksum']; } + if (array_key_exists('documentNumber', $this->fields)) { + $data['documentNumber'] = $this->fields['documentNumber']; + } + if (array_key_exists('issuanceCountry', $this->fields)) { + $data['issuanceCountry'] = $this->fields['issuanceCountry']; + } + if (array_key_exists('issuanceRegion', $this->fields)) { + $data['issuanceRegion'] = $this->fields['issuanceRegion']; + } return $data; } diff --git a/src/Model/OneTimeSaleItem.php b/src/Model/OneTimeSaleItem.php index ed31383bd..e1d8f6b18 100644 --- a/src/Model/OneTimeSaleItem.php +++ b/src/Model/OneTimeSaleItem.php @@ -29,9 +29,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('id', $data)) { $this->setId($data['id']); } - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } if (array_key_exists('productId', $data)) { $this->setProductId($data['productId']); } @@ -68,18 +65,6 @@ public function getId(): ?string return $this->fields['id'] ?? null; } - public function getPlanId(): ?string - { - return $this->fields['planId'] ?? null; - } - - public function setPlanId(null|string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - public function getProductId(): ?string { return $this->fields['productId'] ?? null; @@ -136,9 +121,6 @@ public function jsonSerialize(): array if (array_key_exists('id', $this->fields)) { $data['id'] = $this->fields['id']; } - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } if (array_key_exists('productId', $this->fields)) { $data['productId'] = $this->fields['productId']; } diff --git a/src/Model/OrderChange.php b/src/Model/OrderChange.php index 5e9466917..b15e4169c 100644 --- a/src/Model/OrderChange.php +++ b/src/Model/OrderChange.php @@ -23,6 +23,14 @@ class OrderChange implements JsonSerializable { use HasMetadata; + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_ONLY = 'retainTrialOnly'; + public const RENEWAL_POLICY_RESET = 'reset'; public const RENEWAL_POLICY_RETAIN = 'retain'; diff --git a/src/Model/OrderPreview.php b/src/Model/OrderPreview.php index 059d16fa0..b6362a629 100644 --- a/src/Model/OrderPreview.php +++ b/src/Model/OrderPreview.php @@ -113,7 +113,7 @@ public function getItems(): array public function setItems(array $items): static { $items = array_map( - fn ($value) => $value instanceof OrderPreviewItems ? $value : OrderPreviewItems::from($value), + fn ($value) => $value instanceof OrderPreviewItems ? $value : OrderPreviewItemsFactory::from($value), $items, ); diff --git a/src/Model/OrderPreviewItems.php b/src/Model/OrderPreviewItems.php index 387422b15..102b0d50d 100644 --- a/src/Model/OrderPreviewItems.php +++ b/src/Model/OrderPreviewItems.php @@ -15,64 +15,7 @@ namespace Rebilly\Sdk\Model; use JsonSerializable; -use Rebilly\Sdk\Trait\HasMetadata; -class OrderPreviewItems implements JsonSerializable +interface OrderPreviewItems extends JsonSerializable { - use HasMetadata; - - private array $fields = []; - - public function __construct(array $data = [], array $metadata = []) - { - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } - if (array_key_exists('quantity', $data)) { - $this->setQuantity($data['quantity']); - } - $this->setMetadata($metadata); - } - - public static function from(array $data = [], array $metadata = []): self - { - return new self($data, $metadata); - } - - public function getPlanId(): string - { - return $this->fields['planId']; - } - - public function setPlanId(string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - - public function getQuantity(): ?int - { - return $this->fields['quantity'] ?? null; - } - - public function setQuantity(null|int $quantity): static - { - $this->fields['quantity'] = $quantity; - - return $this; - } - - public function jsonSerialize(): array - { - $data = []; - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } - if (array_key_exists('quantity', $this->fields)) { - $data['quantity'] = $this->fields['quantity']; - } - - return $data; - } } diff --git a/src/Model/OrderPreviewItems0.php b/src/Model/OrderPreviewItems0.php new file mode 100644 index 000000000..e3b74e6b9 --- /dev/null +++ b/src/Model/OrderPreviewItems0.php @@ -0,0 +1,63 @@ +setPlanId($data['planId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlanId(): ?OrderPreviewItems0PlanId + { + return $this->fields['planId'] ?? null; + } + + public function setPlanId(null|OrderPreviewItems0PlanId|array $planId): static + { + if ($planId !== null && !($planId instanceof OrderPreviewItems0PlanId)) { + $planId = OrderPreviewItems0PlanId::from($planId); + } + + $this->fields['planId'] = $planId; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('planId', $this->fields)) { + $data['planId'] = $this->fields['planId']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems0PlanId.php b/src/Model/OrderPreviewItems0PlanId.php new file mode 100644 index 000000000..8748703ca --- /dev/null +++ b/src/Model/OrderPreviewItems0PlanId.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems1.php b/src/Model/OrderPreviewItems1.php new file mode 100644 index 000000000..e129344e4 --- /dev/null +++ b/src/Model/OrderPreviewItems1.php @@ -0,0 +1,63 @@ +setPlan($data['plan']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlan(): ?OrderPreviewItems1Plan + { + return $this->fields['plan'] ?? null; + } + + public function setPlan(null|OrderPreviewItems1Plan|array $plan): static + { + if ($plan !== null && !($plan instanceof OrderPreviewItems1Plan)) { + $plan = OrderPreviewItems1Plan::from($plan); + } + + $this->fields['plan'] = $plan; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('plan', $this->fields)) { + $data['plan'] = $this->fields['plan']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems1Plan.php b/src/Model/OrderPreviewItems1Plan.php new file mode 100644 index 000000000..58f8e5abf --- /dev/null +++ b/src/Model/OrderPreviewItems1Plan.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/OrderPreviewItems2.php b/src/Model/OrderPreviewItems2.php new file mode 100644 index 000000000..a6e792427 --- /dev/null +++ b/src/Model/OrderPreviewItems2.php @@ -0,0 +1,99 @@ +setPlanId($data['planId']); + } + if (array_key_exists('plan', $data)) { + $this->setPlan($data['plan']); + } + if (array_key_exists('quantity', $data)) { + $this->setQuantity($data['quantity']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPlanId(): string + { + return $this->fields['planId']; + } + + public function setPlanId(string $planId): static + { + $this->fields['planId'] = $planId; + + return $this; + } + + public function getPlan(): ConfigurablePlan + { + return $this->fields['plan']; + } + + public function setPlan(ConfigurablePlan|array $plan): static + { + if (!($plan instanceof ConfigurablePlan)) { + $plan = ConfigurablePlanFactory::from($plan); + } + + $this->fields['plan'] = $plan; + + return $this; + } + + public function getQuantity(): ?int + { + return $this->fields['quantity'] ?? null; + } + + public function setQuantity(null|int $quantity): static + { + $this->fields['quantity'] = $quantity; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('planId', $this->fields)) { + $data['planId'] = $this->fields['planId']; + } + if (array_key_exists('plan', $this->fields)) { + $data['plan'] = $this->fields['plan']->jsonSerialize(); + } + if (array_key_exists('quantity', $this->fields)) { + $data['quantity'] = $this->fields['quantity']; + } + + return $data; + } +} diff --git a/src/Model/OrderPreviewItemsFactory.php b/src/Model/OrderPreviewItemsFactory.php new file mode 100644 index 000000000..4f558a2d1 --- /dev/null +++ b/src/Model/OrderPreviewItemsFactory.php @@ -0,0 +1,23 @@ +setNotifications($data['notifications']); } + if (array_key_exists('annualComplianceScreening', $data)) { + $this->setAnnualComplianceScreening($data['annualComplianceScreening']); + } if (array_key_exists('payoutRequestAllocationOrder', $data)) { $this->setPayoutRequestAllocationOrder($data['payoutRequestAllocationOrder']); } @@ -119,6 +122,22 @@ public function setNotifications(null|OrganizationSettingsNotifications|array $n return $this; } + public function getAnnualComplianceScreening(): ?OrganizationSettingsAnnualComplianceScreening + { + return $this->fields['annualComplianceScreening'] ?? null; + } + + public function setAnnualComplianceScreening(null|OrganizationSettingsAnnualComplianceScreening|array $annualComplianceScreening): static + { + if ($annualComplianceScreening !== null && !($annualComplianceScreening instanceof OrganizationSettingsAnnualComplianceScreening)) { + $annualComplianceScreening = OrganizationSettingsAnnualComplianceScreening::from($annualComplianceScreening); + } + + $this->fields['annualComplianceScreening'] = $annualComplianceScreening; + + return $this; + } + /** * @return null|string[] */ @@ -157,6 +176,9 @@ public function jsonSerialize(): array if (array_key_exists('notifications', $this->fields)) { $data['notifications'] = $this->fields['notifications']?->jsonSerialize(); } + if (array_key_exists('annualComplianceScreening', $this->fields)) { + $data['annualComplianceScreening'] = $this->fields['annualComplianceScreening']?->jsonSerialize(); + } if (array_key_exists('payoutRequestAllocationOrder', $this->fields)) { $data['payoutRequestAllocationOrder'] = $this->fields['payoutRequestAllocationOrder']; } diff --git a/src/Model/OrganizationSettingsAnnualComplianceScreening.php b/src/Model/OrganizationSettingsAnnualComplianceScreening.php new file mode 100644 index 000000000..4aae411bd --- /dev/null +++ b/src/Model/OrganizationSettingsAnnualComplianceScreening.php @@ -0,0 +1,78 @@ +setEnabled($data['enabled']); + } + if (array_key_exists('monthDay', $data)) { + $this->setMonthDay($data['monthDay']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getEnabled(): ?bool + { + return $this->fields['enabled'] ?? null; + } + + public function setEnabled(null|bool $enabled): static + { + $this->fields['enabled'] = $enabled; + + return $this; + } + + public function getMonthDay(): ?string + { + return $this->fields['monthDay'] ?? null; + } + + public function setMonthDay(null|string $monthDay): static + { + $this->fields['monthDay'] = $monthDay; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('enabled', $this->fields)) { + $data['enabled'] = $this->fields['enabled']; + } + if (array_key_exists('monthDay', $this->fields)) { + $data['monthDay'] = $this->fields['monthDay']; + } + + return $data; + } +} diff --git a/src/Model/PatchPlaidCredential.php b/src/Model/PatchPlaidCredential.php index c581228c2..bfd2ce520 100644 --- a/src/Model/PatchPlaidCredential.php +++ b/src/Model/PatchPlaidCredential.php @@ -53,6 +53,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'plaid'; + } + public function getStatus(): ?string { return $this->fields['status'] ?? null; @@ -115,7 +120,9 @@ public function setUseStripe(null|bool $useStripe): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'plaid', + ]; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } diff --git a/src/Model/PatchServiceCredential.php b/src/Model/PatchServiceCredential.php index 3ddb51170..75404266e 100644 --- a/src/Model/PatchServiceCredential.php +++ b/src/Model/PatchServiceCredential.php @@ -26,6 +26,24 @@ class PatchServiceCredential implements PatchServiceCredentialRequest public const STATUS_DEACTIVATED = 'deactivated'; + public const TYPE_SMTP = 'smtp'; + + public const TYPE_WEBHOOK = 'webhook'; + + public const TYPE_MAILGUN = 'mailgun'; + + public const TYPE_SENDGRID = 'sendgrid'; + + public const TYPE_AWS_SES = 'aws-ses'; + + public const TYPE_OAUTH2 = 'oauth2'; + + public const TYPE_POSTMARK = 'postmark'; + + public const TYPE_EXPERIAN = 'experian'; + + public const TYPE_AVALARA = 'avalara'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -33,6 +51,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } $this->setMetadata($metadata); } @@ -53,12 +74,27 @@ public function setStatus(string $status): static return $this; } + public function getType(): string + { + return $this->fields['type']; + } + + public function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + public function jsonSerialize(): array { $data = []; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } return $data; } diff --git a/src/Model/PatchServiceCredentialRequest.php b/src/Model/PatchServiceCredentialRequest.php index 305f3c384..08508e2b0 100644 --- a/src/Model/PatchServiceCredentialRequest.php +++ b/src/Model/PatchServiceCredentialRequest.php @@ -18,6 +18,8 @@ interface PatchServiceCredentialRequest extends JsonSerializable { + public function getType(): string; + public function getStatus(): ?string; public function setStatus(string $status): static; diff --git a/src/Model/PatchServiceCredentialRequestFactory.php b/src/Model/PatchServiceCredentialRequestFactory.php new file mode 100644 index 000000000..35e76b081 --- /dev/null +++ b/src/Model/PatchServiceCredentialRequestFactory.php @@ -0,0 +1,38 @@ + PatchPlaidCredential::from($data, $metadata), + 'avalara' => PatchServiceCredential::from($data, $metadata), + 'aws-ses' => PatchServiceCredential::from($data, $metadata), + 'experian' => PatchServiceCredential::from($data, $metadata), + 'mailgun' => PatchServiceCredential::from($data, $metadata), + 'oauth2' => PatchServiceCredential::from($data, $metadata), + 'postmark' => PatchServiceCredential::from($data, $metadata), + 'sendgrid' => PatchServiceCredential::from($data, $metadata), + 'smtp' => PatchServiceCredential::from($data, $metadata), + 'webhook' => PatchServiceCredential::from($data, $metadata), + 'taxjar' => PatchTaxJarCredential::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PatchTaxJarCredential.php b/src/Model/PatchTaxJarCredential.php index af8a97d3a..c2c9e3a88 100644 --- a/src/Model/PatchTaxJarCredential.php +++ b/src/Model/PatchTaxJarCredential.php @@ -44,6 +44,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getType(): string + { + return 'taxjar'; + } + public function getStatus(): string { return $this->fields['status']; @@ -70,7 +75,9 @@ public function setOmitFromAddress(null|bool $omitFromAddress): static public function jsonSerialize(): array { - $data = []; + $data = [ + 'type' => 'taxjar', + ]; if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } diff --git a/src/Model/PayGlocal.php b/src/Model/PayGlocal.php new file mode 100644 index 000000000..0e9c4b197 --- /dev/null +++ b/src/Model/PayGlocal.php @@ -0,0 +1,67 @@ + 'PayGlocal', + ] + $data, $metadata); + + if (array_key_exists('credentials', $data)) { + $this->setCredentials($data['credentials']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCredentials(): PayGlocalCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(PayGlocalCredentials|array $credentials): static + { + if (!($credentials instanceof PayGlocalCredentials)) { + $credentials = PayGlocalCredentials::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/PayGlocalCredentials.php b/src/Model/PayGlocalCredentials.php new file mode 100644 index 000000000..7f3cc38fb --- /dev/null +++ b/src/Model/PayGlocalCredentials.php @@ -0,0 +1,132 @@ +setMerchantId($data['merchantId']); + } + if (array_key_exists('privateKeyId', $data)) { + $this->setPrivateKeyId($data['privateKeyId']); + } + if (array_key_exists('publicKeyId', $data)) { + $this->setPublicKeyId($data['publicKeyId']); + } + if (array_key_exists('publicKey', $data)) { + $this->setPublicKey($data['publicKey']); + } + if (array_key_exists('privateKey', $data)) { + $this->setPrivateKey($data['privateKey']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getMerchantId(): string + { + return $this->fields['merchantId']; + } + + public function setMerchantId(string $merchantId): static + { + $this->fields['merchantId'] = $merchantId; + + return $this; + } + + public function getPrivateKeyId(): string + { + return $this->fields['privateKeyId']; + } + + public function setPrivateKeyId(string $privateKeyId): static + { + $this->fields['privateKeyId'] = $privateKeyId; + + return $this; + } + + public function getPublicKeyId(): string + { + return $this->fields['publicKeyId']; + } + + public function setPublicKeyId(string $publicKeyId): static + { + $this->fields['publicKeyId'] = $publicKeyId; + + return $this; + } + + public function getPublicKey(): string + { + return $this->fields['publicKey']; + } + + public function setPublicKey(string $publicKey): static + { + $this->fields['publicKey'] = $publicKey; + + return $this; + } + + public function getPrivateKey(): string + { + return $this->fields['privateKey']; + } + + public function setPrivateKey(string $privateKey): static + { + $this->fields['privateKey'] = $privateKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('merchantId', $this->fields)) { + $data['merchantId'] = $this->fields['merchantId']; + } + if (array_key_exists('privateKeyId', $this->fields)) { + $data['privateKeyId'] = $this->fields['privateKeyId']; + } + if (array_key_exists('publicKeyId', $this->fields)) { + $data['publicKeyId'] = $this->fields['publicKeyId']; + } + if (array_key_exists('publicKey', $this->fields)) { + $data['publicKey'] = $this->fields['publicKey']; + } + if (array_key_exists('privateKey', $this->fields)) { + $data['privateKey'] = $this->fields['privateKey']; + } + + return $data; + } +} diff --git a/src/Model/PaybiltCredentials.php b/src/Model/PaybiltCredentials.php index 75a15f726..f89b830b1 100644 --- a/src/Model/PaybiltCredentials.php +++ b/src/Model/PaybiltCredentials.php @@ -34,6 +34,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('apiKey', $data)) { $this->setApiKey($data['apiKey']); } + if (array_key_exists('hmacKey', $data)) { + $this->setHmacKey($data['hmacKey']); + } $this->setMetadata($metadata); } @@ -78,6 +81,18 @@ public function setApiKey(string $apiKey): static return $this; } + public function getHmacKey(): ?string + { + return $this->fields['hmacKey'] ?? null; + } + + public function setHmacKey(null|string $hmacKey): static + { + $this->fields['hmacKey'] = $hmacKey; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -90,6 +105,9 @@ public function jsonSerialize(): array if (array_key_exists('apiKey', $this->fields)) { $data['apiKey'] = $this->fields['apiKey']; } + if (array_key_exists('hmacKey', $this->fields)) { + $data['hmacKey'] = $this->fields['hmacKey']; + } return $data; } diff --git a/src/Model/PaymentCard.php b/src/Model/PaymentCard.php index 1a0854ceb..4acfa17f2 100644 --- a/src/Model/PaymentCard.php +++ b/src/Model/PaymentCard.php @@ -114,6 +114,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('bankName', $data)) { $this->setBankName($data['bankName']); } + if (array_key_exists('isPayoutable', $data)) { + $this->setIsPayoutable($data['isPayoutable']); + } if (array_key_exists('billingAddress', $data)) { $this->setBillingAddress($data['billingAddress']); } @@ -287,6 +290,11 @@ public function getBankName(): ?string return $this->fields['bankName'] ?? null; } + public function getIsPayoutable(): ?bool + { + return $this->fields['isPayoutable'] ?? null; + } + public function getBillingAddress(): ?ContactObject { return $this->fields['billingAddress'] ?? null; @@ -477,6 +485,9 @@ public function jsonSerialize(): array if (array_key_exists('bankName', $this->fields)) { $data['bankName'] = $this->fields['bankName']; } + if (array_key_exists('isPayoutable', $this->fields)) { + $data['isPayoutable'] = $this->fields['isPayoutable']; + } if (array_key_exists('billingAddress', $this->fields)) { $data['billingAddress'] = $this->fields['billingAddress']?->jsonSerialize(); } @@ -592,6 +603,13 @@ private function setBankName(null|string $bankName): static return $this; } + private function setIsPayoutable(null|bool $isPayoutable): static + { + $this->fields['isPayoutable'] = $isPayoutable; + + return $this; + } + private function setBillingPortalUrl(null|string $billingPortalUrl): static { $this->fields['billingPortalUrl'] = $billingPortalUrl; diff --git a/src/Model/PaymentInstructionMethods.php b/src/Model/PaymentInstructionMethods.php index 02628d4cb..d4ee7fb31 100644 --- a/src/Model/PaymentInstructionMethods.php +++ b/src/Model/PaymentInstructionMethods.php @@ -290,6 +290,8 @@ class PaymentInstructionMethods implements PaymentInstruction public const METHODS_PIX = 'PIX'; + public const METHODS_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHODS_PIN_PAY = 'PinPay'; public const METHODS_PHONE = 'phone'; diff --git a/src/Model/PayoutRequest.php b/src/Model/PayoutRequest.php index c399e8ac1..7d45afa5d 100644 --- a/src/Model/PayoutRequest.php +++ b/src/Model/PayoutRequest.php @@ -82,6 +82,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('blockReason', $data)) { $this->setBlockReason($data['blockReason']); } + if (array_key_exists('splitReason', $data)) { + $this->setSplitReason($data['splitReason']); + } if (array_key_exists('batchId', $data)) { $this->setBatchId($data['batchId']); } @@ -239,6 +242,18 @@ public function setBlockReason(null|string $blockReason): static return $this; } + public function getSplitReason(): ?string + { + return $this->fields['splitReason'] ?? null; + } + + public function setSplitReason(null|string $splitReason): static + { + $this->fields['splitReason'] = $splitReason; + + return $this; + } + public function getBatchId(): ?string { return $this->fields['batchId'] ?? null; @@ -345,6 +360,9 @@ public function jsonSerialize(): array if (array_key_exists('blockReason', $this->fields)) { $data['blockReason'] = $this->fields['blockReason']; } + if (array_key_exists('splitReason', $this->fields)) { + $data['splitReason'] = $this->fields['splitReason']; + } if (array_key_exists('batchId', $this->fields)) { $data['batchId'] = $this->fields['batchId']; } diff --git a/src/Model/PayoutRequestAllocation.php b/src/Model/PayoutRequestAllocation.php index fdc766941..d782ed7c2 100644 --- a/src/Model/PayoutRequestAllocation.php +++ b/src/Model/PayoutRequestAllocation.php @@ -293,6 +293,8 @@ class PayoutRequestAllocation implements JsonSerializable public const PAYMENT_METHOD_PIX = 'PIX'; + public const PAYMENT_METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const PAYMENT_METHOD_PIN_PAY = 'PinPay'; public const PAYMENT_METHOD_PHONE = 'phone'; @@ -510,6 +512,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('amount', $data)) { $this->setAmount($data['amount']); } + if (array_key_exists('exposureAmount', $data)) { + $this->setExposureAmount($data['exposureAmount']); + } if (array_key_exists('currency', $data)) { $this->setCurrency($data['currency']); } @@ -619,6 +624,11 @@ public function setAmount(float|string $amount): static return $this; } + public function getExposureAmount(): ?float + { + return $this->fields['exposureAmount'] ?? null; + } + public function getCurrency(): string { return $this->fields['currency']; @@ -706,6 +716,9 @@ public function jsonSerialize(): array if (array_key_exists('amount', $this->fields)) { $data['amount'] = $this->fields['amount']; } + if (array_key_exists('exposureAmount', $this->fields)) { + $data['exposureAmount'] = $this->fields['exposureAmount']; + } if (array_key_exists('currency', $this->fields)) { $data['currency'] = $this->fields['currency']; } @@ -774,6 +787,17 @@ private function setGatewayPayoutInstruction(null|string $gatewayPayoutInstructi return $this; } + private function setExposureAmount(null|float|string $exposureAmount): static + { + if (is_string($exposureAmount)) { + $exposureAmount = (float) $exposureAmount; + } + + $this->fields['exposureAmount'] = $exposureAmount; + + return $this; + } + private function setTransactionId(null|string $transactionId): static { $this->fields['transactionId'] = $transactionId; diff --git a/src/Model/PayoutRequestAllocationsDataExport.php b/src/Model/PayoutRequestAllocationsDataExport.php index 93a24ce7b..8af0ba9ec 100644 --- a/src/Model/PayoutRequestAllocationsDataExport.php +++ b/src/Model/PayoutRequestAllocationsDataExport.php @@ -38,6 +38,14 @@ class PayoutRequestAllocationsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?PayoutRequestAllocationsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/PayoutRequestBatch.php b/src/Model/PayoutRequestBatch.php index bd1ac515d..5a3cd0353 100644 --- a/src/Model/PayoutRequestBatch.php +++ b/src/Model/PayoutRequestBatch.php @@ -36,12 +36,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('totalCount', $data)) { $this->setTotalCount($data['totalCount']); } - if (array_key_exists('successCount', $data)) { - $this->setSuccessCount($data['successCount']); - } - if (array_key_exists('failureCount', $data)) { - $this->setFailureCount($data['failureCount']); - } if (array_key_exists('customerCount', $data)) { $this->setCustomerCount($data['customerCount']); } @@ -86,16 +80,6 @@ public function getTotalCount(): ?int return $this->fields['totalCount'] ?? null; } - public function getSuccessCount(): ?int - { - return $this->fields['successCount'] ?? null; - } - - public function getFailureCount(): ?int - { - return $this->fields['failureCount'] ?? null; - } - public function getCustomerCount(): ?int { return $this->fields['customerCount'] ?? null; @@ -169,12 +153,6 @@ public function jsonSerialize(): array if (array_key_exists('totalCount', $this->fields)) { $data['totalCount'] = $this->fields['totalCount']; } - if (array_key_exists('successCount', $this->fields)) { - $data['successCount'] = $this->fields['successCount']; - } - if (array_key_exists('failureCount', $this->fields)) { - $data['failureCount'] = $this->fields['failureCount']; - } if (array_key_exists('customerCount', $this->fields)) { $data['customerCount'] = $this->fields['customerCount']; } @@ -231,20 +209,6 @@ private function setTotalCount(null|int $totalCount): static return $this; } - private function setSuccessCount(null|int $successCount): static - { - $this->fields['successCount'] = $successCount; - - return $this; - } - - private function setFailureCount(null|int $failureCount): static - { - $this->fields['failureCount'] = $failureCount; - - return $this; - } - private function setCustomerCount(null|int $customerCount): static { $this->fields['customerCount'] = $customerCount; diff --git a/src/Model/PayoutRequestsDataExport.php b/src/Model/PayoutRequestsDataExport.php index e25d9c729..24da032b5 100644 --- a/src/Model/PayoutRequestsDataExport.php +++ b/src/Model/PayoutRequestsDataExport.php @@ -38,6 +38,14 @@ class PayoutRequestsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -84,6 +92,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -238,6 +249,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?PayoutRequestsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -325,6 +341,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -411,6 +430,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php index aca4d88f8..500f3d6c5 100644 --- a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php +++ b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php @@ -203,6 +203,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -327,6 +329,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -765,6 +769,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; diff --git a/src/Model/Plan.php b/src/Model/Plan.php index 568c3f25d..038ae476c 100644 --- a/src/Model/Plan.php +++ b/src/Model/Plan.php @@ -67,6 +67,10 @@ public function getRevision(): ?int; public function getIsTrialOnly(): ?bool; + public function getRecurringInterval(): ?PlanSubscriptionPlanRecurringInterval; + + public function getTrial(): ?PlanTrial; + public function getCreatedTime(): ?DateTimeImmutable; public function getUpdatedTime(): ?DateTimeImmutable; diff --git a/src/Model/PlanOneTimeSalePlan.php b/src/Model/PlanOneTimeSalePlan.php index 72a397b62..1cbd5634b 100644 --- a/src/Model/PlanOneTimeSalePlan.php +++ b/src/Model/PlanOneTimeSalePlan.php @@ -65,6 +65,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } + if (array_key_exists('trial', $data)) { + $this->setTrial($data['trial']); + } if (array_key_exists('createdTime', $data)) { $this->setCreatedTime($data['createdTime']); } @@ -234,6 +240,16 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + + public function getTrial(): null + { + return $this->fields['trial'] ?? null; + } + public function getCreatedTime(): ?DateTimeImmutable { return $this->fields['createdTime'] ?? null; @@ -301,6 +317,12 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } + if (array_key_exists('trial', $this->fields)) { + $data['trial'] = $this->fields['trial']; + } if (array_key_exists('createdTime', $this->fields)) { $data['createdTime'] = $this->fields['createdTime']?->format(DateTimeInterface::RFC3339); } @@ -343,6 +365,20 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + + private function setTrial(null $trial): static + { + $this->fields['trial'] = $trial; + + return $this; + } + private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static { if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) { diff --git a/src/Model/PlanSubscriptionPlan.php b/src/Model/PlanSubscriptionPlan.php index 847486c44..2e5f26460 100644 --- a/src/Model/PlanSubscriptionPlan.php +++ b/src/Model/PlanSubscriptionPlan.php @@ -246,14 +246,14 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } - public function getRecurringInterval(): ?PlanSubscriptionPlanRecurringInterval + public function getRecurringInterval(): PlanSubscriptionPlanRecurringInterval { - return $this->fields['recurringInterval'] ?? null; + return $this->fields['recurringInterval']; } - public function setRecurringInterval(null|PlanSubscriptionPlanRecurringInterval|array $recurringInterval): static + public function setRecurringInterval(PlanSubscriptionPlanRecurringInterval|array $recurringInterval): static { - if ($recurringInterval !== null && !($recurringInterval instanceof PlanSubscriptionPlanRecurringInterval)) { + if (!($recurringInterval instanceof PlanSubscriptionPlanRecurringInterval)) { $recurringInterval = PlanSubscriptionPlanRecurringInterval::from($recurringInterval); } @@ -367,7 +367,7 @@ public function jsonSerialize(): array $data['isTrialOnly'] = $this->fields['isTrialOnly']; } if (array_key_exists('recurringInterval', $this->fields)) { - $data['recurringInterval'] = $this->fields['recurringInterval']?->jsonSerialize(); + $data['recurringInterval'] = $this->fields['recurringInterval']->jsonSerialize(); } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']?->jsonSerialize(); diff --git a/src/Model/PlanSubscriptionPlanMeteredBilling.php b/src/Model/PlanSubscriptionPlanMeteredBilling.php index f31163e72..37eb0c5a5 100644 --- a/src/Model/PlanSubscriptionPlanMeteredBilling.php +++ b/src/Model/PlanSubscriptionPlanMeteredBilling.php @@ -38,6 +38,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('max', $data)) { $this->setMax($data['max']); } + if (array_key_exists('sticky', $data)) { + $this->setSticky($data['sticky']); + } $this->setMetadata($metadata); } @@ -90,6 +93,18 @@ public function setMax(null|float|string $max): static return $this; } + public function getSticky(): ?bool + { + return $this->fields['sticky'] ?? null; + } + + public function setSticky(null|bool $sticky): static + { + $this->fields['sticky'] = $sticky; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -102,6 +117,9 @@ public function jsonSerialize(): array if (array_key_exists('max', $this->fields)) { $data['max'] = $this->fields['max']; } + if (array_key_exists('sticky', $this->fields)) { + $data['sticky'] = $this->fields['sticky']; + } return $data; } diff --git a/src/Model/PlanTrialOnlyPlan.php b/src/Model/PlanTrialOnlyPlan.php index 406d3d18f..acbf82fb3 100644 --- a/src/Model/PlanTrialOnlyPlan.php +++ b/src/Model/PlanTrialOnlyPlan.php @@ -62,6 +62,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('isTrialOnly', $data)) { $this->setIsTrialOnly($data['isTrialOnly']); } + if (array_key_exists('recurringInterval', $data)) { + $this->setRecurringInterval($data['recurringInterval']); + } if (array_key_exists('trial', $data)) { $this->setTrial($data['trial']); } @@ -221,6 +224,11 @@ public function getIsTrialOnly(): ?bool return $this->fields['isTrialOnly'] ?? null; } + public function getRecurringInterval(): null + { + return $this->fields['recurringInterval'] ?? null; + } + public function getTrial(): PlanTrial { return $this->fields['trial']; @@ -306,6 +314,9 @@ public function jsonSerialize(): array if (array_key_exists('isTrialOnly', $this->fields)) { $data['isTrialOnly'] = $this->fields['isTrialOnly']; } + if (array_key_exists('recurringInterval', $this->fields)) { + $data['recurringInterval'] = $this->fields['recurringInterval']; + } if (array_key_exists('trial', $this->fields)) { $data['trial'] = $this->fields['trial']->jsonSerialize(); } @@ -354,6 +365,13 @@ private function setIsTrialOnly(null|bool $isTrialOnly): static return $this; } + private function setRecurringInterval(null $recurringInterval): static + { + $this->fields['recurringInterval'] = $recurringInterval; + + return $this; + } + private function setInvoiceTimeShift(null|InvoiceTimeShift|array $invoiceTimeShift): static { if ($invoiceTimeShift !== null && !($invoiceTimeShift instanceof InvoiceTimeShift)) { diff --git a/src/Model/PostAvalaraCredential.php b/src/Model/PostAvalaraCredential.php new file mode 100644 index 000000000..c1994f2eb --- /dev/null +++ b/src/Model/PostAvalaraCredential.php @@ -0,0 +1,202 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('licenseKey', $data)) { + $this->setLicenseKey($data['licenseKey']); + } + if (array_key_exists('accountId', $data)) { + $this->setAccountId($data['accountId']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'avalara'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getLicenseKey(): ?string + { + return $this->fields['licenseKey'] ?? null; + } + + public function setLicenseKey(null|string $licenseKey): static + { + $this->fields['licenseKey'] = $licenseKey; + + return $this; + } + + public function getAccountId(): string + { + return $this->fields['accountId']; + } + + public function setAccountId(string $accountId): static + { + $this->fields['accountId'] = $accountId; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'avalara', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('licenseKey', $this->fields)) { + $data['licenseKey'] = $this->fields['licenseKey']; + } + if (array_key_exists('accountId', $this->fields)) { + $data['accountId'] = $this->fields['accountId']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostAwsSesCredential.php b/src/Model/PostAwsSesCredential.php new file mode 100644 index 000000000..39bd5f05c --- /dev/null +++ b/src/Model/PostAwsSesCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('key', $data)) { + $this->setKey($data['key']); + } + if (array_key_exists('secret', $data)) { + $this->setSecret($data['secret']); + } + if (array_key_exists('region', $data)) { + $this->setRegion($data['region']); + } + if (array_key_exists('configurationSetName', $data)) { + $this->setConfigurationSetName($data['configurationSetName']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'aws-ses'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getKey(): ?string + { + return $this->fields['key'] ?? null; + } + + public function setKey(null|string $key): static + { + $this->fields['key'] = $key; + + return $this; + } + + public function getSecret(): string + { + return $this->fields['secret']; + } + + public function setSecret(string $secret): static + { + $this->fields['secret'] = $secret; + + return $this; + } + + public function getRegion(): string + { + return $this->fields['region']; + } + + public function setRegion(string $region): static + { + $this->fields['region'] = $region; + + return $this; + } + + public function getConfigurationSetName(): ?string + { + return $this->fields['configurationSetName'] ?? null; + } + + public function setConfigurationSetName(null|string $configurationSetName): static + { + $this->fields['configurationSetName'] = $configurationSetName; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'aws-ses', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('key', $this->fields)) { + $data['key'] = $this->fields['key']; + } + if (array_key_exists('secret', $this->fields)) { + $data['secret'] = $this->fields['secret']; + } + if (array_key_exists('region', $this->fields)) { + $data['region'] = $this->fields['region']; + } + if (array_key_exists('configurationSetName', $this->fields)) { + $data['configurationSetName'] = $this->fields['configurationSetName']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostCashier.php b/src/Model/PostCashier.php index d70d04608..545044a08 100644 --- a/src/Model/PostCashier.php +++ b/src/Model/PostCashier.php @@ -37,21 +37,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('redirectUrl', $data)) { $this->setRedirectUrl($data['redirectUrl']); } - if (array_key_exists('balance', $data)) { - $this->setBalance($data['balance']); - } - if (array_key_exists('bonusBalance', $data)) { - $this->setBonusBalance($data['bonusBalance']); - } if (array_key_exists('depositLimits', $data)) { $this->setDepositLimits($data['depositLimits']); } if (array_key_exists('notificationUrl', $data)) { $this->setNotificationUrl($data['notificationUrl']); } - if (array_key_exists('pendingPayoutTotal', $data)) { - $this->setPendingPayoutTotal($data['pendingPayoutTotal']); - } $this->setMetadata($metadata); } @@ -108,38 +99,6 @@ public function setRedirectUrl(null|string $redirectUrl): static return $this; } - public function getBalance(): ?float - { - return $this->fields['balance'] ?? null; - } - - public function setBalance(null|float|string $balance): static - { - if (is_string($balance)) { - $balance = (float) $balance; - } - - $this->fields['balance'] = $balance; - - return $this; - } - - public function getBonusBalance(): ?float - { - return $this->fields['bonusBalance'] ?? null; - } - - public function setBonusBalance(null|float|string $bonusBalance): static - { - if (is_string($bonusBalance)) { - $bonusBalance = (float) $bonusBalance; - } - - $this->fields['bonusBalance'] = $bonusBalance; - - return $this; - } - public function getDepositLimits(): ?PostCashierDepositLimits { return $this->fields['depositLimits'] ?? null; @@ -168,22 +127,6 @@ public function setNotificationUrl(null|string $notificationUrl): static return $this; } - public function getPendingPayoutTotal(): ?float - { - return $this->fields['pendingPayoutTotal'] ?? null; - } - - public function setPendingPayoutTotal(null|float|string $pendingPayoutTotal): static - { - if (is_string($pendingPayoutTotal)) { - $pendingPayoutTotal = (float) $pendingPayoutTotal; - } - - $this->fields['pendingPayoutTotal'] = $pendingPayoutTotal; - - return $this; - } - public function jsonSerialize(): array { $data = []; @@ -199,21 +142,12 @@ public function jsonSerialize(): array if (array_key_exists('redirectUrl', $this->fields)) { $data['redirectUrl'] = $this->fields['redirectUrl']; } - if (array_key_exists('balance', $this->fields)) { - $data['balance'] = $this->fields['balance']; - } - if (array_key_exists('bonusBalance', $this->fields)) { - $data['bonusBalance'] = $this->fields['bonusBalance']; - } if (array_key_exists('depositLimits', $this->fields)) { $data['depositLimits'] = $this->fields['depositLimits']?->jsonSerialize(); } if (array_key_exists('notificationUrl', $this->fields)) { $data['notificationUrl'] = $this->fields['notificationUrl']; } - if (array_key_exists('pendingPayoutTotal', $this->fields)) { - $data['pendingPayoutTotal'] = $this->fields['pendingPayoutTotal']; - } return $data; } diff --git a/src/Model/PostExperianCredential.php b/src/Model/PostExperianCredential.php new file mode 100644 index 000000000..7195c9c87 --- /dev/null +++ b/src/Model/PostExperianCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('username', $data)) { + $this->setUsername($data['username']); + } + if (array_key_exists('password', $data)) { + $this->setPassword($data['password']); + } + if (array_key_exists('hmacKey', $data)) { + $this->setHmacKey($data['hmacKey']); + } + if (array_key_exists('publicKey', $data)) { + $this->setPublicKey($data['publicKey']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'experian'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getUsername(): ?string + { + return $this->fields['username'] ?? null; + } + + public function setUsername(null|string $username): static + { + $this->fields['username'] = $username; + + return $this; + } + + public function getPassword(): string + { + return $this->fields['password']; + } + + public function setPassword(string $password): static + { + $this->fields['password'] = $password; + + return $this; + } + + public function getHmacKey(): string + { + return $this->fields['hmacKey']; + } + + public function setHmacKey(string $hmacKey): static + { + $this->fields['hmacKey'] = $hmacKey; + + return $this; + } + + public function getPublicKey(): string + { + return $this->fields['publicKey']; + } + + public function setPublicKey(string $publicKey): static + { + $this->fields['publicKey'] = $publicKey; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'experian', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('username', $this->fields)) { + $data['username'] = $this->fields['username']; + } + if (array_key_exists('password', $this->fields)) { + $data['password'] = $this->fields['password']; + } + if (array_key_exists('hmacKey', $this->fields)) { + $data['hmacKey'] = $this->fields['hmacKey']; + } + if (array_key_exists('publicKey', $this->fields)) { + $data['publicKey'] = $this->fields['publicKey']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostKycDocumentMatchesRequest.php b/src/Model/PostKycDocumentMatchesRequest.php index 47ca2bbc1..ab7e561b5 100644 --- a/src/Model/PostKycDocumentMatchesRequest.php +++ b/src/Model/PostKycDocumentMatchesRequest.php @@ -18,6 +18,8 @@ interface PostKycDocumentMatchesRequest extends JsonSerializable { + public function getType(): string; + public function getFirstName(): ?string; public function setFirstName(null|string $firstName): static; @@ -29,8 +31,4 @@ public function setLastName(null|string $lastName): static; public function getDocumentSubtype(): ?string; public function setDocumentSubtype(null|string $documentSubtype): static; - - public function getIsTampered(): ?bool; - - public function setIsTampered(null|bool $isTampered): static; } diff --git a/src/Model/PostKycDocumentMatchesRequestFactory.php b/src/Model/PostKycDocumentMatchesRequestFactory.php new file mode 100644 index 000000000..fc3b948c3 --- /dev/null +++ b/src/Model/PostKycDocumentMatchesRequestFactory.php @@ -0,0 +1,31 @@ + KycAddressMatchesOverwrite::from($data, $metadata), + 'funds-proof' => KycFundsMatchesOverwrite::from($data, $metadata), + 'identity-proof' => KycIdentityMatchesOverwrite::from($data, $metadata), + 'purchase-proof' => KycPurchaseMatchesOverwrite::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PostMailgunCredential.php b/src/Model/PostMailgunCredential.php new file mode 100644 index 000000000..9ef32b562 --- /dev/null +++ b/src/Model/PostMailgunCredential.php @@ -0,0 +1,220 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('emailFrom', $data)) { + $this->setEmailFrom($data['emailFrom']); + } + if (array_key_exists('apiKey', $data)) { + $this->setApiKey($data['apiKey']); + } + if (array_key_exists('domain', $data)) { + $this->setDomain($data['domain']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'mailgun'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getEmailFrom(): ?string + { + return $this->fields['emailFrom'] ?? null; + } + + public function setEmailFrom(null|string $emailFrom): static + { + $this->fields['emailFrom'] = $emailFrom; + + return $this; + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function getDomain(): string + { + return $this->fields['domain']; + } + + public function setDomain(string $domain): static + { + $this->fields['domain'] = $domain; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'mailgun', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('emailFrom', $this->fields)) { + $data['emailFrom'] = $this->fields['emailFrom']; + } + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + if (array_key_exists('domain', $this->fields)) { + $data['domain'] = $this->fields['domain']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostOAuth2Credential.php b/src/Model/PostOAuth2Credential.php new file mode 100644 index 000000000..81cdd57a1 --- /dev/null +++ b/src/Model/PostOAuth2Credential.php @@ -0,0 +1,288 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('service', $data)) { + $this->setService($data['service']); + } + if (array_key_exists('code', $data)) { + $this->setCode($data['code']); + } + if (array_key_exists('accessToken', $data)) { + $this->setAccessToken($data['accessToken']); + } + if (array_key_exists('refreshToken', $data)) { + $this->setRefreshToken($data['refreshToken']); + } + if (array_key_exists('expirationTime', $data)) { + $this->setExpirationTime($data['expirationTime']); + } + if (array_key_exists('scopes', $data)) { + $this->setScopes($data['scopes']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'oauth2'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getService(): string + { + return $this->fields['service']; + } + + public function setService(string $service): static + { + $this->fields['service'] = $service; + + return $this; + } + + public function getCode(): ?string + { + return $this->fields['code'] ?? null; + } + + public function setCode(null|string $code): static + { + $this->fields['code'] = $code; + + return $this; + } + + public function getAccessToken(): ?string + { + return $this->fields['accessToken'] ?? null; + } + + public function getRefreshToken(): ?string + { + return $this->fields['refreshToken'] ?? null; + } + + public function getExpirationTime(): ?DateTimeImmutable + { + return $this->fields['expirationTime'] ?? null; + } + + /** + * @return string[] + */ + public function getScopes(): array + { + return $this->fields['scopes']; + } + + /** + * @param string[] $scopes + */ + public function setScopes(array $scopes): static + { + $this->fields['scopes'] = $scopes; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'oauth2', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('service', $this->fields)) { + $data['service'] = $this->fields['service']; + } + if (array_key_exists('code', $this->fields)) { + $data['code'] = $this->fields['code']; + } + if (array_key_exists('accessToken', $this->fields)) { + $data['accessToken'] = $this->fields['accessToken']; + } + if (array_key_exists('refreshToken', $this->fields)) { + $data['refreshToken'] = $this->fields['refreshToken']; + } + if (array_key_exists('expirationTime', $this->fields)) { + $data['expirationTime'] = $this->fields['expirationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('scopes', $this->fields)) { + $data['scopes'] = $this->fields['scopes']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } + + private function setAccessToken(null|string $accessToken): static + { + $this->fields['accessToken'] = $accessToken; + + return $this; + } + + private function setRefreshToken(null|string $refreshToken): static + { + $this->fields['refreshToken'] = $refreshToken; + + return $this; + } + + private function setExpirationTime(null|DateTimeImmutable|string $expirationTime): static + { + if ($expirationTime !== null && !($expirationTime instanceof DateTimeImmutable)) { + $expirationTime = new DateTimeImmutable($expirationTime); + } + + $this->fields['expirationTime'] = $expirationTime; + + 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/PostPaymentInstrumentRequestFactory.php b/src/Model/PostPaymentInstrumentRequestFactory.php index 898309041..e2ccb23ae 100644 --- a/src/Model/PostPaymentInstrumentRequestFactory.php +++ b/src/Model/PostPaymentInstrumentRequestFactory.php @@ -91,6 +91,7 @@ public static function from(array $data = [], array $metadata = []): PostPayment 'Onlineueberweisen' => AlternativeInstrument::from($data, $metadata), 'P24' => AlternativeInstrument::from($data, $metadata), 'PIX' => AlternativeInstrument::from($data, $metadata), + 'PIX-Automatico' => AlternativeInstrument::from($data, $metadata), 'POLi' => AlternativeInstrument::from($data, $metadata), 'Pagadito' => AlternativeInstrument::from($data, $metadata), 'PagoEffectivo' => AlternativeInstrument::from($data, $metadata), diff --git a/src/Model/PostPayoutRequestSplitRequest.php b/src/Model/PostPayoutRequestSplitRequest.php new file mode 100644 index 000000000..41323b848 --- /dev/null +++ b/src/Model/PostPayoutRequestSplitRequest.php @@ -0,0 +1,139 @@ +setPayoutRequestId($data['payoutRequestId']); + } + if (array_key_exists('amounts', $data)) { + $this->setAmounts($data['amounts']); + } + if (array_key_exists('splitReason', $data)) { + $this->setSplitReason($data['splitReason']); + } + if (array_key_exists('splitDescription', $data)) { + $this->setSplitDescription($data['splitDescription']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPayoutRequestId(): string + { + return $this->fields['payoutRequestId']; + } + + public function setPayoutRequestId(string $payoutRequestId): static + { + $this->fields['payoutRequestId'] = $payoutRequestId; + + return $this; + } + + /** + * @return float[] + */ + public function getAmounts(): array + { + return $this->fields['amounts']; + } + + /** + * @param float[]|string[] $amounts + */ + public function setAmounts(array $amounts): static + { + $amounts = array_map( + fn ($value) => is_string($value) ? (float) $value : $value, + $amounts, + ); + + $this->fields['amounts'] = $amounts; + + return $this; + } + + public function getSplitReason(): string + { + return $this->fields['splitReason']; + } + + public function setSplitReason(string $splitReason): static + { + $this->fields['splitReason'] = $splitReason; + + return $this; + } + + public function getSplitDescription(): ?string + { + return $this->fields['splitDescription'] ?? null; + } + + public function setSplitDescription(null|string $splitDescription): static + { + $this->fields['splitDescription'] = $splitDescription; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('payoutRequestId', $this->fields)) { + $data['payoutRequestId'] = $this->fields['payoutRequestId']; + } + if (array_key_exists('amounts', $this->fields)) { + $data['amounts'] = $this->fields['amounts']; + } + if (array_key_exists('splitReason', $this->fields)) { + $data['splitReason'] = $this->fields['splitReason']; + } + if (array_key_exists('splitDescription', $this->fields)) { + $data['splitDescription'] = $this->fields['splitDescription']; + } + + return $data; + } +} diff --git a/src/Model/PostPayoutRequestsToBatchRequest.php b/src/Model/PostPayoutRequestsToBatchRequest.php new file mode 100644 index 000000000..88ba5a9c7 --- /dev/null +++ b/src/Model/PostPayoutRequestsToBatchRequest.php @@ -0,0 +1,21 @@ +setPayoutRequestIds($data['payoutRequestIds']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + /** + * @return string[] + */ + public function getPayoutRequestIds(): array + { + return $this->fields['payoutRequestIds']; + } + + /** + * @param string[] $payoutRequestIds + */ + public function setPayoutRequestIds(array $payoutRequestIds): static + { + $this->fields['payoutRequestIds'] = $payoutRequestIds; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('payoutRequestIds', $this->fields)) { + $data['payoutRequestIds'] = $this->fields['payoutRequestIds']; + } + + return $data; + } +} diff --git a/src/Model/PostPayoutRequestsToBatchRequestFactory.php b/src/Model/PostPayoutRequestsToBatchRequestFactory.php new file mode 100644 index 000000000..3e9f12f26 --- /dev/null +++ b/src/Model/PostPayoutRequestsToBatchRequestFactory.php @@ -0,0 +1,32 @@ +setFilter($data['filter']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFilter(): string + { + return $this->fields['filter']; + } + + public function setFilter(string $filter): static + { + $this->fields['filter'] = $filter; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('filter', $this->fields)) { + $data['filter'] = $this->fields['filter']; + } + + return $data; + } +} diff --git a/src/Model/PostPlaidCredential.php b/src/Model/PostPlaidCredential.php new file mode 100644 index 000000000..9b324afec --- /dev/null +++ b/src/Model/PostPlaidCredential.php @@ -0,0 +1,238 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + if (array_key_exists('clientId', $data)) { + $this->setClientId($data['clientId']); + } + if (array_key_exists('secretToken', $data)) { + $this->setSecretToken($data['secretToken']); + } + if (array_key_exists('useStripe', $data)) { + $this->setUseStripe($data['useStripe']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'plaid'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getWebsiteId(): ?string + { + return $this->fields['websiteId'] ?? null; + } + + public function setWebsiteId(null|string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + public function getClientId(): ?string + { + return $this->fields['clientId'] ?? null; + } + + public function setClientId(null|string $clientId): static + { + $this->fields['clientId'] = $clientId; + + return $this; + } + + public function getSecretToken(): string + { + return $this->fields['secretToken']; + } + + public function setSecretToken(string $secretToken): static + { + $this->fields['secretToken'] = $secretToken; + + return $this; + } + + public function getUseStripe(): ?bool + { + return $this->fields['useStripe'] ?? null; + } + + public function setUseStripe(null|bool $useStripe): static + { + $this->fields['useStripe'] = $useStripe; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'plaid', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; + } + if (array_key_exists('clientId', $this->fields)) { + $data['clientId'] = $this->fields['clientId']; + } + if (array_key_exists('secretToken', $this->fields)) { + $data['secretToken'] = $this->fields['secretToken']; + } + if (array_key_exists('useStripe', $this->fields)) { + $data['useStripe'] = $this->fields['useStripe']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostPostmarkCredential.php b/src/Model/PostPostmarkCredential.php new file mode 100644 index 000000000..29d29553a --- /dev/null +++ b/src/Model/PostPostmarkCredential.php @@ -0,0 +1,184 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('serverApiToken', $data)) { + $this->setServerApiToken($data['serverApiToken']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'postmark'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getServerApiToken(): ?string + { + return $this->fields['serverApiToken'] ?? null; + } + + public function setServerApiToken(null|string $serverApiToken): static + { + $this->fields['serverApiToken'] = $serverApiToken; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'postmark', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('serverApiToken', $this->fields)) { + $data['serverApiToken'] = $this->fields['serverApiToken']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PayoutRequestSplit.php b/src/Model/PostRemovePayoutRequestsFromBatchRequest.php similarity index 55% rename from src/Model/PayoutRequestSplit.php rename to src/Model/PostRemovePayoutRequestsFromBatchRequest.php index 6e95c63ca..965629c34 100644 --- a/src/Model/PayoutRequestSplit.php +++ b/src/Model/PostRemovePayoutRequestsFromBatchRequest.php @@ -17,7 +17,7 @@ use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; -class PayoutRequestSplit implements JsonSerializable +class PostRemovePayoutRequestsFromBatchRequest implements JsonSerializable { use HasMetadata; @@ -25,8 +25,8 @@ class PayoutRequestSplit implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('amounts', $data)) { - $this->setAmounts($data['amounts']); + if (array_key_exists('payoutRequestIds', $data)) { + $this->setPayoutRequestIds($data['payoutRequestIds']); } $this->setMetadata($metadata); } @@ -37,24 +37,19 @@ public static function from(array $data = [], array $metadata = []): self } /** - * @return float[] + * @return string[] */ - public function getAmounts(): array + public function getPayoutRequestIds(): array { - return $this->fields['amounts']; + return $this->fields['payoutRequestIds']; } /** - * @param float[]|string[] $amounts + * @param string[] $payoutRequestIds */ - public function setAmounts(array $amounts): static + public function setPayoutRequestIds(array $payoutRequestIds): static { - $amounts = array_map( - fn ($value) => is_string($value) ? (float) $value : $value, - $amounts, - ); - - $this->fields['amounts'] = $amounts; + $this->fields['payoutRequestIds'] = $payoutRequestIds; return $this; } @@ -62,8 +57,8 @@ public function setAmounts(array $amounts): static public function jsonSerialize(): array { $data = []; - if (array_key_exists('amounts', $this->fields)) { - $data['amounts'] = $this->fields['amounts']; + if (array_key_exists('payoutRequestIds', $this->fields)) { + $data['payoutRequestIds'] = $this->fields['payoutRequestIds']; } return $data; diff --git a/src/Model/PostSendGridCredential.php b/src/Model/PostSendGridCredential.php new file mode 100644 index 000000000..ff9dec23b --- /dev/null +++ b/src/Model/PostSendGridCredential.php @@ -0,0 +1,184 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('apiKey', $data)) { + $this->setApiKey($data['apiKey']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'sendgrid'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getApiKey(): ?string + { + return $this->fields['apiKey'] ?? null; + } + + public function setApiKey(null|string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'sendgrid', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostServiceCredentialRequest.php b/src/Model/PostServiceCredentialRequest.php new file mode 100644 index 000000000..f6eb185dd --- /dev/null +++ b/src/Model/PostServiceCredentialRequest.php @@ -0,0 +1,31 @@ + PostAvalaraCredential::from($data, $metadata), + 'aws-ses' => PostAwsSesCredential::from($data, $metadata), + 'experian' => PostExperianCredential::from($data, $metadata), + 'mailgun' => PostMailgunCredential::from($data, $metadata), + 'oauth2' => PostOAuth2Credential::from($data, $metadata), + 'plaid' => PostPlaidCredential::from($data, $metadata), + 'postmark' => PostPostmarkCredential::from($data, $metadata), + 'sendgrid' => PostSendGridCredential::from($data, $metadata), + 'smtp' => PostSmtpCredential::from($data, $metadata), + 'taxjar' => PostTaxJarCredential::from($data, $metadata), + 'webhook' => PostWebhookCredential::from($data, $metadata), + default => throw new UnknownDiscriminatorValueException(), + }; + } +} diff --git a/src/Model/PostSmtpCredential.php b/src/Model/PostSmtpCredential.php new file mode 100644 index 000000000..a8ab7144c --- /dev/null +++ b/src/Model/PostSmtpCredential.php @@ -0,0 +1,248 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('host', $data)) { + $this->setHost($data['host']); + } + if (array_key_exists('port', $data)) { + $this->setPort($data['port']); + } + if (array_key_exists('encryption', $data)) { + $this->setEncryption($data['encryption']); + } + if (array_key_exists('auth', $data)) { + $this->setAuth($data['auth']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'smtp'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getHost(): ?string + { + return $this->fields['host'] ?? null; + } + + public function setHost(null|string $host): static + { + $this->fields['host'] = $host; + + return $this; + } + + public function getPort(): ?int + { + return $this->fields['port'] ?? null; + } + + public function setPort(null|int $port): static + { + $this->fields['port'] = $port; + + return $this; + } + + public function getEncryption(): ?string + { + return $this->fields['encryption'] ?? null; + } + + public function setEncryption(null|string $encryption): static + { + $this->fields['encryption'] = $encryption; + + return $this; + } + + public function getAuth(): ?SmtpAuthorization + { + return $this->fields['auth'] ?? null; + } + + public function setAuth(null|SmtpAuthorization|array $auth): static + { + if ($auth !== null && !($auth instanceof SmtpAuthorization)) { + $auth = SmtpAuthorizationFactory::from($auth); + } + + $this->fields['auth'] = $auth; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'smtp', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('host', $this->fields)) { + $data['host'] = $this->fields['host']; + } + if (array_key_exists('port', $this->fields)) { + $data['port'] = $this->fields['port']; + } + if (array_key_exists('encryption', $this->fields)) { + $data['encryption'] = $this->fields['encryption']; + } + if (array_key_exists('auth', $this->fields)) { + $data['auth'] = $this->fields['auth']?->jsonSerialize(); + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostTaxJarCredential.php b/src/Model/PostTaxJarCredential.php new file mode 100644 index 000000000..212deb1ae --- /dev/null +++ b/src/Model/PostTaxJarCredential.php @@ -0,0 +1,202 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('apiToken', $data)) { + $this->setApiToken($data['apiToken']); + } + if (array_key_exists('omitFromAddress', $data)) { + $this->setOmitFromAddress($data['omitFromAddress']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'taxjar'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getApiToken(): ?string + { + return $this->fields['apiToken'] ?? null; + } + + public function setApiToken(null|string $apiToken): static + { + $this->fields['apiToken'] = $apiToken; + + return $this; + } + + public function getOmitFromAddress(): ?bool + { + return $this->fields['omitFromAddress'] ?? null; + } + + public function setOmitFromAddress(null|bool $omitFromAddress): static + { + $this->fields['omitFromAddress'] = $omitFromAddress; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'taxjar', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('apiToken', $this->fields)) { + $data['apiToken'] = $this->fields['apiToken']; + } + if (array_key_exists('omitFromAddress', $this->fields)) { + $data['omitFromAddress'] = $this->fields['omitFromAddress']; + } + 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 setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + 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/PostWebhookCredential.php b/src/Model/PostWebhookCredential.php new file mode 100644 index 000000000..c0d315bb3 --- /dev/null +++ b/src/Model/PostWebhookCredential.php @@ -0,0 +1,172 @@ +setId($data['id']); + } + if (array_key_exists('hash', $data)) { + $this->setHash($data['hash']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('deactivationTime', $data)) { + $this->setDeactivationTime($data['deactivationTime']); + } + if (array_key_exists('host', $data)) { + $this->setHost($data['host']); + } + if (array_key_exists('auth', $data)) { + $this->setAuth($data['auth']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getType(): string + { + return 'webhook'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getHash(): ?string + { + return $this->fields['hash'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getDeactivationTime(): ?DateTimeImmutable + { + return $this->fields['deactivationTime'] ?? null; + } + + public function getHost(): ?string + { + return $this->fields['host'] ?? null; + } + + public function setHost(null|string $host): static + { + $this->fields['host'] = $host; + + return $this; + } + + public function getAuth(): ?WebhookAuthorization + { + return $this->fields['auth'] ?? null; + } + + public function setAuth(null|WebhookAuthorization|array $auth): static + { + if ($auth !== null && !($auth instanceof WebhookAuthorization)) { + $auth = WebhookAuthorizationFactory::from($auth); + } + + $this->fields['auth'] = $auth; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'type' => 'webhook', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('hash', $this->fields)) { + $data['hash'] = $this->fields['hash']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('deactivationTime', $this->fields)) { + $data['deactivationTime'] = $this->fields['deactivationTime']?->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('host', $this->fields)) { + $data['host'] = $this->fields['host']; + } + if (array_key_exists('auth', $this->fields)) { + $data['auth'] = $this->fields['auth']?->jsonSerialize(); + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setHash(null|string $hash): static + { + $this->fields['hash'] = $hash; + + return $this; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setDeactivationTime(null|DateTimeImmutable|string $deactivationTime): static + { + if ($deactivationTime !== null && !($deactivationTime instanceof DateTimeImmutable)) { + $deactivationTime = new DateTimeImmutable($deactivationTime); + } + + $this->fields['deactivationTime'] = $deactivationTime; + + return $this; + } +} diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 23f7e27e9..9ab98ff38 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -87,6 +87,18 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('hash', $data)) { $this->setHash($data['hash']); } + if (array_key_exists('requiresCardOnFile', $data)) { + $this->setRequiresCardOnFile($data['requiresCardOnFile']); + } + if (array_key_exists('hasCardOnFile', $data)) { + $this->setHasCardOnFile($data['hasCardOnFile']); + } + if (array_key_exists('billingManagementToken', $data)) { + $this->setBillingManagementToken($data['billingManagementToken']); + } + if (array_key_exists('pastDueInvoice', $data)) { + $this->setPastDueInvoice($data['pastDueInvoice']); + } if (array_key_exists('_links', $data)) { $this->setLinks($data['_links']); } @@ -201,6 +213,37 @@ public function getHash(): ?string return $this->fields['hash'] ?? null; } + public function getRequiresCardOnFile(): ?bool + { + return $this->fields['requiresCardOnFile'] ?? null; + } + + public function getHasCardOnFile(): ?bool + { + return $this->fields['hasCardOnFile'] ?? null; + } + + public function getBillingManagementToken(): ?string + { + return $this->fields['billingManagementToken'] ?? null; + } + + public function getPastDueInvoice(): ?ProfilePastDueInvoice + { + return $this->fields['pastDueInvoice'] ?? null; + } + + public function setPastDueInvoice(null|ProfilePastDueInvoice|array $pastDueInvoice): static + { + if ($pastDueInvoice !== null && !($pastDueInvoice instanceof ProfilePastDueInvoice)) { + $pastDueInvoice = ProfilePastDueInvoice::from($pastDueInvoice); + } + + $this->fields['pastDueInvoice'] = $pastDueInvoice; + + return $this; + } + /** * @return null|ResourceLink[] */ @@ -266,6 +309,18 @@ public function jsonSerialize(): array if (array_key_exists('hash', $this->fields)) { $data['hash'] = $this->fields['hash']; } + if (array_key_exists('requiresCardOnFile', $this->fields)) { + $data['requiresCardOnFile'] = $this->fields['requiresCardOnFile']; + } + if (array_key_exists('hasCardOnFile', $this->fields)) { + $data['hasCardOnFile'] = $this->fields['hasCardOnFile']; + } + if (array_key_exists('billingManagementToken', $this->fields)) { + $data['billingManagementToken'] = $this->fields['billingManagementToken']; + } + if (array_key_exists('pastDueInvoice', $this->fields)) { + $data['pastDueInvoice'] = $this->fields['pastDueInvoice']?->jsonSerialize(); + } if (array_key_exists('_links', $this->fields)) { $data['_links'] = $this->fields['_links'] !== null ? array_map( @@ -415,6 +470,27 @@ private function setHash(null|string $hash): static return $this; } + private function setRequiresCardOnFile(null|bool $requiresCardOnFile): static + { + $this->fields['requiresCardOnFile'] = $requiresCardOnFile; + + return $this; + } + + private function setHasCardOnFile(null|bool $hasCardOnFile): static + { + $this->fields['hasCardOnFile'] = $hasCardOnFile; + + return $this; + } + + private function setBillingManagementToken(null|string $billingManagementToken): static + { + $this->fields['billingManagementToken'] = $billingManagementToken; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/ProfilePastDueInvoice.php b/src/Model/ProfilePastDueInvoice.php new file mode 100644 index 000000000..d33a7cff3 --- /dev/null +++ b/src/Model/ProfilePastDueInvoice.php @@ -0,0 +1,96 @@ +setInvoiceId($data['invoiceId']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + if (array_key_exists('token', $data)) { + $this->setToken($data['token']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getInvoiceId(): string + { + return $this->fields['invoiceId']; + } + + public function getWebsiteId(): string + { + return $this->fields['websiteId']; + } + + public function getToken(): ?string + { + return $this->fields['token'] ?? null; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('invoiceId', $this->fields)) { + $data['invoiceId'] = $this->fields['invoiceId']; + } + if (array_key_exists('websiteId', $this->fields)) { + $data['websiteId'] = $this->fields['websiteId']; + } + if (array_key_exists('token', $this->fields)) { + $data['token'] = $this->fields['token']; + } + + return $data; + } + + private function setInvoiceId(string $invoiceId): static + { + $this->fields['invoiceId'] = $invoiceId; + + return $this; + } + + private function setWebsiteId(string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + private function setToken(null|string $token): static + { + $this->fields['token'] = $token; + + return $this; + } +} diff --git a/src/Model/ProofOfAddressKycDocumentDocumentMatches.php b/src/Model/ProofOfAddressKycDocumentDocumentMatches.php index 9c03cb880..ac2630970 100644 --- a/src/Model/ProofOfAddressKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfAddressKycDocumentDocumentMatches.php @@ -25,6 +25,9 @@ class ProofOfAddressKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycAddressMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfAddressKycDocumentParsedData.php b/src/Model/ProofOfAddressKycDocumentParsedData.php index 376a9c8b4..bd25cb132 100644 --- a/src/Model/ProofOfAddressKycDocumentParsedData.php +++ b/src/Model/ProofOfAddressKycDocumentParsedData.php @@ -25,6 +25,9 @@ class ProofOfAddressKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycAddressMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfCreditFileKycDocument.php b/src/Model/ProofOfCreditFileKycDocument.php index 9e2fa8934..2409dd937 100644 --- a/src/Model/ProofOfCreditFileKycDocument.php +++ b/src/Model/ProofOfCreditFileKycDocument.php @@ -159,6 +159,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('documentMatches', $data)) { $this->setDocumentMatches($data['documentMatches']); } + if (array_key_exists('parsedData', $data)) { + $this->setParsedData($data['parsedData']); + } if (array_key_exists('_links', $data)) { $this->setLinks($data['_links']); } @@ -363,6 +366,22 @@ public function setDocumentMatches(null|ProofOfCreditFileKycDocumentDocumentMatc return $this; } + public function getParsedData(): ?ProofOfCreditFileKycDocumentParsedData + { + return $this->fields['parsedData'] ?? null; + } + + public function setParsedData(null|ProofOfCreditFileKycDocumentParsedData|array $parsedData): static + { + if ($parsedData !== null && !($parsedData instanceof ProofOfCreditFileKycDocumentParsedData)) { + $parsedData = ProofOfCreditFileKycDocumentParsedData::from($parsedData); + } + + $this->fields['parsedData'] = $parsedData; + + return $this; + } + /** * @return null|ResourceLink[] */ @@ -460,6 +479,9 @@ public function jsonSerialize(): array if (array_key_exists('documentMatches', $this->fields)) { $data['documentMatches'] = $this->fields['documentMatches']?->jsonSerialize(); } + if (array_key_exists('parsedData', $this->fields)) { + $data['parsedData'] = $this->fields['parsedData']?->jsonSerialize(); + } if (array_key_exists('_links', $this->fields)) { $data['_links'] = $this->fields['_links'] !== null ? array_map( diff --git a/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php b/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php index 4a5d65fcc..055eb0510 100644 --- a/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfCreditFileKycDocumentDocumentMatches.php @@ -25,12 +25,18 @@ class ProofOfCreditFileKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('data', $data)) { - $this->setData($data['data']); + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); } if (array_key_exists('checkList', $data)) { $this->setCheckList($data['checkList']); } + if (array_key_exists('data', $data)) { + $this->setData($data['data']); + } $this->setMetadata($metadata); } @@ -39,18 +45,19 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getData(): ?CreditFileMatches + public function getVersion(): ?string { - return $this->fields['data'] ?? null; + return $this->fields['version'] ?? null; } - public function setData(null|CreditFileMatches|array $data): static + public function getScore(): ?int { - if ($data !== null && !($data instanceof CreditFileMatches)) { - $data = CreditFileMatches::from($data); - } + return $this->fields['score'] ?? null; + } - $this->fields['data'] = $data; + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; return $this; } @@ -78,11 +85,30 @@ public function setCheckList(null|array $checkList): static return $this; } + public function getData(): ?CreditFileMatches + { + return $this->fields['data'] ?? null; + } + + public function setData(null|CreditFileMatches|array $data): static + { + if ($data !== null && !($data instanceof CreditFileMatches)) { + $data = CreditFileMatches::from($data); + } + + $this->fields['data'] = $data; + + return $this; + } + public function jsonSerialize(): array { $data = []; - if (array_key_exists('data', $this->fields)) { - $data['data'] = $this->fields['data']?->jsonSerialize(); + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; } if (array_key_exists('checkList', $this->fields)) { $data['checkList'] = $this->fields['checkList'] !== null @@ -92,7 +118,17 @@ public function jsonSerialize(): array ) : null; } + if (array_key_exists('data', $this->fields)) { + $data['data'] = $this->fields['data']?->jsonSerialize(); + } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfCreditFileKycDocumentParsedData.php b/src/Model/ProofOfCreditFileKycDocumentParsedData.php new file mode 100644 index 000000000..1a9ed9b71 --- /dev/null +++ b/src/Model/ProofOfCreditFileKycDocumentParsedData.php @@ -0,0 +1,134 @@ +setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } + if (array_key_exists('data', $data)) { + $this->setData($data['data']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + + public function getData(): ?CreditFileMatches + { + return $this->fields['data'] ?? null; + } + + public function setData(null|CreditFileMatches|array $data): static + { + if ($data !== null && !($data instanceof CreditFileMatches)) { + $data = CreditFileMatches::from($data); + } + + $this->fields['data'] = $data; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } + if (array_key_exists('data', $this->fields)) { + $data['data'] = $this->fields['data']?->jsonSerialize(); + } + + return $data; + } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } +} diff --git a/src/Model/ProofOfFundsKycDocumentDocumentMatches.php b/src/Model/ProofOfFundsKycDocumentDocumentMatches.php index b7c74bfff..8ca60337d 100644 --- a/src/Model/ProofOfFundsKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfFundsKycDocumentDocumentMatches.php @@ -25,6 +25,15 @@ class ProofOfFundsKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?FundsMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|FundsMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfFundsKycDocumentParsedData.php b/src/Model/ProofOfFundsKycDocumentParsedData.php index 7ee337b56..aaffb5842 100644 --- a/src/Model/ProofOfFundsKycDocumentParsedData.php +++ b/src/Model/ProofOfFundsKycDocumentParsedData.php @@ -25,6 +25,15 @@ class ProofOfFundsKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?FundsMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|FundsMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php b/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php index 83c1239c3..7fb694ac9 100644 --- a/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfIdentityKycDocumentDocumentMatches.php @@ -25,6 +25,9 @@ class ProofOfIdentityKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycIdentityMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfIdentityKycDocumentParsedData.php b/src/Model/ProofOfIdentityKycDocumentParsedData.php index df60ffd10..30292f0eb 100644 --- a/src/Model/ProofOfIdentityKycDocumentParsedData.php +++ b/src/Model/ProofOfIdentityKycDocumentParsedData.php @@ -25,6 +25,9 @@ class ProofOfIdentityKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } if (array_key_exists('score', $data)) { $this->setScore($data['score']); } @@ -42,6 +45,11 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + public function getScore(): ?int { return $this->fields['score'] ?? null; @@ -96,6 +104,9 @@ public function setData(null|KycIdentityMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } if (array_key_exists('score', $this->fields)) { $data['score'] = $this->fields['score']; } @@ -113,4 +124,11 @@ public function jsonSerialize(): array return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php b/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php index 0433170ff..be60d3501 100644 --- a/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php +++ b/src/Model/ProofOfPurchaseKycDocumentDocumentMatches.php @@ -25,6 +25,15 @@ class ProofOfPurchaseKycDocumentDocumentMatches implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?PurchaseMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|PurchaseMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/ProofOfPurchaseKycDocumentParsedData.php b/src/Model/ProofOfPurchaseKycDocumentParsedData.php index a69891092..60257afdb 100644 --- a/src/Model/ProofOfPurchaseKycDocumentParsedData.php +++ b/src/Model/ProofOfPurchaseKycDocumentParsedData.php @@ -25,6 +25,15 @@ class ProofOfPurchaseKycDocumentParsedData implements JsonSerializable public function __construct(array $data = [], array $metadata = []) { + if (array_key_exists('version', $data)) { + $this->setVersion($data['version']); + } + if (array_key_exists('score', $data)) { + $this->setScore($data['score']); + } + if (array_key_exists('checkList', $data)) { + $this->setCheckList($data['checkList']); + } if (array_key_exists('data', $data)) { $this->setData($data['data']); } @@ -36,6 +45,46 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } + public function getVersion(): ?string + { + return $this->fields['version'] ?? null; + } + + public function getScore(): ?int + { + return $this->fields['score'] ?? null; + } + + public function setScore(null|int $score): static + { + $this->fields['score'] = $score; + + return $this; + } + + /** + * @return null|KycDocumentCheck[] + */ + public function getCheckList(): ?array + { + return $this->fields['checkList'] ?? null; + } + + /** + * @param null|array[]|KycDocumentCheck[] $checkList + */ + public function setCheckList(null|array $checkList): static + { + $checkList = $checkList !== null ? array_map( + fn ($value) => $value instanceof KycDocumentCheck ? $value : KycDocumentCheck::from($value), + $checkList, + ) : null; + + $this->fields['checkList'] = $checkList; + + return $this; + } + public function getData(): ?PurchaseMatches { return $this->fields['data'] ?? null; @@ -55,10 +104,31 @@ public function setData(null|PurchaseMatches|array $data): static public function jsonSerialize(): array { $data = []; + if (array_key_exists('version', $this->fields)) { + $data['version'] = $this->fields['version']; + } + if (array_key_exists('score', $this->fields)) { + $data['score'] = $this->fields['score']; + } + if (array_key_exists('checkList', $this->fields)) { + $data['checkList'] = $this->fields['checkList'] !== null + ? array_map( + static fn (KycDocumentCheck $kycDocumentCheck) => $kycDocumentCheck->jsonSerialize(), + $this->fields['checkList'], + ) + : null; + } if (array_key_exists('data', $this->fields)) { $data['data'] = $this->fields['data']?->jsonSerialize(); } return $data; } + + private function setVersion(null|string $version): static + { + $this->fields['version'] = $version; + + return $this; + } } diff --git a/src/Model/QuoteSubscriptionItem.php b/src/Model/QuoteSubscriptionItem.php index 0fde35dca..acbb3f515 100644 --- a/src/Model/QuoteSubscriptionItem.php +++ b/src/Model/QuoteSubscriptionItem.php @@ -32,6 +32,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('quantity', $data)) { $this->setQuantity($data['quantity']); } + if (array_key_exists('quantityFilled', $data)) { + $this->setQuantityFilled($data['quantityFilled']); + } if (array_key_exists('plan', $data)) { $this->setPlan($data['plan']); } @@ -80,6 +83,22 @@ public function setQuantity(null|int $quantity): static return $this; } + public function getQuantityFilled(): ?float + { + return $this->fields['quantityFilled'] ?? null; + } + + public function setQuantityFilled(null|float|string $quantityFilled): static + { + if (is_string($quantityFilled)) { + $quantityFilled = (float) $quantityFilled; + } + + $this->fields['quantityFilled'] = $quantityFilled; + + return $this; + } + public function getPlan(): ConfigurablePlan { return $this->fields['plan']; @@ -157,6 +176,9 @@ public function jsonSerialize(): array if (array_key_exists('quantity', $this->fields)) { $data['quantity'] = $this->fields['quantity']; } + if (array_key_exists('quantityFilled', $this->fields)) { + $data['quantityFilled'] = $this->fields['quantityFilled']; + } if (array_key_exists('plan', $this->fields)) { $data['plan'] = $this->fields['plan']->jsonSerialize(); } diff --git a/src/Model/QuoteTimeline.php b/src/Model/QuoteTimeline.php index 0088087c7..7533e75ce 100644 --- a/src/Model/QuoteTimeline.php +++ b/src/Model/QuoteTimeline.php @@ -23,23 +23,25 @@ class QuoteTimeline implements JsonSerializable { use HasMetadata; - public const TYPE_CREATED = 'quote-created'; + public const TYPE_QUOTE_CREATED = 'quote-created'; - public const TYPE_ISSUED = 'quote-issued'; + public const TYPE_QUOTE_ISSUED = 'quote-issued'; - public const TYPE_ACCEPTED = 'quote-accepted'; + public const TYPE_QUOTE_ACCEPTED = 'quote-accepted'; - public const TYPE_REJECTED = 'quote-rejected'; + public const TYPE_QUOTE_REJECTED = 'quote-rejected'; - public const TYPE_CANCELED = 'quote-canceled'; + public const TYPE_QUOTE_CANCELED = 'quote-canceled'; - public const TYPE_RECALLED = 'quote-recalled'; + public const TYPE_QUOTE_RECALLED = 'quote-recalled'; - public const TYPE_UPDATED = 'quote-updated'; + public const TYPE_QUOTE_UPDATED = 'quote-updated'; - public const TYPE_EXPIRED = 'quote-expired'; + public const TYPE_QUOTE_EXPIRED = 'quote-expired'; - public const TYPE_ORDER_ATTACHED = 'quote-order-attached'; + public const TYPE_QUOTE_ORDER_ATTACHED = 'quote-order-attached'; + + public const TYPE_TIMELINE_COMMENT_CREATED = 'timeline-comment-created'; public const TRIGGERED_BY_REBILLY = 'rebilly'; diff --git a/src/Model/ReactivationQuoteOrder.php b/src/Model/ReactivationQuoteOrder.php index 3b89323ee..d408bd03c 100644 --- a/src/Model/ReactivationQuoteOrder.php +++ b/src/Model/ReactivationQuoteOrder.php @@ -45,6 +45,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('autopay', $data)) { $this->setAutopay($data['autopay']); } + if (array_key_exists('includeUnpaidInvoices', $data)) { + $this->setIncludeUnpaidInvoices($data['includeUnpaidInvoices']); + } if (array_key_exists('shipping', $data)) { $this->setShipping($data['shipping']); } @@ -153,15 +156,27 @@ public function setAutopay(null|bool $autopay): static return $this; } - public function getShipping(): ?Shipping + public function getIncludeUnpaidInvoices(): ?bool + { + return $this->fields['includeUnpaidInvoices'] ?? null; + } + + public function setIncludeUnpaidInvoices(null|bool $includeUnpaidInvoices): static + { + $this->fields['includeUnpaidInvoices'] = $includeUnpaidInvoices; + + return $this; + } + + public function getShipping(): ?ReactivationQuoteOrderShipping { return $this->fields['shipping'] ?? null; } - public function setShipping(null|Shipping|array $shipping): static + public function setShipping(null|ReactivationQuoteOrderShipping|array $shipping): static { - if ($shipping !== null && !($shipping instanceof Shipping)) { - $shipping = ShippingFactory::from($shipping); + if ($shipping !== null && !($shipping instanceof ReactivationQuoteOrderShipping)) { + $shipping = ReactivationQuoteOrderShipping::from($shipping); } $this->fields['shipping'] = $shipping; @@ -225,6 +240,9 @@ public function jsonSerialize(): array if (array_key_exists('autopay', $this->fields)) { $data['autopay'] = $this->fields['autopay']; } + if (array_key_exists('includeUnpaidInvoices', $this->fields)) { + $data['includeUnpaidInvoices'] = $this->fields['includeUnpaidInvoices']; + } if (array_key_exists('shipping', $this->fields)) { $data['shipping'] = $this->fields['shipping']?->jsonSerialize(); } diff --git a/src/Model/ReactivationQuoteOrderShipping.php b/src/Model/ReactivationQuoteOrderShipping.php new file mode 100644 index 000000000..c337635a9 --- /dev/null +++ b/src/Model/ReactivationQuoteOrderShipping.php @@ -0,0 +1,35 @@ + '', + ] + $data, $metadata); + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } +} diff --git a/src/Model/ReadyToPayGenericMethod.php b/src/Model/ReadyToPayGenericMethod.php index 9545b6ccc..225acd472 100644 --- a/src/Model/ReadyToPayGenericMethod.php +++ b/src/Model/ReadyToPayGenericMethod.php @@ -230,6 +230,8 @@ class ReadyToPayGenericMethod implements ReadyToPayMethods public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PAY_TABS = 'PayTabs'; public const METHOD_PAYSAFECARD = 'Paysafecard'; diff --git a/src/Model/RecurringOrderItems.php b/src/Model/RecurringOrderItems.php index bb1e0a8bf..a15a0bd75 100644 --- a/src/Model/RecurringOrderItems.php +++ b/src/Model/RecurringOrderItems.php @@ -23,10 +23,6 @@ public function getType(): string; public function getId(): ?string; - public function getPlanId(): ?string; - - public function setPlanId(null|string $planId): static; - public function getProductId(): ?string; public function getPlan(): ConfigurablePlan; diff --git a/src/Model/ReportAmlAuditReport.php b/src/Model/ReportAmlAuditReport.php new file mode 100644 index 000000000..d612f432a --- /dev/null +++ b/src/Model/ReportAmlAuditReport.php @@ -0,0 +1,266 @@ +setPersonId($data['personId']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('linkedCustomers', $data)) { + $this->setLinkedCustomers($data['linkedCustomers']); + } + if (array_key_exists('summary', $data)) { + $this->setSummary($data['summary']); + } + if (array_key_exists('screeningHistory', $data)) { + $this->setScreeningHistory($data['screeningHistory']); + } + if (array_key_exists('transactions', $data)) { + $this->setTransactions($data['transactions']); + } + if (array_key_exists('periodStart', $data)) { + $this->setPeriodStart($data['periodStart']); + } + if (array_key_exists('periodEnd', $data)) { + $this->setPeriodEnd($data['periodEnd']); + } + if (array_key_exists('truncated', $data)) { + $this->setTruncated($data['truncated']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getPersonId(): string + { + return $this->fields['personId']; + } + + public function setPersonId(string $personId): static + { + $this->fields['personId'] = $personId; + + return $this; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + /** + * @return ReportAmlAuditReportLinkedCustomers[] + */ + public function getLinkedCustomers(): array + { + return $this->fields['linkedCustomers']; + } + + /** + * @param array[]|ReportAmlAuditReportLinkedCustomers[] $linkedCustomers + */ + public function setLinkedCustomers(array $linkedCustomers): static + { + $linkedCustomers = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportLinkedCustomers ? $value : ReportAmlAuditReportLinkedCustomers::from($value), + $linkedCustomers, + ); + + $this->fields['linkedCustomers'] = $linkedCustomers; + + return $this; + } + + public function getSummary(): ReportAmlAuditReportSummary + { + return $this->fields['summary']; + } + + public function setSummary(ReportAmlAuditReportSummary|array $summary): static + { + if (!($summary instanceof ReportAmlAuditReportSummary)) { + $summary = ReportAmlAuditReportSummary::from($summary); + } + + $this->fields['summary'] = $summary; + + return $this; + } + + /** + * @return ReportAmlAuditReportScreeningHistory[] + */ + public function getScreeningHistory(): array + { + return $this->fields['screeningHistory']; + } + + /** + * @param array[]|ReportAmlAuditReportScreeningHistory[] $screeningHistory + */ + public function setScreeningHistory(array $screeningHistory): static + { + $screeningHistory = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportScreeningHistory ? $value : ReportAmlAuditReportScreeningHistory::from($value), + $screeningHistory, + ); + + $this->fields['screeningHistory'] = $screeningHistory; + + return $this; + } + + /** + * @return ReportAmlAuditReportTransactions[] + */ + public function getTransactions(): array + { + return $this->fields['transactions']; + } + + /** + * @param array[]|ReportAmlAuditReportTransactions[] $transactions + */ + public function setTransactions(array $transactions): static + { + $transactions = array_map( + fn ($value) => $value instanceof ReportAmlAuditReportTransactions ? $value : ReportAmlAuditReportTransactions::from($value), + $transactions, + ); + + $this->fields['transactions'] = $transactions; + + return $this; + } + + public function getPeriodStart(): DateTimeImmutable + { + return $this->fields['periodStart']; + } + + public function setPeriodStart(DateTimeImmutable|string $periodStart): static + { + if (!($periodStart instanceof DateTimeImmutable)) { + $periodStart = new DateTimeImmutable($periodStart); + } + + $this->fields['periodStart'] = $periodStart; + + return $this; + } + + public function getPeriodEnd(): DateTimeImmutable + { + return $this->fields['periodEnd']; + } + + public function setPeriodEnd(DateTimeImmutable|string $periodEnd): static + { + if (!($periodEnd instanceof DateTimeImmutable)) { + $periodEnd = new DateTimeImmutable($periodEnd); + } + + $this->fields['periodEnd'] = $periodEnd; + + return $this; + } + + public function getTruncated(): bool + { + return $this->fields['truncated']; + } + + public function setTruncated(bool $truncated): static + { + $this->fields['truncated'] = $truncated; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('personId', $this->fields)) { + $data['personId'] = $this->fields['personId']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('linkedCustomers', $this->fields)) { + $data['linkedCustomers'] = array_map( + static fn (ReportAmlAuditReportLinkedCustomers $reportAmlAuditReportLinkedCustomers) => $reportAmlAuditReportLinkedCustomers->jsonSerialize(), + $this->fields['linkedCustomers'], + ); + } + if (array_key_exists('summary', $this->fields)) { + $data['summary'] = $this->fields['summary']->jsonSerialize(); + } + if (array_key_exists('screeningHistory', $this->fields)) { + $data['screeningHistory'] = array_map( + static fn (ReportAmlAuditReportScreeningHistory $reportAmlAuditReportScreeningHistory) => $reportAmlAuditReportScreeningHistory->jsonSerialize(), + $this->fields['screeningHistory'], + ); + } + if (array_key_exists('transactions', $this->fields)) { + $data['transactions'] = array_map( + static fn (ReportAmlAuditReportTransactions $reportAmlAuditReportTransactions) => $reportAmlAuditReportTransactions->jsonSerialize(), + $this->fields['transactions'], + ); + } + if (array_key_exists('periodStart', $this->fields)) { + $data['periodStart'] = $this->fields['periodStart']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('periodEnd', $this->fields)) { + $data['periodEnd'] = $this->fields['periodEnd']->format(DateTimeInterface::RFC3339); + } + if (array_key_exists('truncated', $this->fields)) { + $data['truncated'] = $this->fields['truncated']; + } + + return $data; + } +} diff --git a/src/Model/ReportAmlAuditReportLinkedCustomers.php b/src/Model/ReportAmlAuditReportLinkedCustomers.php new file mode 100644 index 000000000..b4e71b4bb --- /dev/null +++ b/src/Model/ReportAmlAuditReportLinkedCustomers.php @@ -0,0 +1,78 @@ +setId($data['id']); + } + if (array_key_exists('websiteId', $data)) { + $this->setWebsiteId($data['websiteId']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getId(): string + { + return $this->fields['id']; + } + + public function setId(string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + public function getWebsiteId(): string + { + return $this->fields['websiteId']; + } + + public function setWebsiteId(string $websiteId): static + { + $this->fields['websiteId'] = $websiteId; + + return $this; + } + + 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']; + } + + return $data; + } +} diff --git a/src/Model/ReportAmlAuditReportScreeningHistory.php b/src/Model/ReportAmlAuditReportScreeningHistory.php new file mode 100644 index 000000000..e2c09a355 --- /dev/null +++ b/src/Model/ReportAmlAuditReportScreeningHistory.php @@ -0,0 +1,190 @@ +setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('source', $data)) { + $this->setSource($data['source']); + } + if (array_key_exists('hitSources', $data)) { + $this->setHitSources($data['hitSources']); + } + if (array_key_exists('result', $data)) { + $this->setResult($data['result']); + } + if (array_key_exists('reviewer', $data)) { + $this->setReviewer($data['reviewer']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getCreatedTime(): DateTimeImmutable + { + return $this->fields['createdTime']; + } + + public function getUpdatedTime(): DateTimeImmutable + { + return $this->fields['updatedTime']; + } + + public function getCustomerId(): string + { + return $this->fields['customerId']; + } + + public function setCustomerId(string $customerId): static + { + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getSource(): string + { + return $this->fields['source']; + } + + public function setSource(string $source): static + { + $this->fields['source'] = $source; + + return $this; + } + + public function getHitSources(): ?string + { + return $this->fields['hitSources'] ?? null; + } + + public function setHitSources(null|string $hitSources): static + { + $this->fields['hitSources'] = $hitSources; + + return $this; + } + + public function getResult(): string + { + return $this->fields['result']; + } + + public function setResult(string $result): static + { + $this->fields['result'] = $result; + + return $this; + } + + public function getReviewer(): ?string + { + return $this->fields['reviewer'] ?? null; + } + + public function setReviewer(null|string $reviewer): static + { + $this->fields['reviewer'] = $reviewer; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + 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('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']; + } + if (array_key_exists('source', $this->fields)) { + $data['source'] = $this->fields['source']; + } + if (array_key_exists('hitSources', $this->fields)) { + $data['hitSources'] = $this->fields['hitSources']; + } + if (array_key_exists('result', $this->fields)) { + $data['result'] = $this->fields['result']; + } + if (array_key_exists('reviewer', $this->fields)) { + $data['reviewer'] = $this->fields['reviewer']; + } + + return $data; + } + + private function setCreatedTime(DateTimeImmutable|string $createdTime): static + { + if (!($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(DateTimeImmutable|string $updatedTime): static + { + if (!($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } +} diff --git a/src/Model/ReportAmlAuditReportSummary.php b/src/Model/ReportAmlAuditReportSummary.php new file mode 100644 index 000000000..59315923f --- /dev/null +++ b/src/Model/ReportAmlAuditReportSummary.php @@ -0,0 +1,102 @@ +setTotalChecks($data['totalChecks']); + } + if (array_key_exists('hitCount', $data)) { + $this->setHitCount($data['hitCount']); + } + if (array_key_exists('lastCheckTime', $data)) { + $this->setLastCheckTime($data['lastCheckTime']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getTotalChecks(): int + { + return $this->fields['totalChecks']; + } + + public function setTotalChecks(int $totalChecks): static + { + $this->fields['totalChecks'] = $totalChecks; + + return $this; + } + + public function getHitCount(): int + { + return $this->fields['hitCount']; + } + + public function setHitCount(int $hitCount): static + { + $this->fields['hitCount'] = $hitCount; + + return $this; + } + + public function getLastCheckTime(): ?DateTimeImmutable + { + return $this->fields['lastCheckTime'] ?? null; + } + + public function setLastCheckTime(null|DateTimeImmutable|string $lastCheckTime): static + { + if ($lastCheckTime !== null && !($lastCheckTime instanceof DateTimeImmutable)) { + $lastCheckTime = new DateTimeImmutable($lastCheckTime); + } + + $this->fields['lastCheckTime'] = $lastCheckTime; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('totalChecks', $this->fields)) { + $data['totalChecks'] = $this->fields['totalChecks']; + } + if (array_key_exists('hitCount', $this->fields)) { + $data['hitCount'] = $this->fields['hitCount']; + } + if (array_key_exists('lastCheckTime', $this->fields)) { + $data['lastCheckTime'] = $this->fields['lastCheckTime']?->format(DateTimeInterface::RFC3339); + } + + return $data; + } +} diff --git a/src/Model/ReportAmlAuditReportTransactions.php b/src/Model/ReportAmlAuditReportTransactions.php new file mode 100644 index 000000000..2a83c44e3 --- /dev/null +++ b/src/Model/ReportAmlAuditReportTransactions.php @@ -0,0 +1,272 @@ +setId($data['id']); + } + if (array_key_exists('customerId', $data)) { + $this->setCustomerId($data['customerId']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('amount', $data)) { + $this->setAmount($data['amount']); + } + if (array_key_exists('currency', $data)) { + $this->setCurrency($data['currency']); + } + if (array_key_exists('type', $data)) { + $this->setType($data['type']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('result', $data)) { + $this->setResult($data['result']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getId(): string + { + return $this->fields['id']; + } + + public function setId(string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + public function getCustomerId(): string + { + return $this->fields['customerId']; + } + + public function setCustomerId(string $customerId): static + { + $this->fields['customerId'] = $customerId; + + return $this; + } + + public function getCreatedTime(): DateTimeImmutable + { + return $this->fields['createdTime']; + } + + public function getUpdatedTime(): DateTimeImmutable + { + return $this->fields['updatedTime']; + } + + 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 getType(): string + { + return $this->fields['type']; + } + + public function getStatus(): string + { + return $this->fields['status']; + } + + public function getResult(): string + { + return $this->fields['result']; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('customerId', $this->fields)) { + $data['customerId'] = $this->fields['customerId']; + } + 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('amount', $this->fields)) { + $data['amount'] = $this->fields['amount']; + } + if (array_key_exists('currency', $this->fields)) { + $data['currency'] = $this->fields['currency']; + } + if (array_key_exists('type', $this->fields)) { + $data['type'] = $this->fields['type']; + } + if (array_key_exists('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('result', $this->fields)) { + $data['result'] = $this->fields['result']; + } + + return $data; + } + + private function setCreatedTime(DateTimeImmutable|string $createdTime): static + { + if (!($createdTime instanceof DateTimeImmutable)) { + $createdTime = new DateTimeImmutable($createdTime); + } + + $this->fields['createdTime'] = $createdTime; + + return $this; + } + + private function setUpdatedTime(DateTimeImmutable|string $updatedTime): static + { + if (!($updatedTime instanceof DateTimeImmutable)) { + $updatedTime = new DateTimeImmutable($updatedTime); + } + + $this->fields['updatedTime'] = $updatedTime; + + return $this; + } + + private function setType(string $type): static + { + $this->fields['type'] = $type; + + return $this; + } + + private function setStatus(string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setResult(string $result): static + { + $this->fields['result'] = $result; + + return $this; + } +} diff --git a/src/Model/ReportKycRejectionsDataRejectionReasons.php b/src/Model/ReportKycRejectionsDataRejectionReasons.php index 4e545b7b4..f1428db40 100644 --- a/src/Model/ReportKycRejectionsDataRejectionReasons.php +++ b/src/Model/ReportKycRejectionsDataRejectionReasons.php @@ -25,6 +25,8 @@ class ReportKycRejectionsDataRejectionReasons implements JsonSerializable public const REJECTION_REASON_DOCUMENT_EXPIRED = 'document-expired'; + public const REJECTION_REASON_DOCUMENT_WAS_VALID_BUT_EXPIRED = 'document-was-valid-but-expired'; + public const REJECTION_REASON_DOCUMENT_NOT_MATCHING = 'document-not-matching'; public const REJECTION_REASON_DOCUMENT_DUPLICATE = 'document-duplicate'; @@ -47,6 +49,8 @@ class ReportKycRejectionsDataRejectionReasons implements JsonSerializable public const REJECTION_REASON_NAME_MISMATCH = 'name-mismatch'; + public const REJECTION_REASON_NAME_AND_DOB_MISMATCH = 'name-and-dob-mismatch'; + public const REJECTION_REASON_CRITICAL_INFO_MISSING = 'critical-info-missing'; public const REJECTION_REASON_OLD_ADDRESS_ON_ID = 'old-address-on-id'; diff --git a/src/Model/RiskScoreBracketBrackets.php b/src/Model/RiskScoreBracketBrackets.php index 3fc44cf24..a45580f55 100644 --- a/src/Model/RiskScoreBracketBrackets.php +++ b/src/Model/RiskScoreBracketBrackets.php @@ -18,15 +18,4 @@ interface RiskScoreBracketBrackets extends JsonSerializable { - public function getStart(): ?int; - - public function setStart(null|int $start): static; - - public function getEnd(): ?int; - - public function setEnd(null|int $end): static; - - public function getValue(): ?int; - - public function setValue(null|int $value): static; } diff --git a/src/Model/RiskScoreBracketBrackets0.php b/src/Model/RiskScoreBracketBrackets0.php index 07d380bc2..84a3a3d48 100644 --- a/src/Model/RiskScoreBracketBrackets0.php +++ b/src/Model/RiskScoreBracketBrackets0.php @@ -24,15 +24,9 @@ class RiskScoreBracketBrackets0 implements RiskScoreBracketBrackets public function __construct(array $data = [], array $metadata = []) { - if (array_key_exists('start', $data)) { - $this->setStart($data['start']); - } if (array_key_exists('end', $data)) { $this->setEnd($data['end']); } - if (array_key_exists('value', $data)) { - $this->setValue($data['value']); - } $this->setMetadata($metadata); } @@ -41,38 +35,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getStart(): ?int - { - return $this->fields['start'] ?? null; - } - - public function setStart(null|int $start): static - { - $this->fields['start'] = $start; - - return $this; - } - - public function getEnd(): ?int + public function getEnd(): ?RiskScoreBracketBrackets0End { return $this->fields['end'] ?? null; } - public function setEnd(null|int $end): static - { - $this->fields['end'] = $end; - - return $this; - } - - public function getValue(): ?int + public function setEnd(null|RiskScoreBracketBrackets0End|array $end): static { - return $this->fields['value'] ?? null; - } + if ($end !== null && !($end instanceof RiskScoreBracketBrackets0End)) { + $end = RiskScoreBracketBrackets0End::from($end); + } - public function setValue(null|int $value): static - { - $this->fields['value'] = $value; + $this->fields['end'] = $end; return $this; } @@ -80,14 +54,8 @@ public function setValue(null|int $value): static public function jsonSerialize(): array { $data = []; - if (array_key_exists('start', $this->fields)) { - $data['start'] = $this->fields['start']; - } if (array_key_exists('end', $this->fields)) { - $data['end'] = $this->fields['end']; - } - if (array_key_exists('value', $this->fields)) { - $data['value'] = $this->fields['value']; + $data['end'] = $this->fields['end']?->jsonSerialize(); } return $data; diff --git a/src/Model/RiskScoreBracketBrackets0End.php b/src/Model/RiskScoreBracketBrackets0End.php new file mode 100644 index 000000000..f3b65780d --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets0End.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/RiskScoreBracketBrackets1.php b/src/Model/RiskScoreBracketBrackets1.php index a6f2bfc4e..7a34ccf16 100644 --- a/src/Model/RiskScoreBracketBrackets1.php +++ b/src/Model/RiskScoreBracketBrackets1.php @@ -27,12 +27,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('start', $data)) { $this->setStart($data['start']); } - if (array_key_exists('end', $data)) { - $this->setEnd($data['end']); - } - if (array_key_exists('value', $data)) { - $this->setValue($data['value']); - } $this->setMetadata($metadata); } @@ -41,38 +35,18 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getStart(): ?int + public function getStart(): ?RiskScoreBracketBrackets1Start { return $this->fields['start'] ?? null; } - public function setStart(null|int $start): static - { - $this->fields['start'] = $start; - - return $this; - } - - public function getEnd(): ?int - { - return $this->fields['end'] ?? null; - } - - public function setEnd(null|int $end): static + public function setStart(null|RiskScoreBracketBrackets1Start|array $start): static { - $this->fields['end'] = $end; - - return $this; - } - - public function getValue(): ?int - { - return $this->fields['value'] ?? null; - } + if ($start !== null && !($start instanceof RiskScoreBracketBrackets1Start)) { + $start = RiskScoreBracketBrackets1Start::from($start); + } - public function setValue(null|int $value): static - { - $this->fields['value'] = $value; + $this->fields['start'] = $start; return $this; } @@ -81,13 +55,7 @@ public function jsonSerialize(): array { $data = []; if (array_key_exists('start', $this->fields)) { - $data['start'] = $this->fields['start']; - } - if (array_key_exists('end', $this->fields)) { - $data['end'] = $this->fields['end']; - } - if (array_key_exists('value', $this->fields)) { - $data['value'] = $this->fields['value']; + $data['start'] = $this->fields['start']?->jsonSerialize(); } return $data; diff --git a/src/Model/RiskScoreBracketBrackets1Start.php b/src/Model/RiskScoreBracketBrackets1Start.php new file mode 100644 index 000000000..8c230cb5e --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets1Start.php @@ -0,0 +1,40 @@ +setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function jsonSerialize(): array + { + $data = []; + + return $data; + } +} diff --git a/src/Model/RiskScoreBracketBrackets2.php b/src/Model/RiskScoreBracketBrackets2.php new file mode 100644 index 000000000..b88ccb4e0 --- /dev/null +++ b/src/Model/RiskScoreBracketBrackets2.php @@ -0,0 +1,95 @@ +setStart($data['start']); + } + if (array_key_exists('end', $data)) { + $this->setEnd($data['end']); + } + if (array_key_exists('value', $data)) { + $this->setValue($data['value']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getStart(): ?int + { + return $this->fields['start'] ?? null; + } + + public function setStart(null|int $start): static + { + $this->fields['start'] = $start; + + return $this; + } + + public function getEnd(): ?int + { + return $this->fields['end'] ?? null; + } + + public function setEnd(null|int $end): static + { + $this->fields['end'] = $end; + + return $this; + } + + public function getValue(): ?int + { + return $this->fields['value'] ?? null; + } + + public function setValue(null|int $value): static + { + $this->fields['value'] = $value; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('start', $this->fields)) { + $data['start'] = $this->fields['start']; + } + if (array_key_exists('end', $this->fields)) { + $data['end'] = $this->fields['end']; + } + if (array_key_exists('value', $this->fields)) { + $data['value'] = $this->fields['value']; + } + + return $data; + } +} diff --git a/src/Model/SubscriptionChange.php b/src/Model/SubscriptionChange.php index 4e5180855..35096249f 100644 --- a/src/Model/SubscriptionChange.php +++ b/src/Model/SubscriptionChange.php @@ -23,6 +23,14 @@ class SubscriptionChange implements JsonSerializable { use HasMetadata; + public const RENEWAL_POLICY_RESET_TO_RECURRING = 'resetToRecurring'; + + public const RENEWAL_POLICY_RETAIN_RECURRING = 'retainRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_THEN_RECURRING = 'retainTrialThenRecurring'; + + public const RENEWAL_POLICY_RETAIN_TRIAL_ONLY = 'retainTrialOnly'; + public const RENEWAL_POLICY_RESET = 'reset'; public const RENEWAL_POLICY_RETAIN = 'retain'; diff --git a/src/Model/SubscriptionItem.php b/src/Model/SubscriptionItem.php index d4c64f288..7868dc50d 100644 --- a/src/Model/SubscriptionItem.php +++ b/src/Model/SubscriptionItem.php @@ -50,9 +50,6 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('rebillNumber', $data)) { $this->setRebillNumber($data['rebillNumber']); } - if (array_key_exists('planId', $data)) { - $this->setPlanId($data['planId']); - } if (array_key_exists('productId', $data)) { $this->setProductId($data['productId']); } @@ -158,18 +155,6 @@ public function getRebillNumber(): ?int return $this->fields['rebillNumber'] ?? null; } - public function getPlanId(): ?string - { - return $this->fields['planId'] ?? null; - } - - public function setPlanId(null|string $planId): static - { - $this->fields['planId'] = $planId; - - return $this; - } - public function getProductId(): ?string { return $this->fields['productId'] ?? null; @@ -307,9 +292,6 @@ public function jsonSerialize(): array if (array_key_exists('rebillNumber', $this->fields)) { $data['rebillNumber'] = $this->fields['rebillNumber']; } - if (array_key_exists('planId', $this->fields)) { - $data['planId'] = $this->fields['planId']; - } if (array_key_exists('productId', $this->fields)) { $data['productId'] = $this->fields['productId']; } diff --git a/src/Model/SubscriptionSummaryMetrics.php b/src/Model/SubscriptionSummaryMetrics.php index 570c0a83e..82a84bd78 100644 --- a/src/Model/SubscriptionSummaryMetrics.php +++ b/src/Model/SubscriptionSummaryMetrics.php @@ -45,24 +45,24 @@ public static function from(array $data = [], array $metadata = []): self return new self($data, $metadata); } - public function getCurrency(): ?string + public function getCurrency(): string { - return $this->fields['currency'] ?? null; + return $this->fields['currency']; } - public function getInvoicedAmount(): ?float + public function getInvoicedAmount(): float { - return $this->fields['invoicedAmount'] ?? null; + return $this->fields['invoicedAmount']; } - public function getCollectedAmount(): ?float + public function getCollectedAmount(): float { - return $this->fields['collectedAmount'] ?? null; + return $this->fields['collectedAmount']; } - public function getInvoiceCount(): ?int + public function getInvoiceCount(): int { - return $this->fields['invoiceCount'] ?? null; + return $this->fields['invoiceCount']; } public function jsonSerialize(): array @@ -84,14 +84,14 @@ public function jsonSerialize(): array return $data; } - private function setCurrency(null|string $currency): static + private function setCurrency(string $currency): static { $this->fields['currency'] = $currency; return $this; } - private function setInvoicedAmount(null|float|string $invoicedAmount): static + private function setInvoicedAmount(float|string $invoicedAmount): static { if (is_string($invoicedAmount)) { $invoicedAmount = (float) $invoicedAmount; @@ -102,7 +102,7 @@ private function setInvoicedAmount(null|float|string $invoicedAmount): static return $this; } - private function setCollectedAmount(null|float|string $collectedAmount): static + private function setCollectedAmount(float|string $collectedAmount): static { if (is_string($collectedAmount)) { $collectedAmount = (float) $collectedAmount; @@ -113,7 +113,7 @@ private function setCollectedAmount(null|float|string $collectedAmount): static return $this; } - private function setInvoiceCount(null|int $invoiceCount): static + private function setInvoiceCount(int $invoiceCount): static { $this->fields['invoiceCount'] = $invoiceCount; diff --git a/src/Model/SubscriptionsDataExport.php b/src/Model/SubscriptionsDataExport.php index 4e0a4d1a9..372036b8f 100644 --- a/src/Model/SubscriptionsDataExport.php +++ b/src/Model/SubscriptionsDataExport.php @@ -40,6 +40,14 @@ class SubscriptionsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?SubscriptionsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/TagUntagRule.php b/src/Model/TagUntagRule.php index 97f8a69a3..8ef0cbc33 100644 --- a/src/Model/TagUntagRule.php +++ b/src/Model/TagUntagRule.php @@ -161,6 +161,12 @@ class TagUntagRule implements JsonSerializable public const EVENT_TYPE_TRANSACTION_PROCESSED = 'transaction-processed'; + public const EVENT_TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + + public const EVENT_TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; + + public const EVENT_TYPE_TRANSACTION_VOIDED = 'transaction-voided'; + public const EVENT_TYPE_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; public const STATUS_ACTIVE = 'active'; diff --git a/src/Model/TimeSeriesTransactionData.php b/src/Model/TimeSeriesTransactionData.php index f4fcc75b3..3a3bf3173 100644 --- a/src/Model/TimeSeriesTransactionData.php +++ b/src/Model/TimeSeriesTransactionData.php @@ -70,16 +70,23 @@ public function setTotal(null|float|string $total): static return $this; } - public function getSubaggregates(): ?TimeSeriesTransactionDataSubaggregates + /** + * @return null|TimeSeriesTransactionDataSubaggregates[] + */ + public function getSubaggregates(): ?array { return $this->fields['subaggregates'] ?? null; } - public function setSubaggregates(null|TimeSeriesTransactionDataSubaggregates|array $subaggregates): static + /** + * @param null|array[]|TimeSeriesTransactionDataSubaggregates[] $subaggregates + */ + public function setSubaggregates(null|array $subaggregates): static { - if ($subaggregates !== null && !($subaggregates instanceof TimeSeriesTransactionDataSubaggregates)) { - $subaggregates = TimeSeriesTransactionDataSubaggregates::from($subaggregates); - } + $subaggregates = $subaggregates !== null ? array_map( + fn ($value) => $value instanceof TimeSeriesTransactionDataSubaggregates ? $value : TimeSeriesTransactionDataSubaggregates::from($value), + $subaggregates, + ) : null; $this->fields['subaggregates'] = $subaggregates; @@ -96,7 +103,12 @@ public function jsonSerialize(): array $data['total'] = $this->fields['total']; } if (array_key_exists('subaggregates', $this->fields)) { - $data['subaggregates'] = $this->fields['subaggregates']?->jsonSerialize(); + $data['subaggregates'] = $this->fields['subaggregates'] !== null + ? array_map( + static fn (TimeSeriesTransactionDataSubaggregates $timeSeriesTransactionDataSubaggregates) => $timeSeriesTransactionDataSubaggregates->jsonSerialize(), + $this->fields['subaggregates'], + ) + : null; } return $data; diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 8c77c8d43..fb75bceff 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -261,6 +261,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_ILIXIUM = 'Ilixium'; + public const GATEWAY_NAME_I_MERCHANT = 'IMerchant'; + public const GATEWAY_NAME_INGENICO = 'Ingenico'; public const GATEWAY_NAME_INOVAPAY = 'INOVAPAY'; @@ -385,6 +387,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_PAYFLOW = 'Payflow'; + public const GATEWAY_NAME_PAY_GLOCAL = 'PayGlocal'; + public const GATEWAY_NAME_PAYNOTE = 'Paynote'; public const GATEWAY_NAME_PAYMENT_ASIA = 'PaymentAsia'; @@ -823,6 +827,8 @@ class Transaction implements JsonSerializable public const ACQUIRER_NAME_PAY_ECARDS = 'PayEcards'; + public const ACQUIRER_NAME_PAY_GLOCAL = 'PayGlocal'; + public const ACQUIRER_NAME_PAYMENT_ASIA = 'PaymentAsia'; public const ACQUIRER_NAME_PAYMEN_TECHNOLOGIES = 'PaymenTechnologies'; @@ -959,6 +965,16 @@ class Transaction implements JsonSerializable public const ACQUIRER_NAME_ZOTAPAY = 'Zotapay'; + public const METHOD_PAYMENT_CARD = 'payment-card'; + + public const METHOD_ACH = 'ach'; + + public const METHOD_CASH = 'cash'; + + public const METHOD_CHECK = 'check'; + + public const METHOD_PAYPAL = 'paypal'; + public const METHOD_ADV_CASH = 'AdvCash'; public const METHOD_AERA = 'Aera'; @@ -1229,6 +1245,8 @@ class Transaction implements JsonSerializable public const METHOD_PIX = 'PIX'; + public const METHOD_PIX_AUTOMATICO = 'PIX-Automatico'; + public const METHOD_PIN_PAY = 'PinPay'; public const METHOD_PHONE = 'phone'; diff --git a/src/Model/TransactionPaymentInstrumentFactory.php b/src/Model/TransactionPaymentInstrumentFactory.php index 7155816f3..c60773274 100644 --- a/src/Model/TransactionPaymentInstrumentFactory.php +++ b/src/Model/TransactionPaymentInstrumentFactory.php @@ -110,6 +110,7 @@ public static function from(array $data = [], array $metadata = []): Transaction 'Onlineueberweisen' => AlternativePaymentInstrument::from($data, $metadata), 'P24' => AlternativePaymentInstrument::from($data, $metadata), 'PIX' => AlternativePaymentInstrument::from($data, $metadata), + 'PIX-Automatico' => AlternativePaymentInstrument::from($data, $metadata), 'POLi' => AlternativePaymentInstrument::from($data, $metadata), 'Pagadito' => AlternativePaymentInstrument::from($data, $metadata), 'PagoEffectivo' => AlternativePaymentInstrument::from($data, $metadata), diff --git a/src/Model/TransactionTimeline.php b/src/Model/TransactionTimeline.php index 59208a8cc..8dd905419 100644 --- a/src/Model/TransactionTimeline.php +++ b/src/Model/TransactionTimeline.php @@ -97,6 +97,8 @@ class TransactionTimeline implements JsonSerializable public const TYPE_TRANSACTION_PAYMENT_METHOD_CHANGED = 'transaction-payment-method-changed'; + public const TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + public const TYPE_TRANSACTION_PROCESS_REQUESTED = 'transaction-process-requested'; public const TYPE_TRANSACTION_PROCESSED = 'transaction-processed'; diff --git a/src/Model/TransactionsDataExport.php b/src/Model/TransactionsDataExport.php index aa2f3c955..17e05a50b 100644 --- a/src/Model/TransactionsDataExport.php +++ b/src/Model/TransactionsDataExport.php @@ -40,6 +40,14 @@ class TransactionsDataExport implements DataExport public const STATUS_COMPLETED = 'completed'; + public const STATUS_FAILED = 'failed'; + + public const FAILURE_REASON_RECORD_LIMIT_EXCEEDED = 'record-limit-exceeded'; + + public const FAILURE_REASON_MAX_RETRIES_REACHED = 'max-retries-reached'; + + public const FAILURE_REASON_NULL = 'null'; + private array $fields = []; public function __construct(array $data = [], array $metadata = []) @@ -86,6 +94,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('status', $data)) { $this->setStatus($data['status']); } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } if (array_key_exists('dateRange', $data)) { $this->setDateRange($data['dateRange']); } @@ -240,6 +251,11 @@ public function getStatus(): ?string return $this->fields['status'] ?? null; } + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + public function getDateRange(): ?TransactionsDataExportDateRange { return $this->fields['dateRange'] ?? null; @@ -327,6 +343,9 @@ public function jsonSerialize(): array if (array_key_exists('status', $this->fields)) { $data['status'] = $this->fields['status']; } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } if (array_key_exists('dateRange', $this->fields)) { $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); } @@ -413,6 +432,13 @@ private function setStatus(null|string $status): static return $this; } + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + return $this; + } + /** * @param null|array[]|ResourceLink[] $links */ diff --git a/src/Model/UsersDataExport.php b/src/Model/UsersDataExport.php new file mode 100644 index 000000000..d6b8d3a1f --- /dev/null +++ b/src/Model/UsersDataExport.php @@ -0,0 +1,450 @@ +setId($data['id']); + } + if (array_key_exists('name', $data)) { + $this->setName($data['name']); + } + if (array_key_exists('format', $data)) { + $this->setFormat($data['format']); + } + if (array_key_exists('arguments', $data)) { + $this->setArguments($data['arguments']); + } + if (array_key_exists('emailNotification', $data)) { + $this->setEmailNotification($data['emailNotification']); + } + if (array_key_exists('fields', $data)) { + $this->setFields($data['fields']); + } + if (array_key_exists('recurring', $data)) { + $this->setRecurring($data['recurring']); + } + if (array_key_exists('userId', $data)) { + $this->setUserId($data['userId']); + } + if (array_key_exists('fileId', $data)) { + $this->setFileId($data['fileId']); + } + if (array_key_exists('recordCount', $data)) { + $this->setRecordCount($data['recordCount']); + } + if (array_key_exists('scheduledTime', $data)) { + $this->setScheduledTime($data['scheduledTime']); + } + if (array_key_exists('createdTime', $data)) { + $this->setCreatedTime($data['createdTime']); + } + if (array_key_exists('updatedTime', $data)) { + $this->setUpdatedTime($data['updatedTime']); + } + if (array_key_exists('status', $data)) { + $this->setStatus($data['status']); + } + if (array_key_exists('failureReason', $data)) { + $this->setFailureReason($data['failureReason']); + } + if (array_key_exists('dateRange', $data)) { + $this->setDateRange($data['dateRange']); + } + if (array_key_exists('_links', $data)) { + $this->setLinks($data['_links']); + } + if (array_key_exists('_embedded', $data)) { + $this->setEmbedded($data['_embedded']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getResource(): string + { + return 'users'; + } + + public function getId(): ?string + { + return $this->fields['id'] ?? null; + } + + public function getName(): string + { + return $this->fields['name']; + } + + public function setName(string $name): static + { + $this->fields['name'] = $name; + + return $this; + } + + public function getFormat(): string + { + return $this->fields['format']; + } + + public function setFormat(string $format): static + { + $this->fields['format'] = $format; + + return $this; + } + + public function getArguments(): ?DataExportArguments + { + return $this->fields['arguments'] ?? null; + } + + public function setArguments(null|DataExportArguments|array $arguments): static + { + if ($arguments !== null && !($arguments instanceof DataExportArguments)) { + $arguments = DataExportArguments::from($arguments); + } + + $this->fields['arguments'] = $arguments; + + return $this; + } + + /** + * @return null|string[] + */ + public function getEmailNotification(): ?array + { + return $this->fields['emailNotification'] ?? null; + } + + /** + * @param null|string[] $emailNotification + */ + public function setEmailNotification(null|array $emailNotification): static + { + $this->fields['emailNotification'] = $emailNotification; + + return $this; + } + + /** + * @return null|string[] + */ + public function getFields(): ?array + { + return $this->fields['fields'] ?? null; + } + + /** + * @param null|string[] $fields + */ + public function setFields(null|array $fields): static + { + $this->fields['fields'] = $fields; + + return $this; + } + + public function getRecurring(): ?DataExportRecurring + { + return $this->fields['recurring'] ?? null; + } + + public function setRecurring(null|DataExportRecurring|array $recurring): static + { + if ($recurring !== null && !($recurring instanceof DataExportRecurring)) { + $recurring = DataExportRecurring::from($recurring); + } + + $this->fields['recurring'] = $recurring; + + return $this; + } + + public function getUserId(): ?string + { + return $this->fields['userId'] ?? null; + } + + public function getFileId(): ?string + { + return $this->fields['fileId'] ?? null; + } + + public function getRecordCount(): ?int + { + return $this->fields['recordCount'] ?? null; + } + + public function getScheduledTime(): ?DateTimeImmutable + { + return $this->fields['scheduledTime'] ?? null; + } + + public function getCreatedTime(): ?DateTimeImmutable + { + return $this->fields['createdTime'] ?? null; + } + + public function getUpdatedTime(): ?DateTimeImmutable + { + return $this->fields['updatedTime'] ?? null; + } + + public function getStatus(): ?string + { + return $this->fields['status'] ?? null; + } + + public function getFailureReason(): ?string + { + return $this->fields['failureReason'] ?? null; + } + + public function getDateRange(): ?UsersDataExportDateRange + { + return $this->fields['dateRange'] ?? null; + } + + public function setDateRange(null|UsersDataExportDateRange|array $dateRange): static + { + if ($dateRange !== null && !($dateRange instanceof UsersDataExportDateRange)) { + $dateRange = UsersDataExportDateRange::from($dateRange); + } + + $this->fields['dateRange'] = $dateRange; + + return $this; + } + + /** + * @return null|ResourceLink[] + */ + public function getLinks(): ?array + { + return $this->fields['_links'] ?? null; + } + + public function getEmbedded(): ?UsersDataExportEmbedded + { + return $this->fields['_embedded'] ?? null; + } + + public function setEmbedded(null|UsersDataExportEmbedded|array $embedded): static + { + if ($embedded !== null && !($embedded instanceof UsersDataExportEmbedded)) { + $embedded = UsersDataExportEmbedded::from($embedded); + } + + $this->fields['_embedded'] = $embedded; + + return $this; + } + + public function jsonSerialize(): array + { + $data = [ + 'resource' => 'users', + ]; + if (array_key_exists('id', $this->fields)) { + $data['id'] = $this->fields['id']; + } + if (array_key_exists('name', $this->fields)) { + $data['name'] = $this->fields['name']; + } + if (array_key_exists('format', $this->fields)) { + $data['format'] = $this->fields['format']; + } + if (array_key_exists('arguments', $this->fields)) { + $data['arguments'] = $this->fields['arguments']?->jsonSerialize(); + } + if (array_key_exists('emailNotification', $this->fields)) { + $data['emailNotification'] = $this->fields['emailNotification']; + } + if (array_key_exists('fields', $this->fields)) { + $data['fields'] = $this->fields['fields']; + } + if (array_key_exists('recurring', $this->fields)) { + $data['recurring'] = $this->fields['recurring']?->jsonSerialize(); + } + if (array_key_exists('userId', $this->fields)) { + $data['userId'] = $this->fields['userId']; + } + if (array_key_exists('fileId', $this->fields)) { + $data['fileId'] = $this->fields['fileId']; + } + if (array_key_exists('recordCount', $this->fields)) { + $data['recordCount'] = $this->fields['recordCount']; + } + if (array_key_exists('scheduledTime', $this->fields)) { + $data['scheduledTime'] = $this->fields['scheduledTime']?->format(DateTimeInterface::RFC3339); + } + 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('status', $this->fields)) { + $data['status'] = $this->fields['status']; + } + if (array_key_exists('failureReason', $this->fields)) { + $data['failureReason'] = $this->fields['failureReason']; + } + if (array_key_exists('dateRange', $this->fields)) { + $data['dateRange'] = $this->fields['dateRange']?->jsonSerialize(); + } + 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; + } + if (array_key_exists('_embedded', $this->fields)) { + $data['_embedded'] = $this->fields['_embedded']?->jsonSerialize(); + } + + return $data; + } + + private function setId(null|string $id): static + { + $this->fields['id'] = $id; + + return $this; + } + + private function setUserId(null|string $userId): static + { + $this->fields['userId'] = $userId; + + return $this; + } + + private function setFileId(null|string $fileId): static + { + $this->fields['fileId'] = $fileId; + + return $this; + } + + private function setRecordCount(null|int $recordCount): static + { + $this->fields['recordCount'] = $recordCount; + + return $this; + } + + private function setScheduledTime(null|DateTimeImmutable|string $scheduledTime): static + { + if ($scheduledTime !== null && !($scheduledTime instanceof DateTimeImmutable)) { + $scheduledTime = new DateTimeImmutable($scheduledTime); + } + + $this->fields['scheduledTime'] = $scheduledTime; + + 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; + } + + private function setStatus(null|string $status): static + { + $this->fields['status'] = $status; + + return $this; + } + + private function setFailureReason(null|string $failureReason): static + { + $this->fields['failureReason'] = $failureReason; + + 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/UsersDataExportDateRange.php b/src/Model/UsersDataExportDateRange.php new file mode 100644 index 000000000..51532f008 --- /dev/null +++ b/src/Model/UsersDataExportDateRange.php @@ -0,0 +1,96 @@ +setStart($data['start']); + } + if (array_key_exists('end', $data)) { + $this->setEnd($data['end']); + } + if (array_key_exists('field', $data)) { + $this->setField($data['field']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getStart(): string + { + return $this->fields['start']; + } + + public function setStart(string $start): static + { + $this->fields['start'] = $start; + + return $this; + } + + public function getEnd(): string + { + return $this->fields['end']; + } + + public function setEnd(string $end): static + { + $this->fields['end'] = $end; + + return $this; + } + + public function getField(): ?string + { + return $this->fields['field'] ?? null; + } + + public function setField(null|string $field): static + { + $this->fields['field'] = $field; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('start', $this->fields)) { + $data['start'] = $this->fields['start']; + } + if (array_key_exists('end', $this->fields)) { + $data['end'] = $this->fields['end']; + } + if (array_key_exists('field', $this->fields)) { + $data['field'] = $this->fields['field']; + } + + return $data; + } +} diff --git a/src/Model/UsersDataExportEmbedded.php b/src/Model/UsersDataExportEmbedded.php new file mode 100644 index 000000000..95c6c67e0 --- /dev/null +++ b/src/Model/UsersDataExportEmbedded.php @@ -0,0 +1,86 @@ +setFile($data['file']); + } + if (array_key_exists('user', $data)) { + $this->setUser($data['user']); + } + $this->setMetadata($metadata); + } + + public static function from(array $data = [], array $metadata = []): self + { + return new self($data, $metadata); + } + + public function getFile(): ?File + { + return $this->fields['file'] ?? null; + } + + public function setFile(null|File|array $file): static + { + if ($file !== null && !($file instanceof File)) { + $file = File::from($file); + } + + $this->fields['file'] = $file; + + return $this; + } + + public function getUser(): ?User + { + return $this->fields['user'] ?? null; + } + + public function setUser(null|User|array $user): static + { + if ($user !== null && !($user instanceof User)) { + $user = User::from($user); + } + + $this->fields['user'] = $user; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('file', $this->fields)) { + $data['file'] = $this->fields['file']?->jsonSerialize(); + } + if (array_key_exists('user', $this->fields)) { + $data['user'] = $this->fields['user']?->jsonSerialize(); + } + + return $data; + } +} diff --git a/src/Model/VaultedInstrument.php b/src/Model/VaultedInstrument.php index 26e1bb0c2..c7ba7ae84 100644 --- a/src/Model/VaultedInstrument.php +++ b/src/Model/VaultedInstrument.php @@ -16,7 +16,7 @@ use Rebilly\Sdk\Trait\HasMetadata; -class VaultedInstrument implements CustomerDefaultPaymentInstrument, TransactionPaymentInstrument +class VaultedInstrument implements TransactionPaymentInstrument { use HasMetadata; diff --git a/src/Model/VivaCredentials.php b/src/Model/VivaCredentials.php index 5497c243b..14901c733 100644 --- a/src/Model/VivaCredentials.php +++ b/src/Model/VivaCredentials.php @@ -37,6 +37,9 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('apiKey', $data)) { $this->setApiKey($data['apiKey']); } + if (array_key_exists('ipnKey', $data)) { + $this->setIpnKey($data['ipnKey']); + } $this->setMetadata($metadata); } @@ -93,6 +96,18 @@ public function setApiKey(string $apiKey): static return $this; } + public function getIpnKey(): string + { + return $this->fields['ipnKey']; + } + + public function setIpnKey(string $ipnKey): static + { + $this->fields['ipnKey'] = $ipnKey; + + return $this; + } + public function jsonSerialize(): array { $data = []; @@ -108,6 +123,9 @@ public function jsonSerialize(): array if (array_key_exists('apiKey', $this->fields)) { $data['apiKey'] = $this->fields['apiKey']; } + if (array_key_exists('ipnKey', $this->fields)) { + $data['ipnKey'] = $this->fields['ipnKey']; + } return $data; } diff --git a/src/Model/WebhookTracking.php b/src/Model/WebhookTracking.php index 3e7b61778..539711ad0 100644 --- a/src/Model/WebhookTracking.php +++ b/src/Model/WebhookTracking.php @@ -75,6 +75,8 @@ class WebhookTracking implements JsonSerializable public const EVENT_TYPE_DATA_EXPORT_COMPLETED = 'data-export-completed'; + public const EVENT_TYPE_DATA_EXPORT_FAILED = 'data-export-failed'; + public const EVENT_TYPE_DISPUTE_CREATED = 'dispute-created'; public const EVENT_TYPE_DISPUTE_MODIFIED = 'dispute-modified'; @@ -251,8 +253,14 @@ class WebhookTracking implements JsonSerializable public const EVENT_TYPE_TRANSACTION_RECONCILED = 'transaction-reconciled'; + public const EVENT_TYPE_TRANSACTION_PARTIALLY_REFUNDED = 'transaction-partially-refunded'; + + public const EVENT_TYPE_TRANSACTION_REFUNDED = 'transaction-refunded'; + public const EVENT_TYPE_TRANSACTION_TIMEOUT_RESOLVED = 'transaction-timeout-resolved'; + public const EVENT_TYPE_TRANSACTION_VOIDED = 'transaction-voided'; + public const EVENT_TYPE_TRIAL_USAGE_LIMIT_REACHED = 'trial-usage-limit-reached'; public const EVENT_TYPE_WAITING_GATEWAY_TRANSACTION_COMPLETED = 'waiting-gateway-transaction-completed'; diff --git a/src/Model/WebsiteSettingsPayoutRequest.php b/src/Model/WebsiteSettingsPayoutRequest.php index 3889f0e82..5f5e702fb 100644 --- a/src/Model/WebsiteSettingsPayoutRequest.php +++ b/src/Model/WebsiteSettingsPayoutRequest.php @@ -14,6 +14,8 @@ namespace Rebilly\Sdk\Model; +use DateTimeImmutable; +use DateTimeInterface; use JsonSerializable; use Rebilly\Sdk\Trait\HasMetadata; @@ -31,6 +33,12 @@ public function __construct(array $data = [], array $metadata = []) if (array_key_exists('pendingPeriodHours', $data)) { $this->setPendingPeriodHours($data['pendingPeriodHours']); } + if (array_key_exists('automaticReadinessTime', $data)) { + $this->setAutomaticReadinessTime($data['automaticReadinessTime']); + } + if (array_key_exists('automaticReadinessLastExecutedAt', $data)) { + $this->setAutomaticReadinessLastExecutedAt($data['automaticReadinessLastExecutedAt']); + } $this->setMetadata($metadata); } @@ -63,6 +71,23 @@ public function setPendingPeriodHours(null|int $pendingPeriodHours): static return $this; } + public function getAutomaticReadinessTime(): ?string + { + return $this->fields['automaticReadinessTime'] ?? null; + } + + public function setAutomaticReadinessTime(null|string $automaticReadinessTime): static + { + $this->fields['automaticReadinessTime'] = $automaticReadinessTime; + + return $this; + } + + public function getAutomaticReadinessLastExecutedAt(): ?DateTimeImmutable + { + return $this->fields['automaticReadinessLastExecutedAt'] ?? null; + } + public function jsonSerialize(): array { $data = []; @@ -72,7 +97,24 @@ public function jsonSerialize(): array if (array_key_exists('pendingPeriodHours', $this->fields)) { $data['pendingPeriodHours'] = $this->fields['pendingPeriodHours']; } + if (array_key_exists('automaticReadinessTime', $this->fields)) { + $data['automaticReadinessTime'] = $this->fields['automaticReadinessTime']; + } + if (array_key_exists('automaticReadinessLastExecutedAt', $this->fields)) { + $data['automaticReadinessLastExecutedAt'] = $this->fields['automaticReadinessLastExecutedAt']?->format(DateTimeInterface::RFC3339); + } return $data; } + + private function setAutomaticReadinessLastExecutedAt(null|DateTimeImmutable|string $automaticReadinessLastExecutedAt): static + { + if ($automaticReadinessLastExecutedAt !== null && !($automaticReadinessLastExecutedAt instanceof DateTimeImmutable)) { + $automaticReadinessLastExecutedAt = new DateTimeImmutable($automaticReadinessLastExecutedAt); + } + + $this->fields['automaticReadinessLastExecutedAt'] = $automaticReadinessLastExecutedAt; + + return $this; + } } diff --git a/src/Service.php b/src/Service.php index ec44f5ffb..693c29cc4 100644 --- a/src/Service.php +++ b/src/Service.php @@ -158,6 +158,8 @@ class Service private Api\PayoutRequestsApi $payoutRequests; + private Api\PayoutRequestSplitsApi $payoutRequestSplits; + private Api\PayoutRequestAllocationsApi $payoutRequestAllocations; private Api\PayoutRequestBatchesApi $payoutRequestBatches; @@ -266,6 +268,7 @@ 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->payoutRequestSplits = new Api\PayoutRequestSplitsApi($this->client); $this->payoutRequestAllocations = new Api\PayoutRequestAllocationsApi($this->client); $this->payoutRequestBatches = new Api\PayoutRequestBatchesApi($this->client); $this->profile = new Api\ProfileApi($this->client); @@ -636,6 +639,11 @@ public function payoutRequests(): Api\PayoutRequestsApi return $this->payoutRequests; } + public function payoutRequestSplits(): Api\PayoutRequestSplitsApi + { + return $this->payoutRequestSplits; + } + public function payoutRequestAllocations(): Api\PayoutRequestAllocationsApi { return $this->payoutRequestAllocations;