├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── slack-on-issue.yml ├── .gitmodules ├── .php-cs-fixer.php ├── .zappr.yaml ├── LICENSE.md ├── bin └── bunq-install ├── composer.json ├── phpstan-baseline.neon ├── phpstan.neon └── src ├── Context ├── ApiContext.php ├── BunqContext.php ├── InstallationContext.php ├── SessionContext.php └── UserContext.php ├── Exception ├── ApiException.php ├── BadRequestException.php ├── BunqException.php ├── EXCEPTION.md ├── ExceptionFactory.php ├── ForbiddenException.php ├── MethodNotAllowedException.php ├── NotFoundException.php ├── PleaseContactBunqException.php ├── SecurityException.php ├── TooManyRequestsException.php ├── UnauthorizedException.php └── UnknownApiErrorException.php ├── Http ├── ApiClient.php ├── BunqResponse.php ├── BunqResponseRaw.php ├── Certificate │ └── api.bunq.com.pubkey.pem ├── Handler │ ├── HandlerBase.php │ ├── HandlerUtil.php │ ├── RequestHandlerAuthentication.php │ ├── RequestHandlerBase.php │ ├── RequestHandlerSignature.php │ ├── ResponseHandlerBase.php │ ├── ResponseHandlerError.php │ └── ResponseHandlerSignature.php └── Pagination.php ├── Model ├── Core │ ├── AnchorObjectInterface.php │ ├── BunqEnumOauthGrantType.php │ ├── BunqEnumOauthResponseType.php │ ├── BunqModel.php │ ├── BunqModelWrapper.php │ ├── BunqResponseInstallation.php │ ├── BunqResponseSessionServer.php │ ├── DeviceServerInternal.php │ ├── Id.php │ ├── Installation.php │ ├── NotificationFilterPushUserInternal.php │ ├── NotificationFilterUrlMonetaryAccountInternal.php │ ├── NotificationFilterUrlUserInternal.php │ ├── OauthAccessToken.php │ ├── OauthAuthorizationUri.php │ ├── PaymentServiceProviderCredentialInternal.php │ ├── SandboxUserInternal.php │ ├── ServerPublicKey.php │ ├── SessionServer.php │ ├── Token.php │ └── Uuid.php └── Generated │ ├── Endpoint │ ├── AdditionalTransactionInformationCategoryApiObject.php │ ├── AdditionalTransactionInformationCategoryUserDefinedApiObject.php │ ├── AttachmentConversationContentApiObject.php │ ├── AttachmentMonetaryAccountApiObject.php │ ├── AttachmentMonetaryAccountContentApiObject.php │ ├── AttachmentPublicApiObject.php │ ├── AttachmentPublicContentApiObject.php │ ├── AttachmentUserApiObject.php │ ├── AttachmentUserContentApiObject.php │ ├── AvatarApiObject.php │ ├── BankSwitchServiceNetherlandsIncomingApiObject.php │ ├── BankSwitchServiceNetherlandsIncomingPaymentApiObject.php │ ├── BillingContractSubscriptionApiObject.php │ ├── BirdeeInvestmentPortfolioApiObject.php │ ├── BirdeeInvestmentPortfolioBalanceApiObject.php │ ├── BirdeePortfolioAllocationApiObject.php │ ├── BunqMeFundraiserProfileApiObject.php │ ├── BunqMeFundraiserProfileUserApiObject.php │ ├── BunqMeFundraiserResultApiObject.php │ ├── BunqMeTabApiObject.php │ ├── BunqMeTabEntryApiObject.php │ ├── BunqMeTabResultInquiryApiObject.php │ ├── BunqMeTabResultResponseApiObject.php │ ├── BunqResponseAdditionalTransactionInformationCategoryApiObjectList.php │ ├── BunqResponseAttachmentPublic.php │ ├── BunqResponseAttachmentUser.php │ ├── BunqResponseAvatar.php │ ├── BunqResponseBankSwitchServiceNetherlandsIncomingPayment.php │ ├── BunqResponseBillingContractSubscriptionApiObjectList.php │ ├── BunqResponseBunqMeFundraiserProfileUser.php │ ├── BunqResponseBunqMeFundraiserProfileUserApiObjectList.php │ ├── BunqResponseBunqMeFundraiserResult.php │ ├── BunqResponseBunqMeTab.php │ ├── BunqResponseBunqMeTabApiObjectList.php │ ├── BunqResponseBunqMeTabResultResponse.php │ ├── BunqResponseCard.php │ ├── BunqResponseCardApiObjectList.php │ ├── BunqResponseCardBatch.php │ ├── BunqResponseCardBatchReplace.php │ ├── BunqResponseCardCredit.php │ ├── BunqResponseCardDebit.php │ ├── BunqResponseCardGeneratedCvc2.php │ ├── BunqResponseCardGeneratedCvc2ApiObjectList.php │ ├── BunqResponseCardNameApiObjectList.php │ ├── BunqResponseCertificatePinned.php │ ├── BunqResponseCertificatePinnedApiObjectList.php │ ├── BunqResponseCompany.php │ ├── BunqResponseCompanyApiObjectList.php │ ├── BunqResponseCompanyEmployeeSettingAdyenCardTransaction.php │ ├── BunqResponseConfirmationOfFunds.php │ ├── BunqResponseCurrencyCloudBeneficiary.php │ ├── BunqResponseCurrencyCloudBeneficiaryApiObjectList.php │ ├── BunqResponseCurrencyCloudBeneficiaryRequirementApiObjectList.php │ ├── BunqResponseCurrencyConversion.php │ ├── BunqResponseCurrencyConversionApiObjectList.php │ ├── BunqResponseCurrencyConversionQuote.php │ ├── BunqResponseCustomerLimitApiObjectList.php │ ├── BunqResponseDevice.php │ ├── BunqResponseDeviceApiObjectList.php │ ├── BunqResponseDeviceServer.php │ ├── BunqResponseDeviceServerApiObjectList.php │ ├── BunqResponseDraftPayment.php │ ├── BunqResponseDraftPaymentApiObjectList.php │ ├── BunqResponseEvent.php │ ├── BunqResponseEventApiObjectList.php │ ├── BunqResponseExportAnnualOverview.php │ ├── BunqResponseExportAnnualOverviewApiObjectList.php │ ├── BunqResponseExportRib.php │ ├── BunqResponseExportRibApiObjectList.php │ ├── BunqResponseExportStatement.php │ ├── BunqResponseExportStatementApiObjectList.php │ ├── BunqResponseExportStatementCard.php │ ├── BunqResponseExportStatementCardApiObjectList.php │ ├── BunqResponseExportStatementCardCsv.php │ ├── BunqResponseExportStatementCardCsvApiObjectList.php │ ├── BunqResponseExportStatementCardPdf.php │ ├── BunqResponseExportStatementCardPdfApiObjectList.php │ ├── BunqResponseExportStatementPayment.php │ ├── BunqResponseFeatureAnnouncement.php │ ├── BunqResponseHealthCheckApiObjectList.php │ ├── BunqResponseIdealMerchantTransaction.php │ ├── BunqResponseIdealMerchantTransactionApiObjectList.php │ ├── BunqResponseInsightApiObjectList.php │ ├── BunqResponseInsightEventApiObjectList.php │ ├── BunqResponseInsightPreferenceDateApiObjectList.php │ ├── BunqResponseInstallationServerPublicKeyApiObjectList.php │ ├── BunqResponseInt.php │ ├── BunqResponseInvoice.php │ ├── BunqResponseInvoiceApiObjectList.php │ ├── BunqResponseInvoiceByUser.php │ ├── BunqResponseInvoiceByUserApiObjectList.php │ ├── BunqResponseInvoiceExportPdf.php │ ├── BunqResponseMasterCardAction.php │ ├── BunqResponseMasterCardActionApiObjectList.php │ ├── BunqResponseMasterCardIdentityCheckChallengeRequestUser.php │ ├── BunqResponseMasterCardPaymentApiObjectList.php │ ├── BunqResponseMonetaryAccount.php │ ├── BunqResponseMonetaryAccountApiObjectList.php │ ├── BunqResponseMonetaryAccountBank.php │ ├── BunqResponseMonetaryAccountBankApiObjectList.php │ ├── BunqResponseMonetaryAccountCard.php │ ├── BunqResponseMonetaryAccountCardApiObjectList.php │ ├── BunqResponseMonetaryAccountExternal.php │ ├── BunqResponseMonetaryAccountExternalApiObjectList.php │ ├── BunqResponseMonetaryAccountExternalSavings.php │ ├── BunqResponseMonetaryAccountExternalSavingsApiObjectList.php │ ├── BunqResponseMonetaryAccountJoint.php │ ├── BunqResponseMonetaryAccountJointApiObjectList.php │ ├── BunqResponseMonetaryAccountSavings.php │ ├── BunqResponseMonetaryAccountSavingsApiObjectList.php │ ├── BunqResponseNoteAttachmentAdyenCardTransaction.php │ ├── BunqResponseNoteAttachmentAdyenCardTransactionApiObjectList.php │ ├── BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.php │ ├── BunqResponseNoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentApiObjectList.php │ ├── BunqResponseNoteAttachmentBunqMeFundraiserResult.php │ ├── BunqResponseNoteAttachmentBunqMeFundraiserResultApiObjectList.php │ ├── BunqResponseNoteAttachmentDraftPayment.php │ ├── BunqResponseNoteAttachmentDraftPaymentApiObjectList.php │ ├── BunqResponseNoteAttachmentIdealMerchantTransaction.php │ ├── BunqResponseNoteAttachmentIdealMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteAttachmentMasterCardAction.php │ ├── BunqResponseNoteAttachmentMasterCardActionApiObjectList.php │ ├── BunqResponseNoteAttachmentOpenBankingMerchantTransaction.php │ ├── BunqResponseNoteAttachmentOpenBankingMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteAttachmentPayment.php │ ├── BunqResponseNoteAttachmentPaymentApiObjectList.php │ ├── BunqResponseNoteAttachmentPaymentBatch.php │ ├── BunqResponseNoteAttachmentPaymentBatchApiObjectList.php │ ├── BunqResponseNoteAttachmentPaymentDelayed.php │ ├── BunqResponseNoteAttachmentPaymentDelayedApiObjectList.php │ ├── BunqResponseNoteAttachmentRequestInquiry.php │ ├── BunqResponseNoteAttachmentRequestInquiryApiObjectList.php │ ├── BunqResponseNoteAttachmentRequestInquiryBatch.php │ ├── BunqResponseNoteAttachmentRequestInquiryBatchApiObjectList.php │ ├── BunqResponseNoteAttachmentRequestResponse.php │ ├── BunqResponseNoteAttachmentRequestResponseApiObjectList.php │ ├── BunqResponseNoteAttachmentScheduleInstance.php │ ├── BunqResponseNoteAttachmentScheduleInstanceApiObjectList.php │ ├── BunqResponseNoteAttachmentSchedulePayment.php │ ├── BunqResponseNoteAttachmentSchedulePaymentApiObjectList.php │ ├── BunqResponseNoteAttachmentSchedulePaymentBatch.php │ ├── BunqResponseNoteAttachmentSchedulePaymentBatchApiObjectList.php │ ├── BunqResponseNoteAttachmentScheduleRequest.php │ ├── BunqResponseNoteAttachmentScheduleRequestApiObjectList.php │ ├── BunqResponseNoteAttachmentScheduleRequestBatch.php │ ├── BunqResponseNoteAttachmentScheduleRequestBatchApiObjectList.php │ ├── BunqResponseNoteAttachmentSofortMerchantTransaction.php │ ├── BunqResponseNoteAttachmentSofortMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteAttachmentWhitelistResult.php │ ├── BunqResponseNoteAttachmentWhitelistResultApiObjectList.php │ ├── BunqResponseNoteTextAdyenCardTransaction.php │ ├── BunqResponseNoteTextAdyenCardTransactionApiObjectList.php │ ├── BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPayment.php │ ├── BunqResponseNoteTextBankSwitchServiceNetherlandsIncomingPaymentApiObjectList.php │ ├── BunqResponseNoteTextBunqMeFundraiserResult.php │ ├── BunqResponseNoteTextBunqMeFundraiserResultApiObjectList.php │ ├── BunqResponseNoteTextDraftPayment.php │ ├── BunqResponseNoteTextDraftPaymentApiObjectList.php │ ├── BunqResponseNoteTextIdealMerchantTransaction.php │ ├── BunqResponseNoteTextIdealMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteTextMasterCardAction.php │ ├── BunqResponseNoteTextMasterCardActionApiObjectList.php │ ├── BunqResponseNoteTextOpenBankingMerchantTransaction.php │ ├── BunqResponseNoteTextOpenBankingMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteTextPayment.php │ ├── BunqResponseNoteTextPaymentApiObjectList.php │ ├── BunqResponseNoteTextPaymentBatch.php │ ├── BunqResponseNoteTextPaymentBatchApiObjectList.php │ ├── BunqResponseNoteTextPaymentDelayed.php │ ├── BunqResponseNoteTextPaymentDelayedApiObjectList.php │ ├── BunqResponseNoteTextRequestInquiry.php │ ├── BunqResponseNoteTextRequestInquiryApiObjectList.php │ ├── BunqResponseNoteTextRequestInquiryBatch.php │ ├── BunqResponseNoteTextRequestInquiryBatchApiObjectList.php │ ├── BunqResponseNoteTextRequestResponse.php │ ├── BunqResponseNoteTextRequestResponseApiObjectList.php │ ├── BunqResponseNoteTextScheduleInstance.php │ ├── BunqResponseNoteTextScheduleInstanceApiObjectList.php │ ├── BunqResponseNoteTextSchedulePayment.php │ ├── BunqResponseNoteTextSchedulePaymentApiObjectList.php │ ├── BunqResponseNoteTextSchedulePaymentBatch.php │ ├── BunqResponseNoteTextSchedulePaymentBatchApiObjectList.php │ ├── BunqResponseNoteTextScheduleRequest.php │ ├── BunqResponseNoteTextScheduleRequestApiObjectList.php │ ├── BunqResponseNoteTextScheduleRequestBatch.php │ ├── BunqResponseNoteTextScheduleRequestBatchApiObjectList.php │ ├── BunqResponseNoteTextSofortMerchantTransaction.php │ ├── BunqResponseNoteTextSofortMerchantTransactionApiObjectList.php │ ├── BunqResponseNoteTextWhitelistResult.php │ ├── BunqResponseNoteTextWhitelistResultApiObjectList.php │ ├── BunqResponseNotificationFilterEmail.php │ ├── BunqResponseNotificationFilterEmailApiObjectList.php │ ├── BunqResponseNotificationFilterFailureApiObjectList.php │ ├── BunqResponseNotificationFilterPush.php │ ├── BunqResponseNotificationFilterPushApiObjectList.php │ ├── BunqResponseNotificationFilterUrlApiObjectList.php │ ├── BunqResponseNotificationFilterUrlMonetaryAccountApiObjectList.php │ ├── BunqResponseNull.php │ ├── BunqResponseOauthCallbackUrl.php │ ├── BunqResponseOauthCallbackUrlApiObjectList.php │ ├── BunqResponseOauthClient.php │ ├── BunqResponseOauthClientApiObjectList.php │ ├── BunqResponsePayment.php │ ├── BunqResponsePaymentApiObjectList.php │ ├── BunqResponsePaymentAutoAllocate.php │ ├── BunqResponsePaymentAutoAllocateApiObjectList.php │ ├── BunqResponsePaymentAutoAllocateDefinitionApiObjectList.php │ ├── BunqResponsePaymentAutoAllocateInstance.php │ ├── BunqResponsePaymentAutoAllocateInstanceApiObjectList.php │ ├── BunqResponsePaymentAutoAllocateUserApiObjectList.php │ ├── BunqResponsePaymentBatch.php │ ├── BunqResponsePaymentBatchApiObjectList.php │ ├── BunqResponsePaymentServiceProviderCredential.php │ ├── BunqResponsePaymentServiceProviderDraftPayment.php │ ├── BunqResponsePaymentServiceProviderDraftPaymentApiObjectList.php │ ├── BunqResponsePaymentServiceProviderIssuerTransaction.php │ ├── BunqResponsePaymentServiceProviderIssuerTransactionApiObjectList.php │ ├── BunqResponsePermittedIp.php │ ├── BunqResponsePermittedIpApiObjectList.php │ ├── BunqResponseRequestInquiry.php │ ├── BunqResponseRequestInquiryApiObjectList.php │ ├── BunqResponseRequestInquiryBatch.php │ ├── BunqResponseRequestInquiryBatchApiObjectList.php │ ├── BunqResponseRequestResponse.php │ ├── BunqResponseRequestResponseApiObjectList.php │ ├── BunqResponseSandboxUserCompany.php │ ├── BunqResponseSandboxUserPerson.php │ ├── BunqResponseSchedule.php │ ├── BunqResponseScheduleApiObjectList.php │ ├── BunqResponseScheduleInstance.php │ ├── BunqResponseScheduleInstanceApiObjectList.php │ ├── BunqResponseSchedulePayment.php │ ├── BunqResponseSchedulePaymentApiObjectList.php │ ├── BunqResponseSchedulePaymentBatch.php │ ├── BunqResponseScheduleUserApiObjectList.php │ ├── BunqResponseShareInviteMonetaryAccountInquiry.php │ ├── BunqResponseShareInviteMonetaryAccountInquiryApiObjectList.php │ ├── BunqResponseShareInviteMonetaryAccountResponse.php │ ├── BunqResponseShareInviteMonetaryAccountResponseApiObjectList.php │ ├── BunqResponseSofortMerchantTransaction.php │ ├── BunqResponseSofortMerchantTransactionApiObjectList.php │ ├── BunqResponseString.php │ ├── BunqResponseTokenQrRequestIdeal.php │ ├── BunqResponseTokenQrRequestSofort.php │ ├── BunqResponseTransferwiseAccountQuote.php │ ├── BunqResponseTransferwiseAccountQuoteApiObjectList.php │ ├── BunqResponseTransferwiseAccountRequirementApiObjectList.php │ ├── BunqResponseTransferwiseCurrencyApiObjectList.php │ ├── BunqResponseTransferwiseQuote.php │ ├── BunqResponseTransferwiseQuoteTemporary.php │ ├── BunqResponseTransferwiseTransfer.php │ ├── BunqResponseTransferwiseTransferApiObjectList.php │ ├── BunqResponseTransferwiseUserApiObjectList.php │ ├── BunqResponseTreeProgressApiObjectList.php │ ├── BunqResponseUser.php │ ├── BunqResponseUserApiObjectList.php │ ├── BunqResponseUserCompany.php │ ├── BunqResponseUserCompanyNameApiObjectList.php │ ├── BunqResponseUserCredentialPasswordIp.php │ ├── BunqResponseUserCredentialPasswordIpApiObjectList.php │ ├── BunqResponseUserLegalNameApiObjectList.php │ ├── BunqResponseUserPaymentServiceProvider.php │ ├── BunqResponseUserPerson.php │ ├── BunqResponseWhitelistSdd.php │ ├── BunqResponseWhitelistSddApiObjectList.php │ ├── BunqResponseWhitelistSddMonetaryAccountPaying.php │ ├── BunqResponseWhitelistSddMonetaryAccountPayingApiObjectList.php │ ├── BunqResponseWhitelistSddOneOff.php │ ├── BunqResponseWhitelistSddOneOffApiObjectList.php │ ├── BunqResponseWhitelistSddRecurring.php │ ├── BunqResponseWhitelistSddRecurringApiObjectList.php │ ├── CardApiObject.php │ ├── CardBatchApiObject.php │ ├── CardBatchReplaceApiObject.php │ ├── CardCreditApiObject.php │ ├── CardDebitApiObject.php │ ├── CardGeneratedCvc2ApiObject.php │ ├── CardNameApiObject.php │ ├── CardReplaceApiObject.php │ ├── CardReplacementApiObject.php │ ├── CashbackPayoutItemApiObject.php │ ├── CertificatePinnedApiObject.php │ ├── ChatMessageApiObject.php │ ├── CoOwnerInviteResponseApiObject.php │ ├── CompanyApiObject.php │ ├── CompanyEmployeeCardApiObject.php │ ├── CompanyEmployeeCardLimitApiObject.php │ ├── CompanyEmployeeCardReceiptApiObject.php │ ├── CompanyEmployeeSettingAdyenCardTransactionApiObject.php │ ├── ConfirmationOfFundsApiObject.php │ ├── CurrencyCloudBeneficiaryApiObject.php │ ├── CurrencyCloudBeneficiaryRequirementApiObject.php │ ├── CurrencyCloudPaymentQuoteApiObject.php │ ├── CurrencyConversionApiObject.php │ ├── CurrencyConversionQuoteApiObject.php │ ├── CustomerApiObject.php │ ├── CustomerLimitApiObject.php │ ├── DeviceApiObject.php │ ├── DeviceServerApiObject.php │ ├── DraftPaymentApiObject.php │ ├── EventApiObject.php │ ├── ExportAnnualOverviewApiObject.php │ ├── ExportAnnualOverviewContentApiObject.php │ ├── ExportRibApiObject.php │ ├── ExportRibContentApiObject.php │ ├── ExportStatementApiObject.php │ ├── ExportStatementCardApiObject.php │ ├── ExportStatementCardContentApiObject.php │ ├── ExportStatementCardCsvApiObject.php │ ├── ExportStatementCardPdfApiObject.php │ ├── ExportStatementContentApiObject.php │ ├── ExportStatementPaymentApiObject.php │ ├── ExportStatementPaymentContentApiObject.php │ ├── FeatureAnnouncementApiObject.php │ ├── FulfillmentApiObject.php │ ├── GinmonTransactionApiObject.php │ ├── HealthCheckApiObject.php │ ├── IdealMerchantTransactionApiObject.php │ ├── InsightApiObject.php │ ├── InsightEventApiObject.php │ ├── InsightPreferenceDateApiObject.php │ ├── InstallationServerPublicKeyApiObject.php │ ├── InvoiceApiObject.php │ ├── InvoiceByUserApiObject.php │ ├── InvoiceExportPdfApiObject.php │ ├── InvoiceExportPdfContentApiObject.php │ ├── MasterCardActionApiObject.php │ ├── MasterCardActionRefundApiObject.php │ ├── MasterCardActionReportApiObject.php │ ├── MasterCardIdentityCheckChallengeRequestUserApiObject.php │ ├── MasterCardPaymentApiObject.php │ ├── MonetaryAccountAccessApiObject.php │ ├── MonetaryAccountApiObject.php │ ├── MonetaryAccountBankApiObject.php │ ├── MonetaryAccountBudgetApiObject.php │ ├── MonetaryAccountCardApiObject.php │ ├── MonetaryAccountExternalApiObject.php │ ├── MonetaryAccountExternalSavingsApiObject.php │ ├── MonetaryAccountInvestmentApiObject.php │ ├── MonetaryAccountJointApiObject.php │ ├── MonetaryAccountLightApiObject.php │ ├── MonetaryAccountProfileApiObject.php │ ├── MonetaryAccountSavingsApiObject.php │ ├── MonetaryAccountSwitchServiceApiObject.php │ ├── NoteAttachmentAdyenCardTransactionApiObject.php │ ├── NoteAttachmentBankSwitchServiceNetherlandsIncomingPaymentApiObject.php │ ├── NoteAttachmentBunqMeFundraiserResultApiObject.php │ ├── NoteAttachmentDraftPaymentApiObject.php │ ├── NoteAttachmentIdealMerchantTransactionApiObject.php │ ├── NoteAttachmentMasterCardActionApiObject.php │ ├── NoteAttachmentOpenBankingMerchantTransactionApiObject.php │ ├── NoteAttachmentPaymentApiObject.php │ ├── NoteAttachmentPaymentBatchApiObject.php │ ├── NoteAttachmentPaymentDelayedApiObject.php │ ├── NoteAttachmentRequestInquiryApiObject.php │ ├── NoteAttachmentRequestInquiryBatchApiObject.php │ ├── NoteAttachmentRequestResponseApiObject.php │ ├── NoteAttachmentScheduleInstanceApiObject.php │ ├── NoteAttachmentSchedulePaymentApiObject.php │ ├── NoteAttachmentSchedulePaymentBatchApiObject.php │ ├── NoteAttachmentScheduleRequestApiObject.php │ ├── NoteAttachmentScheduleRequestBatchApiObject.php │ ├── NoteAttachmentSofortMerchantTransactionApiObject.php │ ├── NoteAttachmentWhitelistResultApiObject.php │ ├── NoteTextAdyenCardTransactionApiObject.php │ ├── NoteTextBankSwitchServiceNetherlandsIncomingPaymentApiObject.php │ ├── NoteTextBunqMeFundraiserResultApiObject.php │ ├── NoteTextDraftPaymentApiObject.php │ ├── NoteTextIdealMerchantTransactionApiObject.php │ ├── NoteTextMasterCardActionApiObject.php │ ├── NoteTextOpenBankingMerchantTransactionApiObject.php │ ├── NoteTextPaymentApiObject.php │ ├── NoteTextPaymentBatchApiObject.php │ ├── NoteTextPaymentDelayedApiObject.php │ ├── NoteTextRequestInquiryApiObject.php │ ├── NoteTextRequestInquiryBatchApiObject.php │ ├── NoteTextRequestResponseApiObject.php │ ├── NoteTextScheduleInstanceApiObject.php │ ├── NoteTextSchedulePaymentApiObject.php │ ├── NoteTextSchedulePaymentBatchApiObject.php │ ├── NoteTextScheduleRequestApiObject.php │ ├── NoteTextScheduleRequestBatchApiObject.php │ ├── NoteTextSofortMerchantTransactionApiObject.php │ ├── NoteTextWhitelistResultApiObject.php │ ├── NotificationFilterEmailApiObject.php │ ├── NotificationFilterFailureApiObject.php │ ├── NotificationFilterPushApiObject.php │ ├── NotificationFilterUrlApiObject.php │ ├── NotificationFilterUrlMonetaryAccountApiObject.php │ ├── OauthCallbackUrlApiObject.php │ ├── OauthClientApiObject.php │ ├── OpenBankingAccountApiObject.php │ ├── OpenBankingProviderBankApiObject.php │ ├── PartnerPromotionCashbackApiObject.php │ ├── PaymentApiObject.php │ ├── PaymentAutoAllocateApiObject.php │ ├── PaymentAutoAllocateDefinitionApiObject.php │ ├── PaymentAutoAllocateInstanceApiObject.php │ ├── PaymentAutoAllocateUserApiObject.php │ ├── PaymentBatchApiObject.php │ ├── PaymentServiceProviderCredentialApiObject.php │ ├── PaymentServiceProviderDraftPaymentApiObject.php │ ├── PaymentServiceProviderIssuerTransactionApiObject.php │ ├── PaymentSuspendedOutgoingApiObject.php │ ├── PermittedIpApiObject.php │ ├── PointMutationApiObject.php │ ├── RelationUserApiObject.php │ ├── RequestInquiryApiObject.php │ ├── RequestInquiryBatchApiObject.php │ ├── RequestResponseApiObject.php │ ├── SandboxUserCompanyApiObject.php │ ├── SandboxUserPersonApiObject.php │ ├── ScheduleApiObject.php │ ├── ScheduleInstanceApiObject.php │ ├── SchedulePaymentApiObject.php │ ├── SchedulePaymentBatchApiObject.php │ ├── ScheduleUserApiObject.php │ ├── ServerErrorApiObject.php │ ├── SessionApiObject.php │ ├── ShareInviteMonetaryAccountInquiryApiObject.php │ ├── ShareInviteMonetaryAccountResponseApiObject.php │ ├── SofortMerchantTransactionApiObject.php │ ├── TokenQrRequestIdealApiObject.php │ ├── TokenQrRequestSofortApiObject.php │ ├── TransferwiseAccountQuoteApiObject.php │ ├── TransferwiseAccountRequirementApiObject.php │ ├── TransferwiseCurrencyApiObject.php │ ├── TransferwiseQuoteApiObject.php │ ├── TransferwiseQuoteTemporaryApiObject.php │ ├── TransferwiseTransferApiObject.php │ ├── TransferwiseTransferRequirementApiObject.php │ ├── TransferwiseUserApiObject.php │ ├── TreeProgressApiObject.php │ ├── UserApiKeyApiObject.php │ ├── UserApiObject.php │ ├── UserBlocklistMasterCardMerchantApiObject.php │ ├── UserCompanyApiObject.php │ ├── UserCompanyNameApiObject.php │ ├── UserCredentialPasswordIpApiObject.php │ ├── UserLegalNameApiObject.php │ ├── UserPartnerPromotionCashbackApiObject.php │ ├── UserPaymentServiceProviderApiObject.php │ ├── UserPersonApiObject.php │ ├── WhitelistApiObject.php │ ├── WhitelistResultApiObject.php │ ├── WhitelistSddApiObject.php │ ├── WhitelistSddMonetaryAccountPayingApiObject.php │ ├── WhitelistSddOneOffApiObject.php │ └── WhitelistSddRecurringApiObject.php │ └── Object │ ├── .NotificationFilterEmail.php.MygNyi │ ├── AdditionalInformationObject.php │ ├── AddressObject.php │ ├── AmountObject.php │ ├── AttachmentMasterCardActionRefundObject.php │ ├── AttachmentMonetaryAccountPaymentObject.php │ ├── AttachmentObject.php │ ├── AttachmentPublicObject.php │ ├── AttachmentUrlObject.php │ ├── AvatarObject.php │ ├── BirdeeInvestmentPortfolioGoalObject.php │ ├── BunqIdObject.php │ ├── BunqMeMerchantAvailableObject.php │ ├── CardBatchEntryObject.php │ ├── CardBatchReplaceEntryObject.php │ ├── CardCountryPermissionObject.php │ ├── CardPinAssignmentObject.php │ ├── CardPrimaryAccountNumberObject.php │ ├── CertificateObject.php │ ├── CoOwnerObject.php │ ├── CompanyVatNumberObject.php │ ├── CurrencyCloudBeneficiaryRequirementFieldObject.php │ ├── DraftPaymentAnchorObjectObject.php │ ├── DraftPaymentEntryObject.php │ ├── DraftPaymentResponseObject.php │ ├── ErrorObject.php │ ├── EventObjectObject.php │ ├── GeolocationObject.php │ ├── HealthCheckResultEntryObject.php │ ├── HealthCheckResultObject.php │ ├── ImageObject.php │ ├── InvoiceItemGroupObject.php │ ├── InvoiceItemObject.php │ ├── IssuerObject.php │ ├── LabelCardObject.php │ ├── LabelMonetaryAccountObject.php │ ├── LabelUserObject.php │ ├── MasterCardActionReferenceObject.php │ ├── MonetaryAccountProfileDrainObject.php │ ├── MonetaryAccountProfileFillObject.php │ ├── MonetaryAccountSettingObject.php │ ├── NotificationAnchorObjectObject.php │ ├── NotificationFilterEmailObject.php │ ├── NotificationFilterObject.php │ ├── NotificationFilterPushObject.php │ ├── NotificationFilterUrlObject.php │ ├── NotificationUrlObject.php │ ├── OauthCallbackUrlObject.php │ ├── PaymentArrivalExpectedObject.php │ ├── PaymentFeeObject.php │ ├── PermittedDeviceObject.php │ ├── PointerObject.php │ ├── RequestInquiryReferenceObject.php │ ├── RequestReferenceSplitTheBillAnchorObjectObject.php │ ├── ScheduleAnchorObjectObject.php │ ├── ScheduleInstanceAnchorObjectObject.php │ ├── SchedulePaymentEntryObject.php │ ├── ShareDetailDraftPaymentObject.php │ ├── ShareDetailObject.php │ ├── ShareDetailPaymentObject.php │ ├── ShareDetailReadOnlyObject.php │ ├── TaxResidentObject.php │ ├── TransferwiseRequirementFieldGroupObject.php │ ├── TransferwiseRequirementFieldGroupValidationAsyncObject.php │ ├── TransferwiseRequirementFieldGroupValidationAsyncParamsObject.php │ ├── TransferwiseRequirementFieldGroupValuesAllowedObject.php │ ├── TransferwiseRequirementFieldObject.php │ ├── UboObject.php │ ├── UserApiKeyAnchoredUserObject.php │ └── WhitelistResultViewAnchoredObjectObject.php ├── Security ├── KeyPair.php ├── PrivateKey.php └── PublicKey.php └── Util ├── BunqEnum.php ├── BunqEnumApiEnvironmentType.php ├── FileUtil.php ├── InstallationUtil.php ├── ModelUtil.php └── SecurityUtil.php /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Steps to reproduce: 2 | 1. 3 | 4 | ## What should happen: 5 | 1. 6 | 7 | ## What happens: 8 | 1. 9 | 10 | ## Traceback 11 | [//]: # (If there is a traceback please share it in a quote! You can do this by pasting the traceback text, highlighting it and pressing the quote button.) 12 | 13 | ## SDK version and environment 14 | - Tested on [1.14.1](https://github.com/bunq/sdk_php/releases/tag/1.14.1) 15 | - [ ] Sandbox 16 | - [ ] Production 17 | 18 | ## Response id 19 | [//]: # (If this error has something to do with a request that fails, please provide the response id of the request.) 20 | - Response id: 21 | 22 | ## Extra info: 23 | [//]: # (Please provide any other relevant information here) 24 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | [//]: # (Thanks for opening this pull request! Before you proceed please make sure that you have an issue that explains what this pull request will do. 2 | Make sure that all your commits link to this issue e.g. "My commit. \(bunq/sdk_php#\)". 3 | If this pull request is changing files that are located in "src/Model/Generated" then this pull request will be closed as these files must/can only be changed on bunq's side.) 4 | 5 | ## This PR closes/fixes the following issues: 6 | [//]: # (If for some reason your pull request does not require a test case you can just mark this box as checked and explain why it does not require a test case.) 7 | - Closes bunq/sdk_php# 8 | - [ ] Tested 9 | -------------------------------------------------------------------------------- /.github/workflows/slack-on-issue.yml: -------------------------------------------------------------------------------- 1 | name: Notify Slack on New Issue or PR 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | pull_request: 7 | types: [opened] 8 | 9 | jobs: 10 | notify: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Send Slack notification 14 | run: | 15 | if [[ "${{ github.event_name }}" == "issues" ]]; then 16 | TYPE="Issue" 17 | TITLE="${{ github.event.issue.title }}" 18 | URL="${{ github.event.issue.html_url }}" 19 | USER="${{ github.event.issue.user.login }}" 20 | else 21 | TYPE="Pull Request" 22 | TITLE="${{ github.event.pull_request.title }}" 23 | URL="${{ github.event.pull_request.html_url }}" 24 | USER="${{ github.event.pull_request.user.login }}" 25 | fi 26 | 27 | PAYLOAD=$(jq -n \ 28 | --arg type "$TYPE" \ 29 | --arg title "$TITLE" \ 30 | --arg url "$URL" \ 31 | --arg user "$USER" \ 32 | '{ 33 | text: "*New GitHub \($type)* :sparkles:", 34 | attachments: [ 35 | { 36 | color: "#36a64f", 37 | title: $title, 38 | title_link: $url, 39 | fields: [ 40 | { 41 | title: "Author", 42 | value: $user, 43 | short: true 44 | } 45 | ] 46 | } 47 | ] 48 | }') 49 | 50 | curl -X POST -H 'Content-type: application/json' --data "$PAYLOAD" $SLACK_WEBHOOK_URL 51 | env: 52 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} 53 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "example"] 2 | path = example 3 | url = https://github.com/bunq/tinker_php.git 4 | -------------------------------------------------------------------------------- /.php-cs-fixer.php: -------------------------------------------------------------------------------- 1 | in(__DIR__) 5 | ->exclude([ 6 | 'vendor', 7 | 'src/Model/Generated' 8 | ]); 9 | 10 | $config = new PhpCsFixer\Config(); 11 | return $config 12 | ->setRules([ 13 | '@PSR2' => true, 14 | 'array_syntax' => [ 15 | 'syntax' => 'short' 16 | ], 17 | 'class_keyword_remove' => false, 18 | 'concat_space' => [ 19 | 'spacing' => 'one' 20 | ], 21 | 'combine_consecutive_unsets' => true, 22 | 'general_phpdoc_annotation_remove' => [ 23 | 'annotations' => ['@author'], 24 | ], 25 | 'linebreak_after_opening_tag' => true, 26 | 'echo_tag_syntax' => [ 27 | 'format' => 'long' 28 | ], 29 | 'no_useless_return' => true, 30 | 'not_operator_with_space' => false, 31 | 'not_operator_with_successor_space' => false, 32 | 'ordered_imports' => true, 33 | 'phpdoc_add_missing_param_annotation' => true, 34 | 'protected_to_private' => true, 35 | 'semicolon_after_instruction' => true, 36 | ]) 37 | ->setFinder($finder); -------------------------------------------------------------------------------- /.zappr.yaml: -------------------------------------------------------------------------------- 1 | autobranch: 2 | pattern: 'bunq/sdk_php#{number}-{title}' 3 | length: 100 4 | commit: 5 | message: 6 | patterns: 7 | - '([A-Za-z0-9 ]+)\. (\(bunq\/sdk_php#[0-9]+\))' 8 | specification: 9 | title: 10 | minimum-length: 11 | enabled: true 12 | length: 8 13 | body: 14 | minimum-length: 15 | enabled: true 16 | length: 8 17 | contains-url: true 18 | contains-issue-number: true 19 | template: 20 | differs-from-body: true 21 | pull-request: 22 | labels: 23 | additional: true 24 | required: 25 | - Can be merged 26 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 bunq b.v. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /bin/bunq-install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getMessage()); 34 | } catch (Exception $exception) { 35 | echo sprintf(InstallationUtil::ERROR_EXCEPTION, $exception->getMessage()); 36 | } 37 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bunq/sdk_php", 3 | "description": "bunq PHP SDK", 4 | "keywords": [ 5 | "open-banking", 6 | "sepa", 7 | "bunq", 8 | "finance", 9 | "api", 10 | "payment" 11 | ], 12 | "homepage": "https://bunq.com/", 13 | "license": "MIT", 14 | "authors": [ 15 | { 16 | "name": "bunq", 17 | "email": "sdk@bunq.com", 18 | "homepage": "https://www.bunq.com", 19 | "role": "Owner" 20 | } 21 | ], 22 | "require": { 23 | "php": "^7.3 || ^8.0", 24 | "composer-plugin-api": "~1.0 || ~2.0", 25 | "ext-curl": "*", 26 | "ext-json": "*", 27 | "ext-mbstring": "*", 28 | "guzzlehttp/guzzle": "^7.4" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "bunq\\": "src/" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "bunq\\test\\": "tests/" 38 | } 39 | }, 40 | "require-dev": { 41 | "composer/composer": "^1.10.11 || ^2.0.1", 42 | "friendsofphp/php-cs-fixer": "^3.0", 43 | "php-parallel-lint/php-parallel-lint": "^1.2", 44 | "phpro/grumphp": "^1.9", 45 | "phpstan/phpstan": "^1.10", 46 | "phpunit/phpunit": "^9.5" 47 | }, 48 | "bin": [ 49 | "bin/bunq-install" 50 | ], 51 | "config": { 52 | "sort-packages": true, 53 | "platform": { 54 | "php": "8.3" 55 | }, 56 | "allow-plugins": { 57 | "phpro/grumphp": false 58 | } 59 | }, 60 | "scripts": { 61 | "phpstan": [ 62 | "./vendor/bin/phpstan analyse --level 2 src" 63 | ] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /phpstan-baseline.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | ignoreErrors: 3 | - 4 | message: "#^PHPDoc tag @param references unknown parameter\\: \\$userCompanyId$#" 5 | count: 2 6 | path: src/Model/Generated/Endpoint/UserCompanyApiObject.php 7 | 8 | - 9 | message: "#^PHPDoc tag @param references unknown parameter\\: \\$userId$#" 10 | count: 1 11 | path: src/Model/Generated/Endpoint/UserApiObject.php 12 | 13 | - 14 | message: "#^PHPDoc tag @param references unknown parameter\\: \\$userPersonId$#" 15 | count: 2 16 | path: src/Model/Generated/Endpoint/UserPersonApiObject.php 17 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 2 3 | tmpDir: cache/phpstan 4 | excludePaths: 5 | - vendor/* 6 | ignoreErrors: 7 | - '#Method .* should return array\<.*\> but returns array\\.#' 8 | - '#Unsafe usage of new static\(\)\.#' 9 | - '#Parameter \$event of method .+ has invalid type Composer\\Script\\Event\.#' 10 | - '#Parameter \$io of method .+ has invalid type Composer\\IO\\IOInterface\.#' 11 | - '#Call to method getIO\(\) on an unknown class Composer\\Script\\Event\.#' 12 | - '#Unsafe call to private method .+ through static::\.#' 13 | - '#Unsafe access to private property .+ through static::\.#' 14 | reportUnmatchedIgnoredErrors: false 15 | featureToggles: 16 | nodeConnectingVisitorCompatibility: false 17 | includes: 18 | - phpstan-baseline.neon 19 | -------------------------------------------------------------------------------- /src/Exception/ApiException.php: -------------------------------------------------------------------------------- 1 | responseCode = $responseCode; 28 | $this->responseId = $responseId; 29 | 30 | parent::__construct($message); 31 | } 32 | 33 | /** 34 | * @return string 35 | */ 36 | public function getResponseId(): string 37 | { 38 | return $this->responseId; 39 | } 40 | 41 | /** 42 | * @return int 43 | */ 44 | public function getResponseCode(): int 45 | { 46 | return $this->responseCode; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Exception/BadRequestException.php: -------------------------------------------------------------------------------- 1 | value = $value; 31 | $this->headers = $headers; 32 | $this->pagination = $pagination; 33 | } 34 | 35 | /** 36 | * @param BunqResponse $bunqResponse 37 | * 38 | * @return static 39 | */ 40 | public static function castFromBunqResponse(BunqResponse $bunqResponse): BunqResponse 41 | { 42 | return new static( 43 | $bunqResponse->getValue(), 44 | $bunqResponse->getHeaders(), 45 | $bunqResponse->getPagination() 46 | ); 47 | } 48 | 49 | /** 50 | * @return mixed 51 | */ 52 | public function getValue() 53 | { 54 | return $this->value; 55 | } 56 | 57 | /** 58 | * @return string[] 59 | */ 60 | public function getHeaders(): array 61 | { 62 | return $this->headers; 63 | } 64 | 65 | /** 66 | * @return Pagination|null 67 | */ 68 | public function getPagination() 69 | { 70 | return $this->pagination; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/Http/BunqResponseRaw.php: -------------------------------------------------------------------------------- 1 | bodyString = $bodyString; 27 | $this->headers = $headers; 28 | } 29 | 30 | /** 31 | * @return string|StreamInterface 32 | */ 33 | public function getBodyString() 34 | { 35 | return $this->bodyString; 36 | } 37 | 38 | /** 39 | * @return string[] 40 | */ 41 | public function getHeaders() 42 | { 43 | return $this->headers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Http/Certificate/api.bunq.com.pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwoaEBO+DoZ+a65WBPYog 3 | vX9qe1bm99lECWBWLDGkJwvoOe4c3v0og4JNPm+NdyZCjogmhOJSjbx3zK/QTbcB 4 | kayWBD5fQba9yI7jR/uAciCTUMBRlIsXGd6OUkK8YsGbWEDeXZq6w+AmFGqTOAmK 5 | V2qvkzDIr1GRhDLNLY8o5EP1SDUmj5CJCGnJ+zyOymjHESQTzsY3YDhaHsDg7/+Y 6 | 4FoCB9QfqHLY51GA0cwrhS/h4SAZjo49ooS1ykxBQneRM9X0Pc/AAHnqcvq5mJqs 7 | jpGiSp1OAIhsiSSKVaQvT2d/4cFsZKrHDBEZT8Y8N4Ycy3b1299S0TqPbF16nI5C 8 | 4QIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /src/Http/Handler/HandlerBase.php: -------------------------------------------------------------------------------- 1 | execute($request), $options); 24 | }; 25 | }; 26 | } 27 | 28 | /** 29 | * Middleware that applies a map function to the resolved promise's 30 | * response. 31 | * 32 | * @param ResponseHandlerBase $responseHandler 33 | * 34 | * @return callable 35 | */ 36 | public static function applyResponseHandler(ResponseHandlerBase $responseHandler): callable 37 | { 38 | return function (callable $handler) use ($responseHandler) { 39 | return function (RequestInterface $request, array $options) use ($handler, $responseHandler) { 40 | return $handler($request, $options)->then( 41 | function (ResponseInterface $response) use ($responseHandler) { 42 | return $responseHandler->execute($response); 43 | } 44 | ); 45 | }; 46 | }; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Http/Handler/RequestHandlerAuthentication.php: -------------------------------------------------------------------------------- 1 | sessionToken = $sessionToken; 27 | } 28 | 29 | /** 30 | * @param RequestInterface $request 31 | * 32 | * @return RequestInterface 33 | */ 34 | public function execute(RequestInterface $request): RequestInterface 35 | { 36 | if (is_null($this->sessionToken)) { 37 | return $request; 38 | } else { 39 | return $request->withHeader( 40 | self::HEADER_CLIENT_AUTHENTICATION, 41 | [$this->sessionToken->getToken()] 42 | ); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Http/Handler/RequestHandlerBase.php: -------------------------------------------------------------------------------- 1 | privateKey = $privateKey; 32 | } 33 | 34 | /** 35 | * @param RequestInterface $request 36 | * 37 | * @return RequestInterface 38 | */ 39 | public function execute(RequestInterface $request): RequestInterface 40 | { 41 | if ($request->getUri()->getPath() === self::ENDPOINT_INSTALLATION) { 42 | return $request; 43 | } else { 44 | $signature = $this->generateRequestSignature($request->getBody()->getContents()); 45 | 46 | return $request->withHeader(self::HEADER_CLIENT_SIGNATURE, $signature); 47 | } 48 | } 49 | 50 | /** 51 | * @param string $body 52 | * 53 | * @return string 54 | */ 55 | protected function generateRequestSignature(string $body): string 56 | { 57 | return $this->privateKey->sign($body); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Http/Handler/ResponseHandlerBase.php: -------------------------------------------------------------------------------- 1 | self::CHOICE_AUTHORIZATION_CODE, 20 | ]; 21 | 22 | /** 23 | * @return BunqEnumOauthGrantType 24 | */ 25 | public static function AUTHORIZATION_CODE(): BunqEnumOauthGrantType 26 | { 27 | return new static(self::CHOICE_AUTHORIZATION_CODE); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Model/Core/BunqEnumOauthResponseType.php: -------------------------------------------------------------------------------- 1 | self::CHOICE_CODE, 20 | ]; 21 | 22 | /** 23 | * @return BunqEnumOauthResponseType 24 | */ 25 | public static function CODE(): BunqEnumOauthResponseType 26 | { 27 | return new static(self::CHOICE_CODE); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Model/Core/BunqModelWrapper.php: -------------------------------------------------------------------------------- 1 | [ 23 | self::FIELD_PAYMENT => PaymentApiObject::OBJECT_TYPE_GET 24 | ] 25 | ]; 26 | 27 | /** 28 | * @param $className 29 | * @param $propertyName 30 | * 31 | * @return string|null 32 | */ 33 | public static function determineWrappingKey($className, $propertyName) 34 | { 35 | if (isset(self::MODEL_WRAPPING_MAP[$className])) { 36 | if (isset(self::MODEL_WRAPPING_MAP[$className][$propertyName])) { 37 | return self::MODEL_WRAPPING_MAP[$className][$propertyName]; 38 | } 39 | } 40 | 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Model/Core/BunqResponseInstallation.php: -------------------------------------------------------------------------------- 1 | post( 42 | vsprintf( 43 | self::ENDPOINT_URL_CREATE, 44 | [] 45 | ), 46 | [ 47 | self::FIELD_DESCRIPTION => $description, 48 | self::FIELD_SECRET => $secret, 49 | self::FIELD_PERMITTED_IPS => $permittedIps, 50 | ], 51 | $allCustomHeader 52 | ); 53 | 54 | return BunqResponseInt::castFromBunqResponse( 55 | static::processForId($responseRaw) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Model/Core/Id.php: -------------------------------------------------------------------------------- 1 | id; 19 | } 20 | 21 | /** 22 | * @return bool 23 | */ 24 | protected function isAllFieldNull() 25 | { 26 | if (!is_null($this->id)) { 27 | return false; 28 | } 29 | 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Model/Core/NotificationFilterPushUserInternal.php: -------------------------------------------------------------------------------- 1 | post( 27 | vsprintf( 28 | self::ENDPOINT_URL_CREATE, 29 | [static::determineUserId()] 30 | ), 31 | [self::FIELD_NOTIFICATION_FILTERS => $allNotificationFilter], 32 | $allHeaderCustom 33 | ); 34 | 35 | return BunqResponseNotificationFilterPushApiObjectList::castFromBunqResponse( 36 | static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Model/Core/NotificationFilterUrlMonetaryAccountInternal.php: -------------------------------------------------------------------------------- 1 | post( 30 | vsprintf( 31 | self::ENDPOINT_URL_CREATE, 32 | [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)] 33 | ), 34 | [self::FIELD_NOTIFICATION_FILTERS => $allNotificationFilter], 35 | $allHeaderCustom 36 | ); 37 | 38 | return BunqResponseNotificationFilterUrlMonetaryAccountApiObjectList::castFromBunqResponse( 39 | static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET) 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Model/Core/NotificationFilterUrlUserInternal.php: -------------------------------------------------------------------------------- 1 | post( 26 | vsprintf( 27 | self::ENDPOINT_URL_CREATE, 28 | [static::determineUserId()] 29 | ), 30 | [self::FIELD_NOTIFICATION_FILTERS => $allNotificationFilter], 31 | $allHeaderCustom 32 | ); 33 | 34 | return BunqResponseNotificationFilterUrlApiObjectList::castFromBunqResponse( 35 | static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET) 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Model/Core/SandboxUserInternal.php: -------------------------------------------------------------------------------- 1 | post( 36 | vsprintf( 37 | self::ENDPOINT_URL_CREATE, 38 | [] 39 | ), 40 | [], 41 | $allCustomHeader 42 | ); 43 | 44 | return BunqResponseSandboxUserPerson::castFromBunqResponse( 45 | static::fromJson($responseRaw, self::OBJECT_TYPE_POST) 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Model/Core/ServerPublicKey.php: -------------------------------------------------------------------------------- 1 | serverPublicKey = new PublicKey($serverPublicKey); 26 | } 27 | 28 | /** 29 | * @return PublicKey 30 | */ 31 | public function getServerPublicKey(): PublicKey 32 | { 33 | return $this->serverPublicKey; 34 | } 35 | 36 | /** 37 | * @param mixed[] $responseArray 38 | * @param string|null $wrapper 39 | * 40 | * @return static 41 | */ 42 | protected static function createFromResponseArray( 43 | array $responseArray, 44 | string $wrapper = null 45 | ) { 46 | return new static($responseArray[self::FIELD_SERVER_PUBLIC_KEY]); 47 | } 48 | 49 | 50 | 51 | /** 52 | * @return bool 53 | */ 54 | protected function isAllFieldNull() 55 | { 56 | if (!is_null($this->serverPublicKey)) { 57 | return false; 58 | } 59 | 60 | return true; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Model/Core/Token.php: -------------------------------------------------------------------------------- 1 | token = $token; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getToken(): string 40 | { 41 | return $this->token; 42 | } 43 | 44 | /** 45 | * @return bool 46 | */ 47 | protected function isAllFieldNull() 48 | { 49 | if (!is_null($this->id)) { 50 | return false; 51 | } 52 | 53 | if (!is_null($this->created)) { 54 | return false; 55 | } 56 | 57 | if (!is_null($this->updated)) { 58 | return false; 59 | } 60 | 61 | if (!is_null($this->token)) { 62 | return false; 63 | } 64 | 65 | return true; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Model/Core/Uuid.php: -------------------------------------------------------------------------------- 1 | uuid; 19 | } 20 | 21 | /** 22 | * @return bool 23 | */ 24 | protected function isAllFieldNull() 25 | { 26 | if (!is_null($this->uuid)) { 27 | return false; 28 | } 29 | 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/BunqResponseAdditionalTransactionInformationCategoryApiObjectList.php: -------------------------------------------------------------------------------- 1 | statusFieldForRequest = $status; 38 | } 39 | 40 | /** 41 | * The status of the receipt. 42 | * 43 | * @return string 44 | */ 45 | public function getStatus() 46 | { 47 | return $this->status; 48 | } 49 | 50 | /** 51 | * @deprecated User should not be able to set values via setters, use constructor. 52 | * 53 | * @param string $status 54 | */ 55 | public function setStatus($status) 56 | { 57 | $this->status = $status; 58 | } 59 | 60 | /** 61 | * @return bool 62 | */ 63 | public function isAllFieldNull() 64 | { 65 | if (!is_null($this->status)) { 66 | return false; 67 | } 68 | 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/InvoiceExportPdfContentApiObject.php: -------------------------------------------------------------------------------- 1 | get( 39 | vsprintf( 40 | self::ENDPOINT_URL_LISTING, 41 | [static::determineUserId(), $invoiceId] 42 | ), 43 | [], 44 | $customHeaders 45 | ); 46 | 47 | return BunqResponseString::castFromBunqResponse( 48 | new BunqResponse($responseRaw->getBodyString(), $responseRaw->getHeaders()) 49 | ); 50 | } 51 | 52 | /** 53 | * @return bool 54 | */ 55 | public function isAllFieldNull() 56 | { 57 | return true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/MonetaryAccountAccessApiObject.php: -------------------------------------------------------------------------------- 1 | accessTypeFieldForRequest = $accessType; 38 | } 39 | 40 | /** 41 | * The access type of the monetary account access. 42 | * 43 | * @return string 44 | */ 45 | public function getAccessType() 46 | { 47 | return $this->accessType; 48 | } 49 | 50 | /** 51 | * @deprecated User should not be able to set values via setters, use constructor. 52 | * 53 | * @param string $accessType 54 | */ 55 | public function setAccessType($accessType) 56 | { 57 | $this->accessType = $accessType; 58 | } 59 | 60 | /** 61 | * @return bool 62 | */ 63 | public function isAllFieldNull() 64 | { 65 | if (!is_null($this->accessType)) { 66 | return false; 67 | } 68 | 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/PointMutationApiObject.php: -------------------------------------------------------------------------------- 1 | numberOfPoint; 28 | } 29 | 30 | /** 31 | * @deprecated User should not be able to set values via setters, use constructor. 32 | * 33 | * @param int $numberOfPoint 34 | */ 35 | public function setNumberOfPoint($numberOfPoint) 36 | { 37 | $this->numberOfPoint = $numberOfPoint; 38 | } 39 | 40 | /** 41 | * @return bool 42 | */ 43 | public function isAllFieldNull() 44 | { 45 | if (!is_null($this->numberOfPoint)) { 46 | return false; 47 | } 48 | 49 | return true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/ServerErrorApiObject.php: -------------------------------------------------------------------------------- 1 | post( 30 | vsprintf( 31 | self::ENDPOINT_URL_CREATE, 32 | [] 33 | ), 34 | [], 35 | $customHeaders 36 | ); 37 | 38 | return BunqResponseInt::castFromBunqResponse( 39 | static::processForId($responseRaw) 40 | ); 41 | } 42 | 43 | /** 44 | * @return bool 45 | */ 46 | public function isAllFieldNull() 47 | { 48 | return true; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/SessionApiObject.php: -------------------------------------------------------------------------------- 1 | delete( 33 | vsprintf( 34 | self::ENDPOINT_URL_DELETE, 35 | [$sessionId] 36 | ), 37 | $customHeaders 38 | ); 39 | 40 | return BunqResponseNull::castFromBunqResponse( 41 | new BunqResponse(null, $responseRaw->getHeaders()) 42 | ); 43 | } 44 | 45 | /** 46 | * @return bool 47 | */ 48 | public function isAllFieldNull() 49 | { 50 | return true; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Model/Generated/Endpoint/WhitelistApiObject.php: -------------------------------------------------------------------------------- 1 | idFieldForRequest = $id; 31 | } 32 | 33 | /** 34 | * The id of the attached Attachment. 35 | * 36 | * @return int 37 | */ 38 | public function getId() 39 | { 40 | return $this->id; 41 | } 42 | 43 | /** 44 | * @deprecated User should not be able to set values via setters, use constructor. 45 | * 46 | * @param int $id 47 | */ 48 | public function setId($id) 49 | { 50 | $this->id = $id; 51 | } 52 | 53 | /** 54 | * @return bool 55 | */ 56 | public function isAllFieldNull() 57 | { 58 | if (!is_null($this->id)) { 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/AttachmentUrlObject.php: -------------------------------------------------------------------------------- 1 | type; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $type 39 | */ 40 | public function setType($type) 41 | { 42 | $this->type = $type; 43 | } 44 | 45 | /** 46 | * The URL where the attachment can be downloaded. 47 | * 48 | * @return string 49 | */ 50 | public function getUrl() 51 | { 52 | return $this->url; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param string $url 59 | */ 60 | public function setUrl($url) 61 | { 62 | $this->url = $url; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->type)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->url)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/BunqIdObject.php: -------------------------------------------------------------------------------- 1 | idFieldForRequest = $id; 31 | } 32 | 33 | /** 34 | * An integer ID of an object. Unique per object type. 35 | * 36 | * @return int 37 | */ 38 | public function getId() 39 | { 40 | return $this->id; 41 | } 42 | 43 | /** 44 | * @deprecated User should not be able to set values via setters, use constructor. 45 | * 46 | * @param int $id 47 | */ 48 | public function setId($id) 49 | { 50 | $this->id = $id; 51 | } 52 | 53 | /** 54 | * @return bool 55 | */ 56 | public function isAllFieldNull() 57 | { 58 | if (!is_null($this->id)) { 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/CertificateObject.php: -------------------------------------------------------------------------------- 1 | certificateFieldForRequest = $certificate; 31 | } 32 | 33 | /** 34 | * A single certificate in the chain in .PEM format. 35 | * 36 | * @return string 37 | */ 38 | public function getCertificate() 39 | { 40 | return $this->certificate; 41 | } 42 | 43 | /** 44 | * @deprecated User should not be able to set values via setters, use constructor. 45 | * 46 | * @param string $certificate 47 | */ 48 | public function setCertificate($certificate) 49 | { 50 | $this->certificate = $certificate; 51 | } 52 | 53 | /** 54 | * @return bool 55 | */ 56 | public function isAllFieldNull() 57 | { 58 | if (!is_null($this->certificate)) { 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/HealthCheckResultEntryObject.php: -------------------------------------------------------------------------------- 1 | type; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $type 39 | */ 40 | public function setType($type) 41 | { 42 | $this->type = $type; 43 | } 44 | 45 | /** 46 | * The status of the HealthCheckResultEntry 47 | * 48 | * @return string 49 | */ 50 | public function getStatus() 51 | { 52 | return $this->status; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param string $status 59 | */ 60 | public function setStatus($status) 61 | { 62 | $this->status = $status; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->type)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->status)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/HealthCheckResultObject.php: -------------------------------------------------------------------------------- 1 | status; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $status 39 | */ 40 | public function setStatus($status) 41 | { 42 | $this->status = $status; 43 | } 44 | 45 | /** 46 | * The entries on which the current status is based. 47 | * 48 | * @return HealthCheckResultEntryObject[] 49 | */ 50 | public function getAllEntry() 51 | { 52 | return $this->allEntry; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param HealthCheckResultEntryObject[] $allEntry 59 | */ 60 | public function setAllEntry($allEntry) 61 | { 62 | $this->allEntry = $allEntry; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->status)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->allEntry)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/MasterCardActionReferenceObject.php: -------------------------------------------------------------------------------- 1 | eventId; 26 | } 27 | 28 | /** 29 | * @deprecated User should not be able to set values via setters, use constructor. 30 | * 31 | * @param int $eventId 32 | */ 33 | public function setEventId($eventId) 34 | { 35 | $this->eventId = $eventId; 36 | } 37 | 38 | /** 39 | * @return bool 40 | */ 41 | public function isAllFieldNull() 42 | { 43 | if (!is_null($this->eventId)) { 44 | return false; 45 | } 46 | 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/PaymentArrivalExpectedObject.php: -------------------------------------------------------------------------------- 1 | status; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $status 39 | */ 40 | public function setStatus($status) 41 | { 42 | $this->status = $status; 43 | } 44 | 45 | /** 46 | * The time when the payment is expected to arrive. 47 | * 48 | * @return string 49 | */ 50 | public function getTime() 51 | { 52 | return $this->time; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param string $time 59 | */ 60 | public function setTime($time) 61 | { 62 | $this->time = $time; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->status)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->time)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/PermittedDeviceObject.php: -------------------------------------------------------------------------------- 1 | description; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $description 39 | */ 40 | public function setDescription($description) 41 | { 42 | $this->description = $description; 43 | } 44 | 45 | /** 46 | * The IP address of the device that may use the credential. 47 | * 48 | * @return string 49 | */ 50 | public function getIp() 51 | { 52 | return $this->ip; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param string $ip 59 | */ 60 | public function setIp($ip) 61 | { 62 | $this->ip = $ip; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->description)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->ip)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/RequestInquiryReferenceObject.php: -------------------------------------------------------------------------------- 1 | type; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $type 39 | */ 40 | public function setType($type) 41 | { 42 | $this->type = $type; 43 | } 44 | 45 | /** 46 | * The id of the request inquiry (batch). 47 | * 48 | * @return int 49 | */ 50 | public function getId() 51 | { 52 | return $this->id; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param int $id 59 | */ 60 | public function setId($id) 61 | { 62 | $this->id = $id; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->type)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->id)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowedObject.php: -------------------------------------------------------------------------------- 1 | key; 33 | } 34 | 35 | /** 36 | * @deprecated User should not be able to set values via setters, use constructor. 37 | * 38 | * @param string $key 39 | */ 40 | public function setKey($key) 41 | { 42 | $this->key = $key; 43 | } 44 | 45 | /** 46 | * The label. 47 | * 48 | * @return string 49 | */ 50 | public function getName() 51 | { 52 | return $this->name; 53 | } 54 | 55 | /** 56 | * @deprecated User should not be able to set values via setters, use constructor. 57 | * 58 | * @param string $name 59 | */ 60 | public function setName($name) 61 | { 62 | $this->name = $name; 63 | } 64 | 65 | /** 66 | * @return bool 67 | */ 68 | public function isAllFieldNull() 69 | { 70 | if (!is_null($this->key)) { 71 | return false; 72 | } 73 | 74 | if (!is_null($this->name)) { 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/Security/PrivateKey.php: -------------------------------------------------------------------------------- 1 | key = $key; 19 | } 20 | 21 | /** 22 | * @param string $dataToSign 23 | * 24 | * @return string 25 | */ 26 | public function sign(string $dataToSign): string 27 | { 28 | openssl_sign($dataToSign, $signature, $this->getKey(), OPENSSL_ALGO_SHA256); 29 | 30 | return base64_encode($signature); 31 | } 32 | 33 | /** 34 | * @return resource 35 | */ 36 | public function getKey() 37 | { 38 | return $this->key; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function export(): string 45 | { 46 | openssl_pkey_export($this->getKey(), $privateKeyString); 47 | 48 | return $privateKeyString; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Security/PublicKey.php: -------------------------------------------------------------------------------- 1 | key = $key; 19 | } 20 | 21 | /** 22 | * @param string $dataToEncrypt 23 | * 24 | * @return string 25 | */ 26 | public function encrypt(string $dataToEncrypt): string 27 | { 28 | openssl_public_encrypt($dataToEncrypt, $encrypted, $this->getKey()); 29 | 30 | return $encrypted; 31 | } 32 | 33 | /** 34 | * @return resource 35 | */ 36 | public function getKey() 37 | { 38 | return $this->key; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Util/BunqEnum.php: -------------------------------------------------------------------------------- 1 | supportedChoices[$choice])) { 33 | $this->choice = $choice; 34 | } else { 35 | throw new BunqException(self::UNEXPECTED_VALUE, [$choice]); 36 | } 37 | } 38 | 39 | /** 40 | * @param mixed $other 41 | * 42 | * @return bool 43 | */ 44 | public function equals($other = null): bool 45 | { 46 | if (is_null($other)) { 47 | return false; 48 | } else { 49 | return 50 | $other instanceof static && 51 | $other->getChoiceString() === $this->getChoiceString(); 52 | } 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getChoiceString(): string 59 | { 60 | return $this->choice; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Util/BunqEnumApiEnvironmentType.php: -------------------------------------------------------------------------------- 1 | self::CHOICE_PRODUCTION, 19 | self::CHOICE_SANDBOX => self::CHOICE_SANDBOX, 20 | ]; 21 | 22 | /** 23 | * @return BunqEnumApiEnvironmentType 24 | */ 25 | public static function PRODUCTION(): BunqEnumApiEnvironmentType 26 | { 27 | return new static(self::CHOICE_PRODUCTION); 28 | } 29 | 30 | /** 31 | * @return BunqEnumApiEnvironmentType 32 | */ 33 | public static function SANDBOX(): BunqEnumApiEnvironmentType 34 | { 35 | return new static(self::CHOICE_SANDBOX); 36 | } 37 | } 38 | --------------------------------------------------------------------------------