diff --git a/src/Model/Core/BunqModel.php b/src/Model/Core/BunqModel.php index 66cf9168..d22038ba 100644 --- a/src/Model/Core/BunqModel.php +++ b/src/Model/Core/BunqModel.php @@ -84,6 +84,18 @@ protected static function fromJsonList( return new BunqResponse($value, $responseRaw->getHeaders(), $pagination); } + /** + * @param string $json + * + * @return BunqModel + */ + public static function createFromJsonString(string $json): BunqModel + { + $responseArray = ModelUtil::deserializeResponseArray($json); + + return static::createFromResponseArray($responseArray); + } + /** * @param mixed[] $responseArray * @param string $wrapper diff --git a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php index c379fb9c..6fe59326 100644 --- a/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php +++ b/src/Model/Generated/Endpoint/AttachmentMonetaryAccount.php @@ -16,6 +16,11 @@ */ class AttachmentMonetaryAccount extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/attachment'; + /** * Binary constants. */ @@ -23,11 +28,6 @@ class AttachmentMonetaryAccount extends BunqModel const FIELD_CONTENT_TYPE = ApiClient::FIELD_CONTENT_TYPE; const FIELD_DESCRIPTION = ApiClient::FIELD_DESCRIPTION; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/attachment'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/AttachmentPublic.php b/src/Model/Generated/Endpoint/AttachmentPublic.php index 3a2b96c9..f0732bb8 100644 --- a/src/Model/Generated/Endpoint/AttachmentPublic.php +++ b/src/Model/Generated/Endpoint/AttachmentPublic.php @@ -16,6 +16,12 @@ */ class AttachmentPublic extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'attachment-public'; + const ENDPOINT_URL_READ = 'attachment-public/%s'; + /** * Binary constants. */ @@ -23,12 +29,6 @@ class AttachmentPublic extends BunqModel const FIELD_CONTENT_TYPE = ApiClient::FIELD_CONTENT_TYPE; const FIELD_DESCRIPTION = ApiClient::FIELD_DESCRIPTION; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'attachment-public'; - const ENDPOINT_URL_READ = 'attachment-public/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/AttachmentTab.php b/src/Model/Generated/Endpoint/AttachmentTab.php index 735b4410..a050a1c7 100644 --- a/src/Model/Generated/Endpoint/AttachmentTab.php +++ b/src/Model/Generated/Endpoint/AttachmentTab.php @@ -16,6 +16,12 @@ */ class AttachmentTab extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/attachment-tab'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/attachment-tab/%s'; + /** * Binary constants. */ @@ -23,12 +29,6 @@ class AttachmentTab extends BunqModel const FIELD_CONTENT_TYPE = ApiClient::FIELD_CONTENT_TYPE; const FIELD_DESCRIPTION = ApiClient::FIELD_DESCRIPTION; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/attachment-tab'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/attachment-tab/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/Avatar.php b/src/Model/Generated/Endpoint/Avatar.php index fe9e0bf2..2ae97b87 100644 --- a/src/Model/Generated/Endpoint/Avatar.php +++ b/src/Model/Generated/Endpoint/Avatar.php @@ -20,17 +20,17 @@ */ class Avatar extends BunqModel { - /** - * Field constants. - */ - const FIELD_ATTACHMENT_PUBLIC_UUID = 'attachment_public_uuid'; - /** * Endpoint constants. */ const ENDPOINT_URL_CREATE = 'avatar'; const ENDPOINT_URL_READ = 'avatar/%s'; + /** + * Field constants. + */ + const FIELD_ATTACHMENT_PUBLIC_UUID = 'attachment_public_uuid'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/BillingContractSubscription.php b/src/Model/Generated/Endpoint/BillingContractSubscription.php index ee3b60d4..39630169 100644 --- a/src/Model/Generated/Endpoint/BillingContractSubscription.php +++ b/src/Model/Generated/Endpoint/BillingContractSubscription.php @@ -13,17 +13,17 @@ */ class BillingContractSubscription extends BunqModel { - /** - * Field constants. - */ - const FIELD_SUBSCRIPTION_TYPE = 'subscription_type'; - /** * Endpoint constants. */ const ENDPOINT_URL_CREATE = 'user/%s/billing-contract-subscription'; const ENDPOINT_URL_LISTING = 'user/%s/billing-contract-subscription'; + /** + * Field constants. + */ + const FIELD_SUBSCRIPTION_TYPE = 'subscription_type'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/BunqMeTab.php b/src/Model/Generated/Endpoint/BunqMeTab.php index 08982974..86c79044 100644 --- a/src/Model/Generated/Endpoint/BunqMeTab.php +++ b/src/Model/Generated/Endpoint/BunqMeTab.php @@ -15,12 +15,6 @@ */ class BunqMeTab extends BunqModel { - /** - * Field constants. - */ - const FIELD_BUNQME_TAB_ENTRY = 'bunqme_tab_entry'; - const FIELD_STATUS = 'status'; - /** * Endpoint constants. */ @@ -29,6 +23,12 @@ class BunqMeTab extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/bunqme-tab'; const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/bunqme-tab/%s'; + /** + * Field constants. + */ + const FIELD_BUNQME_TAB_ENTRY = 'bunqme_tab_entry'; + const FIELD_STATUS = 'status'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php b/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php new file mode 100644 index 00000000..30518190 --- /dev/null +++ b/src/Model/Generated/Endpoint/BunqMeTabResultResponse.php @@ -0,0 +1,44 @@ +payment; + } + + /** + * @param Payment $payment + */ + public function setPayment($payment) + { + $this->payment = $payment; + } +} diff --git a/src/Model/Generated/Endpoint/BunqResponseMasterCardAction.php b/src/Model/Generated/Endpoint/BunqResponseMasterCardAction.php new file mode 100644 index 00000000..f3881d6b --- /dev/null +++ b/src/Model/Generated/Endpoint/BunqResponseMasterCardAction.php @@ -0,0 +1,17 @@ +type = $type; } + /** + * The sub-type of the card. + * + * @return string + */ + public function getSubType() + { + return $this->subType; + } + + /** + * @param string $subType + */ + public function setSubType($subType) + { + $this->subType = $subType; + } + /** * The second line of text on the card * @@ -622,4 +655,23 @@ public function setMonetaryAccountIdFallback($monetaryAccountIdFallback) { $this->monetaryAccountIdFallback = $monetaryAccountIdFallback; } + + /** + * The country that is domestic to the card. Defaults to country of + * residence of user. + * + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * @param string $country + */ + public function setCountry($country) + { + $this->country = $country; + } } diff --git a/src/Model/Generated/Endpoint/CardDebit.php b/src/Model/Generated/Endpoint/CardDebit.php index 2d386753..5f5df7d0 100644 --- a/src/Model/Generated/Endpoint/CardDebit.php +++ b/src/Model/Generated/Endpoint/CardDebit.php @@ -20,6 +20,11 @@ */ class CardDebit extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/card-debit'; + /** * Field constants. */ @@ -30,11 +35,7 @@ class CardDebit extends BunqModel const FIELD_TYPE = 'type'; const FIELD_PIN_CODE_ASSIGNMENT = 'pin_code_assignment'; const FIELD_MONETARY_ACCOUNT_ID_FALLBACK = 'monetary_account_id_fallback'; - - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/card-debit'; + const FIELD_COUNTRY = 'country'; /** * Object type. @@ -76,6 +77,13 @@ class CardDebit extends BunqModel */ protected $type; + /** + * The sub_type of card. + * + * @var string + */ + protected $subType; + /** * The second line of text on the card * @@ -173,6 +181,14 @@ class CardDebit extends BunqModel */ protected $monetaryAccountIdFallback; + /** + * The country that is domestic to the card. Defaults to country of + * residence of user. + * + * @var string + */ + protected $country; + /** * Create a new debit card request. * @@ -291,6 +307,24 @@ public function setType($type) $this->type = $type; } + /** + * The sub_type of card. + * + * @return string + */ + public function getSubType() + { + return $this->subType; + } + + /** + * @param string $subType + */ + public function setSubType($subType) + { + $this->subType = $subType; + } + /** * The second line of text on the card * @@ -530,4 +564,23 @@ public function setMonetaryAccountIdFallback($monetaryAccountIdFallback) { $this->monetaryAccountIdFallback = $monetaryAccountIdFallback; } + + /** + * The country that is domestic to the card. Defaults to country of + * residence of user. + * + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * @param string $country + */ + public function setCountry($country) + { + $this->country = $country; + } } diff --git a/src/Model/Generated/Endpoint/CardReplace.php b/src/Model/Generated/Endpoint/CardReplace.php index 86f714d1..a07be4e1 100644 --- a/src/Model/Generated/Endpoint/CardReplace.php +++ b/src/Model/Generated/Endpoint/CardReplace.php @@ -19,15 +19,15 @@ class CardReplace extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - const FIELD_PIN_CODE = 'pin_code'; - const FIELD_SECOND_LINE = 'second_line'; + const ENDPOINT_URL_CREATE = 'user/%s/card/%s/replace'; /** - * Endpoint constants. + * Field constants. */ - const ENDPOINT_URL_CREATE = 'user/%s/card/%s/replace'; + const FIELD_PIN_CODE = 'pin_code'; + const FIELD_SECOND_LINE = 'second_line'; /** * Object type. diff --git a/src/Model/Generated/Endpoint/CashRegister.php b/src/Model/Generated/Endpoint/CashRegister.php index d941f4ae..c8df8b72 100644 --- a/src/Model/Generated/Endpoint/CashRegister.php +++ b/src/Model/Generated/Endpoint/CashRegister.php @@ -24,6 +24,14 @@ */ class CashRegister extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register'; + /** * Field constants. */ @@ -34,14 +42,6 @@ class CashRegister extends BunqModel const FIELD_NOTIFICATION_FILTERS = 'notification_filters'; const FIELD_TAB_TEXT_WAITING_SCREEN = 'tab_text_waiting_screen'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/CashRegisterQrCode.php b/src/Model/Generated/Endpoint/CashRegisterQrCode.php index 0147fb98..9a9649cf 100644 --- a/src/Model/Generated/Endpoint/CashRegisterQrCode.php +++ b/src/Model/Generated/Endpoint/CashRegisterQrCode.php @@ -16,11 +16,6 @@ */ class CashRegisterQrCode extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATUS = 'status'; - /** * Endpoint constants. */ @@ -29,6 +24,11 @@ class CashRegisterQrCode extends BunqModel const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/qr-code/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/qr-code'; + /** + * Field constants. + */ + const FIELD_STATUS = 'status'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/CertificatePinned.php b/src/Model/Generated/Endpoint/CertificatePinned.php index 45d9785f..d318112d 100644 --- a/src/Model/Generated/Endpoint/CertificatePinned.php +++ b/src/Model/Generated/Endpoint/CertificatePinned.php @@ -15,11 +15,6 @@ */ class CertificatePinned extends BunqModel { - /** - * Field constants. - */ - const FIELD_CERTIFICATE_CHAIN = 'certificate_chain'; - /** * Endpoint constants. */ @@ -28,6 +23,11 @@ class CertificatePinned extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/certificate-pinned'; const ENDPOINT_URL_READ = 'user/%s/certificate-pinned/%s'; + /** + * Field constants. + */ + const FIELD_CERTIFICATE_CHAIN = 'certificate_chain'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/ChatConversation.php b/src/Model/Generated/Endpoint/ChatConversation.php index d2ca8f0d..14968735 100644 --- a/src/Model/Generated/Endpoint/ChatConversation.php +++ b/src/Model/Generated/Endpoint/ChatConversation.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -13,6 +14,11 @@ */ class ChatConversation extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -118,4 +124,21 @@ public function setChatConversationReference($chatConversationReference) { $this->chatConversationReference = $chatConversationReference; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->supportConversationExternal)) { + return $this->supportConversationExternal; + } + + if (!is_null($this->chatConversationReference)) { + return $this->chatConversationReference; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/ChatMessage.php b/src/Model/Generated/Endpoint/ChatMessage.php index 0b659948..8a4950d8 100644 --- a/src/Model/Generated/Endpoint/ChatMessage.php +++ b/src/Model/Generated/Endpoint/ChatMessage.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -13,6 +14,11 @@ */ class ChatMessage extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -116,4 +122,25 @@ public function setChatMessageUser($chatMessageUser) { $this->chatMessageUser = $chatMessageUser; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->chatMessageAnnouncement)) { + return $this->chatMessageAnnouncement; + } + + if (!is_null($this->chatMessageStatus)) { + return $this->chatMessageStatus; + } + + if (!is_null($this->chatMessageUser)) { + return $this->chatMessageUser; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/ChatMessageAttachment.php b/src/Model/Generated/Endpoint/ChatMessageAttachment.php index 43499f61..8eda118f 100644 --- a/src/Model/Generated/Endpoint/ChatMessageAttachment.php +++ b/src/Model/Generated/Endpoint/ChatMessageAttachment.php @@ -14,15 +14,15 @@ class ChatMessageAttachment extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - const FIELD_CLIENT_MESSAGE_UUID = 'client_message_uuid'; - const FIELD_ATTACHMENT = 'attachment'; + const ENDPOINT_URL_CREATE = 'user/%s/chat-conversation/%s/message-attachment'; /** - * Endpoint constants. + * Field constants. */ - const ENDPOINT_URL_CREATE = 'user/%s/chat-conversation/%s/message-attachment'; + const FIELD_CLIENT_MESSAGE_UUID = 'client_message_uuid'; + const FIELD_ATTACHMENT = 'attachment'; /** * Object type. diff --git a/src/Model/Generated/Endpoint/ChatMessageText.php b/src/Model/Generated/Endpoint/ChatMessageText.php index 17fde15e..b7358390 100644 --- a/src/Model/Generated/Endpoint/ChatMessageText.php +++ b/src/Model/Generated/Endpoint/ChatMessageText.php @@ -14,15 +14,15 @@ class ChatMessageText extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - const FIELD_CLIENT_MESSAGE_UUID = 'client_message_uuid'; - const FIELD_TEXT = 'text'; + const ENDPOINT_URL_CREATE = 'user/%s/chat-conversation/%s/message-text'; /** - * Endpoint constants. + * Field constants. */ - const ENDPOINT_URL_CREATE = 'user/%s/chat-conversation/%s/message-text'; + const FIELD_CLIENT_MESSAGE_UUID = 'client_message_uuid'; + const FIELD_TEXT = 'text'; /** * Object type. diff --git a/src/Model/Generated/Endpoint/Customer.php b/src/Model/Generated/Endpoint/Customer.php index c4a8b6f8..88bbdf3b 100644 --- a/src/Model/Generated/Endpoint/Customer.php +++ b/src/Model/Generated/Endpoint/Customer.php @@ -13,11 +13,6 @@ */ class Customer extends BunqModel { - /** - * Field constants. - */ - const FIELD_BILLING_ACCOUNT_ID = 'billing_account_id'; - /** * Endpoint constants. */ @@ -25,6 +20,11 @@ class Customer extends BunqModel const ENDPOINT_URL_READ = 'user/%s/customer/%s'; const ENDPOINT_URL_UPDATE = 'user/%s/customer/%s'; + /** + * Field constants. + */ + const FIELD_BILLING_ACCOUNT_ID = 'billing_account_id'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/CustomerLimit.php b/src/Model/Generated/Endpoint/CustomerLimit.php index a0a03bea..6e58584f 100644 --- a/src/Model/Generated/Endpoint/CustomerLimit.php +++ b/src/Model/Generated/Endpoint/CustomerLimit.php @@ -44,6 +44,13 @@ class CustomerLimit extends BunqModel */ protected $limitCardDebitMastercard; + /** + * The limit of wildcards, e.g. Maestro or MasterCard cards. + * + * @var int + */ + protected $limitCardDebitWildcard; + /** * The limit of free replacement cards. * @@ -135,6 +142,24 @@ public function setLimitCardDebitMastercard($limitCardDebitMastercard) $this->limitCardDebitMastercard = $limitCardDebitMastercard; } + /** + * The limit of wildcards, e.g. Maestro or MasterCard cards. + * + * @return int + */ + public function getLimitCardDebitWildcard() + { + return $this->limitCardDebitWildcard; + } + + /** + * @param int $limitCardDebitWildcard + */ + public function setLimitCardDebitWildcard($limitCardDebitWildcard) + { + $this->limitCardDebitWildcard = $limitCardDebitWildcard; + } + /** * The limit of free replacement cards. * diff --git a/src/Model/Generated/Endpoint/CustomerStatementExport.php b/src/Model/Generated/Endpoint/CustomerStatementExport.php index 525b46c6..6248d590 100644 --- a/src/Model/Generated/Endpoint/CustomerStatementExport.php +++ b/src/Model/Generated/Endpoint/CustomerStatementExport.php @@ -15,14 +15,6 @@ */ class CustomerStatementExport extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATEMENT_FORMAT = 'statement_format'; - const FIELD_DATE_START = 'date_start'; - const FIELD_DATE_END = 'date_end'; - const FIELD_REGIONAL_FORMAT = 'regional_format'; - /** * Endpoint constants. */ @@ -31,6 +23,14 @@ class CustomerStatementExport extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/customer-statement'; const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/customer-statement/%s'; + /** + * Field constants. + */ + const FIELD_STATEMENT_FORMAT = 'statement_format'; + const FIELD_DATE_START = 'date_start'; + const FIELD_DATE_END = 'date_end'; + const FIELD_REGIONAL_FORMAT = 'regional_format'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/Device.php b/src/Model/Generated/Endpoint/Device.php index 8de107f0..46659a43 100644 --- a/src/Model/Generated/Endpoint/Device.php +++ b/src/Model/Generated/Endpoint/Device.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -14,6 +15,11 @@ */ class Device extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -25,11 +31,6 @@ class Device extends BunqModel */ const OBJECT_TYPE = 'Device'; - /** - * @var DevicePhone - */ - protected $devicePhone; - /** * @var DeviceServer */ @@ -91,22 +92,6 @@ public static function listing(ApiContext $apiContext, array $params = [], array ); } - /** - * @return DevicePhone - */ - public function getDevicePhone() - { - return $this->devicePhone; - } - - /** - * @param DevicePhone $devicePhone - */ - public function setDevicePhone($devicePhone) - { - $this->devicePhone = $devicePhone; - } - /** * @return DeviceServer */ @@ -122,4 +107,17 @@ public function setDeviceServer($deviceServer) { $this->deviceServer = $deviceServer; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->deviceServer)) { + return $this->deviceServer; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/DevicePhone.php b/src/Model/Generated/Endpoint/DevicePhone.php deleted file mode 100644 index 04d2bf01..00000000 --- a/src/Model/Generated/Endpoint/DevicePhone.php +++ /dev/null @@ -1,199 +0,0 @@ -id; - } - - /** - * @param int $id - */ - public function setId($id) - { - $this->id = $id; - } - - /** - * The timestamp of the DevicePhone's creation. - * - * @return string - */ - public function getCreated() - { - return $this->created; - } - - /** - * @param string $created - */ - public function setCreated($created) - { - $this->created = $created; - } - - /** - * The timestamp of the DevicePhone's last update. - * - * @return string - */ - public function getUpdated() - { - return $this->updated; - } - - /** - * @param string $updated - */ - public function setUpdated($updated) - { - $this->updated = $updated; - } - - /** - * The description of the DevicePhone. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * @param string $description - */ - public function setDescription($description) - { - $this->description = $description; - } - - /** - * The phone number used to register the DevicePhone. - * - * @return string - */ - public function getPhoneNumber() - { - return $this->phoneNumber; - } - - /** - * @param string $phoneNumber - */ - public function setPhoneNumber($phoneNumber) - { - $this->phoneNumber = $phoneNumber; - } - - /** - * The operating system running on this phone. - * - * @return string - */ - public function getOs() - { - return $this->os; - } - - /** - * @param string $os - */ - public function setOs($os) - { - $this->os = $os; - } - - /** - * The status of the DevicePhone. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param string $status - */ - public function setStatus($status) - { - $this->status = $status; - } -} diff --git a/src/Model/Generated/Endpoint/DeviceServer.php b/src/Model/Generated/Endpoint/DeviceServer.php index c57f3da3..4ab64a13 100644 --- a/src/Model/Generated/Endpoint/DeviceServer.php +++ b/src/Model/Generated/Endpoint/DeviceServer.php @@ -14,13 +14,6 @@ */ class DeviceServer extends BunqModel { - /** - * Field constants. - */ - const FIELD_DESCRIPTION = 'description'; - const FIELD_SECRET = 'secret'; - const FIELD_PERMITTED_IPS = 'permitted_ips'; - /** * Endpoint constants. */ @@ -28,6 +21,13 @@ class DeviceServer extends BunqModel const ENDPOINT_URL_READ = 'device-server/%s'; const ENDPOINT_URL_LISTING = 'device-server'; + /** + * Field constants. + */ + const FIELD_DESCRIPTION = 'description'; + const FIELD_SECRET = 'secret'; + const FIELD_PERMITTED_IPS = 'permitted_ips'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/DraftPayment.php b/src/Model/Generated/Endpoint/DraftPayment.php index 82c24c1e..afaafd0c 100644 --- a/src/Model/Generated/Endpoint/DraftPayment.php +++ b/src/Model/Generated/Endpoint/DraftPayment.php @@ -18,14 +18,6 @@ */ class DraftPayment extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATUS = 'status'; - const FIELD_ENTRIES = 'entries'; - const FIELD_PREVIOUS_UPDATED_TIMESTAMP = 'previous_updated_timestamp'; - const FIELD_NUMBER_OF_REQUIRED_ACCEPTS = 'number_of_required_accepts'; - /** * Endpoint constants. */ @@ -34,6 +26,14 @@ class DraftPayment extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/draft-payment'; const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/draft-payment/%s'; + /** + * Field constants. + */ + const FIELD_STATUS = 'status'; + const FIELD_ENTRIES = 'entries'; + const FIELD_PREVIOUS_UPDATED_TIMESTAMP = 'previous_updated_timestamp'; + const FIELD_NUMBER_OF_REQUIRED_ACCEPTS = 'number_of_required_accepts'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/DraftShareInviteBank.php b/src/Model/Generated/Endpoint/DraftShareInviteBank.php index 03e5f98e..ce51a8d9 100644 --- a/src/Model/Generated/Endpoint/DraftShareInviteBank.php +++ b/src/Model/Generated/Endpoint/DraftShareInviteBank.php @@ -18,13 +18,6 @@ */ class DraftShareInviteBank extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATUS = 'status'; - const FIELD_EXPIRATION = 'expiration'; - const FIELD_DRAFT_SHARE_SETTINGS = 'draft_share_settings'; - /** * Endpoint constants. */ @@ -33,6 +26,13 @@ class DraftShareInviteBank extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/draft-share-invite-bank/%s'; const ENDPOINT_URL_LISTING = 'user/%s/draft-share-invite-bank'; + /** + * Field constants. + */ + const FIELD_STATUS = 'status'; + const FIELD_EXPIRATION = 'expiration'; + const FIELD_DRAFT_SHARE_SETTINGS = 'draft_share_settings'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/ExportAnnualOverview.php b/src/Model/Generated/Endpoint/ExportAnnualOverview.php index 47f1c994..de5fac8b 100644 --- a/src/Model/Generated/Endpoint/ExportAnnualOverview.php +++ b/src/Model/Generated/Endpoint/ExportAnnualOverview.php @@ -16,11 +16,6 @@ */ class ExportAnnualOverview extends BunqModel { - /** - * Field constants. - */ - const FIELD_YEAR = 'year'; - /** * Endpoint constants. */ @@ -28,6 +23,11 @@ class ExportAnnualOverview extends BunqModel const ENDPOINT_URL_READ = 'user/%s/export-annual-overview/%s'; const ENDPOINT_URL_LISTING = 'user/%s/export-annual-overview'; + /** + * Field constants. + */ + const FIELD_YEAR = 'year'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/IdealMerchantTransaction.php b/src/Model/Generated/Endpoint/IdealMerchantTransaction.php index 0600e6d0..1eaf6704 100644 --- a/src/Model/Generated/Endpoint/IdealMerchantTransaction.php +++ b/src/Model/Generated/Endpoint/IdealMerchantTransaction.php @@ -15,12 +15,6 @@ */ class IdealMerchantTransaction extends BunqModel { - /** - * Field constants. - */ - const FIELD_AMOUNT_REQUESTED = 'amount_requested'; - const FIELD_ISSUER = 'issuer'; - /** * Endpoint constants. */ @@ -28,6 +22,12 @@ class IdealMerchantTransaction extends BunqModel const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/ideal-merchant-transaction/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/ideal-merchant-transaction'; + /** + * Field constants. + */ + const FIELD_AMOUNT_REQUESTED = 'amount_requested'; + const FIELD_ISSUER = 'issuer'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/Invoice.php b/src/Model/Generated/Endpoint/Invoice.php index 0a99166b..bba343d3 100644 --- a/src/Model/Generated/Endpoint/Invoice.php +++ b/src/Model/Generated/Endpoint/Invoice.php @@ -17,6 +17,12 @@ */ class Invoice extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/invoice'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/invoice/%s'; + /** * Field constants. */ @@ -24,12 +30,6 @@ class Invoice extends BunqModel const FIELD_DESCRIPTION = 'description'; const FIELD_EXTERNAL_URL = 'external_url'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/invoice'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/invoice/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/MasterCardAction.php b/src/Model/Generated/Endpoint/MasterCardAction.php new file mode 100644 index 00000000..a5accdd6 --- /dev/null +++ b/src/Model/Generated/Endpoint/MasterCardAction.php @@ -0,0 +1,669 @@ +get( + vsprintf( + self::ENDPOINT_URL_READ, + [$userId, $monetaryAccountId, $masterCardActionId] + ), + [], + $customHeaders + ); + + return BunqResponseMasterCardAction::castFromBunqResponse( + static::fromJson($responseRaw, self::OBJECT_TYPE) + ); + } + + /** + * This method is called "listing" because "list" is a restricted PHP word + * and cannot be used as constants, class names, function or method names. + * + * @param ApiContext $apiContext + * @param int $userId + * @param int $monetaryAccountId + * @param string[] $params + * @param string[] $customHeaders + * + * @return BunqResponseMasterCardActionList + */ + public static function listing(ApiContext $apiContext, int $userId, int $monetaryAccountId, array $params = [], array $customHeaders = []): BunqResponseMasterCardActionList + { + $apiClient = new ApiClient($apiContext); + $responseRaw = $apiClient->get( + vsprintf( + self::ENDPOINT_URL_LISTING, + [$userId, $monetaryAccountId] + ), + $params, + $customHeaders + ); + + return BunqResponseMasterCardActionList::castFromBunqResponse( + static::fromJsonList($responseRaw, self::OBJECT_TYPE) + ); + } + + /** + * The id of the monetary account this action links to. + * + * @return int + */ + public function getMonetaryAccountId() + { + return $this->monetaryAccountId; + } + + /** + * @param int $monetaryAccountId + */ + public function setMonetaryAccountId($monetaryAccountId) + { + $this->monetaryAccountId = $monetaryAccountId; + } + + /** + * The id of the card this action links to. + * + * @return int + */ + public function getCardId() + { + return $this->cardId; + } + + /** + * @param int $cardId + */ + public function setCardId($cardId) + { + $this->cardId = $cardId; + } + + /** + * The amount of the transaction in local currency. + * + * @return Amount + */ + public function getAmountLocal() + { + return $this->amountLocal; + } + + /** + * @param Amount $amountLocal + */ + public function setAmountLocal($amountLocal) + { + $this->amountLocal = $amountLocal; + } + + /** + * The amount of the transaction in the monetary account's currency. + * + * @return Amount + */ + public function getAmountBilling() + { + return $this->amountBilling; + } + + /** + * @param Amount $amountBilling + */ + public function setAmountBilling($amountBilling) + { + $this->amountBilling = $amountBilling; + } + + /** + * The original amount in local currency. + * + * @return Amount + */ + public function getAmountOriginalLocal() + { + return $this->amountOriginalLocal; + } + + /** + * @param Amount $amountOriginalLocal + */ + public function setAmountOriginalLocal($amountOriginalLocal) + { + $this->amountOriginalLocal = $amountOriginalLocal; + } + + /** + * The original amount in the monetary account's currency. + * + * @return Amount + */ + public function getAmountOriginalBilling() + { + return $this->amountOriginalBilling; + } + + /** + * @param Amount $amountOriginalBilling + */ + public function setAmountOriginalBilling($amountOriginalBilling) + { + $this->amountOriginalBilling = $amountOriginalBilling; + } + + /** + * The fee amount as charged by the merchant, if applicable. + * + * @return Amount + */ + public function getAmountFee() + { + return $this->amountFee; + } + + /** + * @param Amount $amountFee + */ + public function setAmountFee($amountFee) + { + $this->amountFee = $amountFee; + } + + /** + * Why the transaction was denied, if it was denied, or just ALLOWED. + * + * @return string + */ + public function getDecision() + { + return $this->decision; + } + + /** + * @param string $decision + */ + public function setDecision($decision) + { + $this->decision = $decision; + } + + /** + * Empty if allowed, otherwise a textual explanation of why it was denied. + * + * @return string + */ + public function getDecisionDescription() + { + return $this->decisionDescription; + } + + /** + * @param string $decisionDescription + */ + public function setDecisionDescription($decisionDescription) + { + $this->decisionDescription = $decisionDescription; + } + + /** + * Empty if allowed, otherwise a textual explanation of why it was denied in + * user's language. + * + * @return string + */ + public function getDecisionDescriptionTranslated() + { + return $this->decisionDescriptionTranslated; + } + + /** + * @param string $decisionDescriptionTranslated + */ + public function setDecisionDescriptionTranslated($decisionDescriptionTranslated) + { + $this->decisionDescriptionTranslated = $decisionDescriptionTranslated; + } + + /** + * The description for this transaction to display. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * The status in the authorisation process. + * + * @return string + */ + public function getAuthorisationStatus() + { + return $this->authorisationStatus; + } + + /** + * @param string $authorisationStatus + */ + public function setAuthorisationStatus($authorisationStatus) + { + $this->authorisationStatus = $authorisationStatus; + } + + /** + * The type of transaction that was delivered using the card. + * + * @return string + */ + public function getAuthorisationType() + { + return $this->authorisationType; + } + + /** + * @param string $authorisationType + */ + public function setAuthorisationType($authorisationType) + { + $this->authorisationType = $authorisationType; + } + + /** + * The type of entry mode the user used. Can be 'ATM', 'ICC', + * 'MAGNETIC_STRIPE' or 'E_COMMERCE'. + * + * @return string + */ + public function getPanEntryModeUser() + { + return $this->panEntryModeUser; + } + + /** + * @param string $panEntryModeUser + */ + public function setPanEntryModeUser($panEntryModeUser) + { + $this->panEntryModeUser = $panEntryModeUser; + } + + /** + * The city where the message originates from as announced by the terminal. + * + * @return string + */ + public function getCity() + { + return $this->city; + } + + /** + * @param string $city + */ + public function setCity($city) + { + $this->city = $city; + } + + /** + * The monetary account label of the account that this action is created + * for. + * + * @return LabelMonetaryAccount + */ + public function getAlias() + { + return $this->alias; + } + + /** + * @param LabelMonetaryAccount $alias + */ + public function setAlias($alias) + { + $this->alias = $alias; + } + + /** + * The monetary account label of the counterparty. + * + * @return LabelMonetaryAccount + */ + public function getCounterpartyAlias() + { + return $this->counterpartyAlias; + } + + /** + * @param LabelMonetaryAccount $counterpartyAlias + */ + public function setCounterpartyAlias($counterpartyAlias) + { + $this->counterpartyAlias = $counterpartyAlias; + } + + /** + * The label of the card. + * + * @return LabelCard + */ + public function getLabelCard() + { + return $this->labelCard; + } + + /** + * @param LabelCard $labelCard + */ + public function setLabelCard($labelCard) + { + $this->labelCard = $labelCard; + } + + /** + * If this is a tokenisation action, this shows the status of the token. + * + * @return string + */ + public function getTokenStatus() + { + return $this->tokenStatus; + } + + /** + * @param string $tokenStatus + */ + public function setTokenStatus($tokenStatus) + { + $this->tokenStatus = $tokenStatus; + } + + /** + * If this is a reservation, the moment the reservation will expire. + * + * @return string + */ + public function getReservationExpiryTime() + { + return $this->reservationExpiryTime; + } + + /** + * @param string $reservationExpiryTime + */ + public function setReservationExpiryTime($reservationExpiryTime) + { + $this->reservationExpiryTime = $reservationExpiryTime; + } + + /** + * The type of the limit applied to validate if this MasterCardAction was + * within the spending limits. The returned string matches the limit types + * as defined in the card endpoint. + * + * @return string + */ + public function getAppliedLimit() + { + return $this->appliedLimit; + } + + /** + * @param string $appliedLimit + */ + public function setAppliedLimit($appliedLimit) + { + $this->appliedLimit = $appliedLimit; + } + + /** + * Whether or not chat messages are allowed. + * + * @return bool + */ + public function getAllowChat() + { + return $this->allowChat; + } + + /** + * @param bool $allowChat + */ + public function setAllowChat($allowChat) + { + $this->allowChat = $allowChat; + } + + /** + * The whitelist id for this mastercard action or null. + * + * @return int + */ + public function getEligibleWhitelistId() + { + return $this->eligibleWhitelistId; + } + + /** + * @param int $eligibleWhitelistId + */ + public function setEligibleWhitelistId($eligibleWhitelistId) + { + $this->eligibleWhitelistId = $eligibleWhitelistId; + } +} diff --git a/src/Model/Generated/Endpoint/MonetaryAccount.php b/src/Model/Generated/Endpoint/MonetaryAccount.php index cc4a084e..0587e034 100644 --- a/src/Model/Generated/Endpoint/MonetaryAccount.php +++ b/src/Model/Generated/Endpoint/MonetaryAccount.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -17,6 +18,11 @@ */ class MonetaryAccount extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -105,4 +111,17 @@ public function setMonetaryAccountBank($monetaryAccountBank) { $this->monetaryAccountBank = $monetaryAccountBank; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->monetaryAccountBank)) { + return $this->monetaryAccountBank; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/MonetaryAccountBank.php b/src/Model/Generated/Endpoint/MonetaryAccountBank.php index 50acf88f..dc732896 100644 --- a/src/Model/Generated/Endpoint/MonetaryAccountBank.php +++ b/src/Model/Generated/Endpoint/MonetaryAccountBank.php @@ -24,6 +24,14 @@ */ class MonetaryAccountBank extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account-bank'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account-bank/%s'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account-bank/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account-bank'; + /** * Field constants. */ @@ -41,14 +49,6 @@ class MonetaryAccountBank extends BunqModel const FIELD_NOTIFICATION_FILTERS = 'notification_filters'; const FIELD_SETTING = 'setting'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account-bank'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account-bank/%s'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account-bank/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account-bank'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/Payment.php b/src/Model/Generated/Endpoint/Payment.php index 1b76d131..6a657b71 100644 --- a/src/Model/Generated/Endpoint/Payment.php +++ b/src/Model/Generated/Endpoint/Payment.php @@ -23,6 +23,13 @@ */ class Payment extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/payment'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/payment/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/payment'; + /** * Field constants. */ @@ -34,13 +41,6 @@ class Payment extends BunqModel const FIELD_ALLOW_BUNQTO = 'allow_bunqto'; const FIELD_BUNQTO_STATUS = 'bunqto_status'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/payment'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/payment/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/payment'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/PaymentBatch.php b/src/Model/Generated/Endpoint/PaymentBatch.php index a85514d4..d93fb4ee 100644 --- a/src/Model/Generated/Endpoint/PaymentBatch.php +++ b/src/Model/Generated/Endpoint/PaymentBatch.php @@ -14,12 +14,6 @@ */ class PaymentBatch extends BunqModel { - /** - * Field constants. - */ - const FIELD_PAYMENTS = 'payments'; - const FIELD_BUNQTO_STATUS = 'bunqto_status'; - /** * Endpoint constants. */ @@ -28,6 +22,12 @@ class PaymentBatch extends BunqModel const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/payment-batch/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/payment-batch'; + /** + * Field constants. + */ + const FIELD_PAYMENTS = 'payments'; + const FIELD_BUNQTO_STATUS = 'bunqto_status'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/PaymentChat.php b/src/Model/Generated/Endpoint/PaymentChat.php index 01f91383..378d0e5d 100644 --- a/src/Model/Generated/Endpoint/PaymentChat.php +++ b/src/Model/Generated/Endpoint/PaymentChat.php @@ -13,11 +13,6 @@ */ class PaymentChat extends BunqModel { - /** - * Field constants. - */ - const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; - /** * Endpoint constants. */ @@ -25,6 +20,11 @@ class PaymentChat extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/payment/%s/chat/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/payment/%s/chat'; + /** + * Field constants. + */ + const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/PermittedIp.php b/src/Model/Generated/Endpoint/PermittedIp.php index 653c76dc..f3288067 100644 --- a/src/Model/Generated/Endpoint/PermittedIp.php +++ b/src/Model/Generated/Endpoint/PermittedIp.php @@ -14,12 +14,6 @@ */ class PermittedIp extends BunqModel { - /** - * Field constants. - */ - const FIELD_IP = 'ip'; - const FIELD_STATUS = 'status'; - /** * Endpoint constants. */ @@ -28,6 +22,12 @@ class PermittedIp extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/credential-password-ip/%s/ip'; const ENDPOINT_URL_UPDATE = 'user/%s/credential-password-ip/%s/ip/%s'; + /** + * Field constants. + */ + const FIELD_IP = 'ip'; + const FIELD_STATUS = 'status'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/PromotionDisplay.php b/src/Model/Generated/Endpoint/PromotionDisplay.php index 4ec95c28..7efd7ce0 100644 --- a/src/Model/Generated/Endpoint/PromotionDisplay.php +++ b/src/Model/Generated/Endpoint/PromotionDisplay.php @@ -15,17 +15,17 @@ */ class PromotionDisplay extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATUS = 'status'; - /** * Endpoint constants. */ const ENDPOINT_URL_READ = 'user/%s/promotion-display/%s'; const ENDPOINT_URL_UPDATE = 'user/%s/promotion-display/%s'; + /** + * Field constants. + */ + const FIELD_STATUS = 'status'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/RequestInquiry.php b/src/Model/Generated/Endpoint/RequestInquiry.php index 044d0f75..0b614a91 100644 --- a/src/Model/Generated/Endpoint/RequestInquiry.php +++ b/src/Model/Generated/Endpoint/RequestInquiry.php @@ -24,6 +24,14 @@ */ class RequestInquiry extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/request-inquiry'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-inquiry/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-inquiry'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/request-inquiry/%s'; + /** * Field constants. */ @@ -41,14 +49,6 @@ class RequestInquiry extends BunqModel const FIELD_ALLOW_BUNQME = 'allow_bunqme'; const FIELD_REDIRECT_URL = 'redirect_url'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/request-inquiry'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-inquiry/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-inquiry'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/request-inquiry/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/RequestInquiryBatch.php b/src/Model/Generated/Endpoint/RequestInquiryBatch.php index d32a95b7..ed9f109e 100644 --- a/src/Model/Generated/Endpoint/RequestInquiryBatch.php +++ b/src/Model/Generated/Endpoint/RequestInquiryBatch.php @@ -15,13 +15,6 @@ */ class RequestInquiryBatch extends BunqModel { - /** - * Field constants. - */ - const FIELD_REQUEST_INQUIRIES = 'request_inquiries'; - const FIELD_STATUS = 'status'; - const FIELD_TOTAL_AMOUNT_INQUIRED = 'total_amount_inquired'; - /** * Endpoint constants. */ @@ -30,6 +23,13 @@ class RequestInquiryBatch extends BunqModel const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/request-inquiry-batch/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-inquiry-batch'; + /** + * Field constants. + */ + const FIELD_REQUEST_INQUIRIES = 'request_inquiries'; + const FIELD_STATUS = 'status'; + const FIELD_TOTAL_AMOUNT_INQUIRED = 'total_amount_inquired'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/RequestInquiryChat.php b/src/Model/Generated/Endpoint/RequestInquiryChat.php index bc9ff480..6723767e 100644 --- a/src/Model/Generated/Endpoint/RequestInquiryChat.php +++ b/src/Model/Generated/Endpoint/RequestInquiryChat.php @@ -17,11 +17,6 @@ */ class RequestInquiryChat extends BunqModel { - /** - * Field constants. - */ - const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; - /** * Endpoint constants. */ @@ -29,6 +24,11 @@ class RequestInquiryChat extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-inquiry/%s/chat/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-inquiry/%s/chat'; + /** + * Field constants. + */ + const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/RequestResponse.php b/src/Model/Generated/Endpoint/RequestResponse.php index 693f59a3..113f34d9 100644 --- a/src/Model/Generated/Endpoint/RequestResponse.php +++ b/src/Model/Generated/Endpoint/RequestResponse.php @@ -22,6 +22,13 @@ */ class RequestResponse extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-response/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-response'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/request-response/%s'; + /** * Field constants. */ @@ -30,13 +37,6 @@ class RequestResponse extends BunqModel const FIELD_ADDRESS_SHIPPING = 'address_shipping'; const FIELD_ADDRESS_BILLING = 'address_billing'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-response/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-response'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/request-response/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/RequestResponseChat.php b/src/Model/Generated/Endpoint/RequestResponseChat.php index 0c83531e..2e06ca51 100644 --- a/src/Model/Generated/Endpoint/RequestResponseChat.php +++ b/src/Model/Generated/Endpoint/RequestResponseChat.php @@ -17,11 +17,6 @@ */ class RequestResponseChat extends BunqModel { - /** - * Field constants. - */ - const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; - /** * Endpoint constants. */ @@ -29,6 +24,11 @@ class RequestResponseChat extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/request-response/%s/chat/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/request-response/%s/chat'; + /** + * Field constants. + */ + const FIELD_LAST_READ_MESSAGE_ID = 'last_read_message_id'; + /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/Schedule.php b/src/Model/Generated/Endpoint/Schedule.php index bc8439c8..8f213bad 100644 --- a/src/Model/Generated/Endpoint/Schedule.php +++ b/src/Model/Generated/Endpoint/Schedule.php @@ -5,6 +5,7 @@ use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; +use bunq\Model\Generated\Object\ScheduleAnchorObject; /** * view for reading the scheduled definitions. @@ -19,11 +20,63 @@ class Schedule extends BunqModel const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/schedule/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/schedule'; + /** + * Field constants. + */ + const FIELD_TIME_START = 'time_start'; + const FIELD_TIME_END = 'time_end'; + const FIELD_RECURRENCE_UNIT = 'recurrence_unit'; + const FIELD_RECURRENCE_SIZE = 'recurrence_size'; + /** * Object type. */ const OBJECT_TYPE = 'Schedule'; + /** + * The schedule start time (UTC). + * + * @var string + */ + protected $timeStart; + + /** + * The schedule end time (UTC). + * + * @var string + */ + protected $timeEnd; + + /** + * The schedule recurrence unit, options: ONCE, HOURLY, DAILY, WEEKLY, + * MONTHLY, YEARLY + * + * @var string + */ + protected $recurrenceUnit; + + /** + * The schedule recurrence size. For example size 4 and unit WEEKLY means + * the recurrence is every 4 weeks. + * + * @var int + */ + protected $recurrenceSize; + + /** + * The schedule status, options: ACTIVE, FINISHED, CANCELLED. + * + * @var string + */ + protected $status; + + /** + * The scheduled object. (Payment, PaymentBatch) + * + * @var ScheduleAnchorObject + */ + protected $object; + /** * Get a specific schedule definition for a given monetary account. * @@ -86,4 +139,114 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar static::fromJsonList($responseRaw, self::OBJECT_TYPE) ); } + + /** + * The schedule start time (UTC). + * + * @return string + */ + public function getTimeStart() + { + return $this->timeStart; + } + + /** + * @param string $timeStart + */ + public function setTimeStart($timeStart) + { + $this->timeStart = $timeStart; + } + + /** + * The schedule end time (UTC). + * + * @return string + */ + public function getTimeEnd() + { + return $this->timeEnd; + } + + /** + * @param string $timeEnd + */ + public function setTimeEnd($timeEnd) + { + $this->timeEnd = $timeEnd; + } + + /** + * The schedule recurrence unit, options: ONCE, HOURLY, DAILY, WEEKLY, + * MONTHLY, YEARLY + * + * @return string + */ + public function getRecurrenceUnit() + { + return $this->recurrenceUnit; + } + + /** + * @param string $recurrenceUnit + */ + public function setRecurrenceUnit($recurrenceUnit) + { + $this->recurrenceUnit = $recurrenceUnit; + } + + /** + * The schedule recurrence size. For example size 4 and unit WEEKLY means + * the recurrence is every 4 weeks. + * + * @return int + */ + public function getRecurrenceSize() + { + return $this->recurrenceSize; + } + + /** + * @param int $recurrenceSize + */ + public function setRecurrenceSize($recurrenceSize) + { + $this->recurrenceSize = $recurrenceSize; + } + + /** + * The schedule status, options: ACTIVE, FINISHED, CANCELLED. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param string $status + */ + public function setStatus($status) + { + $this->status = $status; + } + + /** + * The scheduled object. (Payment, PaymentBatch) + * + * @return ScheduleAnchorObject + */ + public function getObject() + { + return $this->object; + } + + /** + * @param ScheduleAnchorObject $object + */ + public function setObject($object) + { + $this->object = $object; + } } diff --git a/src/Model/Generated/Endpoint/ScheduleInstance.php b/src/Model/Generated/Endpoint/ScheduleInstance.php index c63e86c1..2384ba04 100644 --- a/src/Model/Generated/Endpoint/ScheduleInstance.php +++ b/src/Model/Generated/Endpoint/ScheduleInstance.php @@ -6,6 +6,8 @@ use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; use bunq\Model\Generated\Object\Error; +use bunq\Model\Generated\Object\ScheduleAnchorObject; +use bunq\Model\Generated\Object\ScheduleInstanceAnchorObject; /** * view for reading, updating and listing the scheduled instance. @@ -14,11 +16,6 @@ */ class ScheduleInstance extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATE = 'state'; - /** * Endpoint constants. */ @@ -26,10 +23,15 @@ class ScheduleInstance extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/schedule/%s/schedule-instance/%s'; const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/schedule/%s/schedule-instance'; + /** + * Field constants. + */ + const FIELD_STATE = 'state'; + /** * Object type. */ - const OBJECT_TYPE = 'ScheduleInstance'; + const OBJECT_TYPE = 'ScheduledInstance'; /** * The state of the scheduleInstance. (FINISHED_SUCCESSFULLY, RETRY, @@ -62,16 +64,16 @@ class ScheduleInstance extends BunqModel protected $errorMessage; /** - * The scheduled object. + * The scheduled object. (Payment, PaymentBatch) * - * @var BunqModel + * @var ScheduleAnchorObject */ protected $scheduledObject; /** - * The result object of this schedule instance. (payment, payment batch) + * The result object of this schedule instance. (Payment, PaymentBatch) * - * @var BunqModel + * @var ScheduleInstanceAnchorObject */ protected $resultObject; @@ -111,9 +113,9 @@ public static function get(ApiContext $apiContext, int $userId, int $monetaryAcc * @param int $scheduleInstanceId * @param string[] $customHeaders * - * @return BunqResponseInt + * @return BunqResponseScheduleInstance */ - public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $scheduleId, int $scheduleInstanceId, array $customHeaders = []): BunqResponseInt + public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $scheduleId, int $scheduleInstanceId, array $customHeaders = []): BunqResponseScheduleInstance { $apiClient = new ApiClient($apiContext); $responseRaw = $apiClient->put( @@ -125,8 +127,8 @@ public static function update(ApiContext $apiContext, array $requestMap, int $us $customHeaders ); - return BunqResponseInt::castFromBunqResponse( - static::processForId($responseRaw) + return BunqResponseScheduleInstance::castFromBunqResponse( + static::fromJson($responseRaw, self::OBJECT_TYPE) ); } @@ -235,9 +237,9 @@ public function setErrorMessage($errorMessage) } /** - * The scheduled object. + * The scheduled object. (Payment, PaymentBatch) * - * @return BunqModel + * @return ScheduleAnchorObject */ public function getScheduledObject() { @@ -245,7 +247,7 @@ public function getScheduledObject() } /** - * @param BunqModel $scheduledObject + * @param ScheduleAnchorObject $scheduledObject */ public function setScheduledObject($scheduledObject) { @@ -253,9 +255,9 @@ public function setScheduledObject($scheduledObject) } /** - * The result object of this schedule instance. (payment, payment batch) + * The result object of this schedule instance. (Payment, PaymentBatch) * - * @return BunqModel + * @return ScheduleInstanceAnchorObject */ public function getResultObject() { @@ -263,7 +265,7 @@ public function getResultObject() } /** - * @param BunqModel $resultObject + * @param ScheduleInstanceAnchorObject $resultObject */ public function setResultObject($resultObject) { diff --git a/src/Model/Generated/Endpoint/SchedulePayment.php b/src/Model/Generated/Endpoint/SchedulePayment.php index 56ccf7b6..794e42ad 100644 --- a/src/Model/Generated/Endpoint/SchedulePayment.php +++ b/src/Model/Generated/Endpoint/SchedulePayment.php @@ -5,7 +5,6 @@ use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; -use bunq\Model\Generated\Object\Schedule; use bunq\Model\Generated\Object\SchedulePaymentEntry; /** @@ -15,12 +14,6 @@ */ class SchedulePayment extends BunqModel { - /** - * Field constants. - */ - const FIELD_PAYMENT = 'payment'; - const FIELD_SCHEDULE = 'schedule'; - /** * Endpoint constants. */ @@ -30,10 +23,16 @@ class SchedulePayment extends BunqModel const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/schedule-payment'; const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/schedule-payment/%s'; + /** + * Field constants. + */ + const FIELD_PAYMENT = 'payment'; + const FIELD_SCHEDULE = 'schedule'; + /** * Object type. */ - const OBJECT_TYPE = 'SchedulePayment'; + const OBJECT_TYPE = 'ScheduledPayment'; /** * The payment details. @@ -163,9 +162,9 @@ public static function listing(ApiContext $apiContext, int $userId, int $monetar * @param int $schedulePaymentId * @param string[] $customHeaders * - * @return BunqResponseInt + * @return BunqResponseSchedulePayment */ - public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $schedulePaymentId, array $customHeaders = []): BunqResponseInt + public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $schedulePaymentId, array $customHeaders = []): BunqResponseSchedulePayment { $apiClient = new ApiClient($apiContext); $responseRaw = $apiClient->put( @@ -177,8 +176,8 @@ public static function update(ApiContext $apiContext, array $requestMap, int $us $customHeaders ); - return BunqResponseInt::castFromBunqResponse( - static::processForId($responseRaw) + return BunqResponseSchedulePayment::castFromBunqResponse( + static::fromJson($responseRaw, self::OBJECT_TYPE) ); } diff --git a/src/Model/Generated/Endpoint/SchedulePaymentBatch.php b/src/Model/Generated/Endpoint/SchedulePaymentBatch.php index 7ca7f30c..e5403844 100644 --- a/src/Model/Generated/Endpoint/SchedulePaymentBatch.php +++ b/src/Model/Generated/Endpoint/SchedulePaymentBatch.php @@ -5,7 +5,6 @@ use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; -use bunq\Model\Generated\Object\Schedule; use bunq\Model\Generated\Object\SchedulePaymentEntry; /** @@ -15,12 +14,6 @@ */ class SchedulePaymentBatch extends BunqModel { - /** - * Field constants. - */ - const FIELD_PAYMENTS = 'payments'; - const FIELD_SCHEDULE = 'schedule'; - /** * Endpoint constants. */ @@ -28,10 +21,16 @@ class SchedulePaymentBatch extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/schedule-payment-batch/%s'; const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/schedule-payment-batch/%s'; + /** + * Field constants. + */ + const FIELD_PAYMENTS = 'payments'; + const FIELD_SCHEDULE = 'schedule'; + /** * Object type. */ - const OBJECT_TYPE = 'SchedulePaymentBatch'; + const OBJECT_TYPE = 'ScheduledPaymentBatch'; /** * The payment details. @@ -81,9 +80,9 @@ public static function create(ApiContext $apiContext, array $requestMap, int $us * @param int $schedulePaymentBatchId * @param string[] $customHeaders * - * @return BunqResponseInt + * @return BunqResponseSchedulePaymentBatch */ - public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $schedulePaymentBatchId, array $customHeaders = []): BunqResponseInt + public static function update(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, int $schedulePaymentBatchId, array $customHeaders = []): BunqResponseSchedulePaymentBatch { $apiClient = new ApiClient($apiContext); $responseRaw = $apiClient->put( @@ -95,8 +94,8 @@ public static function update(ApiContext $apiContext, array $requestMap, int $us $customHeaders ); - return BunqResponseInt::castFromBunqResponse( - static::processForId($responseRaw) + return BunqResponseSchedulePaymentBatch::castFromBunqResponse( + static::fromJson($responseRaw, self::OBJECT_TYPE) ); } diff --git a/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php b/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php index 8b47e889..e92c7002 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankInquiry.php @@ -19,6 +19,14 @@ */ class ShareInviteBankInquiry extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/share-invite-bank-inquiry'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/share-invite-bank-inquiry/%s'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/share-invite-bank-inquiry/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/share-invite-bank-inquiry'; + /** * Field constants. */ @@ -26,17 +34,10 @@ class ShareInviteBankInquiry extends BunqModel const FIELD_DRAFT_SHARE_INVITE_BANK_ID = 'draft_share_invite_bank_id'; const FIELD_SHARE_DETAIL = 'share_detail'; const FIELD_STATUS = 'status'; + const FIELD_SHARE_TYPE = 'share_type'; const FIELD_START_DATE = 'start_date'; const FIELD_END_DATE = 'end_date'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/share-invite-bank-inquiry'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/share-invite-bank-inquiry/%s'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/share-invite-bank-inquiry/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/share-invite-bank-inquiry'; - /** * Object type. */ @@ -93,13 +94,21 @@ class ShareInviteBankInquiry extends BunqModel /** * The status of the share. Can be PENDING, REVOKED (the user deletes the - * share inquiry before it's accepted) or CANCELLED (the user deletes an - * active share). + * share inquiry before it's accepted), ACCEPTED, CANCELLED (the user + * deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, + * CANCELLATION_REJECTED (for canceling mutual connects) * * @var string */ protected $status; + /** + * The share type, either STANDARD or MUTUAL. + * + * @var string + */ + protected $shareType; + /** * The start date of this share. * @@ -369,8 +378,9 @@ public function setShareDetail($shareDetail) /** * The status of the share. Can be PENDING, REVOKED (the user deletes the - * share inquiry before it's accepted) or CANCELLED (the user deletes an - * active share). + * share inquiry before it's accepted), ACCEPTED, CANCELLED (the user + * deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, + * CANCELLATION_REJECTED (for canceling mutual connects) * * @return string */ @@ -387,6 +397,24 @@ public function setStatus($status) $this->status = $status; } + /** + * The share type, either STANDARD or MUTUAL. + * + * @return string + */ + public function getShareType() + { + return $this->shareType; + } + + /** + * @param string $shareType + */ + public function setShareType($shareType) + { + $this->shareType = $shareType; + } + /** * The start date of this share. * diff --git a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php index f421ae7d..64be6cb6 100644 --- a/src/Model/Generated/Endpoint/ShareInviteBankResponse.php +++ b/src/Model/Generated/Endpoint/ShareInviteBankResponse.php @@ -18,11 +18,6 @@ */ class ShareInviteBankResponse extends BunqModel { - /** - * Field constants. - */ - const FIELD_STATUS = 'status'; - /** * Endpoint constants. */ @@ -30,6 +25,11 @@ class ShareInviteBankResponse extends BunqModel const ENDPOINT_URL_UPDATE = 'user/%s/share-invite-bank-response/%s'; const ENDPOINT_URL_LISTING = 'user/%s/share-invite-bank-response'; + /** + * Field constants. + */ + const FIELD_STATUS = 'status'; + /** * Object type. */ @@ -72,18 +72,22 @@ class ShareInviteBankResponse extends BunqModel protected $shareDetail; /** - * The status of the share. Can be ACCEPTED (other user scans the QR and - * accepts the share), REVOKED (other user scans the QR but denies the - * share), CANCELLED (other user cancels an existing share), EXPIRED (other - * user did not react before expiration), PENDING (share is waiting for - * reply by the other user) or REJECTED (share initiated by other user but - * rejected). Once the share's status becomes REVOKED, CANCELLED, EXPIRED or - * REJECTED, its status can no longer be updated. + * The status of the share. Can be PENDING, REVOKED (the user deletes the + * share inquiry before it's accepted), ACCEPTED, CANCELLED (the user + * deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, + * CANCELLATION_REJECTED (for canceling mutual connects) * * @var string */ protected $status; + /** + * The share type: STANDARD. + * + * @var string + */ + protected $shareType; + /** * The start date of this share. * @@ -283,13 +287,10 @@ public function setShareDetail($shareDetail) } /** - * The status of the share. Can be ACCEPTED (other user scans the QR and - * accepts the share), REVOKED (other user scans the QR but denies the - * share), CANCELLED (other user cancels an existing share), EXPIRED (other - * user did not react before expiration), PENDING (share is waiting for - * reply by the other user) or REJECTED (share initiated by other user but - * rejected). Once the share's status becomes REVOKED, CANCELLED, EXPIRED or - * REJECTED, its status can no longer be updated. + * The status of the share. Can be PENDING, REVOKED (the user deletes the + * share inquiry before it's accepted), ACCEPTED, CANCELLED (the user + * deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, + * CANCELLATION_REJECTED (for canceling mutual connects) * * @return string */ @@ -306,6 +307,24 @@ public function setStatus($status) $this->status = $status; } + /** + * The share type: STANDARD. + * + * @return string + */ + public function getShareType() + { + return $this->shareType; + } + + /** + * @param string $shareType + */ + public function setShareType($shareType) + { + $this->shareType = $shareType; + } + /** * The start date of this share. * diff --git a/src/Model/Generated/Endpoint/Tab.php b/src/Model/Generated/Endpoint/Tab.php index a260c3b8..c890c247 100644 --- a/src/Model/Generated/Endpoint/Tab.php +++ b/src/Model/Generated/Endpoint/Tab.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -19,6 +20,11 @@ */ class Tab extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -132,4 +138,21 @@ public function setTabUsageMultiple($tabUsageMultiple) { $this->tabUsageMultiple = $tabUsageMultiple; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->tabUsageSingle)) { + return $this->tabUsageSingle; + } + + if (!is_null($this->tabUsageMultiple)) { + return $this->tabUsageMultiple; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/TabItemShop.php b/src/Model/Generated/Endpoint/TabItemShop.php index 095805e2..0d124c47 100644 --- a/src/Model/Generated/Endpoint/TabItemShop.php +++ b/src/Model/Generated/Endpoint/TabItemShop.php @@ -22,6 +22,15 @@ */ class TabItemShop extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; + const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; + /** * Field constants. */ @@ -32,15 +41,6 @@ class TabItemShop extends BunqModel const FIELD_QUANTITY = 'quantity'; const FIELD_AMOUNT = 'amount'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; - const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/TabItemShopBatch.php b/src/Model/Generated/Endpoint/TabItemShopBatch.php index c11a074f..b8e1ed7f 100644 --- a/src/Model/Generated/Endpoint/TabItemShopBatch.php +++ b/src/Model/Generated/Endpoint/TabItemShopBatch.php @@ -14,14 +14,14 @@ class TabItemShopBatch extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - const FIELD_TAB_ITEMS = 'tab_items'; + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item-batch'; /** - * Endpoint constants. + * Field constants. */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab/%s/tab-item-batch'; + const FIELD_TAB_ITEMS = 'tab_items'; /** * Object type. diff --git a/src/Model/Generated/Endpoint/TabUsageMultiple.php b/src/Model/Generated/Endpoint/TabUsageMultiple.php index a95c3c50..963b7a55 100644 --- a/src/Model/Generated/Endpoint/TabUsageMultiple.php +++ b/src/Model/Generated/Endpoint/TabUsageMultiple.php @@ -26,6 +26,15 @@ */ class TabUsageMultiple extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; + const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple'; + /** * Field constants. */ @@ -42,15 +51,6 @@ class TabUsageMultiple extends BunqModel const FIELD_EXPIRATION = 'expiration'; const FIELD_TAB_ATTACHMENT = 'tab_attachment'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; - const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-multiple'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/TabUsageSingle.php b/src/Model/Generated/Endpoint/TabUsageSingle.php index 2bd6c7d6..b9de3deb 100644 --- a/src/Model/Generated/Endpoint/TabUsageSingle.php +++ b/src/Model/Generated/Endpoint/TabUsageSingle.php @@ -26,6 +26,15 @@ */ class TabUsageSingle extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single'; + const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; + const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; + const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; + const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single'; + /** * Field constants. */ @@ -43,15 +52,6 @@ class TabUsageSingle extends BunqModel const FIELD_EXPIRATION = 'expiration'; const FIELD_TAB_ATTACHMENT = 'tab_attachment'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_CREATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single'; - const ENDPOINT_URL_UPDATE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; - const ENDPOINT_URL_DELETE = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; - const ENDPOINT_URL_READ = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single/%s'; - const ENDPOINT_URL_LISTING = 'user/%s/monetary-account/%s/cash-register/%s/tab-usage-single'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php b/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php index 58f1ac47..def7294e 100644 --- a/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php +++ b/src/Model/Generated/Endpoint/TokenQrRequestIdeal.php @@ -24,14 +24,14 @@ class TokenQrRequestIdeal extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - const FIELD_TOKEN = 'token'; + const ENDPOINT_URL_CREATE = 'user/%s/token-qr-request-ideal'; /** - * Endpoint constants. + * Field constants. */ - const ENDPOINT_URL_CREATE = 'user/%s/token-qr-request-ideal'; + const FIELD_TOKEN = 'token'; /** * Object type. diff --git a/src/Model/Generated/Endpoint/User.php b/src/Model/Generated/Endpoint/User.php index a41840c4..b2d5ac61 100644 --- a/src/Model/Generated/Endpoint/User.php +++ b/src/Model/Generated/Endpoint/User.php @@ -2,6 +2,7 @@ namespace bunq\Model\Generated\Endpoint; use bunq\Context\ApiContext; +use bunq\exception\BunqException; use bunq\Http\ApiClient; use bunq\Http\BunqResponse; use bunq\Model\Core\BunqModel; @@ -14,6 +15,11 @@ */ class User extends BunqModel { + /** + * Error constants. + */ + const ERROR_NULL_FIELDS = 'All fields of an extended model or object are null.'; + /** * Endpoint constants. */ @@ -142,4 +148,25 @@ public function setUserCompany($userCompany) { $this->userCompany = $userCompany; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->userLight)) { + return $this->userLight; + } + + if (!is_null($this->userPerson)) { + return $this->userPerson; + } + + if (!is_null($this->userCompany)) { + return $this->userCompany; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Endpoint/UserCompany.php b/src/Model/Generated/Endpoint/UserCompany.php index 456f7f7c..f6dda727 100644 --- a/src/Model/Generated/Endpoint/UserCompany.php +++ b/src/Model/Generated/Endpoint/UserCompany.php @@ -23,6 +23,12 @@ */ class UserCompany extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_READ = 'user-company/%s'; + const ENDPOINT_URL_UPDATE = 'user-company/%s'; + /** * Field constants. */ @@ -43,12 +49,6 @@ class UserCompany extends BunqModel const FIELD_COUNTER_BANK_IBAN = 'counter_bank_iban'; const FIELD_NOTIFICATION_FILTERS = 'notification_filters'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_READ = 'user-company/%s'; - const ENDPOINT_URL_UPDATE = 'user-company/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/UserLight.php b/src/Model/Generated/Endpoint/UserLight.php index 04c03a83..6fad6844 100644 --- a/src/Model/Generated/Endpoint/UserLight.php +++ b/src/Model/Generated/Endpoint/UserLight.php @@ -19,6 +19,11 @@ */ class UserLight extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_READ = 'user-light/%s'; + /** * Field constants. */ @@ -51,11 +56,6 @@ class UserLight extends BunqModel const FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = 'daily_limit_without_confirmation_login'; const FIELD_NOTIFICATION_FILTERS = 'notification_filters'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_READ = 'user-light/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Endpoint/UserPerson.php b/src/Model/Generated/Endpoint/UserPerson.php index 0a972e7f..f3d7ef03 100644 --- a/src/Model/Generated/Endpoint/UserPerson.php +++ b/src/Model/Generated/Endpoint/UserPerson.php @@ -22,6 +22,12 @@ */ class UserPerson extends BunqModel { + /** + * Endpoint constants. + */ + const ENDPOINT_URL_READ = 'user-person/%s'; + const ENDPOINT_URL_UPDATE = 'user-person/%s'; + /** * Field constants. */ @@ -53,12 +59,6 @@ class UserPerson extends BunqModel const FIELD_COUNTER_BANK_IBAN = 'counter_bank_iban'; const FIELD_NOTIFICATION_FILTERS = 'notification_filters'; - /** - * Endpoint constants. - */ - const ENDPOINT_URL_READ = 'user-person/%s'; - const ENDPOINT_URL_UPDATE = 'user-person/%s'; - /** * Object type. */ diff --git a/src/Model/Generated/Object/AnchoredObject.php b/src/Model/Generated/Object/AnchoredObject.php index 88a75c84..86cac134 100644 --- a/src/Model/Generated/Object/AnchoredObject.php +++ b/src/Model/Generated/Object/AnchoredObject.php @@ -1,6 +1,7 @@ userCredentialPasswordIp = $userCredentialPasswordIp; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->cardDebit)) { + return $this->cardDebit; + } + + if (!is_null($this->cardPinChange)) { + return $this->cardPinChange; + } + + if (!is_null($this->cardResult)) { + return $this->cardResult; + } + + if (!is_null($this->draftPayment)) { + return $this->draftPayment; + } + + if (!is_null($this->idealMerchantTransaction)) { + return $this->idealMerchantTransaction; + } + + if (!is_null($this->invoice)) { + return $this->invoice; + } + + if (!is_null($this->payment)) { + return $this->payment; + } + + if (!is_null($this->paymentBatch)) { + return $this->paymentBatch; + } + + if (!is_null($this->promotionDisplay)) { + return $this->promotionDisplay; + } + + if (!is_null($this->requestInquiryBatch)) { + return $this->requestInquiryBatch; + } + + if (!is_null($this->requestInquiry)) { + return $this->requestInquiry; + } + + if (!is_null($this->requestResponse)) { + return $this->requestResponse; + } + + if (!is_null($this->scheduledPaymentBatch)) { + return $this->scheduledPaymentBatch; + } + + if (!is_null($this->scheduledPayment)) { + return $this->scheduledPayment; + } + + if (!is_null($this->scheduledInstance)) { + return $this->scheduledInstance; + } + + if (!is_null($this->shareInviteBankInquiry)) { + return $this->shareInviteBankInquiry; + } + + if (!is_null($this->shareInviteBankResponse)) { + return $this->shareInviteBankResponse; + } + + if (!is_null($this->userCredentialPasswordIp)) { + return $this->userCredentialPasswordIp; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Object/ChatMessageContent.php b/src/Model/Generated/Object/ChatMessageContent.php index 54c401ac..7108b651 100644 --- a/src/Model/Generated/Object/ChatMessageContent.php +++ b/src/Model/Generated/Object/ChatMessageContent.php @@ -1,6 +1,7 @@ chatMessageContentText = $chatMessageContentText; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->chatMessageContentAnchorEvent)) { + return $this->chatMessageContentAnchorEvent; + } + + if (!is_null($this->chatMessageContentAttachment)) { + return $this->chatMessageContentAttachment; + } + + if (!is_null($this->chatMessageContentGeolocation)) { + return $this->chatMessageContentGeolocation; + } + + if (!is_null($this->chatMessageContentStatusConversationTitle)) { + return $this->chatMessageContentStatusConversationTitle; + } + + if (!is_null($this->chatMessageContentStatusConversation)) { + return $this->chatMessageContentStatusConversation; + } + + if (!is_null($this->chatMessageContentStatusMembership)) { + return $this->chatMessageContentStatusMembership; + } + + if (!is_null($this->chatMessageContentText)) { + return $this->chatMessageContentText; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Object/DraftPaymentAnchorObject.php b/src/Model/Generated/Object/DraftPaymentAnchorObject.php index 40ce8a91..8a7b3bbd 100644 --- a/src/Model/Generated/Object/DraftPaymentAnchorObject.php +++ b/src/Model/Generated/Object/DraftPaymentAnchorObject.php @@ -1,6 +1,7 @@ paymentBatch = $paymentBatch; } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->payment)) { + return $this->payment; + } + + if (!is_null($this->paymentBatch)) { + return $this->paymentBatch; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } } diff --git a/src/Model/Generated/Object/NotificationAnchorObject.php b/src/Model/Generated/Object/NotificationAnchorObject.php new file mode 100644 index 00000000..2ba5d2b2 --- /dev/null +++ b/src/Model/Generated/Object/NotificationAnchorObject.php @@ -0,0 +1,649 @@ +bunqMeTab; + } + + /** + * @param BunqMeTab $bunqMeTab + */ + public function setBunqMeTab($bunqMeTab) + { + $this->bunqMeTab = $bunqMeTab; + } + + /** + * @return BunqMeTabResultInquiry + */ + public function getBunqMeTabResultInquiry() + { + return $this->bunqMeTabResultInquiry; + } + + /** + * @param BunqMeTabResultInquiry $bunqMeTabResultInquiry + */ + public function setBunqMeTabResultInquiry($bunqMeTabResultInquiry) + { + $this->bunqMeTabResultInquiry = $bunqMeTabResultInquiry; + } + + /** + * @return BunqMeTabResultResponse + */ + public function getBunqMeTabResultResponse() + { + return $this->bunqMeTabResultResponse; + } + + /** + * @param BunqMeTabResultResponse $bunqMeTabResultResponse + */ + public function setBunqMeTabResultResponse($bunqMeTabResultResponse) + { + $this->bunqMeTabResultResponse = $bunqMeTabResultResponse; + } + + /** + * @return ChatMessageStatus + */ + public function getChatMessageStatus() + { + return $this->chatMessageStatus; + } + + /** + * @param ChatMessageStatus $chatMessageStatus + */ + public function setChatMessageStatus($chatMessageStatus) + { + $this->chatMessageStatus = $chatMessageStatus; + } + + /** + * @return ChatMessageUser + */ + public function getChatMessageUser() + { + return $this->chatMessageUser; + } + + /** + * @param ChatMessageUser $chatMessageUser + */ + public function setChatMessageUser($chatMessageUser) + { + $this->chatMessageUser = $chatMessageUser; + } + + /** + * @return ChatMessageAnnouncement + */ + public function getChatMessageAnnouncement() + { + return $this->chatMessageAnnouncement; + } + + /** + * @param ChatMessageAnnouncement $chatMessageAnnouncement + */ + public function setChatMessageAnnouncement($chatMessageAnnouncement) + { + $this->chatMessageAnnouncement = $chatMessageAnnouncement; + } + + /** + * @return DraftPayment + */ + public function getDraftPayment() + { + return $this->draftPayment; + } + + /** + * @param DraftPayment $draftPayment + */ + public function setDraftPayment($draftPayment) + { + $this->draftPayment = $draftPayment; + } + + /** + * @return IdealMerchantTransaction + */ + public function getIdealMerchantTransaction() + { + return $this->idealMerchantTransaction; + } + + /** + * @param IdealMerchantTransaction $idealMerchantTransaction + */ + public function setIdealMerchantTransaction($idealMerchantTransaction) + { + $this->idealMerchantTransaction = $idealMerchantTransaction; + } + + /** + * @return Invoice + */ + public function getInvoice() + { + return $this->invoice; + } + + /** + * @param Invoice $invoice + */ + public function setInvoice($invoice) + { + $this->invoice = $invoice; + } + + /** + * @return MasterCardAction + */ + public function getMasterCardAction() + { + return $this->masterCardAction; + } + + /** + * @param MasterCardAction $masterCardAction + */ + public function setMasterCardAction($masterCardAction) + { + $this->masterCardAction = $masterCardAction; + } + + /** + * @return MonetaryAccountBank + */ + public function getMonetaryAccountBank() + { + return $this->monetaryAccountBank; + } + + /** + * @param MonetaryAccountBank $monetaryAccountBank + */ + public function setMonetaryAccountBank($monetaryAccountBank) + { + $this->monetaryAccountBank = $monetaryAccountBank; + } + + /** + * @return Payment + */ + public function getPayment() + { + return $this->payment; + } + + /** + * @param Payment $payment + */ + public function setPayment($payment) + { + $this->payment = $payment; + } + + /** + * @return PaymentBatch + */ + public function getPaymentBatch() + { + return $this->paymentBatch; + } + + /** + * @param PaymentBatch $paymentBatch + */ + public function setPaymentBatch($paymentBatch) + { + $this->paymentBatch = $paymentBatch; + } + + /** + * @return RequestInquiry + */ + public function getRequestInquiry() + { + return $this->requestInquiry; + } + + /** + * @param RequestInquiry $requestInquiry + */ + public function setRequestInquiry($requestInquiry) + { + $this->requestInquiry = $requestInquiry; + } + + /** + * @return RequestInquiryBatch + */ + public function getRequestInquiryBatch() + { + return $this->requestInquiryBatch; + } + + /** + * @param RequestInquiryBatch $requestInquiryBatch + */ + public function setRequestInquiryBatch($requestInquiryBatch) + { + $this->requestInquiryBatch = $requestInquiryBatch; + } + + /** + * @return RequestResponse + */ + public function getRequestResponse() + { + return $this->requestResponse; + } + + /** + * @param RequestResponse $requestResponse + */ + public function setRequestResponse($requestResponse) + { + $this->requestResponse = $requestResponse; + } + + /** + * @return ShareInviteBankInquiry + */ + public function getShareInviteBankInquiry() + { + return $this->shareInviteBankInquiry; + } + + /** + * @param ShareInviteBankInquiry $shareInviteBankInquiry + */ + public function setShareInviteBankInquiry($shareInviteBankInquiry) + { + $this->shareInviteBankInquiry = $shareInviteBankInquiry; + } + + /** + * @return ShareInviteBankResponse + */ + public function getShareInviteBankResponse() + { + return $this->shareInviteBankResponse; + } + + /** + * @param ShareInviteBankResponse $shareInviteBankResponse + */ + public function setShareInviteBankResponse($shareInviteBankResponse) + { + $this->shareInviteBankResponse = $shareInviteBankResponse; + } + + /** + * @return SchedulePayment + */ + public function getScheduledPayment() + { + return $this->scheduledPayment; + } + + /** + * @param SchedulePayment $scheduledPayment + */ + public function setScheduledPayment($scheduledPayment) + { + $this->scheduledPayment = $scheduledPayment; + } + + /** + * @return ScheduleInstance + */ + public function getScheduledInstance() + { + return $this->scheduledInstance; + } + + /** + * @param ScheduleInstance $scheduledInstance + */ + public function setScheduledInstance($scheduledInstance) + { + $this->scheduledInstance = $scheduledInstance; + } + + /** + * @return TabResultInquiry + */ + public function getTabResultInquiry() + { + return $this->tabResultInquiry; + } + + /** + * @param TabResultInquiry $tabResultInquiry + */ + public function setTabResultInquiry($tabResultInquiry) + { + $this->tabResultInquiry = $tabResultInquiry; + } + + /** + * @return TabResultResponse + */ + public function getTabResultResponse() + { + return $this->tabResultResponse; + } + + /** + * @param TabResultResponse $tabResultResponse + */ + public function setTabResultResponse($tabResultResponse) + { + $this->tabResultResponse = $tabResultResponse; + } + + /** + * @return UserPerson + */ + public function getUserPerson() + { + return $this->userPerson; + } + + /** + * @param UserPerson $userPerson + */ + public function setUserPerson($userPerson) + { + $this->userPerson = $userPerson; + } + + /** + * @return UserCompany + */ + public function getUserCompany() + { + return $this->userCompany; + } + + /** + * @param UserCompany $userCompany + */ + public function setUserCompany($userCompany) + { + $this->userCompany = $userCompany; + } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->bunqMeTab)) { + return $this->bunqMeTab; + } + + if (!is_null($this->bunqMeTabResultInquiry)) { + return $this->bunqMeTabResultInquiry; + } + + if (!is_null($this->bunqMeTabResultResponse)) { + return $this->bunqMeTabResultResponse; + } + + if (!is_null($this->chatMessageStatus)) { + return $this->chatMessageStatus; + } + + if (!is_null($this->chatMessageUser)) { + return $this->chatMessageUser; + } + + if (!is_null($this->chatMessageAnnouncement)) { + return $this->chatMessageAnnouncement; + } + + if (!is_null($this->draftPayment)) { + return $this->draftPayment; + } + + if (!is_null($this->idealMerchantTransaction)) { + return $this->idealMerchantTransaction; + } + + if (!is_null($this->invoice)) { + return $this->invoice; + } + + if (!is_null($this->masterCardAction)) { + return $this->masterCardAction; + } + + if (!is_null($this->monetaryAccountBank)) { + return $this->monetaryAccountBank; + } + + if (!is_null($this->payment)) { + return $this->payment; + } + + if (!is_null($this->paymentBatch)) { + return $this->paymentBatch; + } + + if (!is_null($this->requestInquiry)) { + return $this->requestInquiry; + } + + if (!is_null($this->requestInquiryBatch)) { + return $this->requestInquiryBatch; + } + + if (!is_null($this->requestResponse)) { + return $this->requestResponse; + } + + if (!is_null($this->shareInviteBankInquiry)) { + return $this->shareInviteBankInquiry; + } + + if (!is_null($this->shareInviteBankResponse)) { + return $this->shareInviteBankResponse; + } + + if (!is_null($this->scheduledPayment)) { + return $this->scheduledPayment; + } + + if (!is_null($this->scheduledInstance)) { + return $this->scheduledInstance; + } + + if (!is_null($this->tabResultInquiry)) { + return $this->tabResultInquiry; + } + + if (!is_null($this->tabResultResponse)) { + return $this->tabResultResponse; + } + + if (!is_null($this->userPerson)) { + return $this->userPerson; + } + + if (!is_null($this->userCompany)) { + return $this->userCompany; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } +} diff --git a/src/Model/Generated/Object/NotificationUrl.php b/src/Model/Generated/Object/NotificationUrl.php new file mode 100644 index 00000000..5b7238d2 --- /dev/null +++ b/src/Model/Generated/Object/NotificationUrl.php @@ -0,0 +1,94 @@ +targetUrl; + } + + /** + * @param string $targetUrl + */ + public function setTargetUrl($targetUrl) + { + $this->targetUrl = $targetUrl; + } + + /** + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * @param string $category + */ + public function setCategory($category) + { + $this->category = $category; + } + + /** + * @return string + */ + public function getEventType() + { + return $this->eventType; + } + + /** + * @param string $eventType + */ + public function setEventType($eventType) + { + $this->eventType = $eventType; + } + + /** + * @return NotificationAnchorObject + */ + public function getObject() + { + return $this->object; + } + + /** + * @param NotificationAnchorObject $object + */ + public function setObject($object) + { + $this->object = $object; + } +} diff --git a/src/Model/Generated/Object/Schedule.php b/src/Model/Generated/Object/Schedule.php deleted file mode 100644 index a68b1086..00000000 --- a/src/Model/Generated/Object/Schedule.php +++ /dev/null @@ -1,176 +0,0 @@ -timeStart = $timeStart; - $this->recurrenceUnit = $recurrenceUnit; - $this->recurrenceSize = $recurrenceSize; - } - - /** - * The schedule start time (UTC). - * - * @return string - */ - public function getTimeStart() - { - return $this->timeStart; - } - - /** - * @param string $timeStart - */ - public function setTimeStart($timeStart) - { - $this->timeStart = $timeStart; - } - - /** - * The schedule end time (UTC). - * - * @return string - */ - public function getTimeEnd() - { - return $this->timeEnd; - } - - /** - * @param string $timeEnd - */ - public function setTimeEnd($timeEnd) - { - $this->timeEnd = $timeEnd; - } - - /** - * The schedule recurrence unit, options: ONCE, HOURLY, DAILY, WEEKLY, - * MONTHLY, YEARLY - * - * @return string - */ - public function getRecurrenceUnit() - { - return $this->recurrenceUnit; - } - - /** - * @param string $recurrenceUnit - */ - public function setRecurrenceUnit($recurrenceUnit) - { - $this->recurrenceUnit = $recurrenceUnit; - } - - /** - * The schedule recurrence size. For example size 4 and unit WEEKLY means - * the recurrence is every 4 weeks. - * - * @return int - */ - public function getRecurrenceSize() - { - return $this->recurrenceSize; - } - - /** - * @param int $recurrenceSize - */ - public function setRecurrenceSize($recurrenceSize) - { - $this->recurrenceSize = $recurrenceSize; - } - - /** - * The schedule status, options: ACTIVE, FINISHED, CANCELLED. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * @param string $status - */ - public function setStatus($status) - { - $this->status = $status; - } - - /** - * The scheduled object. - * - * @return BunqModel - */ - public function getObject() - { - return $this->object; - } - - /** - * @param BunqModel $object - */ - public function setObject($object) - { - $this->object = $object; - } -} diff --git a/src/Model/Generated/Object/ScheduleAnchorObject.php b/src/Model/Generated/Object/ScheduleAnchorObject.php new file mode 100644 index 00000000..33323ff6 --- /dev/null +++ b/src/Model/Generated/Object/ScheduleAnchorObject.php @@ -0,0 +1,77 @@ +payment; + } + + /** + * @param Payment $payment + */ + public function setPayment($payment) + { + $this->payment = $payment; + } + + /** + * @return PaymentBatch + */ + public function getPaymentBatch() + { + return $this->paymentBatch; + } + + /** + * @param PaymentBatch $paymentBatch + */ + public function setPaymentBatch($paymentBatch) + { + $this->paymentBatch = $paymentBatch; + } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->payment)) { + return $this->payment; + } + + if (!is_null($this->paymentBatch)) { + return $this->paymentBatch; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } +} diff --git a/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php b/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php new file mode 100644 index 00000000..620d799a --- /dev/null +++ b/src/Model/Generated/Object/ScheduleInstanceAnchorObject.php @@ -0,0 +1,77 @@ +payment; + } + + /** + * @param Payment $payment + */ + public function setPayment($payment) + { + $this->payment = $payment; + } + + /** + * @return PaymentBatch + */ + public function getPaymentBatch() + { + return $this->paymentBatch; + } + + /** + * @param PaymentBatch $paymentBatch + */ + public function setPaymentBatch($paymentBatch) + { + $this->paymentBatch = $paymentBatch; + } + + /** + * @return BunqModel + * @throws BunqException + */ + public function getReferencedObject() + { + if (!is_null($this->payment)) { + return $this->payment; + } + + if (!is_null($this->paymentBatch)) { + return $this->paymentBatch; + } + + throw new BunqException(self::ERROR_NULL_FIELDS); + } +} diff --git a/tests/Config.php b/tests/Config.php index a2dc984e..ad66e04f 100644 --- a/tests/Config.php +++ b/tests/Config.php @@ -12,7 +12,7 @@ class Config /** * The path where the config.json file is stored */ - const CONFIG_PATH = '/resource/config.json'; + const CONFIG_PATH = '/Resource/config.json'; /** * Delimiter between the IP addresses in the PERMITTED_IPS field. diff --git a/tests/JsonParserTest.php b/tests/JsonParserTest.php index 5d74407e..e88b7e44 100644 --- a/tests/JsonParserTest.php +++ b/tests/JsonParserTest.php @@ -36,8 +36,8 @@ class JsonParserTest extends TestCase /** * Resource location constants. */ - const RESOURCE_INSTALLATION_JSON = '/resource/installation.json'; - const RESOURCE_USER_COMPANY_JSON = '/resource/user_company.json'; + const RESOURCE_INSTALLATION_JSON = '/Resource/installation.json'; + const RESOURCE_USER_COMPANY_JSON = '/Resource/user_company.json'; /** * Function constants. diff --git a/tests/Model/Generated/Endpoint/AttachmentPublicTest.php b/tests/Model/Generated/Endpoint/AttachmentPublicTest.php index 141e5743..380b8b03 100644 --- a/tests/Model/Generated/Endpoint/AttachmentPublicTest.php +++ b/tests/Model/Generated/Endpoint/AttachmentPublicTest.php @@ -18,7 +18,7 @@ class AttachmentPublicTest extends BunqSdkTestBase /** * Points to the folder where attachments are located. */ - const PATH_ATTACHMENT = '/../../../resource/'; + const PATH_ATTACHMENT = '/../../../Resource/'; /** * @var string diff --git a/tests/Model/Generated/Endpoint/AvatarTest.php b/tests/Model/Generated/Endpoint/AvatarTest.php index 3cd08305..30503f80 100644 --- a/tests/Model/Generated/Endpoint/AvatarTest.php +++ b/tests/Model/Generated/Endpoint/AvatarTest.php @@ -24,7 +24,7 @@ class AvatarTest extends BunqSdkTestBase /** * Points to the directory where attachments are stored. */ - const PATH_ATTACHMENT = '/../../../resource/'; + const PATH_ATTACHMENT = '/../../../Resource/'; /** * @var string diff --git a/tests/Model/Generated/Object/NotificationUrlTest.php b/tests/Model/Generated/Object/NotificationUrlTest.php new file mode 100644 index 00000000..8f9190b4 --- /dev/null +++ b/tests/Model/Generated/Object/NotificationUrlTest.php @@ -0,0 +1,292 @@ +executeNotificationUrlTest( + self::JSON_PATH_MUTATION_MODEL, + Payment::class, + self::GETTER_PAYMENT + ); + } + + /** + */ + public function testBunqMeTabModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_BUNQ_ME_TAB_MODEL, + BunqMeTab::class, + self::GETTER_BUNQ_ME_TAB + ); + } + + /** + */ + public function testGetMonetaryAccountModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL, + MonetaryAccountBank::class, + self::GETTER_MONETARY_ACCOUNT_BANK + ); + } + + /** + */ + public function testPaymentBatchModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_PAYMENT_BATCH_MODEL, + PaymentBatch::class, + self::GETTER_PAYMENT_BATCH + ); + } + + /** + */ + public function testRequestResponse() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_REQUEST_RESPONSE_MODEL, + RequestResponse::class, + self::GETTER_REQUEST_RESPONSE + ); + } + + /** + */ + public function testRequestInquiryModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_REQUEST_INQUIRY_MODEL, + RequestInquiry::class, + self::GETTER_REQUEST_INQUIRY + ); + } + + /** + */ + public function testSchedulePaymentModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_SCHEDULE_PAYMENT_MODEL, + SchedulePayment::class, + self::GETTER_SCHEDULE_PAYMENT + ); + } + + /** + */ + public function testShareInviteBankResponse() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_SHARE_INVITE_BANK_RESPONSE_MODEL, + ShareInviteBankResponse::class, + self::GETTER_SHARE_INVITE_BANK_RESPONSE + ); + } + + /** + */ + public function testScheduledInstance() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_SCHEDULE_INSTANCE_MODEL, + ScheduleInstance::class, + self::GETTER_SCHEDULE_INSTANCE + ); + } + + /** + */ + public function testShareInviteBankInquiry() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_SHARE_INVITE_BANK_INQUIRY_MODEL, + ShareInviteBankInquiry::class, + self::GETTER_SHARE_INVITE_BANK_INQUIRY + ); + } + + /** + */ + public function testMasterCardAction() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_MASTER_CARD_ACTION_MODEL, + MasterCardAction::class, + self::GETTER_MASTER_CARD_ACTION + ); + } + + /** + */ + public function testChatMessageAnnouncementModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_CHAT_MESSAGE_ANNOUNCEMENT_MODEL, + ChatMessageAnnouncement::class, + self::GETTER_CHAT_MESSAGE_ANNOUNCEMENT + ); + } + + /** + */ + public function testDraftPaymentModel() + { + $this->executeNotificationUrlTest( + self::JSON_PATH_DRAFT_PAYMENT_MODEL, + DraftPayment::class, + self::GETTER_DRAFT_PAYMENT + ); + } + + /** + * @param string $expectedJsonFileName + * @param string $classNameExpected + * @param string $referencedObjectGetterName + */ + private function executeNotificationUrlTest( + string $expectedJsonFileName, + string $classNameExpected, + string $referencedObjectGetterName + ) { + $jsonExpectedString = FileUtil::getFileContents($expectedJsonFileName); + $notificationUrl = $this->getNotificationUrlFromJson($jsonExpectedString); + + $model = $notificationUrl->getObject()->$referencedObjectGetterName(); + $referencedModel = $notificationUrl->getObject()->getReferencedObject(); + + static::assertNotNull($model); + static::assertNotNull($referencedModel); + static::assertInstanceOf($classNameExpected, $referencedModel); + } + + /** + * @param string $jsonString + * + * @return NotificationUrl + */ + private function getNotificationUrlFromJson(string $jsonString): NotificationUrl + { + $json = json_decode($jsonString, true); + + static::assertNotNull($json, self::ERROR_ASSERT_JSON_DECODE_ERROR); + + $notificationObject = $this->getNotificationObjectJsonString($json); + $notificationUrl = NotificationUrl::createFromJsonString($notificationObject); + $notificationUrl = self::assertInstanceOfNotificationUrl($notificationUrl); + + static::assertNotNull($notificationUrl->getObject(), self::ERROR_ASSERT_OBJECT_IS_NULL_ERROR); + + return $notificationUrl; + } + + /** + * @param string[] $json + * + * @return string + */ + private function getNotificationObjectJsonString(array $json) + { + $this->assertJsonIsNotificationUrlJson($json); + + return json_encode($json[self::KEY_NOTIFICATION_URL_MODEL]); + } + + /** + * @param string[] $json + */ + private function assertJsonIsNotificationUrlJson(array $json) + { + static::assertArrayHasKey(self::KEY_NOTIFICATION_URL_MODEL, $json); + } + + /** + * @param BunqModel $model + * + * @return NotificationUrl + */ + private function assertInstanceOfNotificationUrl(BunqModel $model): NotificationUrl + { + static::assertInstanceOf(NotificationUrl::class, $model); + + /* @var NotificationUrl $model */ + + return $model; + } +} diff --git a/tests/README.md b/tests/README.md index f5554241..397d7223 100644 --- a/tests/README.md +++ b/tests/README.md @@ -32,7 +32,7 @@ are also tested :thumbs_up:. ## Configuration To run the tests you must first setup the test configuration JSON. The example -of a configuration file is located at [`tests/resource/config.example.json`](./resource/config.example.json). +of a configuration file is located at [`tests/Resource/config.example.json`](./Resource/config.example.json). In order to make use of the configuration file, please copy the example to the same directory, fill in your sandbox user data and rename the copy to config.json. ## Execution diff --git a/tests/resource/NotificationUrlJsons/BunqMeTab.json b/tests/resource/NotificationUrlJsons/BunqMeTab.json new file mode 100644 index 00000000..6b3fc920 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/BunqMeTab.json @@ -0,0 +1,77 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "BUNQME_TAB", + "event_type": "BUNQME_TAB_CREATED", + "object": { + "BunqMeTab": { + "id": 8, + "created": "2017-11-09 11:05:42.364451", + "updated": "2017-11-09 11:05:42.364451", + "time_expiry": "2017-12-09 11:05:42.361442", + "monetary_account_id": 32, + "status": "WAITING_FOR_PAYMENT", + "bunqme_tab_share_url": "https:\/\/bunq.me\/t\/4da1167c-01bc-4a91-a1e1-44a83e4fef2e", + "bunqme_tab_entry": { + "uuid": "4da1167c-01bc-4a91-a1e1-44a83e4fef2e", + "created": "2017-11-09 11:05:42.450462", + "updated": "2017-11-09 11:05:42.450462", + "amount_inquired": { + "currency": "EUR", + "value": "5.00" + }, + "status": "WAITING_FOR_PAYMENT", + "description": "Thank you for building this awesome feature!", + "alias": { + "iban": "NL18BUNQ2025104340", + "is_light": false, + "display_name": "B.O. Varb", + "avatar": { + "uuid": "b0005448-e385-4d6c-baef-244c295b524f", + "image": [ + { + "attachment_public_uuid": "0c872c0e-1c98-4eea-ba75-a36c6d0a40c7", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "353f4064-96bd-49d7-ac69-f87513726c80", + "display_name": "B.O. Varb", + "country": "NL", + "avatar": { + "uuid": "ec2dc709-c8dd-4868-b3e7-601338d88881", + "image": [ + { + "attachment_public_uuid": "7444998c-ff1d-4708-afe3-7b56e33c6f89", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "353f4064-96bd-49d7-ac69-f87513726c80" + }, + "public_nick_name": "Bravo O (nickname)" + }, + "country": "NL" + }, + "redirect_url": null, + "merchant_available": [ + { + "merchant_type": "IDEAL", + "available": true + }, + { + "merchant_type": "SOFORT", + "available": true + } + ] + }, + "result_inquiries": [] + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/ChatMessageAnnouncement.json b/tests/resource/NotificationUrlJsons/ChatMessageAnnouncement.json new file mode 100644 index 00000000..58ae5aa4 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/ChatMessageAnnouncement.json @@ -0,0 +1,21 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "BUNQME_TAB", + "event_type": "BUNQME_TAB_CREATED", + "object": { + "ChatMessageAnnouncement": { + "id": 30, + "created": "2017-09-05 12:00:00.912674", + "updated": "2017-09-05 12:00:00.912674", + "conversation_id": 3, + "content": { + "ChatMessageContentText": { + "text": "Hey! You have failed to pay more than five direct debits over the past 30 days. Although such things can happen, please keep in mind that we might be forced to take measures if we get a lot of complaints about it. To help prevent this we summarised some information which might prove useful.\n\nRead more here. https:\/\/www.bunq.com\/en\/direct-debits\/\n\nPlease let us know if you have any further questions, we would love to help you out!" + } + }, + "client_message_uuid": null + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/DraftPayment.json b/tests/resource/NotificationUrlJsons/DraftPayment.json new file mode 100644 index 00000000..8e739378 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/DraftPayment.json @@ -0,0 +1,203 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "DRAFT_PAYMENT", + "event_type": "DRAFT_PAYMENT_ACCEPTED", + "object": { + "DraftPayment": { + "id": 1, + "created": "2017-07-13 21:44:31.314437", + "updated": "2017-07-13 21:44:31.314437", + "monetary_account_id": 42, + "status": "PENDING", + "type": "BUNQ", + "user_alias_created": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "responses": null, + "entries": [ + { + "amount": { + "currency": "EUR", + "value": "46.26" + }, + "alias": { + "iban": "NL16BUNQ2025103794", + "is_light": false, + "display_name": "G. Mason", + "avatar": { + "uuid": "e3bc865a-83a8-4788-af62-4f0c38df8f0d", + "image": [ + { + "attachment_public_uuid": "62c88a57-3cd9-49f7-81dc-8f1a4fcc80ac", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": "NL49BUNQ2025104073", + "is_light": false, + "display_name": "Echo (nickname)", + "avatar": { + "uuid": "11ec9a66-3c18-4711-8586-36f32e262830", + "image": [ + { + "attachment_public_uuid": "63eb3676-058a-45f0-b81d-8b26ee2e4f21", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "688e4bdc-ec27-4d8e-942b-3aee7b5d15e9", + "display_name": "Echo (nickname)", + "country": "NL", + "avatar": { + "uuid": "3da21898-1535-43c9-9023-83333e776b8b", + "image": [ + { + "attachment_public_uuid": "6bb2b5d6-faee-4d5d-8284-af026bde3640", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "688e4bdc-ec27-4d8e-942b-3aee7b5d15e9" + }, + "public_nick_name": "Echo (nickname)" + }, + "country": "NL" + }, + "description": "Test payment to NL49BUNQ2025104073", + "type": "BUNQ", + "attachment": [], + "merchant_reference": null + }, + { + "amount": { + "currency": "EUR", + "value": "2.56" + }, + "alias": { + "iban": "NL16BUNQ2025103794", + "is_light": false, + "display_name": "G. Mason", + "avatar": { + "uuid": "e3bc865a-83a8-4788-af62-4f0c38df8f0d", + "image": [ + { + "attachment_public_uuid": "62c88a57-3cd9-49f7-81dc-8f1a4fcc80ac", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": "NL32BUNQ2025103506", + "is_light": false, + "display_name": "Niels (nickname)", + "avatar": { + "uuid": "e47f5214-2198-4605-886c-9950714476f3", + "image": [ + { + "attachment_public_uuid": "3c7d4d11-d203-4ed4-b471-5b5e24079bf6", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da", + "display_name": "Niels (nickname)", + "country": "NL", + "avatar": { + "uuid": "ad92c001-a4ec-4344-89ad-bf6a6b0e5628", + "image": [ + { + "attachment_public_uuid": "2b7bc30e-d6af-4440-90ba-a801cba3d8d7", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da" + }, + "public_nick_name": "Niels (nickname)" + }, + "country": "NL" + }, + "description": "Test payment to NL32BUNQ2025103506", + "type": "BUNQ", + "attachment": [], + "merchant_reference": null + } + ], + "object": null + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/MasterCardAction.json b/tests/resource/NotificationUrlJsons/MasterCardAction.json new file mode 100644 index 00000000..c39513d0 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/MasterCardAction.json @@ -0,0 +1,137 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "DRAFT_PAYMENT", + "event_type": "DRAFT_PAYMENT_ACCEPTED", + "object": { + "MasterCardAction": { + "id": 1, + "created": "2017-07-10 06:33:10.497530", + "updated": "2017-07-10 06:33:10.676651", + "monetary_account_id": 31, + "card_id": 2, + "amount_local": { + "currency": "EUR", + "value": "2.00" + }, + "amount_billing": { + "currency": "EUR", + "value": "2.00" + }, + "amount_original_local": { + "currency": "EUR", + "value": "2.00" + }, + "amount_original_billing": { + "currency": "EUR", + "value": "2.00" + }, + "amount_fee": { + "currency": "EUR", + "value": "0.00" + }, + "decision": "COUNTRY_NOT_PERMITTED", + "decision_description": "Card transaction was denied, because the country was not permitted in card settings.", + "decision_description_translated": "Card transaction was denied, because the country was not permitted in card settings.", + "description": "Spar city Sloterdijk Amsterdam, NL", + "authorisation_status": "BLOCKED", + "authorisation_type": "NORMAL_AUTHORISATION", + "city": "Amsterdam", + "alias": { + "iban": "NL88BUNQ2025103565", + "is_light": false, + "display_name": "B.O. Varb", + "avatar": { + "uuid": "0c245e21-e3bc-4bab-8880-7ca6d09691b5", + "image": [ + { + "attachment_public_uuid": "1441cea4-3f24-43d4-9f35-2dfd8ff7bc8c", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "353f4064-96bd-49d7-ac69-f87513726c80", + "display_name": "B.O. Varb", + "country": "NL", + "avatar": { + "uuid": "ec2dc709-c8dd-4868-b3e7-601338d88881", + "image": [ + { + "attachment_public_uuid": "7444998c-ff1d-4708-afe3-7b56e33c6f89", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "353f4064-96bd-49d7-ac69-f87513726c80" + }, + "public_nick_name": "Bravo O (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": null, + "is_light": null, + "display_name": "Spar city Sloterdijk", + "avatar": { + "uuid": "ed91da5e-6100-42ab-a5b1-bcbeab62cb96", + "image": [ + { + "attachment_public_uuid": "58b3df6c-bfa4-4a42-91b3-db0e7f2ac64e", + "height": 640, + "width": 640, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": null, + "display_name": "Spar city Sloterdijk", + "country": "NL", + "avatar": null, + "public_nick_name": "Spar city Sloterdijk" + }, + "country": "NL", + "merchant_category_code": "5411" + }, + "label_card": { + "uuid": "c3b99cac-3677-4311-841c-4a7bba7397f2", + "type": "MAESTRO", + "second_line": "Pets", + "expiry_date": "2021-07-31", + "status": "ACTIVE", + "label_user": { + "uuid": "353f4064-96bd-49d7-ac69-f87513726c80", + "display_name": "B.O. Varb", + "country": "NL", + "avatar": { + "uuid": "ec2dc709-c8dd-4868-b3e7-601338d88881", + "image": [ + { + "attachment_public_uuid": "7444998c-ff1d-4708-afe3-7b56e33c6f89", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "353f4064-96bd-49d7-ac69-f87513726c80" + }, + "public_nick_name": "Bravo O (nickname)" + } + }, + "token_status": null, + "reservation_expiry_time": null, + "applied_limit": null, + "conversation": null, + "allow_chat": true, + "pan_entry_mode_user": "ICC", + "eligible_whitelist_id": null + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/MonetaryAccountBank.json b/tests/resource/NotificationUrlJsons/MonetaryAccountBank.json new file mode 100644 index 00000000..84e603ca --- /dev/null +++ b/tests/resource/NotificationUrlJsons/MonetaryAccountBank.json @@ -0,0 +1,57 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "DRAFT_PAYMENT", + "event_type": "DRAFT_PAYMENT_ACCEPTED", + "object": { + "MonetaryAccountBank": { + "id": 21, + "created": "2017-07-08 00:42:33.951277", + "updated": "2017-07-08 00:42:33.951277", + "alias": [ + { + "type": "IBAN", + "value": "NL18BUNQ2025104049", + "name": "bunq" + } + ], + "avatar": { + "uuid": "246519c2-1280-4fd8-a864-ed9d313ceeba", + "image": [ + { + "attachment_public_uuid": "52613480-7bd1-4da4-be8a-4a15f78c085d", + "height": 126, + "width": 200, + "content_type|": "image\/jpeg" + } + ], + "anchor_uuid": "45631547-6bdb-479e-859b-192273964ed4" + }, + "balance": null, + "country": "NL", + "currency": "EUR", + "daily_limit": { + "currency": "EUR", + "value": "10000.00" + }, + "daily_spent": { + "currency": "EUR", + "value": "0.00" + }, + "description": "sofort", + "public_uuid": "45631547-6bdb-479e-859b-192273964ed4", + "status": "ACTIVE", + "sub_status": "NONE", + "timezone": "europe\/amsterdam", + "user_id": 214, + "monetary_account_profile": null, + "notification_filters": [], + "setting": null, + "overdraft_limit": { + "currency": "EUR", + "value": "0.00" + } + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/Mutation.json b/tests/resource/NotificationUrlJsons/Mutation.json new file mode 100644 index 00000000..7a1e3332 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/Mutation.json @@ -0,0 +1,86 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "MUTATION", + "event_type": "MUTATION_CREATED", + "object": { + "Payment": { + "id": 108864, + "created": "2017-11-08 11:20:03.950184", + "updated": "2017-11-08 11:20:03.950184", + "monetary_account_id": 213, + "amount": { + "currency": "EUR", + "value": "-24.95" + }, + "description": "73d6df4a 680498 Your order #1234567", + "type": "IDEAL", + "merchant_reference": null, + "maturity_date": "2017-11-08", + "alias": { + "iban": "NL86BUNQ2025105541", + "is_light": false, + "display_name": "D. Howard", + "avatar": { + "uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec", + "image": [ + { + "attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42", + "height": 1023, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1", + "display_name": "D. Howard", + "country": "NL", + "avatar": { + "uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc", + "image": [ + { + "attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980", + "height": 456, + "width": 456, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1" + }, + "public_nick_name": "Dominic (nick) premium \u2728" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": null, + "is_light": null, + "display_name": "BoekenGigant", + "label_user": { + "uuid": null, + "display_name": "BoekenGigant", + "country": "NL", + "avatar": null, + "public_nick_name": "BoekenGigant" + }, + "avatar": null, + "country": "NL" + }, + "attachment": [], + "geolocation": { + "latitude": 52.387862883215, + "longitude": 4.8333778222355, + "altitude": 0, + "radius": 65 + }, + "batch_id": null, + "conversation": null, + "allow_chat": true, + "scheduled_id": null, + "address_billing": null, + "address_shipping": null + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/PaymentBatch.json b/tests/resource/NotificationUrlJsons/PaymentBatch.json new file mode 100644 index 00000000..f0ffd9ae --- /dev/null +++ b/tests/resource/NotificationUrlJsons/PaymentBatch.json @@ -0,0 +1,247 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "PAYMENT", + "event_type": "PAYMENT_BATCH_CREATED", + "object": { + "PaymentBatch": { + "id": 1, + "created": "2017-07-13 01:57:39.399256", + "updated": "2017-07-13 01:57:39.399256", + "payments": [ + { + "id": 108864, + "created": "2017-11-08 11:20:03.950184", + "updated": "2017-11-08 11:20:03.950184", + "monetary_account_id": 213, + "amount": { + "currency": "EUR", + "value": "-24.95" + }, + "description": "73d6df4a 680498 Your order #1234567", + "type": "IDEAL", + "merchant_reference": null, + "maturity_date": "2017-11-08", + "alias": { + "iban": "NL86BUNQ2025105541", + "is_light": false, + "display_name": "D. Howard", + "avatar": { + "uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec", + "image": [ + { + "attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42", + "height": 1023, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1", + "display_name": "D. Howard", + "country": "NL", + "avatar": { + "uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc", + "image": [ + { + "attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980", + "height": 456, + "width": 456, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1" + }, + "public_nick_name": "Dominic (nick) premium \u2728" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": null, + "is_light": null, + "display_name": "BoekenGigant", + "label_user": { + "uuid": null, + "display_name": "BoekenGigant", + "country": "NL", + "avatar": null, + "public_nick_name": "BoekenGigant" + }, + "avatar": null, + "country": "NL" + }, + "attachment": [], + "geolocation": { + "latitude": 52.387862883215, + "longitude": 4.8333778222355, + "altitude": 0, + "radius": 65 + }, + "batch_id": null, + "conversation": null, + "allow_chat": true, + "scheduled_id": null, + "address_billing": null, + "address_shipping": null + }, + { + "id": 108864, + "created": "2017-11-08 11:20:03.950184", + "updated": "2017-11-08 11:20:03.950184", + "monetary_account_id": 213, + "amount": { + "currency": "EUR", + "value": "-24.95" + }, + "description": "73d6df4a 680498 Your order #1234567", + "type": "IDEAL", + "merchant_reference": null, + "maturity_date": "2017-11-08", + "alias": { + "iban": "NL86BUNQ2025105541", + "is_light": false, + "display_name": "D. Howard", + "avatar": { + "uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec", + "image": [ + { + "attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42", + "height": 1023, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1", + "display_name": "D. Howard", + "country": "NL", + "avatar": { + "uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc", + "image": [ + { + "attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980", + "height": 456, + "width": 456, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1" + }, + "public_nick_name": "Dominic (nick) premium \u2728" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": null, + "is_light": null, + "display_name": "BoekenGigant", + "label_user": { + "uuid": null, + "display_name": "BoekenGigant", + "country": "NL", + "avatar": null, + "public_nick_name": "BoekenGigant" + }, + "avatar": null, + "country": "NL" + }, + "attachment": [], + "geolocation": { + "latitude": 52.387862883215, + "longitude": 4.8333778222355, + "altitude": 0, + "radius": 65 + }, + "batch_id": null, + "conversation": null, + "allow_chat": true, + "scheduled_id": null, + "address_billing": null, + "address_shipping": null + }, + { + "id": 108864, + "created": "2017-11-08 11:20:03.950184", + "updated": "2017-11-08 11:20:03.950184", + "monetary_account_id": 213, + "amount": { + "currency": "EUR", + "value": "-24.95" + }, + "description": "73d6df4a 680498 Your order #1234567", + "type": "IDEAL", + "merchant_reference": null, + "maturity_date": "2017-11-08", + "alias": { + "iban": "NL86BUNQ2025105541", + "is_light": false, + "display_name": "D. Howard", + "avatar": { + "uuid": "cd028f6d-52f3-4b55-be76-56223b7adeec", + "image": [ + { + "attachment_public_uuid": "54b3fbaa-a427-4115-a04d-08372f706a42", + "height": 1023, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1", + "display_name": "D. Howard", + "country": "NL", + "avatar": { + "uuid": "514aaa28-c2da-42ce-aa76-7b6fd6f528cc", + "image": [ + { + "attachment_public_uuid": "14847000-40da-4f63-9137-817683acd980", + "height": 456, + "width": 456, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "0f4540c4-e81d-4aca-ad12-144fb73635a1" + }, + "public_nick_name": "Dominic (nick) premium \u2728" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": null, + "is_light": null, + "display_name": "BoekenGigant", + "label_user": { + "uuid": null, + "display_name": "BoekenGigant", + "country": "NL", + "avatar": null, + "public_nick_name": "BoekenGigant" + }, + "avatar": null, + "country": "NL" + }, + "attachment": [], + "geolocation": { + "latitude": 52.387862883215, + "longitude": 4.8333778222355, + "altitude": 0, + "radius": 65 + }, + "batch_id": null, + "conversation": null, + "allow_chat": true, + "scheduled_id": null, + "address_billing": null, + "address_shipping": null + } + ] + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/RequestInquiry.json b/tests/resource/NotificationUrlJsons/RequestInquiry.json new file mode 100644 index 00000000..af57b48e --- /dev/null +++ b/tests/resource/NotificationUrlJsons/RequestInquiry.json @@ -0,0 +1,128 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "REQUEST", + "event_type": "REQUEST_INQUIRY_ACCEPTED", + "object": { + "RequestInquiry": { + "id": 21, + "created": "2017-07-16 01:58:10.359035", + "updated": "2017-07-22 23:37:35.925263", + "time_responded": "2017-07-22 23:37:35.889673", + "time_expiry": null, + "monetary_account_id": 43, + "amount_inquired": { + "currency": "EUR", + "value": "8.77" + }, + "amount_responded": null, + "status": "REVOKED", + "description": "Test request inquiry to NL60BUNQ2025103972", + "merchant_reference": null, + "user_alias_created": { + "iban": "NL32BUNQ2025103506", + "is_light": false, + "display_name": "N. Garland", + "avatar": { + "uuid": "e47f5214-2198-4605-886c-9950714476f3", + "image": [ + { + "attachment_public_uuid": "3c7d4d11-d203-4ed4-b471-5b5e24079bf6", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da", + "display_name": "N. Garland", + "country": "NL", + "avatar": { + "uuid": "ad92c001-a4ec-4344-89ad-bf6a6b0e5628", + "image": [ + { + "attachment_public_uuid": "2b7bc30e-d6af-4440-90ba-a801cba3d8d7", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da" + }, + "public_nick_name": "Niels (nickname)" + }, + "country": "NL" + }, + "user_alias_revoked": { + "uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da", + "display_name": "N. Garland", + "country": "NL", + "avatar": { + "uuid": "ad92c001-a4ec-4344-89ad-bf6a6b0e5628", + "image": [ + { + "attachment_public_uuid": "2b7bc30e-d6af-4440-90ba-a801cba3d8d7", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "398e4411-6d98-40b9-bb48-9b33a4cb82da" + }, + "public_nick_name": "Niels (nickname)" + }, + "counterparty_alias": { + "iban": "NL60BUNQ2025103972", + "is_light": false, + "display_name": "Charlie CH Arl (nickname)", + "avatar": { + "uuid": "5188b2d7-5cf9-49ca-ba47-625fee317e79", + "image": [ + { + "attachment_public_uuid": "f427ccd8-81e7-46a7-a9bc-9c52e66f15ae", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858", + "display_name": "Charlie CH Arl (nickname)", + "country": "NL", + "avatar": { + "uuid": "cf4eedd8-afea-4374-9505-7ea5af898091", + "image": [ + { + "attachment_public_uuid": "e6f69b18-0aba-4001-98d6-968d464b706c", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858" + }, + "public_nick_name": "Charlie CH Arl (nickname)" + }, + "country": "NL" + }, + "attachment": [], + "minimum_age": null, + "require_address": null, + "geolocation": null, + "type": "INTERNAL", + "sub_type": "NONE", + "bunqme_share_url": null, + "batch_id": null, + "scheduled_id": null, + "address_billing": null, + "address_shipping": null, + "conversation": null, + "allow_chat": true + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/RequestResponse.json b/tests/resource/NotificationUrlJsons/RequestResponse.json new file mode 100644 index 00000000..d0b0ced1 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/RequestResponse.json @@ -0,0 +1,108 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "REQUEST", + "event_type": "REQUEST_INQUIRY_ACCEPTED", + "object": { + "RequestResponse": { + "id": 2, + "created": "2017-07-13 21:44:31.840439", + "updated": "2017-07-13 21:44:31.840439", + "time_responded": null, + "time_expiry": null, + "monetary_account_id": 36, + "amount_inquired": { + "currency": "EUR", + "value": "3.31" + }, + "amount_responded": null, + "status": "PENDING", + "description": "Test request inquiry to NL15BUNQ2025104200", + "alias": { + "iban": "NL15BUNQ2025104200", + "is_light": false, + "display_name": "Delta \u0644\u0623\u0628\u062c\u062f\u064a\u0629 \u0627 \u0639\u0631\u0628\u064a\u0629 (nickname)", + "avatar": { + "uuid": "11ab9e94-a90e-4334-9e70-b81ad7c4dc0a", + "image": [ + { + "attachment_public_uuid": "423b6870-a938-41d4-812b-f9b090e03d07", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "e3281b2c-d552-49b4-b575-33b87cfee463", + "display_name": "Delta \u0644\u0623\u0628\u062c\u062f\u064a\u0629 \u0627 \u0639\u0631\u0628\u064a\u0629 (nickname)", + "country": "NL", + "avatar": { + "uuid": "a94240e9-360f-4097-9caa-7974946de533", + "image": [ + { + "attachment_public_uuid": "4f25125b-ce8b-43e9-b726-317c9eb0fd46", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "e3281b2c-d552-49b4-b575-33b87cfee463" + }, + "public_nick_name": "Delta \u0644\u0623\u0628\u062c\u062f\u064a\u0629 \u0627 \u0639\u0631\u0628\u064a\u0629 (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": "NL59BUNQ2025104669", + "is_light": false, + "display_name": "Alpha Corp.", + "avatar": { + "uuid": "26789d97-ec34-4fe8-9a71-ca145a23ba7a", + "image": [ + { + "attachment_public_uuid": "3965b302-7a77-4813-8b00-ad3f9b84f439", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid|": "2711664e-885e-4b5c-bf2c-581ba39061d3", + "display_name": "Alpha Corp.", + "country": "NL", + "avatar": { + "uuid": "829fee85-ffa6-473b-ac5b-b464c7b0a3a9", + "image": [ + { + "attachment_public_uuid": "89347f1e-fd96-4c28-b9f5-bc9ec1f4443a", + "height": 640, + "width": 640, + "content_type": "image\/png" + } + ], + "anchor_uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3" + }, + "public_nick_name": "Alpha Corp." + }, + "country": "NL" + }, + "attachment": null, + "minimum_age": null, + "require_address": null, + "geolocation": null, + "type": "INTERNAL", + "sub_type": "NONE", + "redirect_url": null, + "address_billing": null, + "address_shipping": null, + "conversation": null, + "allow_chat": true, + "eligible_whitelist_id": null + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/ScheduledInstance.json b/tests/resource/NotificationUrlJsons/ScheduledInstance.json new file mode 100644 index 00000000..fd57d468 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/ScheduledInstance.json @@ -0,0 +1,231 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "SCHEDULE_STATUS", + "event_type": "SCHEDULE_INSTANCE_PAYMENT_BATCH_SUCCEEDED", + "object": { + "ScheduledInstance": { + "id": 2, + "created": "2017-07-16 21:02:06.511789", + "updated": "2017-07-16 21:02:06.625282", + "state": "FINISHED_SUCCESSFULLY", + "error_message": null, + "time_start": "2017-07-15 21:02:06.022814", + "time_end": "2017-07-16 21:02:06.022814", + "scheduled_object": { + "ScheduledPayment": { + "id": 1, + "created": "2017-07-11 21:02:06.384325", + "updated": "2017-07-16 21:02:06.630454", + "monetary_account_id": 42, + "schedule": { + "time_start": "2017-07-15 21:02:06.022814", + "time_next": null, + "time_end": "2017-07-16 21:02:06.022814", + "recurrence_unit": "DAILY", + "recurrence_size": 1 + }, + "status": "FINISHED", + "label_schedule_user_create": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "label_schedule_user_canceled": null, + "payment": { + "amount": { + "currency": "EUR", + "value": "-34.42" + }, + "alias": { + "iban": "NL16BUNQ2025103794", + "is_light": false, + "display_name": "G. Mason", + "avatar": { + "uuid": "e3bc865a-83a8-4788-af62-4f0c38df8f0d", + "image": [ + { + "attachment_public_uuid": "62c88a57-3cd9-49f7-81dc-8f1a4fcc80ac", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "country": "NL" + }, + "counterparty_aliasl": { + "iba": "NL60BUNQ2025103972", + "is_light": false, + "display_name": "Charlie CH Arl (nickname)", + "avatar": { + "uuid": "5188b2d7-5cf9-49ca-ba47-625fee317e79", + "image": [ + { + "attachment_public_uuid": "f427ccd8-81e7-46a7-a9bc-9c52e66f15ae", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858", + "display_name": "Charlie CH Arl (nickname)", + "country": "NL", + "avatar": { + "uuid": "cf4eedd8-afea-4374-9505-7ea5af898091", + "image": [ + { + "attachment_public_uuid": "e6f69b18-0aba-4001-98d6-968d464b706c", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858" + }, + "public_nick_name": "Charlie CH Arl (nickname)" + }, + "country": "NL" + }, + "description": "Test payment to NL60BUNQ2025103972", + "merchant_reference": null, + "type": "BUNQ", + "sub_type": "PAYMENT" + } + } + }, + "result_object": { + "Payment": { + "id": 133, + "created": "2017-07-16 21:02:06.579658", + "updated": "2017-07-16 21:02:06.579658", + "monetary_account_id": 42, + "amount": { + "currency": "EUR", + "value": "-34.42" + }, + "description": "Test payment to NL60BUNQ2025103972", + "type": "BUNQ", + "merchant_reference": null, + "maturity_date": "2017-07-16", + "alias": { + "iban": "NL16BUNQ2025103794", + "is_light": false, + "display_name": "G. Mason", + "avatar": { + "uuid": "e3bc865a-83a8-4788-af62-4f0c38df8f0d", + "image": [ + { + "attachment_public_uuid": "62c88a57-3cd9-49f7-81dc-8f1a4fcc80ac", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5", + "display_name": "G. Mason", + "country": "NL", + "avatar": { + "uuid": "4605580d-014c-42f1-a4d4-7b398f3b37e5", + "image": [ + { + "attachment_public_uuid": "d6b930f4-1fd0-4b29-8455-e900ed0aced5", + "heigh": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "fbff5c27-e5c1-44c6-be6f-ddd2c6615bf5" + }, + "public_nick_name": "Griffin (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": "NL60BUNQ2025103972", + "is_light": false, + "display_name": "Charlie CH Arl (nickname)", + "avatar": { + "uuid": "5188b2d7-5cf9-49ca-ba47-625fee317e79", + "image": [ + { + "attachment_public_uuid": "f427ccd8-81e7-46a7-a9bc-9c52e66f15ae", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858", + "display_name": "Charlie CH Arl (nickname)", + "country": "NL", + "avatar": { + "uuid": "cf4eedd8-afea-4374-9505-7ea5af898091", + "image": [ + { + "attachment_public_uuid": "e6f69b18-0aba-4001-98d6-968d464b706c", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "3f4973b4-7503-4317-bf4c-bc63e4f6a858" + }, + "public_nick_name": "Charlie CH Arl (nickname)" + }, + "country": "NL" + }, + "attachment": [], + "geolocation": null, + "batch_id": null, + "conversation": null, + "allow_chat": true, + "scheduled_id": 2, + "address_billing": null, + "address_shipping": null + } + } + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/ScheduledPayment.json b/tests/resource/NotificationUrlJsons/ScheduledPayment.json new file mode 100644 index 00000000..458f1e54 --- /dev/null +++ b/tests/resource/NotificationUrlJsons/ScheduledPayment.json @@ -0,0 +1,124 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "SCHEDULE_RESULT", + "event_type": "SCHEDULE_DEFINITION_PAYMENT_BATCH_CANCELLED", + "object": { + "ScheduledPayment": { + "id": 2, + "created": "2017-07-11 22:56:20.737255", + "updated": "2017-07-11 22:56:20.737255", + "monetary_account_id": 44, + "schedule": { + "time_start": "2017-07-25 22:56:20.571271", + "time_next": "2018-07-25 22:56:20.000000", + "time_end": "2018-07-25 22:56:20.571271", + "recurrence_unit": "YEARLY", + "recurrence_size": 1 + }, + "status": "ACTIVE", + "label_schedule_user_created": { + "uuid": "407b2959-3df2-4c72-8c44-c90d8f00855f", + "display_name": "J. Barrett", + "country": "NL", + "avatar": { + "uuid": "3872244f-82c5-4131-82d9-ba878f7e4cb6", + "image": [ + { + "attachment_public_uuid": "abca51a8-af0f-4ab5-b329-645809781615", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "407b2959-3df2-4c72-8c44-c90d8f00855f" + }, + "public_nick_name": "Jodi (nickname)" + }, + "label_schedule_user_canceled": null, + "payment": { + "amount": { + "currency": "EUR", + "value": "-8.89" + }, + "alias": { + "iban": "NL71BUNQ2025104162", + "is_light": false, + "display_name": "J. Barrett", + "avatar": { + "uuid": "8418f60a-2f89-443e-94ab-5f4cc10a1a1f", + "image": [ + { + "attachment_public_uuid": "c00867c4-8bbe-4dd7-ac72-85798a2969cb", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "407b2959-3df2-4c72-8c44-c90d8f00855f", + "display_name": "J. Barrett", + "country": "NL", + "avatar": { + "uuid": "3872244f-82c5-4131-82d9-ba878f7e4cb6", + "image": [ + { + "attachment_public_uuid": "abca51a8-af0f-4ab5-b329-645809781615", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "407b2959-3df2-4c72-8c44-c90d8f00855f" + }, + "public_nick_name": "Jodi (nickname)" + }, + "country": "NL" + }, + "counterparty_alias": { + "iban": "NL59BUNQ2025104669", + "is_light": false, + "display_name": "Alpha Corp.", + "avatar": { + "uuid": "26789d97-ec34-4fe8-9a71-ca145a23ba7a", + "image": [ + { + "attachment_public_uuid": "3965b302-7a77-4813-8b00-ad3f9b84f439", + "height": 1024, + "width|": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3", + "display_name": "Alpha Corp.", + "country": "NL", + "avatar": { + "uuid": "829fee85-ffa6-473b-ac5b-b464c7b0a3a9", + "image": [ + { + "attachment_public_uuid": "89347f1e-fd96-4c28-b9f5-bc9ec1f4443a", + "height": 640, + "width": 640, + "content_type": "image\/png" + } + ], + "anchor_uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3" + }, + "public_nick_name": "Alpha Corp." + }, + "country": "NL" + }, + "description": "Test payment to NL59BUNQ2025104669", + "merchant_reference": null, + "type": "BUNQ", + "sub_type": "PAYMENT" + } + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/ShareInviteBankInquiry.json b/tests/resource/NotificationUrlJsons/ShareInviteBankInquiry.json new file mode 100644 index 00000000..7c8211be --- /dev/null +++ b/tests/resource/NotificationUrlJsons/ShareInviteBankInquiry.json @@ -0,0 +1,102 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "SHARE", + "event_type": "SHARE_INVITE_BANK_INQUIRY_ACCEPTED", + "object": { + "ShareInviteBankInquiry": { + "id": 1, + "created": "2017-07-20 02:32:32.074527", + "updated": "2017-07-20 02:32:32.074527", + "alias": { + "iban": "NL59BUNQ2025104669", + "is_light": false, + "display_name": "Alpha Corp.", + "avatar": { + "uuid": "26789d97-ec34-4fe8-9a71-ca145a23ba7a", + "image": [ + { + "attachment_public_uuid": "3965b302-7a77-4813-8b00-ad3f9b84f439", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3", + "display_name": "Alpha Corp.", + "country": "NL", + "avatar": { + "uuid": "829fee85-ffa6-473b-ac5b-b464c7b0a3a9", + "image": [ + { + "attachment_public_uuid": "89347f1e-fd96-4c28-b9f5-bc9ec1f4443a", + "height": 640, + "width": 640, + "content_type": "image\/png" + } + ], + "anchor_uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3" + }, + "public_nick_name": "Alpha Corp." + }, + "country": "NL" + }, + "user_alias_created": { + "uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3", + "display_name": "Alpha Corp.", + "country": "NL", + "avatar": { + "uuid": "829fee85-ffa6-473b-ac5b-b464c7b0a3a9", + "image": [ + { + "attachment_public_uuid": "89347f1e-fd96-4c28-b9f5-bc9ec1f4443a", + "height": 640, + "width": 640, + "content_type": "image\/png" + } + ], + "anchor_uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3" + }, + "public_nick_name": "Alpha Corp." + }, + "user_alias_revoked": null, + "counter_user_alias": { + "uuid": "688e4bdc-ec27-4d8e-942b-3aee7b5d15e9", + "display_name": "Echo (nickname)", + "country": "000", + "avatar": { + "uuid": "3da21898-1535-43c9-9023-83333e776b8b", + "image": [ + { + "attachment_public_uuid": "6bb2b5d6-faee-4d5d-8284-af026bde3640", + "height": 480, + "width": 480, + "content_type": "image\/jpeg" + } + ], + "anchor_uuid": "688e4bdc-ec27-4d8e-942b-3aee7b5d15e9" + }, + "public_nick_name": "Echo (nickname)" + }, + "monetary_account_id": 46, + "draft_share_invite_bank_id": null, + "share_type": "STANDARD", + "status": "PENDING", + "share_detail": { + "ShareDetailPayment": { + "view_balance": true, + "view_old_events": true, + "view_new_events": true, + "budget": null, + "make_payments": true + } + }, + "start_date": "2017-07-20 02:34:05.864029", + "end_date": "2017-11-11 02:34:05.864029" + } + } + } +} diff --git a/tests/resource/NotificationUrlJsons/ShareInviteBankResponse.json b/tests/resource/NotificationUrlJsons/ShareInviteBankResponse.json new file mode 100644 index 00000000..41c30f2f --- /dev/null +++ b/tests/resource/NotificationUrlJsons/ShareInviteBankResponse.json @@ -0,0 +1,67 @@ +{ + "NotificationUrl": { + "target_url": "nope", + "category": "SHARE", + "event_type": "SHARE_INVITE_BANK_INQUIRY_ACCEPTED", + "object": { + "ShareInviteBankResponse": { + "id": 2, + "created": "2017-07-20 02:32:32.114297", + "updated": "2017-07-20 02:32:32.114297", + "monetary_account_id": null, + "draft_share_invite_bank_id": null, + "counter_alias": { + "iban": "NL59BUNQ2025104669", + "is_light": false, + "display_name": "Alpha Corp.", + "avatar": { + "uuid": "26789d97-ec34-4fe8-9a71-ca145a23ba7a", + "image": [ + { + "attachment_public_uuid": "3965b302-7a77-4813-8b00-ad3f9b84f439", + "height": 1024, + "width": 1024, + "content_type": "image\/png" + } + ], + "anchor_uuid": null + }, + "label_user": { + "uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3", + "display_name": "Alpha Corp.", + "country": "NL", + "avatar": { + "uuid": "829fee85-ffa6-473b-ac5b-b464c7b0a3a9", + "image": [ + { + "attachment_public_uuid": "89347f1e-fd96-4c28-b9f5-bc9ec1f4443a", + "height": 640, + "width": 640, + "content_type": "image\/png" + } + ], + "anchor_uuid": "2711664e-885e-4b5c-bf2c-581ba39061d3" + }, + "public_nick_name": "Alpha Corp." + }, + "country": "NL" + }, + "user_alias_cancelled": null, + "description": "bunq account", + "share_type": "STANDARD", + "status": "PENDING", + "share_detail": { + "ShareDetailPayment": { + "view_balance": true, + "view_old_events": true, + "view_new_events": true, + "budget": null, + "make_payments": true + } + }, + "start_date": "2017-07-20 02:34:05.864029", + "end_date": "2017-11-11 02:34:05.864029" + } + } + } +}