diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache new file mode 100644 index 00000000..888444f4 --- /dev/null +++ b/.php-cs-fixer.cache @@ -0,0 +1 @@ +{"php":"8.1.14","version":"3.13.2:v3.13.2#3952f08a81bd3b1b15e11c3de0b6bf037faa8496","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":{"allow_single_line_closure":false,"position_after_functions_and_oop_constructs":"next","position_after_anonymous_constructs":"next","position_after_control_structures":"next"},"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"single_trait_insert_per_statement":true},"hashes":{"src\/BuckarooClient.php":"a04feed78f40b502363053f348a95d42","src\/Config\/Config.php":"3049e56bf3e3a3f2b947f4a18cded93a","src\/Config\/DefaultConfig.php":"ff088b4e5124f40155cc198401134378","src\/Exceptions\/BuckarooException.php":"d2544fdaa34bf1de4d51630f8d9cc5a9","src\/Exceptions\/TransferException.php":"d6d7bc200cb3e9697368e423c2dfacd5","src\/Handlers\/Credentials.php":"72547a0871ef078f61217d9c387e8bf6","src\/Handlers\/HMAC\/Generator.php":"285cbc96e2eb0a709b1d541602257cae","src\/Handlers\/HMAC\/Hmac.php":"18f9016e7c5aea3a0b692d20723940a7","src\/Handlers\/HMAC\/Validator.php":"75a5227ff35b94611b9799121e026abc","src\/Handlers\/Logging\/DefaultLogger.php":"91e9a8fa50a5770f092be6a546f4f179","src\/Handlers\/Logging\/Loggable.php":"f4b7e8704cbbe37d9c354801bebbfc59","src\/Handlers\/Logging\/Observer.php":"060d6e5806f7d7e16004d03cab986d37","src\/Handlers\/Logging\/Observers\/ErrorReporter.php":"7ec7da9e92f3b23b4c5d4efce8d86bd9","src\/Handlers\/Logging\/Observers\/Monolog.php":"b74e205fce2dd76bd9e70867ccb8f8ec","src\/Handlers\/Logging\/Subject.php":"3d67799142a50aab2eef4e24219cb74e","src\/Handlers\/Reply\/HttpPost.php":"4e0f9906ba5d6cdd307ebfadee255542","src\/Handlers\/Reply\/Json.php":"c9843468bfb3433c27fcd733d659e28a","src\/Handlers\/Reply\/ReplyHandler.php":"db1fe60f80a3c5d8c4e4250743e4eafa","src\/Handlers\/Reply\/ReplyStrategy.php":"5bab082004f01d9950a9bc1ff468cd69","src\/Models\/Adapters\/ServiceParametersKeysAdapter.php":"b9ba2ebeed2dcfc47dac37dca6f3546c","src\/Models\/AdditionalParameters.php":"4971bbecdfda4aafd081ff5dbc1e3dd0","src\/Models\/Address.php":"ceeab777c91d46aeae2d4e7ab5d7df99","src\/Models\/Article.php":"aa20190c5a3dd2ff6ae169268a2d34e0","src\/Models\/BankAccount.php":"e82a08360df8697c9e059178a7c8fbd8","src\/Models\/ClientIP.php":"e19df1c3fe6357c96c26e2f8ff1e5e29","src\/Models\/Company.php":"d47ad3497173c8fc6fb6fc3daa73aec9","src\/Models\/Debtor.php":"3e6ab2b25de1e477d44bfb1165913366","src\/Models\/Email.php":"982763a72eb2935b8a9b3e9982ed72ca","src\/Models\/Interfaces\/Recipient.php":"85589ae85ccc2fdeecc18b3b2a0fdcbb","src\/Models\/Model.php":"2c7d00151866c93051e081a74097bd88","src\/Models\/Payload\/PayPayload.php":"cca5ff8b604ae2aa749b6b3dfabbaf82","src\/Models\/Payload\/Payload.php":"7a0b6e8625d6fdc41c98aefbe37ae306","src\/Models\/Payload\/RefundPayload.php":"50ca2b6fadd6d1dfc1af85e4e475a551","src\/Models\/Person.php":"da9fce2330f7dbe81553cdf6a6ff5474","src\/Models\/Phone.php":"1a9f7c4872419d316fdebb2703f658a8","src\/Models\/ServiceList.php":"e51064ef8722035a1af8577f1cdb29dc","src\/Models\/ServiceParameter.php":"dafc671a780a47388f2cf6067b9c08ce","src\/Models\/Services.php":"953ba8de24fdf96f25f87a19439528d4","src\/PaymentMethods\/Afterpay\/Afterpay.php":"5220a26153046c35a71c5f9544a8c07c","src\/PaymentMethods\/Afterpay\/Models\/Article.php":"1101df36002c534b8194c8f38b5f359c","src\/PaymentMethods\/Afterpay\/Models\/Pay.php":"e8d7f0818eb7078a61ca31056c8c1394","src\/PaymentMethods\/Afterpay\/Models\/Person.php":"400ed6119966980ff0c48ca7e75702c6","src\/PaymentMethods\/Afterpay\/Models\/Recipient.php":"1da6ea525690661c2237ab21382ed19e","src\/PaymentMethods\/Afterpay\/Models\/Refund.php":"bc0c928de027bd2c3eca4ad997d2ed10","src\/PaymentMethods\/Afterpay\/Service\/ParameterKeys\/AddressAdapter.php":"692191fd233a1ea93b3dea94a8b4a9d1","src\/PaymentMethods\/Afterpay\/Service\/ParameterKeys\/ArticleAdapter.php":"c9cf7fac3e8bd7554fb773180301ddfe","src\/PaymentMethods\/Afterpay\/Service\/ParameterKeys\/PhoneAdapter.php":"5a13e983066abe460ae4831cabe1c428","src\/PaymentMethods\/Afterpay\/Service\/ParameterKeys\/RecipientAdapter.php":"9ce22d14bc2d17220e3f5765720f713a","src\/PaymentMethods\/AfterpayDigiAccept\/AfterpayDigiAccept.php":"a17f362fc17716edaf11c5e6c2f1dc8f","src\/PaymentMethods\/AfterpayDigiAccept\/Models\/Pay.php":"59cb734c920506b03f62bd89b9590554","src\/PaymentMethods\/AfterpayDigiAccept\/Models\/Recipient.php":"049301de1c6a4ca82cba08830ff04eb0","src\/PaymentMethods\/AfterpayDigiAccept\/Models\/Refund.php":"0453cf9fdd07cd1ff5cb68feac2cc2c1","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/AddressAdapter.php":"81ac818062aaf5e4aca0deaef2d0f17c","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/ArticleAdapter.php":"54cb4aa29bbfa9d13250d7c90069eab0","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/EmailAdapter.php":"607a333d0355446d5b2bb5d78d2648af","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/PhoneAdapter.php":"e025168a23f2bc4033e4f08669604ee7","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/RecipientAdapter.php":"9f932e8753a8dd4bb8e2a4c5a5b4be9b","src\/PaymentMethods\/AfterpayDigiAccept\/Service\/ParameterKeys\/ServiceAdapter.php":"bc34e01a54c01929cda40c8bac36de03","src\/PaymentMethods\/Alipay\/Alipay.php":"dd908e596902c85130e0e4920da04272","src\/PaymentMethods\/Alipay\/Models\/Pay.php":"fb9572ebd5464e8a006c0681a452e951","src\/PaymentMethods\/ApplePay\/ApplePay.php":"877e953b5326ffa57f75dbe34496c185","src\/PaymentMethods\/ApplePay\/Models\/Pay.php":"3b614359549f91062e646ab56f436490","src\/PaymentMethods\/ApplePay\/Models\/PayPayload.php":"c676ee7ee1bcc1907a04a27f9e2ac160","src\/PaymentMethods\/Bancontact\/Bancontact.php":"0fdc7bf41bf2669e20e919deebcc3ff9","src\/PaymentMethods\/Bancontact\/Models\/Authenticate.php":"62906afe0a165a35651eb394b951193d","src\/PaymentMethods\/Bancontact\/Models\/Pay.php":"8fc9760c4052b60eb79d5ffa3b0ae69b","src\/PaymentMethods\/Bancontact\/Models\/PayEncrypted.php":"f0f4283c57c8ab2bb06e5f5950f8e643","src\/PaymentMethods\/BankTransfer\/BankTransfer.php":"15b6812b9c8cc34f2d81aaa685c99f5d","src\/PaymentMethods\/BankTransfer\/Models\/Pay.php":"991cff07b81d31ad98343c9ccf674510","src\/PaymentMethods\/BankTransfer\/Service\/ParameterKeys\/CustomerAdapter.php":"6c859ee4db8fc7fa505e5e7987da5977","src\/PaymentMethods\/BankTransfer\/Service\/ParameterKeys\/EmailAdapter.php":"cdbdc24a8503270b046be3553bfe4583","src\/PaymentMethods\/BankTransfer\/Service\/ParameterKeys\/PayAdapter.php":"ae9149be34d4d0912b490722b6756e86","src\/PaymentMethods\/Belfius\/Belfius.php":"6d0514225d9c9f5281900d7bc53e704c","src\/PaymentMethods\/Billink\/Billink.php":"adb3e9af9aea69f6ed8c2d0f8ecc280b","src\/PaymentMethods\/Billink\/Models\/Article.php":"ed916bb29315a44950f44604b5a6b399","src\/PaymentMethods\/Billink\/Models\/Capture.php":"d78606a9918a5925ed15a11cc29df1f6","src\/PaymentMethods\/Billink\/Models\/Pay.php":"74e1561269fdf63a24a696cb0de0c5fb","src\/PaymentMethods\/Billink\/Models\/Recipient.php":"39b57b32e18e6069844aad09f92b0f43","src\/PaymentMethods\/Billink\/Service\/ParameterKeys\/AddressAdapter.php":"8de6d09943d0621affdda7e724708274","src\/PaymentMethods\/Billink\/Service\/ParameterKeys\/ArticleAdapter.php":"4f5d6145f7becd1ed27ca33f22077397","src\/PaymentMethods\/Billink\/Service\/ParameterKeys\/PhoneAdapter.php":"0edca59d6e4c151f1c85fe465c6ef3bd","src\/PaymentMethods\/Billink\/Service\/ParameterKeys\/RecipientAdapter.php":"105fa7a29317a0b80f1a8b9b119c5fc1","src\/PaymentMethods\/BuckarooVoucher\/BuckarooVoucher.php":"b181c9e03dd924b899cac175e8c15259","src\/PaymentMethods\/BuckarooVoucher\/Models\/Create.php":"767d5866d5be79b887c0fcb2dc37f7c3","src\/PaymentMethods\/BuckarooVoucher\/Models\/CreatePayload.php":"42913f90c793c2ed1b27fc855fae68c8","src\/PaymentMethods\/BuckarooVoucher\/Models\/Deactivate.php":"96bed609390d0ecb3dd8a94dd9ba240b","src\/PaymentMethods\/BuckarooVoucher\/Models\/GetBalance.php":"65b690ff91464e3898d3d960467c6690","src\/PaymentMethods\/BuckarooVoucher\/Models\/Pay.php":"e39a2921209a5c4ec9f5649dd3c4ac50","src\/PaymentMethods\/BuckarooWallet\/BuckarooWallet.php":"ef5b362c63a5fde93fa3281690c79c41","src\/PaymentMethods\/BuckarooWallet\/Models\/DepositReservePayload.php":"c57b8f8352bc2b4eac33fa49d8416958","src\/PaymentMethods\/BuckarooWallet\/Models\/ReleasePayload.php":"e31a198d3046222442855a7ec111d9ef","src\/PaymentMethods\/BuckarooWallet\/Models\/Wallet.php":"fd1d7d36ea9c27bc6da65aadb2d48a38","src\/PaymentMethods\/BuckarooWallet\/Service\/ParameterKeys\/BankAccountAdapter.php":"3a433e884d2b0d755f469a20861a6430","src\/PaymentMethods\/BuckarooWallet\/Service\/ParameterKeys\/CustomerAdapter.php":"303e6c1671897d735dd113cc4166af1d","src\/PaymentMethods\/BuckarooWallet\/Service\/ParameterKeys\/EmailAdapter.php":"703b17e3e3fcb9175aab78ce7d317ef7","src\/PaymentMethods\/CreditCard\/CreditCard.php":"025762107dba72d62e3c8f6a1de74bbd","src\/PaymentMethods\/CreditCard\/Models\/CardData.php":"df7536390b7b2b7a63903a0ff3d24069","src\/PaymentMethods\/CreditCard\/Models\/SecurityCode.php":"d9a6a20c5ca807629e3b4a1877446132","src\/PaymentMethods\/CreditClick\/CreditClick.php":"9e5484352aa2b73cbf5ece5e238d826f","src\/PaymentMethods\/CreditClick\/Models\/Pay.php":"8e8763e5fdf905c1c58e689fc96a77d0","src\/PaymentMethods\/CreditClick\/Models\/Refund.php":"82ec73b5892602d35c0321150ec499b7","src\/PaymentMethods\/CreditClick\/Service\/ParameterKeys\/CustomerAdapter.php":"7f94f0737428a95fde806eec14d2be5d","src\/PaymentMethods\/CreditManagement\/CreditManagement.php":"2bb0a0507d143bc8d42ea4c6cb523f92","src\/PaymentMethods\/CreditManagement\/Models\/AddOrUpdateProductLines.php":"5275167ba0256eb6e0aeffe0f6ade3a5","src\/PaymentMethods\/CreditManagement\/Models\/Article.php":"61b8495754e71a08c69f4aa5267c5e0b","src\/PaymentMethods\/CreditManagement\/Models\/CreditNote.php":"386def7c4e3295db852923423ac99b9b","src\/PaymentMethods\/CreditManagement\/Models\/Debtor.php":"611fdd1a517f779701709420e7b0866e","src\/PaymentMethods\/CreditManagement\/Models\/DebtorFile.php":"59f4fe33c0156a68fb9153b492a3c824","src\/PaymentMethods\/CreditManagement\/Models\/DebtorInfo.php":"f78fdb63e146972a09975a234b7e1d44","src\/PaymentMethods\/CreditManagement\/Models\/Invoice.php":"6a0c3c9d3f6149bcdd5b7f5cd20f6170","src\/PaymentMethods\/CreditManagement\/Models\/MultipleInvoiceInfo.php":"e8b87aa2fcbd7357f0cea6ef05f4f0f0","src\/PaymentMethods\/CreditManagement\/Models\/PaymentPlan.php":"1e1c12e66f2091ba9a65090364ad62dd","src\/PaymentMethods\/CreditManagement\/Service\/ParameterKeys\/ArticleAdapter.php":"d644cfeb053b9ed4c585badae22c39cd","src\/PaymentMethods\/CreditManagement\/Service\/ParameterKeys\/DebtorInfoAdapter.php":"111483943c0c031041d2cf9c5bdd6896","src\/PaymentMethods\/EPS\/EPS.php":"4a19a3827ec83faed3a7abae33fb60c2","src\/PaymentMethods\/Emandates\/Emandates.php":"e1f0adf6f026b2004ca4db417295a483","src\/PaymentMethods\/Emandates\/Models\/Mandate.php":"825f7606cdce24b7cd87c85c56ef51be","src\/PaymentMethods\/GiftCard\/GiftCard.php":"605c12b4ba7a57b69538a94bcfd1bc48","src\/PaymentMethods\/GiftCard\/Models\/Pay.php":"5672b5bb84a6ec7989fb82b3c70f566f","src\/PaymentMethods\/GiftCard\/Models\/PayPayload.php":"6beb12d039bb1a75e9545860c3cbf9bc","src\/PaymentMethods\/Giropay\/Giropay.php":"afe9d431a68e56af845b5945c6ee6d72","src\/PaymentMethods\/Giropay\/Models\/Pay.php":"bd0fb92797290265baafbef8c143d77b","src\/PaymentMethods\/In3\/In3.php":"2ce32872023af75f0a60be62474f46a9","src\/PaymentMethods\/In3\/Models\/Pay.php":"bc41a5976dc954f06bab49e3451b4931","src\/PaymentMethods\/In3\/Models\/PayPayload.php":"5e1559127bd6bcc39af9cba5016f71fe","src\/PaymentMethods\/In3\/Models\/Subtotal.php":"1a9ac4476a45521af82482e1be6ba854","src\/PaymentMethods\/In3\/Service\/ParameterKeys\/AddressAdapter.php":"53b92ce98c02ae7d93e6b14227563b47","src\/PaymentMethods\/In3\/Service\/ParameterKeys\/ArticleAdapter.php":"58b9d16f6ea930ac4efc763a326e28ca","src\/PaymentMethods\/In3\/Service\/ParameterKeys\/CompanyAdapter.php":"f5ea7377501c6af673f61849e5566f58","src\/PaymentMethods\/In3\/Service\/ParameterKeys\/PhoneAdapter.php":"2d6f0fa594ab03430d55ec26dcd8ba39","src\/PaymentMethods\/Interfaces\/Combinable.php":"b3a8a715e15d40f1fec8e8aa69e23db4","src\/PaymentMethods\/KBC\/KBC.php":"1dd2a8585a64b8078339a1172f09bf10","src\/PaymentMethods\/KlarnaKP\/KlarnaKP.php":"2c5696440cc568dc337c0d7cb4ebfc48","src\/PaymentMethods\/KlarnaKP\/Models\/Payload.php":"b33d782fc49f5ec4e61aa240da52d2de","src\/PaymentMethods\/KlarnaKP\/Models\/Recipient.php":"1ea7c1ca72ea5b10c109db5752ed158f","src\/PaymentMethods\/KlarnaKP\/Service\/ParameterKeys\/AddressAdapter.php":"b683bbacf1c10c1e7b0dc3625b83730a","src\/PaymentMethods\/KlarnaKP\/Service\/ParameterKeys\/ArticleAdapter.php":"7d987920678ff84247fa9941d2a219d0","src\/PaymentMethods\/KlarnaKP\/Service\/ParameterKeys\/EmailAdapter.php":"6c7a63c151b2d52475ba843259e369da","src\/PaymentMethods\/KlarnaKP\/Service\/ParameterKeys\/PhoneAdapter.php":"3f18c0a203e29cdb2c7fbed3e5e78e71","src\/PaymentMethods\/KlarnaKP\/Service\/ParameterKeys\/RecipientAdapter.php":"a79df1fdeb4bcc7f4147218891a266df","src\/PaymentMethods\/KlarnaPay\/KlarnaPay.php":"74ffbf3cc7239a4dbb3ab30698e19792","src\/PaymentMethods\/KlarnaPay\/Models\/Pay.php":"158f36bcb659ea6d2fe6226c7dd6900c","src\/PaymentMethods\/KlarnaPay\/Models\/PayPayload.php":"74f8711b521078bc34dfb2abeef6bcb6","src\/PaymentMethods\/KlarnaPay\/Models\/Recipient.php":"d5cf4d926b5d08c514150fc4e98f6343","src\/PaymentMethods\/KlarnaPay\/Service\/ParameterKeys\/AddressAdapter.php":"ae4d5a23dc640095d90cbb919ecdeab2","src\/PaymentMethods\/KlarnaPay\/Service\/ParameterKeys\/ArticleAdapter.php":"99629484c73633b2fcef73e74a2016ca","src\/PaymentMethods\/KlarnaPay\/Service\/ParameterKeys\/PhoneAdapter.php":"dbede561858850c098431e29785363a4","src\/PaymentMethods\/Marketplaces\/Marketplaces.php":"a58ad6edd52a8da52e37c55f88bf6a42","src\/PaymentMethods\/Marketplaces\/Models\/Marketplace.php":"c56e09f922cdc3c84912ba11414f37cc","src\/PaymentMethods\/Marketplaces\/Models\/Seller.php":"36a79655bb1190ecb8781b3b7fcd7ddf","src\/PaymentMethods\/Marketplaces\/Models\/ServiceList.php":"a25677f4cb9f55a72f90c78d9e05fad9","src\/PaymentMethods\/PayPerEmail\/Models\/Attachment.php":"ccff70fe9482b7ac0c4ee99c0f1e3923","src\/PaymentMethods\/PayPerEmail\/Models\/PaymentInvitation.php":"db244fffd49b47138ad8d32d14af187d","src\/PaymentMethods\/PayPerEmail\/PayPerEmail.php":"c07cb576cd8f37362b11dac19a7898e6","src\/PaymentMethods\/PayPerEmail\/Service\/ParameterKeys\/AttachmentAdapter.php":"cc857add67db197985a4879125190f84","src\/PaymentMethods\/PayPerEmail\/Service\/ParameterKeys\/CustomerAdapter.php":"cff29d3c99971efd11d19fc7392d23e2","src\/PaymentMethods\/PayPerEmail\/Service\/ParameterKeys\/EmailAdapter.php":"b16e545c775b75e3ed3747ef2151154b","src\/PaymentMethods\/PayablePaymentMethod.php":"eeb8a8a289ad40f6c7bffea0efe56311","src\/PaymentMethods\/Payconiq\/Payconiq.php":"057415ee3ede1bbbc1d9cb67a5e51bc2","src\/PaymentMethods\/PaymentFacade.php":"ba72ae85a84fe7f8c296b89f9fd9250e","src\/PaymentMethods\/PaymentInterface.php":"accc043249c9d1184d4fb100f14fb303","src\/PaymentMethods\/PaymentMethod.php":"0f51af639e899532e7e5df812644ec86","src\/PaymentMethods\/PaymentMethodFactory.php":"4d8d697c43d0931150afa37c8902a8a9","src\/PaymentMethods\/Paypal\/Models\/Address.php":"74d8d0bc2ac7235e4a1a657cc70827c9","src\/PaymentMethods\/Paypal\/Models\/ExtraInfo.php":"b1e13c02b0c39531358693233b028bf7","src\/PaymentMethods\/Paypal\/Models\/Pay.php":"67225ec2037509db760c99ad4038d459","src\/PaymentMethods\/Paypal\/Paypal.php":"ab57cc1612f2438ea246cd745bbd6b3c","src\/PaymentMethods\/Paypal\/Service\/ParameterKeys\/AddressAdapter.php":"d370a51df269afcfad9dc75e8e148dd4","src\/PaymentMethods\/Paypal\/Service\/ParameterKeys\/PhoneAdapter.php":"046f3a220b5602d42482a3a3ec389f9a","src\/PaymentMethods\/PointOfSale\/Models\/Pay.php":"e1842ac15bedd7a83aeaa296049252eb","src\/PaymentMethods\/PointOfSale\/PointOfSale.php":"25637901753d2c07d00ab6bf0beb381c","src\/PaymentMethods\/Przelewy24\/Models\/Pay.php":"814d22c0721a1c222f44dbd9a97383f7","src\/PaymentMethods\/Przelewy24\/Przelewy24.php":"1c983da62802be6050cfc74d8057f67f","src\/PaymentMethods\/Przelewy24\/Service\/ParameterKeys\/CustomerAdapter.php":"bc65a7576fe49c7c36d10f96f578fcc4","src\/PaymentMethods\/Przelewy24\/Service\/ParameterKeys\/EmailAdapter.php":"6af44a175667a1691e5161f8e7758d4e","src\/PaymentMethods\/RequestToPay\/Models\/Pay.php":"2fad82aa8337684d09515abef60a8b4d","src\/PaymentMethods\/RequestToPay\/RequestToPay.php":"7178be8eba90bce0db5d7a52a886ba88","src\/PaymentMethods\/RequestToPay\/Service\/ParameterKeys\/CustomerAdapter.php":"8462aea2ecf95c390320fb679baa982c","src\/PaymentMethods\/SEPA\/Models\/ExtraInfo.php":"22e1282bfe0d8d4a619e2e3488781709","src\/PaymentMethods\/SEPA\/Models\/Pay.php":"830cef74f9747712da251f22dac45a8f","src\/PaymentMethods\/SEPA\/SEPA.php":"4b1ca116d0a6fdb1af60ce65d6d58ae5","src\/PaymentMethods\/SEPA\/Service\/ParameterKeys\/AddressAdapter.php":"889d7bf15ae56a1e915e8174c98a7bad","src\/PaymentMethods\/SEPA\/Service\/ParameterKeys\/CustomerAdapter.php":"2af215870b7bb4d3c8fcf7c2e2de2ade","src\/PaymentMethods\/SEPA\/Service\/ParameterKeys\/PayAdapter.php":"d3b6a8f9c8bd89562484aa0d4d2fae45","src\/PaymentMethods\/Sofort\/Sofort.php":"c9569a2fd82566d49e0ab32049e31790","src\/PaymentMethods\/Subscriptions\/Models\/Charge.php":"5504ef5f4d0bc17d96265d16c5e12bd7","src\/PaymentMethods\/Subscriptions\/Models\/CombinedPayload.php":"596b2cff5735b04501f222405d5972f3","src\/PaymentMethods\/Subscriptions\/Models\/RatePlan.php":"9388bde594fb072e9464f00dd199e446","src\/PaymentMethods\/Subscriptions\/Models\/ResumeSubscription.php":"17986644eddcb97b87df97a9b3aee5cf","src\/PaymentMethods\/Subscriptions\/Models\/Subscription.php":"e6b7efee299adfe4e42af3ec3a3b0ca4","src\/PaymentMethods\/Subscriptions\/Service\/ParameterKeys\/CompanyAdapter.php":"a7b7d8f8accfcf9d36a1529b6e000939","src\/PaymentMethods\/Subscriptions\/Subscriptions.php":"eb54f618f94dfacfc4c99af8c789e629","src\/PaymentMethods\/Surepay\/Models\/Verify.php":"027841518d304cdf248d8cf1939ee0c8","src\/PaymentMethods\/Surepay\/Service\/ParameterKeys\/BankAccountAdapter.php":"9c1fa1ab42ab667878db82e1d6fbf8e0","src\/PaymentMethods\/Surepay\/Surepay.php":"bf44ddde109ed1fc424b6c585ab9bc51","src\/PaymentMethods\/Tinka\/Models\/Article.php":"2e2b75383981bd6bbff67cfe7a4ad566","src\/PaymentMethods\/Tinka\/Models\/Pay.php":"049ead8ce258a9e0ac6db008285ee31b","src\/PaymentMethods\/Tinka\/Models\/Recipient.php":"a1eb20125c466d0b48028c6c4f00f46c","src\/PaymentMethods\/Tinka\/Service\/ParameterKeys\/AddressAdapter.php":"82e58c240201ff1468b8b9be353f33e9","src\/PaymentMethods\/Tinka\/Service\/ParameterKeys\/ArticleAdapter.php":"05c428e81a33f41916f688964eb906da","src\/PaymentMethods\/Tinka\/Service\/ParameterKeys\/CustomerAdapter.php":"be0e6db5b2a617fc6bc9e22af096ff9a","src\/PaymentMethods\/Tinka\/Service\/ParameterKeys\/PhoneAdapter.php":"43c682cf85f9fbdeb64b9637df3a0240","src\/PaymentMethods\/Tinka\/Tinka.php":"90bf921d625064956a42dae45a155e1d","src\/PaymentMethods\/Traits\/CountableGroupKey.php":"bbaf4ac62c697e4ea8ecdc0ad979b08f","src\/PaymentMethods\/Trustly\/Models\/Pay.php":"4d7d1f5790586bb743c7205f34064b83","src\/PaymentMethods\/Trustly\/Service\/ParameterKeys\/CustomerAdapter.php":"e18c0a88bc3ba7f213623c11b2ddb78f","src\/PaymentMethods\/Trustly\/Service\/ParameterKeys\/PayAdapter.php":"ac193e9ad3cb7c91f33c93dba4876771","src\/PaymentMethods\/Trustly\/Trustly.php":"2e8290e1eaae8a1cd8e57b5e4f949f70","src\/PaymentMethods\/WeChatPay\/Models\/Pay.php":"b6752b57a0f3d33711c2d47ec6bcb4d8","src\/PaymentMethods\/WeChatPay\/WeChatPay.php":"7ff27945ea981100f38b22c0c529dfd7","src\/PaymentMethods\/iDeal\/Models\/Pay.php":"8953ccceaed38d93289ac3e4a0ed01b5","src\/PaymentMethods\/iDeal\/iDeal.php":"c702d7245950e5a9207f0ccccfc84cc9","src\/PaymentMethods\/iDealQR\/Models\/Generate.php":"f62e5ea61ee49356adaecbee64b4614e","src\/PaymentMethods\/iDealQR\/iDealQR.php":"b5ab8add224e4ce6119ab15e5674f8a6","src\/PaymentMethods\/iDin\/Models\/Issuer.php":"902e454bbfebb4bd52e6ef8b8ba98414","src\/PaymentMethods\/iDin\/Service\/ParameterKeys\/IssuerAdapter.php":"c94438083ea61affd5d9e93e408bb81e","src\/PaymentMethods\/iDin\/iDin.php":"90ce856c9fee3f40cb14d7c3a7af3ef5","src\/Resources\/Arrayable.php":"309daa9c8e87e451a36c15936d5096ea","src\/Resources\/Constants\/CreditManagementInstallmentInterval.php":"56be568c35303858ae97945530c21396","src\/Resources\/Constants\/Endpoints.php":"1ae5ae439f1e44add96c81154b667c00","src\/Resources\/Constants\/Gender.php":"97e49539071851397500521f9c89a12d","src\/Resources\/Constants\/IPProtocolVersion.php":"0db5ea9636219a2c7413db7123cf9bf6","src\/Resources\/Constants\/RecipientCategory.php":"5c1e88ed6130c05a6e70a7d63a93d35b","src\/Resources\/Constants\/ResponseStatus.php":"415427f1ee6d9d6f0ae0b493f35f7ced","src\/Services\/PayloadService.php":"b9389c2f502dba9d991deb80b0d35423","src\/Services\/ServiceListParameters\/DefaultParameters.php":"70310adb54e262d917a6f7cf56f33845","src\/Services\/ServiceListParameters\/ModelParameters.php":"95b6660ae0e9ea3b1c2a9b49c6464325","src\/Services\/ServiceListParameters\/ServiceListParameter.php":"6a3ee9bf76707933ca0e5f62b939b1ef","src\/Services\/TransactionHeaders\/CultureHeader.php":"4ab1521e0ba6d540413a28f40df56efc","src\/Services\/TransactionHeaders\/DefaultHeader.php":"49e846e47a97aec9e88e07876c91292b","src\/Services\/TransactionHeaders\/HmacHeader.php":"989d350872e2c2be58e58d194afeff00","src\/Services\/TransactionHeaders\/SoftwareHeader.php":"401661ee7e91717cc8e85dd287350697","src\/Services\/TransactionHeaders\/TransactionHeader.php":"3561b8da46cc8c2e30e388f4c14f43a2","src\/Services\/TransactionService.php":"645011cb9016de8ba4fe0e327c4c0e2f","src\/Tests\/BuckarooTestCase.php":"59fa0474f05eeb7fb58804f9c7a5abbf","src\/Tests\/ConfirmingCredentialsTest.php":"dafe9ac0d2130dd00a70a608bea45d79","src\/Tests\/Payments\/AfterpayDigiAcceptTest.php":"fa8f831a79138d351fc32f8689e894ad","src\/Tests\/Payments\/AfterpayTest.php":"7f9118c1255135c177c53622bde616d0","src\/Tests\/Payments\/AlipayTest.php":"34a11d65eaed60e78ba07c7ff212a8d6","src\/Tests\/Payments\/ApplepayTest.php":"03c6df81d4e5c1cfd9bd8de7dde6c1cc","src\/Tests\/Payments\/BancontactTest.php":"447848fa9bda9e46da7b6982d0f7beeb","src\/Tests\/Payments\/BelfiusTest.php":"d2d89a38269c89f958028c369c242fec","src\/Tests\/Payments\/BillinkTest.php":"e280f20bc1243a1e02bb411cde4c6a65","src\/Tests\/Payments\/BuckarooVoucherTest.php":"d89df1433fb4cfb96bf78d8f18ec4c5f","src\/Tests\/Payments\/BuckarooWalletTest.php":"afc1d0548f753945247999ba807afc48","src\/Tests\/Payments\/CreditClickTest.php":"1a2ebccf1d39c85f10dc94b4f65bc532","src\/Tests\/Payments\/CreditManagementTest.php":"d4962a2314b90551cd3d5d5045747204","src\/Tests\/Payments\/CreditcardTest.php":"97973a52c7c293bb465f18dbf7f6e738","src\/Tests\/Payments\/EPSTest.php":"723848a3ceac50ecc55bea1628af5524","src\/Tests\/Payments\/EmandatesTest.php":"ace1767a1082bd018c5bd92133668921","src\/Tests\/Payments\/GiftcardsTest.php":"3c95aac83049355c7406fafc238612a9","src\/Tests\/Payments\/GiropayTest.php":"d34db9464001d482efced6fce154fa81","src\/Tests\/Payments\/IdealQRTest.php":"762cffefc22390fa4cc9cfb8b2c69ac8","src\/Tests\/Payments\/IdealTest.php":"4358913a9c1cbb542a718ae63e191eae","src\/Tests\/Payments\/In3Test.php":"2f4cfd0f4fd6867dc9baa84a8af3e818","src\/Tests\/Payments\/KBCTest.php":"0613bc4562721c6f708ecdb5bc5e2e09","src\/Tests\/Payments\/KlarnaKPTest.php":"a37a85f8e1e890da350538e3700f3d4d","src\/Tests\/Payments\/KlarnaTest.php":"5bd8aa0aaed355119ee62f60e72d4750","src\/Tests\/Payments\/MarketplacesTest.php":"739a6b5b6800d013ac303a09bf2d3e7a","src\/Tests\/Payments\/PayPerEmailTest.php":"b3ba3a1b035a6d20c878ca7789b8bf4c","src\/Tests\/Payments\/PayconiqTest.php":"7fe90286f337d89d5957645e4c9cdc78","src\/Tests\/Payments\/PaypalTest.php":"cad91a5da101aa184aa553e218269c12","src\/Tests\/Payments\/PosTest.php":"e62ed85f8f5d4bfc656af138e5929ffc","src\/Tests\/Payments\/Przelewy24Test.php":"8a97e176c3647bc0987fbe45d2ef954c","src\/Tests\/Payments\/PushTest.php":"f5ba3c83801cafa0dc87d8627b9908cc","src\/Tests\/Payments\/RequestToPayTest.php":"cfe293133184adcfeda67bdea48e1d5a","src\/Tests\/Payments\/SepaTest.php":"dfb262ed8dfd9a7015d34ac7946f84f5","src\/Tests\/Payments\/SofortTest.php":"8286e4a926c887f550d4a876de6d192a","src\/Tests\/Payments\/SubscriptionsTest.php":"ea6b39b1218bc5691c554c8ebf0e1501","src\/Tests\/Payments\/SurepayTest.php":"22cd38b25e69cad31722e3ece6469976","src\/Tests\/Payments\/TinkaTest.php":"b07f3ffc272c4a14c393d232c2c33922","src\/Tests\/Payments\/TransferTest.php":"282bbf6c8069947eab3d26295e375c98","src\/Tests\/Payments\/TrustlyTest.php":"d182a0b78d88ae9eab551c751d4292b0","src\/Tests\/Payments\/WeChatPayTest.php":"8914f8ad3347995891c3993da76662cc","src\/Tests\/Payments\/iDinTest.php":"08f737792c22a2730c97edcce3976f88","src\/Transaction\/Client.php":"03b658c31b936d5925a53da3754f3917","src\/Transaction\/Request\/HttpClient\/HttpClientAbstract.php":"fca81cd7e91893e62dc1e20e5550c4c6","src\/Transaction\/Request\/HttpClient\/HttpClientGuzzle.php":"028365cd09b32f68f3c72912c0406a71","src\/Transaction\/Request\/HttpClient\/HttpClientInterface.php":"848ed947a3d1fa37d02cd99052c278bc","src\/Transaction\/Request\/Request.php":"702c743d61aa070aa8c8407b70421a1d","src\/Transaction\/Request\/TransactionRequest.php":"5f53d3e7cd9db218ad1727721519496e","src\/Transaction\/Response\/Response.php":"07b5db6302a16ee85c1689b7e32a1392","src\/Transaction\/Response\/TransactionResponse.php":"af0fe1f4f94d166bee59387adee881f8","example\/additional_services\/credit_management.php":"32ebd2c0cd3cd10b074c35edd114e674","example\/additional_services\/idin.php":"7dd17bb4d43dd2ae991ebe4686a7c6d2","example\/additional_services\/marketplaces.php":"307e99ab0f2342eeb80c756b4d2e81ed","example\/additional_services\/pay_per_email.php":"d3e2fc698cd56d5c1379f29c587da5df","example\/additional_services\/subscriptions.php":"ae86639ebd10a3aa26d1f3c516d4bdb2","example\/additional_services\/surepay.php":"cf0dd7b1f1aa99c94a5bb68bfccc5445","example\/additional_services\/voucher.php":"bdb49b1d45e44bf5fdd705032e9f4d57","example\/additional_services\/wallets.php":"962b46e5e78ca375562dd7f864550e83","example\/bootstrap.php":"2db7c0b07d6e3a932bc988e1131a6665","example\/responses\/push.php":"f87925d03c57e376f6ad85d8fb12fab0","example\/responses\/return.php":"88d46cf36ec3550a3c0daca8aad94849","example\/transactions\/afterpay.php":"f8dc471f412bb3fefbf6c5a5f50c55aa","example\/transactions\/afterpaydigiaccept.php":"81b4d5de6624b4dc52dd37d6eb44fed8","example\/transactions\/alipay.php":"3b87fc27ec2ac13b13553454ae632fcd","example\/transactions\/applepay.php":"0d507f91f2224307c33fe85c52f8e732","example\/transactions\/applepay_redirect.php":"00ba0cabc3a7bb547f8821fadf94c74b","example\/transactions\/bancontact.php":"d1ee54f16d05c1a9126cbf228951d44f","example\/transactions\/belfius.php":"16a0efb01febb9cbcd70f7badcf5c64d","example\/transactions\/billink.php":"9305b0ee2b569d5ea1b5ac3f702bfc4e","example\/transactions\/credit_click.php":"27463cb1ab953baa0b7a82d32b500996","example\/transactions\/creditcard.php":"98a19b4d843617f53bd93f447fe3df0a","example\/transactions\/eps.php":"46fa813019489d29dd68e02b9bfa2a92","example\/transactions\/giftcards.php":"89a4fd8eb260009808402066944f7b95","example\/transactions\/giftcards_redirect.php":"1e7c17cd1c83a39e4b230758fdc77e0c","example\/transactions\/giropay.php":"2c82c4a5aa0fee3dc8c0ad40d3c5d791","example\/transactions\/ideal.php":"b346b5816272e6b626850efffb1d5f28","example\/transactions\/ideal_qr.php":"9bea404b446fb5ef442f09af33401b57","example\/transactions\/in3.php":"f078817d49c83c22232bc615fc721521","example\/transactions\/kbc.php":"5c55f714be73d80e632912f3acb56def","example\/transactions\/klarna.php":"6e8d1b91bdc5992e5e514d3e652d25c9","example\/transactions\/klarnakp.php":"716cfcbdbb24e47f772330a85c4f69c4","example\/transactions\/payconiq.php":"cd952b2d7a6ce6df0e25f6c5f03230e1","example\/transactions\/paypal.php":"d819893fca49ff7ccbf140133d2ea7ac","example\/transactions\/pos.php":"cd2118e471e77210a4b687a98d067989","example\/transactions\/przelewy24.php":"d92bb6501d79d637ca91b811bb6e82e7","example\/transactions\/requesttopay.php":"d9bee74990c3f208ab3e8d4b459d497e","example\/transactions\/sepa.php":"10268e103cd7c7df9dd4b66988bcda82","example\/transactions\/sofort.php":"a8552ca60ec035fc0d03eafdbecfcca7","example\/transactions\/tinka.php":"1e10d360bf3987b4bf2dd07446ad610d","example\/transactions\/transfer.php":"53a25922b9707797df8d6d9623dc6565","example\/transactions\/trustly.php":"98c0c06cf6b3b6cad2ce5894dad8bb9b","example\/transactions\/wechat.php":"5c4f687f253b3b1c557feedcd45ad05b"}} \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..1f539060 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,42 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/example' + ]) + ->name('*.php') + ->notPath('bootstrap/*') + ->notPath('storage/*') + ->notPath('vendor') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline' => true, + 'phpdoc_scalar' => true, + 'unary_operator_spaces' => true, + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => [ + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], + ], + 'braces' => [ + 'allow_single_line_closure' => false, + 'position_after_functions_and_oop_constructs' => 'next', + 'position_after_anonymous_constructs' => 'next', + 'position_after_control_structures' => 'next', + ], + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_var_without_name' => true, + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ], + 'single_trait_insert_per_statement' => true, + ]) + ->setFinder($finder); \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c33bb91..a3c513b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,34 @@ All notable changes to this project will be documented in this file. ## [Released] +## [1.3.0] +- Add parameter retrieval in replyhandler, check lower & upper string +- Remove hardcoded iDEAL banks and use api call to retrieve the latest available iDEAL banks +- Add html_entity_decode for the validation checker +- Fixed combined subscription test +- Update Debtor code +- Fix additional parameters +- Add missing cardnumber & pin parameter in giftcard +- Check more condition on json return or push +- Php Clean code format PSR-12 +- Add payRemainderEncrypted to creditcard +- Add culture to default payload +- Use TransactionResponse when retrieving the transation status Report by @avido in https://github.com/buckaroo-it/BuckarooSDK_PHP/issues/71 +- Update rate_plans node to ratePlans for subscription method + +## [1.2.0] +- Add cancelAuthorize method to billink +- Bugfix billink +- Remove Careof in Klarna KP +- Add missing methods in afterpaydigiaccept & partial refund in afterpay +- Add missing parameter and add cancelauthorize +- BP-2088 Consistent naming for VAT in Credit Management +- Added new payment method Buckaroo voucher +- Add ApplePay payRedirect method + example fix +- All examples updated +- Update iDeal banks +- Fix missing FashionChequePin + ## [1.1.2] - Add missing service parameters to Giftcard payment - BP-2130 Examples updated. @@ -19,7 +47,6 @@ All notable changes to this project will be documented in this file. - BP-2059 Add CancelAuthorize for Creditcards & Missing APIs parameters ## [1.0.1] - - Add missing methods to different payment providers. - Support lower and/or upper case reply and push response. Report by @antonboutkam https://github.com/buckaroo-it/BuckarooSDK_PHP/issues/36 - Improve reply and push validation. Report by @antonboutkam https://github.com/buckaroo-it/BuckarooSDK_PHP/issues/36 @@ -29,5 +56,4 @@ All notable changes to this project will be documented in this file. - Moved vlucas/phpdotenv to dev-dependency. Report by @ederuiter https://github.com/buckaroo-it/BuckarooSDK_PHP/issues/32 ## [1.0.0] - - Initial release. \ No newline at end of file diff --git a/composer.json b/composer.json index 5bf182c0..dd68a786 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "buckaroo/sdk", "description": "Buckaroo payment SDK", "license": "MIT", - "version": "1.2.0", + "version": "1.3.0", "type": "library", "require": { "php": ">=7.4|^8.0", @@ -17,7 +17,8 @@ "squizlabs/php_codesniffer": "3.*", "symfony/var-dumper": "^5.4.9", "phpunit/phpunit": "^9.5", - "vlucas/phpdotenv": "^5.4" + "vlucas/phpdotenv": "^5.4", + "friendsofphp/php-cs-fixer": "^3.13" }, "authors": [{ "name": "Buckaroo", diff --git a/example/additional_services/credit_management.php b/example/additional_services/credit_management.php index ca50724c..e26bd257 100644 --- a/example/additional_services/credit_management.php +++ b/example/additional_services/credit_management.php @@ -12,60 +12,60 @@ // With the returned payload, we can combine it with the next payment. $invoice = $buckaroo->method('credit_management')->manually()->createCombinedInvoice([ - 'invoice' => rand(1000, 9999), - 'applyStartRecurrent' => 'False', - 'invoiceAmount' => 10.00, - 'invoiceAmountVAT' => 1.00, - 'invoiceDate' => date('Y-m-d'), - 'dueDate' => date('Y-m-d'), - 'schemeKey' => '2amq34', - 'maxStepIndex' => 1, - 'allowedServices' => 'ideal,mastercard', - 'debtor' => [ - 'code' => 'johnsmith4' + 'invoice' => rand(1000, 9999), + 'applyStartRecurrent' => 'False', + 'invoiceAmount' => 10.00, + 'invoiceAmountVAT' => 1.00, + 'invoiceDate' => date('Y-m-d'), + 'dueDate' => date('Y-m-d'), + 'schemeKey' => '2amq34', + 'maxStepIndex' => 1, + 'allowedServices' => 'ideal,mastercard', + 'debtor' => [ + 'code' => 'johnsmith4', ], - 'email' => 'youremail@example.nl', - 'phone' => [ - 'mobile' => '06198765432' + 'email' => 'youremail@example.nl', + 'phone' => [ + 'mobile' => '06198765432', ], - 'person' => [ - 'culture' => 'nl-NL', - 'title' => 'Msc', - 'initials' => 'JS', + 'person' => [ + 'culture' => 'nl-NL', + 'title' => 'Msc', + 'initials' => 'JS', 'firstName' => 'Test', 'lastNamePrefix' => 'Jones', 'lastName' => 'Aflever', - 'gender' => Gender::MALE + 'gender' => Gender::MALE, ], - 'company' => [ - 'culture' => 'nl-NL', - 'name' => 'My Company Corporation', + 'company' => [ + 'culture' => 'nl-NL', + 'name' => 'My Company Corporation', 'vatApplicable' => true, - 'vatNumber' => 'NL140619562B01', - 'chamberOfCommerce' => '20091741' + 'vatNumber' => 'NL140619562B01', + 'chamberOfCommerce' => '20091741', ], - 'address' => [ - 'street' => 'Hoofdtraat', - 'houseNumber' => '90', + 'address' => [ + 'street' => 'Hoofdtraat', + 'houseNumber' => '90', 'houseNumberSuffix' => 'A', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'country' => 'NL' - ] + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'country' => 'NL', + ], ]); // In this case, we have the payload stored in the $invoice variable. We can now combine it with the next payment using the combine method $response = $buckaroo->method('sepadirectdebit')->combine($invoice)->pay([ - 'invoice' => uniqid(), - 'amountDebit' => 10.10, - 'iban' => 'NL13TEST0123456789', - 'bic' => 'TESTNL2A', - 'collectdate' => date('Y-m-d'), - 'mandateReference' => '1DCtestreference', - 'mandateDate' => '2022-07-03', - 'customer' => [ - 'name' => 'John Smith' - ] -]); \ No newline at end of file + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'iban' => 'NL13TEST0123456789', + 'bic' => 'TESTNL2A', + 'collectdate' => date('Y-m-d'), + 'mandateReference' => '1DCtestreference', + 'mandateDate' => '2022-07-03', + 'customer' => [ + 'name' => 'John Smith', + ], +]); diff --git a/example/additional_services/idin.php b/example/additional_services/idin.php index 0deeec41..8fe3a8b6 100644 --- a/example/additional_services/idin.php +++ b/example/additional_services/idin.php @@ -8,15 +8,15 @@ //Identify $response = $buckaroo->method('idin')->identify([ - 'issuer' => 'BANKNL2Y' + 'issuer' => 'BANKNL2Y', ]); //Verify $response = $buckaroo->method('idin')->verify([ - 'issuer' => 'BANKNL2Y' + 'issuer' => 'BANKNL2Y', ]); //Login $response = $buckaroo->method('idin')->login([ - 'issuer' => 'BANKNL2Y' -]); \ No newline at end of file + 'issuer' => 'BANKNL2Y', +]); diff --git a/example/additional_services/marketplaces.php b/example/additional_services/marketplaces.php index 0e02323e..2091ec03 100644 --- a/example/additional_services/marketplaces.php +++ b/example/additional_services/marketplaces.php @@ -8,26 +8,26 @@ $marketplace = $buckaroo->method('marketplaces')->manually()->split([ 'daysUntilTransfer' => 2, - 'marketplace' => [ - 'amount' => 10, - 'description' => 'INV0001 Commission Marketplace' + 'marketplace' => [ + 'amount' => 10, + 'description' => 'INV0001 Commission Marketplace', ], - 'sellers' => [ + 'sellers' => [ [ - 'accountId' => '789C60F316D24B088ACD471', - 'amount' => 50, - 'description' => 'INV001 Payout Make-Up Products BV' + 'accountId' => '789C60F316D24B088ACD471', + 'amount' => 50, + 'description' => 'INV001 Payout Make-Up Products BV', ], [ - 'accountId' => '369C60F316D24B088ACD238', - 'amount' => 35, - 'description' => 'INV0001 Payout Beauty Products BV' - ] - ] + 'accountId' => '369C60F316D24B088ACD238', + 'amount' => 35, + 'description' => 'INV0001 Payout Beauty Products BV', + ], + ], ]); $response = $buckaroo->method('ideal')->combine($marketplace)->pay([ - 'invoice' => uniqid(), + 'invoice' => uniqid(), 'amountDebit' => 95.00, - 'issuer' => 'ABNANL2A' -]); \ No newline at end of file + 'issuer' => 'ABNANL2A', +]); diff --git a/example/additional_services/pay_per_email.php b/example/additional_services/pay_per_email.php index ebcd6e67..c45ec115 100644 --- a/example/additional_services/pay_per_email.php +++ b/example/additional_services/pay_per_email.php @@ -8,16 +8,16 @@ $buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); $response = $buckaroo->method('payperemail')->paymentInvitation([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'merchantSendsEmail' => false, - 'email' => 'johnsmith@gmail.com', - 'expirationDate' => carbon()->addDays()->format('Y-m-d'), + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'merchantSendsEmail' => false, + 'email' => 'johnsmith@gmail.com', + 'expirationDate' => carbon()->addDays()->format('Y-m-d'), 'paymentMethodsAllowed' => 'ideal,mastercard,paypal', - 'attachment' => '', - 'customer' => [ - 'gender' => Gender::FEMALE, - 'firstName' => 'John', - 'lastName' => 'Smith' - ] -]); \ No newline at end of file + 'attachment' => '', + 'customer' => [ + 'gender' => Gender::FEMALE, + 'firstName' => 'John', + 'lastName' => 'Smith', + ], +]); diff --git a/example/additional_services/subscriptions.php b/example/additional_services/subscriptions.php index 0312b52a..6539111e 100644 --- a/example/additional_services/subscriptions.php +++ b/example/additional_services/subscriptions.php @@ -9,100 +9,100 @@ //** START Create Duo Combined */ $subscriptions = $buckaroo->method('subscriptions')->manually()->createCombined([ - 'includeTransaction' => false, - 'transactionVatPercentage' => 5, - 'configurationCode' => 'xxxxx', - 'email' => 'test@buckaroo.nl', - 'rate_plans' => [ - 'add' => [ - 'startDate' => date('Y-m-d'), - 'ratePlanCode' => 'xxxxxx', - ] + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'xxxxx', + 'email' => 'test@buckaroo.nl', + 'rate_plans' => [ + 'add' => [ + 'startDate' => date('Y-m-d'), + 'ratePlanCode' => 'xxxxxx', + ], ], - 'phone' => [ - 'mobile' => '0612345678' + 'phone' => [ + 'mobile' => '0612345678', ], - 'debtor' => [ - 'code' => 'xxxxxx' + 'debtor' => [ + 'code' => 'xxxxxx', ], - 'person' => [ - 'firstName' => 'John', - 'lastName' => 'Do', - 'gender' => Gender::FEMALE, - 'culture' => 'nl-NL', - 'birthDate' => date('Y-m-d') + 'person' => [ + 'firstName' => 'John', + 'lastName' => 'Do', + 'gender' => Gender::FEMALE, + 'culture' => 'nl-NL', + 'birthDate' => date('Y-m-d'), + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '90', + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '90', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'country' => 'NL' - ] ]); $response = $buckaroo->method('ideal')->combine($subscriptions)->pay([ - 'invoice' => uniqid(), + 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'issuer' => 'ABNANL2A' + 'issuer' => 'ABNANL2A', ]); //** END Create Duo Combined */ //** START Create Triple Combined */ $subscriptions = $buckaroo->method('subscriptions')->manually()->createCombined([ - 'includeTransaction' => false, - 'transactionVatPercentage' => 5, - 'configurationCode' => 'xxxxx', - 'email' => 'test@buckaroo.nl', - 'rate_plans' => [ - 'add' => [ - 'startDate' => date('Y-m-d'), - 'ratePlanCode' => 'xxxxxx', - ] + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'xxxxx', + 'email' => 'test@buckaroo.nl', + 'rate_plans' => [ + 'add' => [ + 'startDate' => date('Y-m-d'), + 'ratePlanCode' => 'xxxxxx', + ], + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' + 'debtor' => [ + 'code' => 'xxxxxx', ], - 'debtor' => [ - 'code' => 'xxxxxx' + 'person' => [ + 'firstName' => 'John', + 'lastName' => 'Do', + 'gender' => Gender::FEMALE, + 'culture' => 'nl-NL', + 'birthDate' => date('Y-m-d'), ], - 'person' => [ - 'firstName' => 'John', - 'lastName' => 'Do', - 'gender' => Gender::FEMALE, - 'culture' => 'nl-NL', - 'birthDate' => date('Y-m-d') + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '90', + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '90', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'country' => 'NL' - ] ]); $paypal_extra_info = $buckaroo->method('paypal')->manually()->extraInfo([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'customer' => [ - 'name' => 'John Smith' + 'customer' => [ + 'name' => 'John Smith', ], - 'address' => [ - 'street' => 'Hoofstraat 90', - 'street2' => 'Street 2', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'zipcode' => '8441AB', - 'country' => 'NL' + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' - ] ]); $response = $buckaroo->method('paypal')->combine($subscriptions)->combine($paypal_extra_info)->pay([ 'amountDebit' => 10, - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); -//** END Create Triple Combined */ \ No newline at end of file +//** END Create Triple Combined */ diff --git a/example/additional_services/surepay.php b/example/additional_services/surepay.php index 570cc7b7..33f5017b 100644 --- a/example/additional_services/surepay.php +++ b/example/additional_services/surepay.php @@ -8,8 +8,8 @@ //Verify $response = $buckaroo->method('surepay')->verify([ - 'bankAccount' => [ - 'iban' => 'NL13TEST0123456789', - 'accountName' => 'John Doe' - ] -]); \ No newline at end of file + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', + 'accountName' => 'John Doe', + ], +]); diff --git a/example/additional_services/voucher.php b/example/additional_services/voucher.php index b340adbe..4567fa5f 100644 --- a/example/additional_services/voucher.php +++ b/example/additional_services/voucher.php @@ -20,9 +20,9 @@ //Pay $response = $buckaroo->method('buckaroovoucher')->pay( [ - 'amountDebit' =>'10', + 'amountDebit' => '10', 'invoice' => uniqid(), - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] ); @@ -30,10 +30,10 @@ //Pay $response = $buckaroo->method('buckaroovoucher')->payRemainder( [ - 'amountDebit' =>'10', + 'amountDebit' => '10', 'invoice' => uniqid(), 'vouchercode' => 'vouchercode', - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', ] ); @@ -43,20 +43,20 @@ [ 'amountCredit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', ] ); //Get Balance $response = $buckaroo->method('buckaroovoucher')->getBalance( [ - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] ); //Deactivate $response = $buckaroo->method('buckaroovoucher')->deactivate( [ - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] -); \ No newline at end of file +); diff --git a/example/additional_services/wallets.php b/example/additional_services/wallets.php index b0104de3..ffd0a5bc 100644 --- a/example/additional_services/wallets.php +++ b/example/additional_services/wallets.php @@ -7,13 +7,13 @@ $buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); $response = $buckaroo->method('buckaroo_wallet')->createWallet([ - 'walletId' => uniqid(), - 'email' => 'test@buckaroo.nl', - 'customer' => [ - 'firstName' => 'John', - 'lastName' => 'Doe' + 'walletId' => uniqid(), + 'email' => 'test@buckaroo.nl', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Doe', ], - 'bankAccount' => [ - 'iban' => 'NL13TEST0123456789', - ] -]); \ No newline at end of file + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', + ], +]); diff --git a/example/bootstrap.php b/example/bootstrap.php index 9764bff8..b3bf3821 100644 --- a/example/bootstrap.php +++ b/example/bootstrap.php @@ -2,7 +2,6 @@ use Dotenv\Dotenv; - require_once __DIR__ . "/../vendor/autoload.php"; $dotenv = Dotenv::createImmutable(__DIR__ . "/../"); diff --git a/example/responses/push.php b/example/responses/push.php index 6478e270..84d9ec4b 100644 --- a/example/responses/push.php +++ b/example/responses/push.php @@ -29,7 +29,7 @@ "brq_timestamp" => "2022-05-24 07:29:09", "brq_transactions" => "4C1BE53E2C42412AB32A799D9316E7DD", "brq_websitekey" => "IBjihN7Fhp", - "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5" + "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5", ]; $reply_handler = new ReplyHandler($buckaroo->client()->config(), $post_data); @@ -41,9 +41,9 @@ //START JSON PUSH $auth_header = 'IBjihN7Fhp:0YvyjYAzDQ28W+hQi80f2nhe0Z1QFJLbz7IH//6LsAU=:cad1832100784f57a6e6de835d9f3638:1658227572'; $post_data = '{"Transaction":{"Key":"5340604668D74435AA344E1428ED1292","Invoice":"62d68b6c8ab0c","ServiceCode":"ideal","Status":{"Code":{"Code":190,"Description":"Success"},"SubCode":{"Code":"S001","Description":"Transaction successfully processed"},"DateTime":"2022-07-19T12:46:12"},"IsTest":true,"Order":"ORDER_NO_62d68b6ca2df3","Currency":"EUR","AmountDebit":10.1,"TransactionType":"C021","Services":[{"Name":"ideal","Action":null,"Parameters":[{"Name":"consumerIssuer","Value":"ABN AMRO"},{"Name":"transactionId","Value":"0000000000000001"},{"Name":"consumerName","Value":"J. de Tèster"},{"Name":"consumerIBAN","Value":"NL44RABO0123456789"},{"Name":"consumerBIC","Value":"RABONL2U"}],"VersionAsProperty":2}],"CustomParameters":null,"AdditionalParameters":{"List":[{"Name":"initiated_by_magento","Value":"1"},{"Name":"service_action","Value":"something"}]},"MutationType":1,"RelatedTransactions":null,"IsCancelable":false,"IssuingCountry":null,"StartRecurrent":false,"Recurring":false,"CustomerName":"J. de Tèster","PayerHash":"2d26d34584a4eafeeaa97eed10cfdae22ae64cdce1649a80a55fafca8850e3e22cb32eb7c8fc95ef0c6f96669a21651d4734cc568816f9bd59c2092911e6c0da","PaymentKey":"AEC974D455FF4A4B9B4C21E437A04838","Description":null}}'; -$uri = 'https://buckaroo.nextto.dev/push'; +$uri = 'https://buckaroo.nextto.dev/push'; $reply_handler = new ReplyHandler($buckaroo->client()->config(), $post_data, $auth_header, $uri); $reply_handler->validate(); $reply_handler->isValid(); // Return either true or false -//END JSON PUSH \ No newline at end of file +//END JSON PUSH diff --git a/example/responses/return.php b/example/responses/return.php index d80c20c8..319091bc 100644 --- a/example/responses/return.php +++ b/example/responses/return.php @@ -25,7 +25,7 @@ "brq_timestamp" => "2022-05-24 07:29:09", "brq_transactions" => "4C1BE53E2C42412AB32A799D9316E7DD", "brq_websitekey" => "IBjihN7Fhp", - "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5" + "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5", ]; $buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); @@ -34,4 +34,3 @@ $replyHandler->validate(); $replyHandler->isValid(); - diff --git a/example/transactions/afterpay.php b/example/transactions/afterpay.php index 322af513..80ff3eab 100644 --- a/example/transactions/afterpay.php +++ b/example/transactions/afterpay.php @@ -9,97 +9,97 @@ //Pay $response = $buckaroo->method('afterpay')->pay([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'clientIP' => '127.0.0.1', - 'billing' => [ - 'recipient' => [ - 'category' => RecipientCategory::PERSON, - 'careOf' => 'John Smith', - 'title' => 'Mrs', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01', - 'conversationLanguage' => 'NL', - 'identificationNumber' => 'IdNumber12345', - 'customerNumber' => 'customerNumber12345' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'clientIP' => '127.0.0.1', + 'billing' => [ + 'recipient' => [ + 'category' => RecipientCategory::PERSON, + 'careOf' => 'John Smith', + 'title' => 'Mrs', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + 'conversationLanguage' => 'NL', + 'identificationNumber' => 'IdNumber12345', + 'customerNumber' => 'customerNumber12345', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => RecipientCategory::COMPANY, - 'careOf' => 'John Smith', - 'companyName' => 'Buckaroo B.V.', - 'firstName' => 'John', - 'lastName' => 'Do', - 'chamberOfCommerce' => '12345678' + 'shipping' => [ + 'recipient' => [ + 'category' => RecipientCategory::COMPANY, + 'careOf' => 'John Smith', + 'companyName' => 'Buckaroo B.V.', + 'firstName' => 'John', + 'lastName' => 'Do', + 'chamberOfCommerce' => '12345678', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]); //Authorize $response = $buckaroo->method('afterpay')->authorize([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'clientIP' => '127.0.0.1', - 'articles' => [ + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'clientIP' => '127.0.0.1', + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'grossUnitPrice' => '20.10' + 'grossUnitPrice' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'grossUnitPrice' => '10.10' + 'grossUnitPrice' => '10.10', ], ], - 'customer' => [ + 'customer' => [ 'useBillingInfoForShipping' => false, - 'billing' => [ + 'billing' => [ 'firstName' => 'Test', 'lastName' => 'Acceptatie', 'email' => 'billingcustomer@buckaroo.nl', @@ -111,9 +111,9 @@ 'city' => 'Heerenveen', 'country' => 'NL', 'salutation' => 'Mr', - 'birthDate' => '01-01-1990' + 'birthDate' => '01-01-1990', ], - 'shipping' => [ + 'shipping' => [ 'firstName' => 'Test', 'lastName' => 'Aflever', 'email' => 'billingcustomer@buckaroo.nl', @@ -125,9 +125,9 @@ 'city' => 'Heerenveen', 'country' => 'NL', 'salutation' => 'Mr', - 'birthDate' => '01-01-1990' - ] - ] + 'birthDate' => '01-01-1990', + ], + ], ]); //Capture @@ -135,45 +135,45 @@ 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', //Set transaction key of the transaction to capture 'invoice' => '628603a20c375', //Set invoice id 'amountDebit' => 50.30, //set amount to capture - 'clientIP' => '127.0.0.1', - 'articles' => [ + 'clientIP' => '127.0.0.1', + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'grossUnitPrice' => '20.10' + 'grossUnitPrice' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'grossUnitPrice' => '10.10' + 'grossUnitPrice' => '10.10', ], - ] + ], ]); //Refund $response = $buckaroo->method('afterpay')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund - 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, ]); //Partial refund $response = $buckaroo->method('afterpay')->refund([ - 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund + 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', //Set transaction key of the transaction to refund 'amountCredit' => 1.23, - 'articles' => [ + 'articles' => [ [ - 'refundType' => 'Return', + 'refundType' => 'Return', 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' - ] - ] -]); \ No newline at end of file + 'price' => '20.10', + ], + ], +]); diff --git a/example/transactions/afterpaydigiaccept.php b/example/transactions/afterpaydigiaccept.php index 546e6b69..eb9f01b1 100644 --- a/example/transactions/afterpaydigiaccept.php +++ b/example/transactions/afterpaydigiaccept.php @@ -9,233 +9,233 @@ //Pay $response = $buckaroo->method('afterpaydigiaccept')->pay([ - 'amountDebit' => 40.50, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'b2b' => true, - 'addressesDiffer' => true, - 'customerIPAddress' => '0.0.0.0', - 'shippingCosts' => 0.5, - 'costCentre' => 'Test', - 'department' => 'Test', - 'establishmentNumber' => '123456', - 'billing' => [ - 'recipient' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'AB', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01', - 'culture' => 'NL' - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'amountDebit' => 40.50, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'b2b' => true, + 'addressesDiffer' => true, + 'customerIPAddress' => '0.0.0.0', + 'shippingCosts' => 0.5, + 'costCentre' => 'Test', + 'department' => 'Test', + 'establishmentNumber' => '123456', + 'billing' => [ + 'recipient' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'AB', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + 'culture' => 'NL', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'culture' => 'NL', - 'gender' => Gender::MALE, - 'initials' => 'YJ', - 'lastName' => 'Jansen', - 'companyName' => 'Buckaroo B.V.', - 'birthDate' => '1990-01-01', - 'chamberOfCommerce' => '12345678', - 'vatNumber' => 'NL12345678', - ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'shipping' => [ + 'recipient' => [ + 'culture' => 'NL', + 'gender' => Gender::MALE, + 'initials' => 'YJ', + 'lastName' => 'Jansen', + 'companyName' => 'Buckaroo B.V.', + 'birthDate' => '1990-01-01', + 'chamberOfCommerce' => '12345678', + 'vatNumber' => 'NL12345678', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl', + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => uniqid(), 'description' => 'Blue Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], [ 'identifier' => uniqid(), 'description' => 'Red Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], - ] + ], ]); //Authorize $response = $buckaroo->method('afterpaydigiaccept')->authorize([ - 'amountDebit' => 40.50, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'b2b' => true, - 'addressesDiffer' => true, - 'customerIPAddress' => '0.0.0.0', - 'shippingCosts' => 0.5, - 'costCentre' => 'Test', - 'department' => 'Test', - 'establishmentNumber' => '123456', - 'billing' => [ - 'recipient' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'AB', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01', - 'culture' => 'NL' - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'amountDebit' => 40.50, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'b2b' => true, + 'addressesDiffer' => true, + 'customerIPAddress' => '0.0.0.0', + 'shippingCosts' => 0.5, + 'costCentre' => 'Test', + 'department' => 'Test', + 'establishmentNumber' => '123456', + 'billing' => [ + 'recipient' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'AB', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + 'culture' => 'NL', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'culture' => 'NL', - 'gender' => Gender::MALE, - 'initials' => 'YJ', - 'lastName' => 'Jansen', - 'companyName' => 'Buckaroo B.V.', - 'birthDate' => '1990-01-01', - 'chamberOfCommerce' => '12345678', - 'vatNumber' => 'NL12345678', - ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'shipping' => [ + 'recipient' => [ + 'culture' => 'NL', + 'gender' => Gender::MALE, + 'initials' => 'YJ', + 'lastName' => 'Jansen', + 'companyName' => 'Buckaroo B.V.', + 'birthDate' => '1990-01-01', + 'chamberOfCommerce' => '12345678', + 'vatNumber' => 'NL12345678', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl', + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => uniqid(), 'description' => 'Blue Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], [ 'identifier' => uniqid(), 'description' => 'Red Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], - ] + ], ]); //Capture $response = $buckaroo->method('afterpaydigiaccept')->pay([ 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', - 'amountDebit' => 40.50, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'b2b' => true, - 'addressesDiffer' => true, - 'customerIPAddress' => '0.0.0.0', - 'shippingCosts' => 0.5, - 'costCentre' => 'Test', - 'department' => 'Test', - 'establishmentNumber' => '123456', - 'billing' => [ - 'recipient' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'AB', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01', - 'culture' => 'NL' - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'amountDebit' => 40.50, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'b2b' => true, + 'addressesDiffer' => true, + 'customerIPAddress' => '0.0.0.0', + 'shippingCosts' => 0.5, + 'costCentre' => 'Test', + 'department' => 'Test', + 'establishmentNumber' => '123456', + 'billing' => [ + 'recipient' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'AB', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + 'culture' => 'NL', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'culture' => 'NL', - 'gender' => Gender::MALE, - 'initials' => 'YJ', - 'lastName' => 'Jansen', - 'companyName' => 'Buckaroo B.V.', - 'birthDate' => '1990-01-01', - 'chamberOfCommerce' => '12345678', - 'vatNumber' => 'NL12345678', - ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'shipping' => [ + 'recipient' => [ + 'culture' => 'NL', + 'gender' => Gender::MALE, + 'initials' => 'YJ', + 'lastName' => 'Jansen', + 'companyName' => 'Buckaroo B.V.', + 'birthDate' => '1990-01-01', + 'chamberOfCommerce' => '12345678', + 'vatNumber' => 'NL12345678', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl', + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => uniqid(), 'description' => 'Blue Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], [ 'identifier' => uniqid(), 'description' => 'Red Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], - ] + ], ]); //Refund $response = $buckaroo->method('afterpaydigiaccept')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' -]); \ No newline at end of file + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/example/transactions/alipay.php b/example/transactions/alipay.php index 6c67f48a..9d0ff33b 100644 --- a/example/transactions/alipay.php +++ b/example/transactions/alipay.php @@ -10,12 +10,12 @@ $response = $buckaroo->method('alipay')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'useMobileView' => true + 'useMobileView' => true, ]); //Refund $response = $buckaroo->method('alipay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', -]); \ No newline at end of file +]); diff --git a/example/transactions/applepay.php b/example/transactions/applepay.php index 1a674e1a..4cc4a12e 100644 --- a/example/transactions/applepay.php +++ b/example/transactions/applepay.php @@ -12,7 +12,7 @@ 'amountDebit' => 10, 'invoice' => uniqid(), 'paymentData' => uniqid(), - 'customerCardName' => 'Buck Aroo' + 'customerCardName' => 'Buck Aroo', ]); //Pay Redirect @@ -27,5 +27,5 @@ $response = $buckaroo->method('applepay')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); diff --git a/example/transactions/applepay_redirect.php b/example/transactions/applepay_redirect.php index daec0957..e1e4a63b 100644 --- a/example/transactions/applepay_redirect.php +++ b/example/transactions/applepay_redirect.php @@ -12,7 +12,7 @@ 'amountDebit' => 10, 'invoice' => uniqid(), 'servicesSelectableByClient' => 'applepay', - 'continueOnIncomplete' => '1' + 'continueOnIncomplete' => '1', ]); @@ -20,5 +20,5 @@ $response = $buckaroo->method('applepay')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); diff --git a/example/transactions/bancontact.php b/example/transactions/bancontact.php index c6e2f9b4..fbfa1e1d 100644 --- a/example/transactions/bancontact.php +++ b/example/transactions/bancontact.php @@ -12,28 +12,28 @@ //'saveToken' => true, //SaveToken is the parameter used to indicate if a token is to be created, that can be used for Wallet Initiated Payments in the future. //'encryptedCardData' => '', //If this is set PayEncryoted Action will be used. The value of this parameter is the result of the "encryptCardData"-function of our Client Side Encryption SDK. 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); //PayEncrypted $response = $buckaroo->method('bancontactmrcash')->payEncrypted([ 'invoice' => uniqid(), - 'amountDebit' => 10.10, - 'description' => 'Bancontact PayEncrypted Test 123', - 'encryptedCardData' => '001SlXfd8MbiTd/JFwCiGVs3f6o4x6xt0aN29NzOSNZHPKlVsz/EWeQmyhb1gGZ86VY88DP7gfDV+UyjcPfpVfHZd7u+WkO71hnV2QfYILCBNqE1aiPv2GQVGdaGbuoQloKu1o3o3I1UDmVxivXTMQX76ovot89geA6hqbtakmpmvxeiwwea3l4htNoX1IlD1hfYkDDl9rzSu5ypcjvVs6aRGXK5iMHnyrmEsEnfdj/Q5XWbsD5xAm4u3y6J8d4UP7LB31VLECzZUTiJOtKKcCQlT01YThIkQlj8PWBBMtt4H52VN3IH2+wPYtR8HiOZzcA2HA7UxozogIpS53tIURj/g==' + 'amountDebit' => 10.10, + 'description' => 'Bancontact PayEncrypted Test 123', + 'encryptedCardData' => '001SlXfd8MbiTd/JFwCiGVs3f6o4x6xt0aN29NzOSNZHPKlVsz/EWeQmyhb1gGZ86VY88DP7gfDV+UyjcPfpVfHZd7u+WkO71hnV2QfYILCBNqE1aiPv2GQVGdaGbuoQloKu1o3o3I1UDmVxivXTMQX76ovot89geA6hqbtakmpmvxeiwwea3l4htNoX1IlD1hfYkDDl9rzSu5ypcjvVs6aRGXK5iMHnyrmEsEnfdj/Q5XWbsD5xAm4u3y6J8d4UP7LB31VLECzZUTiJOtKKcCQlT01YThIkQlj8PWBBMtt4H52VN3IH2+wPYtR8HiOZzcA2HA7UxozogIpS53tIURj/g==', ]); //Recurrent payment $response = $buckaroo->method('bancontactmrcash')->payRecurrent([ - 'invoice' => 'testinvoice 123', - 'amountDebit' => 10.50, - 'originalTransactionKey' => '91D08EC01F414926A4CA29C059XXXXXX', + 'invoice' => 'testinvoice 123', + 'amountDebit' => 10.50, + 'originalTransactionKey' => '91D08EC01F414926A4CA29C059XXXXXX', ]); //Refund $response = $buckaroo->method('bancontactmrcash')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/belfius.php b/example/transactions/belfius.php index da7c65b8..06945fd0 100644 --- a/example/transactions/belfius.php +++ b/example/transactions/belfius.php @@ -10,12 +10,12 @@ //Pay $response = $buckaroo->method('belfius')->pay([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); //Refund $response = $buckaroo->method('belfius')->refund([ - 'invoice' => 'INVOICE_NO_628cf7f4f3c79', //Set invoice number of the transaction to refund + 'invoice' => 'INVOICE_NO_628cf7f4f3c79', //Set invoice number of the transaction to refund 'originalTransactionKey' => '59AA593AFB3D4B4C8524ACB71EDDCE40', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/billink.php b/example/transactions/billink.php index ebce251d..2fcfb3a1 100644 --- a/example/transactions/billink.php +++ b/example/transactions/billink.php @@ -9,63 +9,63 @@ //Also accepts json //Pay $response = $buckaroo->method('billink')->pay([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'trackAndTrace' => 'TR0F123456789', - 'vATNumber' => '2', - 'billing' => [ - 'recipient' => [ - 'category' => 'B2B', - 'careOf' => 'John Smith', - 'title' => 'Female', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '01-01-1990', - 'chamberOfCommerce' => 'TEST' - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'trackAndTrace' => 'TR0F123456789', + 'vATNumber' => '2', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2B', + 'careOf' => 'John Smith', + 'title' => 'Female', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '01-01-1990', + 'chamberOfCommerce' => 'TEST', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2C', - 'careOf' => 'John Smith', - 'title' => 'Male', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' - ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2C', + 'careOf' => 'John Smith', + 'title' => 'Male', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', 'price' => '20.10', - 'priceExcl' => 5 + 'priceExcl' => 5, ], [ 'identifier' => 'Articlenumber2', @@ -73,70 +73,70 @@ 'vatPercentage' => '21', 'quantity' => '1', 'price' => 10.10, - 'priceExcl' => 5 + 'priceExcl' => 5, ], - ] + ], ]); //Authorize $response = $buckaroo->method('billink')->authorize([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'trackAndTrace' => 'TR0F123456789', - 'vATNumber' => '2', - 'billing' => [ - 'recipient' => [ - 'category' => 'B2B', - 'careOf' => 'John Smith', - 'title' => 'Female', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '01-01-1990', - 'chamberOfCommerce' => 'TEST' - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'trackAndTrace' => 'TR0F123456789', + 'vATNumber' => '2', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2B', + 'careOf' => 'John Smith', + 'title' => 'Female', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '01-01-1990', + 'chamberOfCommerce' => 'TEST', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2C', - 'careOf' => 'John Smith', - 'title' => 'Male', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' - ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2C', + 'careOf' => 'John Smith', + 'title' => 'Male', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', 'price' => '20.10', - 'priceExcl' => 5 + 'priceExcl' => 5, ], [ 'identifier' => 'Articlenumber2', @@ -144,9 +144,9 @@ 'vatPercentage' => '21', 'quantity' => '1', 'price' => 10.10, - 'priceExcl' => 5 + 'priceExcl' => 5, ], - ] + ], ]); //Capture @@ -154,14 +154,14 @@ 'originalTransactionKey' => '74AD098CCFAA4F739FE16279B5059B6B', //Set transaction key of the transaction to capture 'invoice' => '62905fa2650f4', //Set invoice id 'amountDebit' => 50.30, //set amount to capture - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', 'price' => '20.10', - 'priceExcl' => 5 + 'priceExcl' => 5, ], [ 'identifier' => 'Articlenumber2', @@ -169,9 +169,9 @@ 'vatPercentage' => '21', 'quantity' => '1', 'price' => 10.10, - 'priceExcl' => 5 + 'priceExcl' => 5, ], - ] + ], ]); //Cancel authorize @@ -184,6 +184,6 @@ //Refund $response = $buckaroo->method('billink')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', +]); diff --git a/example/transactions/credit_click.php b/example/transactions/credit_click.php index 037fa7b3..32187c1f 100644 --- a/example/transactions/credit_click.php +++ b/example/transactions/credit_click.php @@ -12,19 +12,19 @@ 'amountDebit' => 10, 'invoice' => uniqid(), 'email' => 'billingcustomer@buckaroo.nl', - 'customer' => [ + 'customer' => [ 'firstName' => 'Test', - 'lastName' => 'Aflever' - ] + 'lastName' => 'Aflever', + ], ]); //Refund $response = $buckaroo->method('creditclick')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'description' => 'refund', + 'invoice' => 'testinvoice 123', + 'description' => 'refund', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', 'serviceParameters' => [ - 'reason' => 'RequestedByCustomer' - ] -]); \ No newline at end of file + 'reason' => 'RequestedByCustomer', + ], +]); diff --git a/example/transactions/creditcard.php b/example/transactions/creditcard.php index aaacef78..b94da1e0 100644 --- a/example/transactions/creditcard.php +++ b/example/transactions/creditcard.php @@ -10,72 +10,72 @@ $response = $buckaroo->method('creditcard')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'name' => 'visa' + 'name' => 'visa', ]); //Pay Encrypted $response = $buckaroo->method('creditcard')->payEncrypted([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'name' => 'mastercard', - 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'name' => 'mastercard', + 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); //Pay with security code $response = $buckaroo->method('creditcard')->payWithSecurityCode([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); //Refund $response = $buckaroo->method('creditcard')->refund([ 'amountCredit' => 10, 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '13FAF43579D94F5FB8119A6819XXXXXX', - 'name' => 'mastercard' + 'originalTransactionKey' => '13FAF43579D94F5FB8119A6819XXXXXX', + 'name' => 'mastercard', ]); //Authorize $response = $buckaroo->method('creditcard')->authorize([ 'amountDebit' => 10, 'invoice' => 'testinvoice 123', - 'name' => 'mastercard' + 'name' => 'mastercard', ]); //Authorize Encrypted $response = $buckaroo->method('creditcard')->authorizeEncrypted([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'name' => 'mastercard', - 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'name' => 'mastercard', + 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); //Authorize with security code $response = $buckaroo->method('creditcard')->authorizeWithSecurityCode([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); //Capture $response = $buckaroo->method('creditcard')->capture([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); //Pay Recurrent $response = $buckaroo->method('creditcard')->payRecurrent([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' -]); \ No newline at end of file + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); diff --git a/example/transactions/eps.php b/example/transactions/eps.php index d7b00421..426ed7ae 100644 --- a/example/transactions/eps.php +++ b/example/transactions/eps.php @@ -9,13 +9,13 @@ //Also accepts json //Pay $response = $buckaroo->method('eps')->pay([ - 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'invoice' => uniqid(), + 'amountDebit' => 10.10, ]); //Refund $response = $buckaroo->method('eps')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/giftcards.php b/example/transactions/giftcards.php index 6ccb9b13..a01fdd31 100644 --- a/example/transactions/giftcards.php +++ b/example/transactions/giftcards.php @@ -13,13 +13,13 @@ 'invoice' => uniqid(), 'name' => 'boekenbon', 'intersolveCardnumber' => '0000000000000000001', - 'intersolvePIN' => '1000' + 'intersolvePIN' => '1000', ]); //Refund $response = $buckaroo->method('giftcard')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', - 'name' => 'boekenbon' -]); \ No newline at end of file + 'name' => 'boekenbon', +]); diff --git a/example/transactions/giftcards_redirect.php b/example/transactions/giftcards_redirect.php index a44fc152..8503b384 100644 --- a/example/transactions/giftcards_redirect.php +++ b/example/transactions/giftcards_redirect.php @@ -11,15 +11,15 @@ $response = $buckaroo->method('giftcard')->payRedirect([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'servicesSelectableByClient'=> 'westlandbon,ideal,ippies,babygiftcard,babyparkgiftcard,beautywellness,boekenbon,boekenvoordeel,designshopsgiftcard,fashioncheque,fashionucadeaukaart,fijncadeau,koffiecadeau,kokenzo,kookcadeau,nationaleentertainmentcard,naturesgift,podiumcadeaukaart,shoesaccessories,webshopgiftcard,wijncadeau,wonenzo,yourgift,vvvgiftcard,parfumcadeaukaart', - 'continueOnIncomplete'=> '1' + 'servicesSelectableByClient' => 'westlandbon,ideal,ippies,babygiftcard,babyparkgiftcard,beautywellness,boekenbon,boekenvoordeel,designshopsgiftcard,fashioncheque,fashionucadeaukaart,fijncadeau,koffiecadeau,kokenzo,kookcadeau,nationaleentertainmentcard,naturesgift,podiumcadeaukaart,shoesaccessories,webshopgiftcard,wijncadeau,wonenzo,yourgift,vvvgiftcard,parfumcadeaukaart', + 'continueOnIncomplete' => '1', ]); //Refund $response = $buckaroo->method('giftcard')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '50891AED2D9647668A2F48C87B3000EE', - 'name' => 'boekenbon' + 'name' => 'boekenbon', ]); diff --git a/example/transactions/giropay.php b/example/transactions/giropay.php index 5b84744a..d1cfbac0 100644 --- a/example/transactions/giropay.php +++ b/example/transactions/giropay.php @@ -11,12 +11,12 @@ $response = $buckaroo->method('giropay')->pay([ 'invoice' => uniqid(), 'bic' => 'GENODETT488', - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); //Refund $response = $buckaroo->method('giropay')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/ideal.php b/example/transactions/ideal.php index b7327568..4400853b 100644 --- a/example/transactions/ideal.php +++ b/example/transactions/ideal.php @@ -9,17 +9,17 @@ //Also accepts json //Pay $response = $buckaroo->method('ideal')->pay([ - 'returnURL' => 'https://example.com/return', - 'invoice' => uniqid(), - 'amountDebit' => 10.10, - 'issuer' => 'ABNANL2A', + 'returnURL' => 'https://example.com/return', + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'issuer' => 'ABNANL2A', ]); //Refund $response = $buckaroo->method('ideal')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); //Get issuers diff --git a/example/transactions/ideal_qr.php b/example/transactions/ideal_qr.php index ffb9500b..9d07b101 100644 --- a/example/transactions/ideal_qr.php +++ b/example/transactions/ideal_qr.php @@ -9,14 +9,14 @@ //Also accepts json //Create payment $response = $buckaroo->method('ideal_qr')->generate([ - 'description' => 'Test purchase', - 'minAmount' => '0.10', - 'maxAmount' => '10.0', - 'imageSize' => '2000', - 'purchaseId' => 'Testpurchase123', - 'isOneOff' => false, - 'amount' => '1.00', - 'amountIsChangeable' => true, - 'expiration' => '2030-09-30', - 'isProcessing' => false + 'description' => 'Test purchase', + 'minAmount' => '0.10', + 'maxAmount' => '10.0', + 'imageSize' => '2000', + 'purchaseId' => 'Testpurchase123', + 'isOneOff' => false, + 'amount' => '1.00', + 'amountIsChangeable' => true, + 'expiration' => '2030-09-30', + 'isProcessing' => false, ]); diff --git a/example/transactions/in3.php b/example/transactions/in3.php index 3d12ef35..2fc03cc4 100644 --- a/example/transactions/in3.php +++ b/example/transactions/in3.php @@ -8,59 +8,59 @@ $buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); $payload = [ - 'amountDebit' => 9.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'invoiceDate' => '22-01-2018', - 'customerType' => 'Company', - 'email' => 'test@buckaroo.nl', - 'phone' => [ - 'mobile' => '0612345678' + 'amountDebit' => 9.5, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'description' => 'This is a test order', + 'invoiceDate' => '22-01-2018', + 'customerType' => 'Company', + 'email' => 'test@buckaroo.nl', + 'phone' => [ + 'mobile' => '0612345678', ], - 'articles' => [ + 'articles' => [ [ - 'identifier' => uniqid(), - 'description' => 'Blue Toy Car', - 'quantity' => '1', - 'price' => 10.00 - ] + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'quantity' => '1', + 'price' => 10.00, + ], ], - 'company' => [ - 'companyName' => 'My Company B.V.', - 'chamberOfCommerce' => '123456' + 'company' => [ + 'companyName' => 'My Company B.V.', + 'chamberOfCommerce' => '123456', ], - 'customer' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'J.S.', - 'lastName' => 'Aflever', - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => '0610000000', - 'culture' => 'nl-NL', - 'birthDate' => '1990-01-01', + 'customer' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'J.S.', + 'lastName' => 'Aflever', + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => '0610000000', + 'culture' => 'nl-NL', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '2', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '2', 'houseNumberAdditional' => 'a', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'subtotals' => [ + 'subtotals' => [ [ - 'name' => 'Korting', - 'value' => -2.00 + 'name' => 'Korting', + 'value' => -2.00, ], [ - 'name' => 'Betaaltoeslag', - 'value' => 0.50 + 'name' => 'Betaaltoeslag', + 'value' => 0.50, ], [ - 'name' => 'Verzendkosten', - 'value' => 1.00 - ] - ] + 'name' => 'Verzendkosten', + 'value' => 1.00, + ], + ], ]; //Also accepts json @@ -74,5 +74,5 @@ $response = $buckaroo->method('in3')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' -]); \ No newline at end of file + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/example/transactions/kbc.php b/example/transactions/kbc.php index 34702660..a3e056a4 100644 --- a/example/transactions/kbc.php +++ b/example/transactions/kbc.php @@ -10,13 +10,13 @@ //Pay $response = $buckaroo->method('kbcpaymentbutton')->pay([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); //Refund $response = $buckaroo->method('kbcpaymentbutton')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/klarna.php b/example/transactions/klarna.php index f1b3bc01..ebe45505 100644 --- a/example/transactions/klarna.php +++ b/example/transactions/klarna.php @@ -7,134 +7,134 @@ //Pay $response = $buckaroo->method('klarna')->pay([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'billing' => [ - 'recipient' => [ - 'category' => 'B2C', - 'gender' => 'female', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'billing' => [ + 'recipient' => [ + 'category' => 'B2C', + 'gender' => 'female', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2B', - 'gender' => 'male', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]); //PayInInstallments $response = $buckaroo->method('klarna')->payInInstallments([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'currency' => 'GBP', - 'billing' => [ - 'recipient' => [ - 'category' => 'B2C', - 'gender' => 'female', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'currency' => 'GBP', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2C', + 'gender' => 'female', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'GB' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'GB', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2B', - 'gender' => 'male', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'GB' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'GB', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]); //Refund $response = $buckaroo->method('klarna')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund - 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/klarnakp.php b/example/transactions/klarnakp.php index 5c81e4cd..15f87887 100644 --- a/example/transactions/klarnakp.php +++ b/example/transactions/klarnakp.php @@ -7,62 +7,62 @@ $buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); $response = $buckaroo->method('klarnakp')->reserve([ - 'invoice' => uniqid(), - 'gender' => "1", - 'operatingCountry' => 'NL', - 'pno' => '01011990', - 'billing' => [ - 'recipient' => [ - 'firstName' => 'John', - 'lastName' => 'Do' + 'invoice' => uniqid(), + 'gender' => "1", + 'operatingCountry' => 'NL', + 'pno' => '01011990', + 'billing' => [ + 'recipient' => [ + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Neherkade', - 'houseNumber' => '1', - 'zipcode' => '2521VA', - 'city' => 'Gravenhage', - 'country' => 'NL' + 'address' => [ + 'street' => 'Neherkade', + 'houseNumber' => '1', + 'zipcode' => '2521VA', + 'city' => 'Gravenhage', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0612345678', + 'phone' => [ + 'mobile' => '0612345678', ], - 'email' => 'youremail@example.nl' + 'email' => 'youremail@example.nl', ], - 'shipping' => [ - 'recipient' => [ - 'firstName' => 'John', - 'lastName' => 'Do' + 'shipping' => [ + 'recipient' => [ + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Rosenburglaan', - 'houseNumber' => '216', - 'zipcode' => '4385 JM', - 'city' => 'Vlissingen', - 'country' => 'NL' + 'address' => [ + 'street' => 'Rosenburglaan', + 'houseNumber' => '216', + 'zipcode' => '4385 JM', + 'city' => 'Vlissingen', + 'country' => 'NL', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' - ] - ] + 'price' => '10.10', + ], + ], ]); //Refund $response = $buckaroo->method('klarnakp')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' -]); \ No newline at end of file + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/example/transactions/payconiq.php b/example/transactions/payconiq.php index 1e5fefea..af2521f9 100644 --- a/example/transactions/payconiq.php +++ b/example/transactions/payconiq.php @@ -11,12 +11,12 @@ $response = $buckaroo->method('payconiq')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'description' => 'Payment for testinvoice123' + 'description' => 'Payment for testinvoice123', ]); //Refund $response = $buckaroo->method('payconiq')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', +]); diff --git a/example/transactions/paypal.php b/example/transactions/paypal.php index b6c43e59..d2958527 100644 --- a/example/transactions/paypal.php +++ b/example/transactions/paypal.php @@ -10,39 +10,39 @@ //Pay $response = $buckaroo->method('paypal')->pay([ 'amountDebit' => 10, - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); //Recurrent Payment $response = $buckaroo->method('paypal')->payRecurrent([ 'amountDebit' => 10, 'originalTransactionKey' => 'C32C0B52E1FE4A37835FFB1716XXXXXX', - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); //Pay with extra info $response = $buckaroo->method('paypal')->extraInfo([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'customer' => [ - 'name' => 'John Smith' + 'customer' => [ + 'name' => 'John Smith', ], - 'address' => [ - 'street' => 'Hoofstraat 90', - 'street2' => 'Street 2', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'zipcode' => '8441AB', - 'country' => 'NL' + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' - ] ]); //Refund $response = $buckaroo->method('paypal')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/example/transactions/pos.php b/example/transactions/pos.php index 854ce906..d0b9b4b9 100644 --- a/example/transactions/pos.php +++ b/example/transactions/pos.php @@ -11,5 +11,5 @@ $response = $buckaroo->method('pospayment')->pay([ 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'terminalID' => '50000001' -]); \ No newline at end of file + 'terminalID' => '50000001', +]); diff --git a/example/transactions/przelewy24.php b/example/transactions/przelewy24.php index cac32c2b..70ceaaaf 100644 --- a/example/transactions/przelewy24.php +++ b/example/transactions/przelewy24.php @@ -9,18 +9,18 @@ //Also accepts json //Pay $response = $buckaroo->method("przelewy24")->pay([ - 'amountDebit' => 3.5, - 'invoice' => uniqid(), - 'email' => 'test@test.nl', - 'customer' => [ - 'firstName' => 'John', - 'lastName' => 'Smith', - ] + 'amountDebit' => 3.5, + 'invoice' => uniqid(), + 'email' => 'test@test.nl', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Smith', + ], ]); //Refund $response = $buckaroo->method('przelewy24')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/example/transactions/requesttopay.php b/example/transactions/requesttopay.php index 9a7af502..ef64aadc 100644 --- a/example/transactions/requesttopay.php +++ b/example/transactions/requesttopay.php @@ -9,15 +9,15 @@ //Also accepts json //Pay $response = $buckaroo->method("requesttopay")->pay([ - 'amountDebit' => 3.5, - 'invoice' => uniqid(), - 'customer' => [ - 'name' => 'J. De Tester' - ] + 'amountDebit' => 3.5, + 'invoice' => uniqid(), + 'customer' => [ + 'name' => 'J. De Tester', + ], ]); $response = $buckaroo->method('requesttopay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/example/transactions/sepa.php b/example/transactions/sepa.php index e21f1e30..f4640976 100644 --- a/example/transactions/sepa.php +++ b/example/transactions/sepa.php @@ -11,19 +11,19 @@ $response = $buckaroo->method('sepadirectdebit')->pay([ 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'iban' => 'NL13TEST0123456789', - 'bic' => 'TESTNL2A', - 'collectdate' => '2022-12-01', - 'mandateReference' => '1DCtestreference', - 'mandateDate' => '2022-07-03', - 'customer' => [ - 'name' => 'John Smith' - ] + 'iban' => 'NL13TEST0123456789', + 'bic' => 'TESTNL2A', + 'collectdate' => '2022-12-01', + 'mandateReference' => '1DCtestreference', + 'mandateDate' => '2022-07-03', + 'customer' => [ + 'name' => 'John Smith', + ], ]); //Refund $response = $buckaroo->method('sepadirectdebit')->refund([ - 'invoice' => 'INVOICE_NO_628d386d9b9d4', //Set invoice number of the transaction to refund + 'invoice' => 'INVOICE_NO_628d386d9b9d4', //Set invoice number of the transaction to refund 'originalTransactionKey' => 'B6DDFC65AE074CB7AF2C0EA015D473D0', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/sofort.php b/example/transactions/sofort.php index ff008d05..877c8f59 100644 --- a/example/transactions/sofort.php +++ b/example/transactions/sofort.php @@ -10,13 +10,13 @@ //Pay $response = $buckaroo->method('sofortueberweisung')->pay([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); //Refund $response = $buckaroo->method('sofortueberweisung')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/tinka.php b/example/transactions/tinka.php index 55ecc558..441b53e0 100644 --- a/example/transactions/tinka.php +++ b/example/transactions/tinka.php @@ -10,72 +10,72 @@ //Also accepts json //Pay $response = $buckaroo->method('tinka')->pay([ - 'amountDebit' => 3.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'paymentMethod' => 'Credit', - 'deliveryMethod' => 'Locker', - 'deliveryDate' => '2030-01-01', - 'articles' => [ + 'amountDebit' => 3.5, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'description' => 'This is a test order', + 'paymentMethod' => 'Credit', + 'deliveryMethod' => 'Locker', + 'deliveryDate' => '2030-01-01', + 'articles' => [ [ - 'type' => 1, - 'description' => 'Blue Toy Car', - 'brand' => 'Ford Focus', - 'manufacturer' => 'Ford', - 'color' => 'Red', - 'size' => 'Small', - 'quantity' => '1', - 'price' => '3.5', - 'unitCode' => 'test' - ] + 'type' => 1, + 'description' => 'Blue Toy Car', + 'brand' => 'Ford Focus', + 'manufacturer' => 'Ford', + 'color' => 'Red', + 'size' => 'Small', + 'quantity' => '1', + 'price' => '3.5', + 'unitCode' => 'test', + ], ], - 'customer' => [ - 'gender' => Gender::MALE, - 'firstName' => 'Buck', - 'lastName' => 'Aroo', - 'initials' => 'BA', - 'birthDate' => '1990-01-01', + 'customer' => [ + 'gender' => Gender::MALE, + 'firstName' => 'Buck', + 'lastName' => 'Aroo', + 'initials' => 'BA', + 'birthDate' => '1990-01-01', ], - 'billing' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the' + 'billing' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', ], 'email' => 'billingcustomer@buckaroo.nl', 'phone' => [ 'mobile' => '0109876543', ], - 'address' => [ + 'address' => [ 'street' => 'Hoofdstraat', 'houseNumber' => '80', 'houseNumberAdditional' => 'A', 'zipcode' => '8441EE', 'city' => 'Heerenveen', 'country' => 'NL', - ] + ], ], - 'shipping' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the' + 'shipping' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', ], 'email' => 'billingcustomer@buckaroo.nl', 'phone' => [ 'mobile' => '0109876543', ], - 'address' => [ + 'address' => [ 'street' => 'Hoofdstraat', 'houseNumber' => '80', 'houseNumberAdditional' => 'A', 'zipcode' => '8441EE', 'city' => 'Heerenveen', 'country' => 'NL', - ] - ] + ], + ], ]); //Refund $response = $buckaroo->method('tinka')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/example/transactions/transfer.php b/example/transactions/transfer.php index 2868e0b5..0e8ad539 100644 --- a/example/transactions/transfer.php +++ b/example/transactions/transfer.php @@ -19,13 +19,13 @@ 'customer' => [ 'gender' => Gender::MALE, 'firstName' => 'John', - 'lastName' => 'Smith' - ] + 'lastName' => 'Smith', + ], ]); //Refund $response = $buckaroo->method('transfer')->refund([ - 'invoice' => '', //Set invoice number of the transaction to refund + 'invoice' => '', //Set invoice number of the transaction to refund 'originalTransactionKey' => '', //Set transaction key of the transaction to refund - 'amountCredit' => 10.10 + 'amountCredit' => 10.10, ]); diff --git a/example/transactions/trustly.php b/example/transactions/trustly.php index eb95b404..fca9c7fa 100644 --- a/example/transactions/trustly.php +++ b/example/transactions/trustly.php @@ -12,15 +12,15 @@ 'amountDebit' => 10, 'invoice' => uniqid(), 'country' => 'DE', - 'customer' => [ + 'customer' => [ 'firstName' => 'Test', - 'lastName' => 'Aflever' - ] + 'lastName' => 'Aflever', + ], ]); //Refund $response = $buckaroo->method('trustly')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' -]); \ No newline at end of file + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/example/transactions/wechat.php b/example/transactions/wechat.php index 815624f2..fbf1ff56 100644 --- a/example/transactions/wechat.php +++ b/example/transactions/wechat.php @@ -11,12 +11,12 @@ $response = $buckaroo->method('wechatpay')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'locale' => 'en-US' + 'locale' => 'en-US', ]); //Refund $response = $buckaroo->method('wechatpay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', -]); \ No newline at end of file +]); diff --git a/src/BuckarooClient.php b/src/BuckarooClient.php index c69b1a7f..6c20a039 100644 --- a/src/BuckarooClient.php +++ b/src/BuckarooClient.php @@ -118,7 +118,7 @@ public function client() */ private function getConfig(string $websiteKey, string $secretKey, string $mode = null): ?Config { - if($websiteKey && $secretKey) + if ($websiteKey && $secretKey) { return new DefaultConfig($websiteKey, $secretKey, $mode); } diff --git a/src/Config/Config.php b/src/Config/Config.php index 1566250b..215333ac 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -75,8 +75,16 @@ abstract class Config implements Loggable * @param string|null $pushURL * @param Subject|null $logger */ - public function __construct(string $websiteKey, string $secretKey, ?string $mode = null, ?string $currency = null, ?string $returnURL = null, ?string $returnURLCancel = null, ?string $pushURL = null, Subject $logger = null) - { + public function __construct( + string $websiteKey, + string $secretKey, + ?string $mode = null, + ?string $currency = null, + ?string $returnURL = null, + ?string $returnURLCancel = null, + ?string $pushURL = null, + Subject $logger = null + ) { $this->websiteKey = $websiteKey; $this->secretKey = $secretKey; @@ -92,14 +100,16 @@ public function __construct(string $websiteKey, string $secretKey, ?string $mode /** * @return string */ - public function websiteKey(): string { + public function websiteKey(): string + { return $this->websiteKey; } /** * @return string */ - public function secretKey(): string { + public function secretKey(): string + { return $this->secretKey; } @@ -117,7 +127,7 @@ public function isLiveMode(): bool */ public function mode(?string $mode = null): string { - if($mode && in_array($mode, [self::LIVE_MODE, self::TEST_MODE])) + if ($mode && in_array($mode, [self::LIVE_MODE, self::TEST_MODE])) { $this->mode = $mode; } @@ -165,9 +175,9 @@ public function merge(array $payload) { $payload = $this->filterNonUpdatableKeys($payload); - foreach($payload as $key => $value) + foreach ($payload as $key => $value) { - if(property_exists($this, $key)) + if (property_exists($this, $key)) { $this->$key = $value; } @@ -182,10 +192,11 @@ public function merge(array $payload) */ private function filterNonUpdatableKeys($payload) { - $filter = array('websiteKey', 'secretKey'); + $filter = ['websiteKey', 'secretKey']; - return array_filter($payload, function($k) use ($filter){ - return !in_array($k, $filter); + return array_filter($payload, function ($k) use ($filter) + { + return ! in_array($k, $filter); }, ARRAY_FILTER_USE_KEY); } @@ -195,11 +206,11 @@ private function filterNonUpdatableKeys($payload) */ public function get(array $properties = []) { - $values = array(); + $values = []; - foreach($properties as $property) + foreach ($properties as $property) { - if(method_exists($this, $property)) + if (method_exists($this, $property)) { $values[$property] = $this->$property(); } diff --git a/src/Config/DefaultConfig.php b/src/Config/DefaultConfig.php index e5e851d8..8a82d958 100644 --- a/src/Config/DefaultConfig.php +++ b/src/Config/DefaultConfig.php @@ -22,5 +22,4 @@ class DefaultConfig extends Config { - -} \ No newline at end of file +} diff --git a/src/Exceptions/BuckarooException.php b/src/Exceptions/BuckarooException.php index d1f0df64..0e9f5694 100644 --- a/src/Exceptions/BuckarooException.php +++ b/src/Exceptions/BuckarooException.php @@ -48,7 +48,7 @@ public function __construct(?Subject $logger, string $message = "", int $code = */ private function log($logger, $message) { - if($logger) + if ($logger) { $this->logger = $logger; $this->logger->error($message); @@ -65,4 +65,4 @@ protected function message(string $message): string { return 'Buckaroo SDKExeption: ' . $message; } -} \ No newline at end of file +} diff --git a/src/Handlers/Credentials.php b/src/Handlers/Credentials.php index 5ca83ee0..b835ade9 100644 --- a/src/Handlers/Credentials.php +++ b/src/Handlers/Credentials.php @@ -54,20 +54,24 @@ public function __construct(Client $client, Config $config) */ public function confirm(): bool { - $serviceList = new ServiceList('ideal', 2, 'Specification'); + $serviceList = new ServiceList('ideal', 2, 'Specification'); $request = new TransactionRequest; - try { + try + { $response = $this->client->specification($request, 'ideal', 2); - }catch(BuckarooException $e){ + } + catch (BuckarooException $e) + { return false; } - if($response->getHttpResponse()->getStatusCode() == 200) { + if ($response->getHttpResponse()->getStatusCode() == 200) + { return true; } return false; } -} \ No newline at end of file +} diff --git a/src/Handlers/HMAC/Generator.php b/src/Handlers/HMAC/Generator.php index 8f6e31aa..15dea58e 100644 --- a/src/Handlers/HMAC/Generator.php +++ b/src/Handlers/HMAC/Generator.php @@ -76,7 +76,11 @@ public function __construct(Config $config, $data, $uri, $method = 'POST') */ public function generate() { - $hashString = $this->config->websiteKey() . $this->method . $this->uri . $this->time . $this->nonce . $this->base64Data; + $hashString = $this->config->websiteKey() . + $this->method . $this->uri . + $this->time . $this->nonce . + $this->base64Data; + $hash = hash_hmac('sha256', $hashString, $this->config->secretKey(), true); $hmac = base64_encode($hash); @@ -84,7 +88,7 @@ public function generate() $this->config->websiteKey(), $hmac, $this->nonce, - $this->time + $this->time, ]); } -} \ No newline at end of file +} diff --git a/src/Handlers/HMAC/Hmac.php b/src/Handlers/HMAC/Hmac.php index a764f124..e5e670f4 100644 --- a/src/Handlers/HMAC/Hmac.php +++ b/src/Handlers/HMAC/Hmac.php @@ -28,9 +28,9 @@ abstract class Hmac */ public function uri($uri = null) { - if($uri) + if ($uri) { - $uri = preg_replace( "#^[^:/.]*[:/]+#i", "", $uri); + $uri = preg_replace("#^[^:/.]*[:/]+#i", "", $uri); $this->uri = strtolower(urlencode($uri)); } @@ -46,14 +46,14 @@ public function base64Data($data = null) { $this->base64Data = ''; - if($data) + if ($data) { - if(is_array($data)) + if (is_array($data)) { $data = json_encode($data, JSON_UNESCAPED_UNICODE); } - $md5 = md5($data, true); + $md5 = md5($data, true); $this->base64Data = base64_encode($md5); } @@ -67,7 +67,7 @@ public function base64Data($data = null) */ public function nonce($nonce = null) { - if($nonce) + if ($nonce) { $this->nonce = $nonce; } @@ -81,11 +81,11 @@ public function nonce($nonce = null) */ public function time($time = null) { - if($time) + if ($time) { $this->time = $time; } return $this->time; } -} \ No newline at end of file +} diff --git a/src/Handlers/HMAC/Validator.php b/src/Handlers/HMAC/Validator.php index 59592d91..92560cbe 100644 --- a/src/Handlers/HMAC/Validator.php +++ b/src/Handlers/HMAC/Validator.php @@ -95,11 +95,11 @@ public function validate(string $header, string $uri, string $method, $data) */ public function validateOrFail(string $header, string $uri, string $method, $data) { - if($this->validate($header, $uri, $method, $data)) + if ($this->validate($header, $uri, $method, $data)) { return true; } throw new BuckarooException($this->config->getLogger(), "HMAC validation failed."); } -} \ No newline at end of file +} diff --git a/src/Handlers/Logging/DefaultLogger.php b/src/Handlers/Logging/DefaultLogger.php index d7604c43..0cccc30c 100644 --- a/src/Handlers/Logging/DefaultLogger.php +++ b/src/Handlers/Logging/DefaultLogger.php @@ -30,7 +30,7 @@ class DefaultLogger implements Subject, LoggerInterface /** * @var array */ - protected array $observers = []; + protected array $observers = []; /** * @@ -39,7 +39,7 @@ public function __construct() { $this->attach(new Monolog()); - if(($_ENV['BPE_REPORT_ERROR'] ?? false) === 'true') + if (($_ENV['BPE_REPORT_ERROR'] ?? false) === 'true') { $this->attach(new ErrorReporter()); } @@ -51,9 +51,9 @@ public function __construct() */ public function attach($observer) { - if(is_array($observer)) + if (is_array($observer)) { - foreach($observer as $singleObserver) + foreach ($observer as $singleObserver) { $this->attach($singleObserver); } @@ -61,7 +61,7 @@ public function attach($observer) return $this; } - if($observer instanceof Observer) + if ($observer instanceof Observer) { $this->observers[] = $observer; } @@ -75,7 +75,8 @@ public function attach($observer) */ public function detach(Observer $observer) { - $this->observers = array_filter($this->observers, function($value) use ($observer){ + $this->observers = array_filter($this->observers, function ($value) use ($observer) + { return get_class($value) != get_class($observer); }); @@ -107,7 +108,7 @@ public function alert($message, array $context = []): void * @param array $context * @return void */ - public function critical($message, array $context = array()): void + public function critical($message, array $context = []): void { $this->notify('critical', $message, $context); } @@ -117,7 +118,7 @@ public function critical($message, array $context = array()): void * @param array $context * @return void */ - public function error($message, array $context = array()): void + public function error($message, array $context = []): void { $this->notify('error', $message, $context); } @@ -127,7 +128,7 @@ public function error($message, array $context = array()): void * @param array $context * @return void */ - public function warning($message, array $context = array()): void + public function warning($message, array $context = []): void { $this->notify('warning', $message, $context); } @@ -137,7 +138,7 @@ public function warning($message, array $context = array()): void * @param array $context * @return void */ - public function notice($message, array $context = array()): void + public function notice($message, array $context = []): void { $this->notify('notice', $message, $context); } @@ -147,7 +148,7 @@ public function notice($message, array $context = array()): void * @param array $context * @return void */ - public function info($message, array $context = array()): void + public function info($message, array $context = []): void { $this->notify('info', $message, $context); } @@ -157,9 +158,10 @@ public function info($message, array $context = array()): void * @param array $context * @return void */ - public function debug($message, array $context = array()): void + public function debug($message, array $context = []): void { - if($_ENV['BPE_DEBUG'] ?? false) { + if ($_ENV['BPE_DEBUG'] ?? false) + { $this->notify('debug', $message, $context); } } @@ -170,7 +172,7 @@ public function debug($message, array $context = array()): void * @param array $context * @return void */ - public function log($level, $message, array $context = array()): void + public function log($level, $message, array $context = []): void { $this->notify('log', $message, $context); } @@ -181,12 +183,13 @@ public function log($level, $message, array $context = array()): void * @param array $context * @return $this */ - public function notify(string $method, string $message, array $context = array()) + public function notify(string $method, string $message, array $context = []) { - foreach($this->observers as $observer) { + foreach ($this->observers as $observer) + { $observer->handle($method, $message, $context); } return $this; } -} \ No newline at end of file +} diff --git a/src/Handlers/Logging/Loggable.php b/src/Handlers/Logging/Loggable.php index 058357ef..df9f69de 100644 --- a/src/Handlers/Logging/Loggable.php +++ b/src/Handlers/Logging/Loggable.php @@ -24,4 +24,4 @@ interface Loggable { public function setLogger(Subject $logger); public function getLogger(): ?Subject; -} \ No newline at end of file +} diff --git a/src/Handlers/Logging/Observer.php b/src/Handlers/Logging/Observer.php index 87874bb0..c62210a4 100644 --- a/src/Handlers/Logging/Observer.php +++ b/src/Handlers/Logging/Observer.php @@ -20,6 +20,7 @@ namespace Buckaroo\Handlers\Logging; -interface Observer{ - public function handle(string $method, string $message, array $context = array()); -} \ No newline at end of file +interface Observer +{ + public function handle(string $method, string $message, array $context = []); +} diff --git a/src/Handlers/Logging/Observers/ErrorReporter.php b/src/Handlers/Logging/Observers/ErrorReporter.php index ba071664..b98a7575 100644 --- a/src/Handlers/Logging/Observers/ErrorReporter.php +++ b/src/Handlers/Logging/Observers/ErrorReporter.php @@ -9,15 +9,16 @@ class ErrorReporter implements Observer private array $reportables = [ 'error', 'critical', - 'emergency' + 'emergency', ]; - public function handle(string $method, string $message, array $context = array()) + public function handle(string $method, string $message, array $context = []) { - if(in_array($method, $this->reportables)) { + if (in_array($method, $this->reportables)) + { //print("Fire off message to mail/report server/slack"); } return $this; } -} \ No newline at end of file +} diff --git a/src/Handlers/Logging/Observers/Monolog.php b/src/Handlers/Logging/Observers/Monolog.php index d0c2159f..e1cfbb4e 100644 --- a/src/Handlers/Logging/Observers/Monolog.php +++ b/src/Handlers/Logging/Observers/Monolog.php @@ -8,13 +8,14 @@ class Monolog implements Observer { - public function __construct() { + public function __construct() + { $this->log = new Logger('Buckaroo log'); $this->log->pushHandler(new StreamHandler('php://stdout', Logger::INFO)); } - public function handle(string $method, string $message, array $context = array()) + public function handle(string $method, string $message, array $context = []) { $this->log->$method($message, $context); } -} \ No newline at end of file +} diff --git a/src/Handlers/Logging/Subject.php b/src/Handlers/Logging/Subject.php index 4333736c..0a2e1be1 100644 --- a/src/Handlers/Logging/Subject.php +++ b/src/Handlers/Logging/Subject.php @@ -40,5 +40,5 @@ public function detach(Observer $observer); * @param array $context * @return mixed */ - public function notify(string $method, string $message, array $context = array()); -} \ No newline at end of file + public function notify(string $method, string $message, array $context = []); +} diff --git a/src/Handlers/Reply/HttpPost.php b/src/Handlers/Reply/HttpPost.php index ed5982c4..30a6f9ac 100644 --- a/src/Handlers/Reply/HttpPost.php +++ b/src/Handlers/Reply/HttpPost.php @@ -51,20 +51,26 @@ public function __construct(Config $config, array $data) public function validate(): bool { //Remove brq_signature from the equation - $data = array_filter($this->data, function($key){ + $data = array_filter($this->data, function ($key) + { $acceptable_top_level = ['brq', 'add', 'cust', 'BRQ', 'ADD', 'CUST']; - return ($key != 'brq_signature' && $key != 'BRQ_SIGNATURE') && in_array(explode('_', $key)[0], $acceptable_top_level) ; + return ( + $key != 'brq_signature' && $key != 'BRQ_SIGNATURE') && + in_array(explode('_', $key)[0], $acceptable_top_level); }, ARRAY_FILTER_USE_KEY); //Combine the array keys with value - $data = array_map(function($value, $key){ - return $key . '=' . $value; + $data = array_map(function ($value, $key) + { + return $key . '=' . html_entity_decode($value); }, $data, array_keys($data)); - $dataString = implode('', $data) . trim($this->config->secretKey()); + $dataString = implode('', $data) . trim($this->config->secretKey()); - return hash_equals(sha1($dataString), trim($this->data['brq_signature'] ?? $this->data['BRQ_SIGNATURE'] ?? null)); + return hash_equals( + sha1($dataString), + trim($this->data['brq_signature'] ?? $this->data['BRQ_SIGNATURE'] ?? null) + ); } } - diff --git a/src/Handlers/Reply/Json.php b/src/Handlers/Reply/Json.php index 4e0b6f3e..4282651a 100644 --- a/src/Handlers/Reply/Json.php +++ b/src/Handlers/Reply/Json.php @@ -53,7 +53,7 @@ class Json implements ReplyStrategy * @param string $uri * @param $method */ - public function __construct(Config $config, array $data, string $auth_header = '', string $uri = '', $method = 'POST') + public function __construct(Config $config, array $data, string $auth_header, string $uri, $method = 'POST') { $this->config = $config; $this->data = $data; @@ -71,4 +71,4 @@ public function validate(): bool return $validator->validate($this->auth_header, $this->uri, $this->method, $this->data); } -} \ No newline at end of file +} diff --git a/src/Handlers/Reply/ReplyHandler.php b/src/Handlers/Reply/ReplyHandler.php index d58b5315..4d4e556e 100644 --- a/src/Handlers/Reply/ReplyHandler.php +++ b/src/Handlers/Reply/ReplyHandler.php @@ -87,19 +87,19 @@ private function setStrategy() { $data = $this->data; - if(is_string($data)) + if (is_string($data)) { $data = json_decode($data, true); } - if($this->contains('Transaction', $data)) + if ($this->contains('Transaction', $data) && $this->auth_header && $this->uri) { $this->strategy = new Json($this->config, $data, $this->auth_header, $this->uri); return $this; } - if($this->contains('brq_', $data) || $this->contains('BRQ_', $data)) + if ($this->contains('brq_', $data) || $this->contains('BRQ_', $data)) { $this->strategy = new HttpPost($this->config, $data); @@ -114,11 +114,16 @@ private function setStrategy() * @param array $data * @return bool */ - private function contains(string $needle, array $data): bool + private function contains(string $needle, array $data, bool $strict = false): bool { - foreach(array_keys($data) as $key) + foreach (array_keys($data) as $key) { - if(str_contains($key, $needle)) + if($strict && $key == $needle) + { + return true; + } + + if(!$strict && str_contains($key, $needle)) { return true; } @@ -140,11 +145,11 @@ public function isValid() */ public function data($key = null) { - if($key) + if ($key) { - return $this->data[$key] ?? null; + return $this->data[$key] ?? $this->data[strtolower($key)] ?? $this->data[strtoupper($key)] ?? null; } return $this->data; } -} \ No newline at end of file +} diff --git a/src/Handlers/Reply/ReplyStrategy.php b/src/Handlers/Reply/ReplyStrategy.php index df236b44..8b1c1033 100644 --- a/src/Handlers/Reply/ReplyStrategy.php +++ b/src/Handlers/Reply/ReplyStrategy.php @@ -23,4 +23,4 @@ interface ReplyStrategy { public function validate(): bool; -} \ No newline at end of file +} diff --git a/src/Models/Adapters/ServiceParametersKeysAdapter.php b/src/Models/Adapters/ServiceParametersKeysAdapter.php index 3b03b9f5..46c13e82 100644 --- a/src/Models/Adapters/ServiceParametersKeysAdapter.php +++ b/src/Models/Adapters/ServiceParametersKeysAdapter.php @@ -41,7 +41,8 @@ abstract class ServiceParametersKeysAdapter extends ServiceParameter /** * @param Model $model */ - public function __construct(Model $model) { + public function __construct(Model $model) + { $this->model = $model; } @@ -83,4 +84,4 @@ public function getObjectVars(): array { return $this->model->getObjectVars(); } -} \ No newline at end of file +} diff --git a/src/Models/AdditionalParameters.php b/src/Models/AdditionalParameters.php index 791d2791..f0efa7cd 100644 --- a/src/Models/AdditionalParameters.php +++ b/src/Models/AdditionalParameters.php @@ -27,30 +27,20 @@ class AdditionalParameters extends Model */ protected array $AdditionalParameter; - /** - * @param array|null $values - */ - public function __construct(?array $values = null) - { - $this->AdditionalParameter = $values ?? array(); - - parent::__construct($values); - } - /** * @param array|null $data * @return AdditionalParameters */ public function setProperties(?array $data) { - foreach($data ?? array() as $name => $value) + foreach ($data ?? [] as $name => $value) { - $this->AdditionalParameter[] = array( - 'Value' => $value, - 'Name' => $name - ); + $this->AdditionalParameter[] = [ + 'Value' => $value, + 'Name' => $name, + ]; } return parent::setProperties($data); } -} \ No newline at end of file +} diff --git a/src/Models/Address.php b/src/Models/Address.php index 5fb8adcf..5e3dd759 100644 --- a/src/Models/Address.php +++ b/src/Models/Address.php @@ -29,4 +29,4 @@ class Address extends Model protected string $city; protected string $state; protected string $country; -} \ No newline at end of file +} diff --git a/src/Models/BankAccount.php b/src/Models/BankAccount.php index a966b263..0b59bd4e 100644 --- a/src/Models/BankAccount.php +++ b/src/Models/BankAccount.php @@ -25,4 +25,4 @@ class BankAccount extends Model protected string $iban; protected string $accountName; protected string $bic; -} \ No newline at end of file +} diff --git a/src/Models/ClientIP.php b/src/Models/ClientIP.php index 6b4390fc..13818dcb 100644 --- a/src/Models/ClientIP.php +++ b/src/Models/ClientIP.php @@ -27,10 +27,8 @@ class ClientIP extends Model /** * @var */ - /** - * @var - */ - protected $Type, $Address; + protected $Type; + protected $Address; /** * @param string|null $ip @@ -59,7 +57,7 @@ private function setAddress(?string $ip) */ private function setType(?int $type) { - $this->Type = $type ?? IPProtocolVersion::getVersion($this->Address); + $this->Type = $type ?? IPProtocolVersion::getVersion($this->Address); return $this; } @@ -74,18 +72,22 @@ private function getRemoteIp() /** * Get the forwarded IP if it exists */ - if (isset($headers['X-Forwarded-For']) && filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP)) { + if (isset($headers['X-Forwarded-For']) && filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP)) + { return $headers['X-Forwarded-For']; } - if (isset($headers['HTTP_X_FORWARDED_FOR']) && filter_var($headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) { + if (isset($headers['HTTP_X_FORWARDED_FOR']) && + filter_var($headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP) + ) { return $headers['HTTP_X_FORWARDED_FOR']; } - if (isset($_SERVER['REMOTE_ADDR']) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { + if (isset($_SERVER['REMOTE_ADDR']) && filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) + { return $_SERVER['REMOTE_ADDR']; } return '127.0.0.1'; } -} \ No newline at end of file +} diff --git a/src/Models/Company.php b/src/Models/Company.php index 6495e7ce..9d803e32 100644 --- a/src/Models/Company.php +++ b/src/Models/Company.php @@ -26,4 +26,4 @@ class Company extends Person protected bool $vatApplicable; protected string $vatNumber; protected string $chamberOfCommerce; -} \ No newline at end of file +} diff --git a/src/Models/Debtor.php b/src/Models/Debtor.php index 93c1cef9..b5ad8973 100644 --- a/src/Models/Debtor.php +++ b/src/Models/Debtor.php @@ -23,4 +23,4 @@ class Debtor extends Model { protected string $code; -} \ No newline at end of file +} diff --git a/src/Models/Email.php b/src/Models/Email.php index 65887c7a..45e8f0bb 100644 --- a/src/Models/Email.php +++ b/src/Models/Email.php @@ -28,4 +28,4 @@ public function __construct(?string $email = null) { parent::__construct(['email' => $email]); } -} \ No newline at end of file +} diff --git a/src/Models/Interfaces/Recipient.php b/src/Models/Interfaces/Recipient.php index 52b28d1e..fafdba60 100644 --- a/src/Models/Interfaces/Recipient.php +++ b/src/Models/Interfaces/Recipient.php @@ -22,5 +22,4 @@ interface Recipient { - -} \ No newline at end of file +} diff --git a/src/Models/Model.php b/src/Models/Model.php index d7281bb0..16f2b799 100644 --- a/src/Models/Model.php +++ b/src/Models/Model.php @@ -75,9 +75,9 @@ public function getObjectVars() */ public function setProperties(?array $data) { - if($data) + if ($data) { - foreach($data ?? array() as $property => $value) + foreach ($data ?? [] as $property => $value) { $this->$property = $value; } @@ -109,14 +109,14 @@ public function toArray() : array */ private function recursiveToArray(array $array) : array { - foreach($array as $key => $value) + foreach ($array as $key => $value) { - if(is_array($value)) + if (is_array($value)) { $array[$key] = $this->recursiveToArray($value); } - if(is_a($value, Arrayable::class)) + if (is_a($value, Arrayable::class)) { $array[$key] = $value->toArray(); } @@ -124,4 +124,4 @@ private function recursiveToArray(array $array) : array return $array; } -} \ No newline at end of file +} diff --git a/src/Models/Payload/PayPayload.php b/src/Models/Payload/PayPayload.php index 084e72f6..f54c4381 100644 --- a/src/Models/Payload/PayPayload.php +++ b/src/Models/Payload/PayPayload.php @@ -42,4 +42,4 @@ public function __construct(?array $payload) parent::__construct($payload); } -} \ No newline at end of file +} diff --git a/src/Models/Payload/Payload.php b/src/Models/Payload/Payload.php index edf87ebd..201c7fda 100644 --- a/src/Models/Payload/Payload.php +++ b/src/Models/Payload/Payload.php @@ -79,6 +79,12 @@ class Payload extends Model * @var string */ protected string $websiteKey; + + /** + * @var string + */ + protected string $culture; + /** * @var bool */ @@ -114,14 +120,14 @@ class Payload extends Model */ public function setProperties(?array $data) { - if(isset($data['additionalParameters'])) + if (isset($data['additionalParameters'])) { $this->additionalParameters = new AdditionalParameters($data['additionalParameters']); unset($data['additionalParameters']); } - if(isset($data['clientIP'])) + if (isset($data['clientIP'])) { $this->clientIP = new ClientIP($data['clientIP']['address'] ?? null, $data['clientIP']['type'] ?? null); @@ -130,4 +136,4 @@ public function setProperties(?array $data) return parent::setProperties($data); } -} \ No newline at end of file +} diff --git a/src/Models/Payload/RefundPayload.php b/src/Models/Payload/RefundPayload.php index 3e793083..4dbcc00e 100644 --- a/src/Models/Payload/RefundPayload.php +++ b/src/Models/Payload/RefundPayload.php @@ -26,4 +26,4 @@ class RefundPayload extends Payload * @var float */ protected float $amountCredit; -} \ No newline at end of file +} diff --git a/src/Models/Phone.php b/src/Models/Phone.php index 36e19382..3f07e9d1 100644 --- a/src/Models/Phone.php +++ b/src/Models/Phone.php @@ -25,4 +25,4 @@ class Phone extends Model protected string $landLine; protected string $mobile; protected string $fax; -} \ No newline at end of file +} diff --git a/src/Models/ServiceList.php b/src/Models/ServiceList.php index 3cff6df4..d5b28b40 100644 --- a/src/Models/ServiceList.php +++ b/src/Models/ServiceList.php @@ -20,7 +20,9 @@ namespace Buckaroo\Models; -use Buckaroo\Services\ServiceListParameters\{DefaultParameters, ModelParameters, ServiceListParameter}; +use Buckaroo\Services\ServiceListParameters\DefaultParameters; +use Buckaroo\Services\ServiceListParameters\ModelParameters; +use Buckaroo\Services\ServiceListParameters\ServiceListParameter; class ServiceList extends Model { @@ -59,7 +61,7 @@ public function __construct(string $name, int $version, string $action, ?Model $ $this->parameterService = new DefaultParameters($this); - if($model) + if ($model) { $this->decorateParameters($model); $this->parameterService->data(); @@ -84,9 +86,9 @@ public function parameters(): array public function appendParameter($value, $key = null) { /* Check value pass multiple, iterate through it*/ - if(is_array($value) && is_array(current($value))) + if (is_array($value) && is_array(current($value))) { - foreach($value as $singleValue) + foreach ($value as $singleValue) { $this->appendParameter($singleValue, $key); } @@ -94,7 +96,7 @@ public function appendParameter($value, $key = null) return $this; } - if($key) + if ($key) { $this->parameters[$key] = $value; @@ -129,9 +131,9 @@ protected function decorateParameters(Model $model, ?string $groupType = null, ? */ protected function iterateThroughObject(Model $model, array $array, ?string $keyName = null) { - foreach($array as $key => $value) + foreach ($array as $key => $value) { - if($model instanceof ServiceParameter && $value instanceof Model) + if ($model instanceof ServiceParameter && $value instanceof Model) { $this->decorateParameters( $value, @@ -142,7 +144,7 @@ protected function iterateThroughObject(Model $model, array $array, ?string $key continue; } - if(is_array($value) && count($value)) + if (is_array($value) && count($value)) { $this->iterateThroughObject($model, $value, $key); } @@ -150,4 +152,4 @@ protected function iterateThroughObject(Model $model, array $array, ?string $key return $this; } -} \ No newline at end of file +} diff --git a/src/Models/ServiceParameter.php b/src/Models/ServiceParameter.php index 7ed1589f..80903470 100644 --- a/src/Models/ServiceParameter.php +++ b/src/Models/ServiceParameter.php @@ -33,9 +33,9 @@ class ServiceParameter extends Model */ public function setProperties(?array $data) { - foreach($data ?? array() as $property => $value) + foreach ($data ?? [] as $property => $value) { - if(method_exists($this, $property)) + if (method_exists($this, $property)) { $this->$property($value); @@ -66,4 +66,4 @@ public function getGroupKey(string $key, ?int $keyCount = 0): ?int { return $this->groupData[$key]['groupKey'] ?? null; } -} \ No newline at end of file +} diff --git a/src/Models/Services.php b/src/Models/Services.php index 7800c0f8..6a69eb4c 100644 --- a/src/Models/Services.php +++ b/src/Models/Services.php @@ -45,4 +45,4 @@ public function pushServiceList(ServiceList $serviceList): self return $this; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Models/Article.php b/src/PaymentMethods/Afterpay/Models/Article.php index a5412a2f..92e6ab8c 100644 --- a/src/PaymentMethods/Afterpay/Models/Article.php +++ b/src/PaymentMethods/Afterpay/Models/Article.php @@ -26,4 +26,4 @@ class Article extends \Buckaroo\Models\Article protected string $url; protected string $marketPlaceSellerId; protected string $refundType; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Models/Pay.php b/src/PaymentMethods/Afterpay/Models/Pay.php index 6ee7f6ba..f8200e3c 100644 --- a/src/PaymentMethods/Afterpay/Models/Pay.php +++ b/src/PaymentMethods/Afterpay/Models/Pay.php @@ -76,9 +76,9 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -87,7 +87,7 @@ class Pay extends ServiceParameter */ public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Shipping', $billing); @@ -102,7 +102,7 @@ public function billing($billing = null) */ public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->shippingRecipient = new Recipient('Shipping', $shipping); } @@ -116,9 +116,9 @@ public function shipping($shipping = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -126,4 +126,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Models/Person.php b/src/PaymentMethods/Afterpay/Models/Person.php index 38021450..c3d6a2a0 100644 --- a/src/PaymentMethods/Afterpay/Models/Person.php +++ b/src/PaymentMethods/Afterpay/Models/Person.php @@ -25,4 +25,4 @@ class Person extends \Buckaroo\Models\Person protected string $customerNumber; protected string $identificationNumber; protected string $conversationLanguage; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Models/Recipient.php b/src/PaymentMethods/Afterpay/Models/Recipient.php index 572a1cc6..2677b3be 100644 --- a/src/PaymentMethods/Afterpay/Models/Recipient.php +++ b/src/PaymentMethods/Afterpay/Models/Recipient.php @@ -26,7 +26,7 @@ use Buckaroo\Models\Interfaces\Recipient as RecipientInterface; use Buckaroo\Models\Phone; use Buckaroo\Models\ServiceParameter; -use Buckaroo\PaymentMethods\Afterpay\Service\ParameterKeys\{AddressAdapter}; +use Buckaroo\PaymentMethods\Afterpay\Service\ParameterKeys\AddressAdapter; use Buckaroo\PaymentMethods\Afterpay\Service\ParameterKeys\PhoneAdapter; use Buckaroo\PaymentMethods\Afterpay\Service\ParameterKeys\RecipientAdapter; use Buckaroo\Resources\Constants\RecipientCategory; @@ -73,9 +73,9 @@ public function __construct(string $type, ?array $values = null) */ public function recipient($recipient = null) { - if(is_array($recipient)) + if (is_array($recipient)) { - $this->recipient = $this->getRecipientObject($recipient); + $this->recipient = $this->getRecipientObject($recipient); } return $this->recipient; @@ -87,7 +87,7 @@ public function recipient($recipient = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -101,9 +101,9 @@ public function address($address = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { - $this->phone = new PhoneAdapter(new Phone($phone)); + $this->phone = new PhoneAdapter(new Phone($phone)); } return $this->phone; @@ -115,9 +115,9 @@ public function phone($phone = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { - $this->email = new Email($email); + $this->email = new Email($email); } return $this->email; @@ -130,7 +130,8 @@ public function email($email = null) */ private function getRecipientObject(array $recipient) : RecipientInterface { - switch ($recipient['category']) { + switch ($recipient['category']) + { case RecipientCategory::COMPANY: return new RecipientAdapter(new Company($recipient)); case RecipientCategory::PERSON: @@ -148,4 +149,4 @@ public function getGroupType(string $key): ?string { return $this->type . 'Customer'; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Models/Refund.php b/src/PaymentMethods/Afterpay/Models/Refund.php index 6c0ba65e..8ac00a53 100644 --- a/src/PaymentMethods/Afterpay/Models/Refund.php +++ b/src/PaymentMethods/Afterpay/Models/Refund.php @@ -34,9 +34,9 @@ class Refund extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -45,9 +45,9 @@ class Refund extends ServiceParameter */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -55,4 +55,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/Afterpay/Service/ParameterKeys/AddressAdapter.php index 3defb026..81cbbeed 100644 --- a/src/PaymentMethods/Afterpay/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/Afterpay/Service/ParameterKeys/AddressAdapter.php @@ -25,8 +25,8 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumber' => 'StreetNumber', - 'houseNumberAdditional' => 'StreetNumberAdditional', - 'zipcode' => 'PostalCode' + 'houseNumber' => 'StreetNumber', + 'houseNumberAdditional' => 'StreetNumberAdditional', + 'zipcode' => 'PostalCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/Afterpay/Service/ParameterKeys/ArticleAdapter.php index 6720b213..113aca72 100644 --- a/src/PaymentMethods/Afterpay/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/Afterpay/Service/ParameterKeys/ArticleAdapter.php @@ -25,6 +25,6 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'price' => 'GrossUnitPrice' + 'price' => 'GrossUnitPrice', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/Afterpay/Service/ParameterKeys/PhoneAdapter.php index a81c3a2a..5c8e9d5f 100644 --- a/src/PaymentMethods/Afterpay/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/Afterpay/Service/ParameterKeys/PhoneAdapter.php @@ -25,7 +25,7 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'landLine' => 'Phone', - 'mobile' => 'MobilePhone' + 'landLine' => 'Phone', + 'mobile' => 'MobilePhone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Afterpay/Service/ParameterKeys/RecipientAdapter.php b/src/PaymentMethods/Afterpay/Service/ParameterKeys/RecipientAdapter.php index f138bc58..112083fa 100644 --- a/src/PaymentMethods/Afterpay/Service/ParameterKeys/RecipientAdapter.php +++ b/src/PaymentMethods/Afterpay/Service/ParameterKeys/RecipientAdapter.php @@ -26,7 +26,7 @@ class RecipientAdapter extends ServiceParametersKeysAdapter implements RecipientInterface { protected array $keys = [ - 'title' => 'Salutation', - 'chamberOfCommerce' => 'IdentificationNumber' + 'title' => 'Salutation', + 'chamberOfCommerce' => 'IdentificationNumber', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/AfterpayDigiAccept.php b/src/PaymentMethods/AfterpayDigiAccept/AfterpayDigiAccept.php index ed8fc96b..1019afb9 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/AfterpayDigiAccept.php +++ b/src/PaymentMethods/AfterpayDigiAccept/AfterpayDigiAccept.php @@ -77,4 +77,4 @@ public function cancelAuthorize(?Model $model = null): TransactionResponse return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Models/Pay.php b/src/PaymentMethods/AfterpayDigiAccept/Models/Pay.php index f554b3b4..897d47e5 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Models/Pay.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Models/Pay.php @@ -38,9 +38,9 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -96,9 +96,9 @@ class Pay extends ServiceParameter */ public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { - $this->billingRecipient = new Recipient('Billing', $billing); + $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Shipping', $billing); } @@ -111,7 +111,7 @@ public function billing($billing = null) */ public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->addressesDiffer = true; @@ -127,9 +127,9 @@ public function shipping($shipping = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -137,4 +137,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Models/Recipient.php b/src/PaymentMethods/AfterpayDigiAccept/Models/Recipient.php index c12004b3..05735b86 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Models/Recipient.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Models/Recipient.php @@ -1,4 +1,5 @@ recipient = $this->getRecipientObject($recipient); } @@ -86,7 +87,7 @@ public function recipient($recipient = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter($this->type, new Address($address)); } @@ -100,7 +101,7 @@ public function address($address = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter($this->type, new Phone($phone)); } @@ -114,7 +115,7 @@ public function phone($phone = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new EmailAdapter($this->type, new Email($email)); } @@ -130,11 +131,13 @@ private function getRecipientObject(array $recipient) : RecipientAdapter { $model = new Person($recipient); - if(($recipient['companyName'] ?? null) || ( $recipient['chamberOfCommerce'] ?? null) || ($recipient['vatNumber'] ?? null)) - { + if (($recipient['companyName'] ?? null) || + ($recipient['chamberOfCommerce'] ?? null) || + ($recipient['vatNumber'] ?? null) + ) { $model = new Company($recipient); } return new RecipientAdapter($this->type, $model); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Models/Refund.php b/src/PaymentMethods/AfterpayDigiAccept/Models/Refund.php index ea090fff..e87339cc 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Models/Refund.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Models/Refund.php @@ -44,9 +44,9 @@ class Refund extends ServiceParameter */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -54,4 +54,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/AddressAdapter.php index 8c4809f3..d2c0e275 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/AddressAdapter.php @@ -26,8 +26,8 @@ class AddressAdapter extends ServiceAdapter * @var array|string[] */ protected array $keys = [ - 'houseNumberAdditional' => 'HouseNumberSuffix', - 'zipcode' => 'PostalCode' + 'houseNumberAdditional' => 'HouseNumberSuffix', + 'zipcode' => 'PostalCode', ]; /** @@ -36,7 +36,7 @@ class AddressAdapter extends ServiceAdapter */ public function serviceParameterKeyOf($propertyName): string { - if($this->prefix == 'Shipping' && $propertyName == 'country') + if ($this->prefix == 'Shipping' && $propertyName == 'country') { return 'ShippingCountryCode'; } @@ -45,4 +45,4 @@ public function serviceParameterKeyOf($propertyName): string return $this->prefix . $name; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ArticleAdapter.php index 27ee0cce..65c5a5dc 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ArticleAdapter.php @@ -25,10 +25,10 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'identifier' => 'ArticleId', - 'quantity' => 'ArticleQuantity', - 'price' => 'ArticleUnitprice', - 'vatCategory' => 'ArticleVatcategory', - 'description' => 'ArticleDescription' + 'identifier' => 'ArticleId', + 'quantity' => 'ArticleQuantity', + 'price' => 'ArticleUnitprice', + 'vatCategory' => 'ArticleVatcategory', + 'description' => 'ArticleDescription', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/EmailAdapter.php index 9bb9f6aa..f01915f9 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/EmailAdapter.php @@ -22,5 +22,4 @@ class EmailAdapter extends ServiceAdapter { - -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/PhoneAdapter.php index 4e5618b1..d3fb8802 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/PhoneAdapter.php @@ -23,6 +23,6 @@ class PhoneAdapter extends ServiceAdapter { protected array $keys = [ - 'mobile' => 'PhoneNumber' + 'mobile' => 'PhoneNumber', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/RecipientAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/RecipientAdapter.php index f93405d6..dd2af1c3 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/RecipientAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/RecipientAdapter.php @@ -26,9 +26,9 @@ class RecipientAdapter extends ServiceAdapter * @var array|string[] */ protected array $keys = [ - 'culture' => 'Language', - 'chamberOfCommerce' => 'CompanyCOCRegistration', - 'vatNumber' => 'VatNumber' + 'culture' => 'Language', + 'chamberOfCommerce' => 'CompanyCOCRegistration', + 'vatNumber' => 'VatNumber', ]; /** @@ -37,7 +37,7 @@ class RecipientAdapter extends ServiceAdapter */ public function serviceParameterKeyOf($propertyName): string { - if(in_array($propertyName, ['companyName', 'chamberOfCommerce', 'vatNumber'])) + if (in_array($propertyName, ['companyName', 'chamberOfCommerce', 'vatNumber'])) { return (isset($this->keys[$propertyName]))? $this->keys[$propertyName] : ucfirst($propertyName); } @@ -46,4 +46,4 @@ public function serviceParameterKeyOf($propertyName): string return $this->prefix . $name; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ServiceAdapter.php b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ServiceAdapter.php index 64ce8e91..1788c103 100644 --- a/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ServiceAdapter.php +++ b/src/PaymentMethods/AfterpayDigiAccept/Service/ParameterKeys/ServiceAdapter.php @@ -50,4 +50,4 @@ public function serviceParameterKeyOf($propertyName): string return $this->prefix . $name; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Alipay/Alipay.php b/src/PaymentMethods/Alipay/Alipay.php index d28e9cb6..423c0988 100644 --- a/src/PaymentMethods/Alipay/Alipay.php +++ b/src/PaymentMethods/Alipay/Alipay.php @@ -40,4 +40,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Alipay/Models/Pay.php b/src/PaymentMethods/Alipay/Models/Pay.php index 900e8596..29daacb1 100644 --- a/src/PaymentMethods/Alipay/Models/Pay.php +++ b/src/PaymentMethods/Alipay/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected bool $useMobileView; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/ApplePay/ApplePay.php b/src/PaymentMethods/ApplePay/ApplePay.php index cb9fde36..178ab156 100644 --- a/src/PaymentMethods/ApplePay/ApplePay.php +++ b/src/PaymentMethods/ApplePay/ApplePay.php @@ -34,4 +34,4 @@ public function payRedirect(): TransactionResponse return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/ApplePay/Models/Pay.php b/src/PaymentMethods/ApplePay/Models/Pay.php index bfca0c35..af8e5cdc 100644 --- a/src/PaymentMethods/ApplePay/Models/Pay.php +++ b/src/PaymentMethods/ApplePay/Models/Pay.php @@ -26,4 +26,4 @@ class Pay extends ServiceParameter { protected string $paymentData; protected string $customerCardName; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/ApplePay/Models/PayPayload.php b/src/PaymentMethods/ApplePay/Models/PayPayload.php index eb5d15e1..98c2d452 100644 --- a/src/PaymentMethods/ApplePay/Models/PayPayload.php +++ b/src/PaymentMethods/ApplePay/Models/PayPayload.php @@ -25,4 +25,4 @@ class PayPayload extends \Buckaroo\Models\Payload\PayPayload protected string $continueOnIncomplete; protected string $servicesSelectableByClient; protected string $servicesExcludedForClient; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Bancontact/Bancontact.php b/src/PaymentMethods/Bancontact/Bancontact.php index 4c884358..eaa4ef08 100644 --- a/src/PaymentMethods/Bancontact/Bancontact.php +++ b/src/PaymentMethods/Bancontact/Bancontact.php @@ -71,4 +71,4 @@ public function authenticate(): TransactionResponse return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Bancontact/Models/Authenticate.php b/src/PaymentMethods/Bancontact/Models/Authenticate.php index 8248634e..271be042 100644 --- a/src/PaymentMethods/Bancontact/Models/Authenticate.php +++ b/src/PaymentMethods/Bancontact/Models/Authenticate.php @@ -25,4 +25,4 @@ class Authenticate extends ServiceParameter { protected bool $saveToken; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Bancontact/Models/Pay.php b/src/PaymentMethods/Bancontact/Models/Pay.php index c83eb8e0..da2ed5be 100644 --- a/src/PaymentMethods/Bancontact/Models/Pay.php +++ b/src/PaymentMethods/Bancontact/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected bool $saveToken; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Bancontact/Models/PayEncrypted.php b/src/PaymentMethods/Bancontact/Models/PayEncrypted.php index 88795e40..e52be220 100644 --- a/src/PaymentMethods/Bancontact/Models/PayEncrypted.php +++ b/src/PaymentMethods/Bancontact/Models/PayEncrypted.php @@ -25,4 +25,4 @@ class PayEncrypted extends ServiceParameter { protected string $encryptedCardData; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BankTransfer/Models/Pay.php b/src/PaymentMethods/BankTransfer/Models/Pay.php index 7498d85d..7b55677d 100644 --- a/src/PaymentMethods/BankTransfer/Models/Pay.php +++ b/src/PaymentMethods/BankTransfer/Models/Pay.php @@ -56,7 +56,7 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } @@ -70,11 +70,11 @@ public function customer($customer = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new EmailAdapter(new Email($email)); } return $this->email; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/CustomerAdapter.php index a258d2ea..6b1d8f16 100644 --- a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/CustomerAdapter.php @@ -25,9 +25,9 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'gender' => 'CustomerGender', - 'firstName' => 'CustomerFirstName', - 'lastName' => 'CustomerLastName', - 'email' => 'CustomerEmail', + 'gender' => 'CustomerGender', + 'firstName' => 'CustomerFirstName', + 'lastName' => 'CustomerLastName', + 'email' => 'CustomerEmail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/EmailAdapter.php index 2485f96b..96b1d83e 100644 --- a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/EmailAdapter.php @@ -25,6 +25,6 @@ class EmailAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'email' => 'Customeremail' + 'email' => 'Customeremail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/PayAdapter.php b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/PayAdapter.php index d501d8cd..9aeaad37 100644 --- a/src/PaymentMethods/BankTransfer/Service/ParameterKeys/PayAdapter.php +++ b/src/PaymentMethods/BankTransfer/Service/ParameterKeys/PayAdapter.php @@ -25,6 +25,6 @@ class PayAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'country' => 'CustomerCountry' + 'country' => 'CustomerCountry', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Belfius/Belfius.php b/src/PaymentMethods/Belfius/Belfius.php index e648517d..230cf6d6 100644 --- a/src/PaymentMethods/Belfius/Belfius.php +++ b/src/PaymentMethods/Belfius/Belfius.php @@ -1,4 +1,5 @@ postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Models/Article.php b/src/PaymentMethods/Billink/Models/Article.php index 72a701ce..5b3d79d0 100644 --- a/src/PaymentMethods/Billink/Models/Article.php +++ b/src/PaymentMethods/Billink/Models/Article.php @@ -23,4 +23,4 @@ class Article extends \Buckaroo\Models\Article { protected float $priceExcl; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Models/Capture.php b/src/PaymentMethods/Billink/Models/Capture.php index 5f5eff3f..499615db 100644 --- a/src/PaymentMethods/Billink/Models/Capture.php +++ b/src/PaymentMethods/Billink/Models/Capture.php @@ -44,9 +44,9 @@ class Capture extends ServiceParameter */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -54,4 +54,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Models/Pay.php b/src/PaymentMethods/Billink/Models/Pay.php index 41134956..2b7d661f 100644 --- a/src/PaymentMethods/Billink/Models/Pay.php +++ b/src/PaymentMethods/Billink/Models/Pay.php @@ -60,9 +60,9 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -71,7 +71,7 @@ class Pay extends ServiceParameter */ public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Billing', $billing); @@ -86,7 +86,7 @@ public function billing($billing = null) */ public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->shippingRecipient = new Recipient('Shipping', $shipping); } @@ -100,9 +100,9 @@ public function shipping($shipping = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -110,4 +110,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Models/Recipient.php b/src/PaymentMethods/Billink/Models/Recipient.php index dd58d5cb..3d42e629 100644 --- a/src/PaymentMethods/Billink/Models/Recipient.php +++ b/src/PaymentMethods/Billink/Models/Recipient.php @@ -20,8 +20,13 @@ namespace Buckaroo\PaymentMethods\Billink\Models; -use Buckaroo\Models\{Address, Company, Email, Person, Phone, ServiceParameter}; +use Buckaroo\Models\Address; +use Buckaroo\Models\Company; +use Buckaroo\Models\Email; use Buckaroo\Models\Interfaces\Recipient as RecipientInterface; +use Buckaroo\Models\Person; +use Buckaroo\Models\Phone; +use Buckaroo\Models\ServiceParameter; use Buckaroo\PaymentMethods\Billink\Service\ParameterKeys\AddressAdapter; use Buckaroo\PaymentMethods\Billink\Service\ParameterKeys\PhoneAdapter; use Buckaroo\PaymentMethods\Billink\Service\ParameterKeys\RecipientAdapter; @@ -67,9 +72,9 @@ public function __construct(string $type, ?array $values = null) */ public function recipient($recipient = null) { - if(is_array($recipient)) + if (is_array($recipient)) { - $this->recipient = $this->getRecipientObject($recipient); + $this->recipient = $this->getRecipientObject($recipient); } return $this->recipient; @@ -81,7 +86,7 @@ public function recipient($recipient = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -95,7 +100,7 @@ public function address($address = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter(new Phone($phone)); } @@ -109,7 +114,7 @@ public function phone($phone = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } @@ -124,9 +129,10 @@ public function email($email = null) */ private function getRecipientObject(array $recipient) : RecipientInterface { - if(isset($recipient['category'])) + if (isset($recipient['category'])) { - switch ($recipient['category']) { + switch ($recipient['category']) + { case 'B2B': return new RecipientAdapter(new Company($recipient)); case 'B2C': @@ -145,4 +151,4 @@ public function getGroupType(string $key): ?string { return $this->type . 'Customer'; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/Billink/Service/ParameterKeys/AddressAdapter.php index 9b133486..7228b390 100644 --- a/src/PaymentMethods/Billink/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/Billink/Service/ParameterKeys/AddressAdapter.php @@ -25,8 +25,8 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumber' => 'StreetNumber', - 'houseNumberAdditional' => 'StreetNumberAdditional', - 'zipcode' => 'PostalCode' + 'houseNumber' => 'StreetNumber', + 'houseNumberAdditional' => 'StreetNumberAdditional', + 'zipcode' => 'PostalCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/Billink/Service/ParameterKeys/ArticleAdapter.php index 6590be34..9b6e7c8a 100644 --- a/src/PaymentMethods/Billink/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/Billink/Service/ParameterKeys/ArticleAdapter.php @@ -25,8 +25,8 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'identifier' => 'Identifier', - 'price' => 'GrossUnitPriceIncl', - 'priceExcl' => 'GrossUnitPriceExcl' + 'identifier' => 'Identifier', + 'price' => 'GrossUnitPriceIncl', + 'priceExcl' => 'GrossUnitPriceExcl', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/Billink/Service/ParameterKeys/PhoneAdapter.php index 1f6aa7bf..e8e80660 100644 --- a/src/PaymentMethods/Billink/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/Billink/Service/ParameterKeys/PhoneAdapter.php @@ -25,7 +25,7 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'landLine' => 'Phone', - 'mobile' => 'MobilePhone' + 'landLine' => 'Phone', + 'mobile' => 'MobilePhone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Billink/Service/ParameterKeys/RecipientAdapter.php b/src/PaymentMethods/Billink/Service/ParameterKeys/RecipientAdapter.php index fee8932d..6c6687ff 100644 --- a/src/PaymentMethods/Billink/Service/ParameterKeys/RecipientAdapter.php +++ b/src/PaymentMethods/Billink/Service/ParameterKeys/RecipientAdapter.php @@ -26,6 +26,6 @@ class RecipientAdapter extends ServiceParametersKeysAdapter implements RecipientInterface { protected array $keys = [ - 'title' => 'Salutation', + 'title' => 'Salutation', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooVoucher/BuckarooVoucher.php b/src/PaymentMethods/BuckarooVoucher/BuckarooVoucher.php index a0de1b16..d0fac17e 100644 --- a/src/PaymentMethods/BuckarooVoucher/BuckarooVoucher.php +++ b/src/PaymentMethods/BuckarooVoucher/BuckarooVoucher.php @@ -21,13 +21,12 @@ namespace Buckaroo\PaymentMethods\BuckarooVoucher; use Buckaroo\Models\Model; -use Buckaroo\PaymentMethods\PayablePaymentMethod; -use Buckaroo\Transaction\Response\TransactionResponse; -use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Pay; use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Create; use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Deactivate; use Buckaroo\PaymentMethods\BuckarooVoucher\Models\GetBalance; -use Buckaroo\PaymentMethods\BuckarooVoucher\Models\CreatePayload; +use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Pay; +use Buckaroo\PaymentMethods\PayablePaymentMethod; +use Buckaroo\Transaction\Response\TransactionResponse; class BuckarooVoucher extends PayablePaymentMethod { diff --git a/src/PaymentMethods/BuckarooVoucher/Models/CreatePayload.php b/src/PaymentMethods/BuckarooVoucher/Models/CreatePayload.php index 41f3e48a..65f30f5e 100644 --- a/src/PaymentMethods/BuckarooVoucher/Models/CreatePayload.php +++ b/src/PaymentMethods/BuckarooVoucher/Models/CreatePayload.php @@ -24,4 +24,4 @@ class CreatePayload extends Payload { -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooVoucher/Models/Deactivate.php b/src/PaymentMethods/BuckarooVoucher/Models/Deactivate.php index 30e2d213..1f4d9118 100644 --- a/src/PaymentMethods/BuckarooVoucher/Models/Deactivate.php +++ b/src/PaymentMethods/BuckarooVoucher/Models/Deactivate.php @@ -20,8 +20,6 @@ namespace Buckaroo\PaymentMethods\BuckarooVoucher\Models; -use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Pay; - class Deactivate extends Pay { -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooVoucher/Models/GetBalance.php b/src/PaymentMethods/BuckarooVoucher/Models/GetBalance.php index 07ef0527..1f44b16c 100644 --- a/src/PaymentMethods/BuckarooVoucher/Models/GetBalance.php +++ b/src/PaymentMethods/BuckarooVoucher/Models/GetBalance.php @@ -20,8 +20,6 @@ namespace Buckaroo\PaymentMethods\BuckarooVoucher\Models; -use Buckaroo\PaymentMethods\BuckarooVoucher\Models\Pay; - class GetBalance extends Pay { -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooVoucher/Models/Pay.php b/src/PaymentMethods/BuckarooVoucher/Models/Pay.php index c71b2237..03007563 100644 --- a/src/PaymentMethods/BuckarooVoucher/Models/Pay.php +++ b/src/PaymentMethods/BuckarooVoucher/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected string $vouchercode; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/BuckarooWallet.php b/src/PaymentMethods/BuckarooWallet/BuckarooWallet.php index 2e30379d..26d8670f 100644 --- a/src/PaymentMethods/BuckarooWallet/BuckarooWallet.php +++ b/src/PaymentMethods/BuckarooWallet/BuckarooWallet.php @@ -158,5 +158,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay(new Wallet($this->payload)); } - -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Models/DepositReservePayload.php b/src/PaymentMethods/BuckarooWallet/Models/DepositReservePayload.php index 3e22130a..ce56271f 100644 --- a/src/PaymentMethods/BuckarooWallet/Models/DepositReservePayload.php +++ b/src/PaymentMethods/BuckarooWallet/Models/DepositReservePayload.php @@ -27,4 +27,4 @@ class DepositReservePayload extends Payload protected string $invoice; protected string $originalTransactionKey; protected float $amountCredit; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Models/ReleasePayload.php b/src/PaymentMethods/BuckarooWallet/Models/ReleasePayload.php index 41635015..88701c2a 100644 --- a/src/PaymentMethods/BuckarooWallet/Models/ReleasePayload.php +++ b/src/PaymentMethods/BuckarooWallet/Models/ReleasePayload.php @@ -25,4 +25,4 @@ class ReleasePayload extends Payload { protected float $amountCredit; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Models/Wallet.php b/src/PaymentMethods/BuckarooWallet/Models/Wallet.php index 9f553eef..7ce76132 100644 --- a/src/PaymentMethods/BuckarooWallet/Models/Wallet.php +++ b/src/PaymentMethods/BuckarooWallet/Models/Wallet.php @@ -67,7 +67,7 @@ class Wallet extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } @@ -81,7 +81,7 @@ public function customer($customer = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new EmailAdapter(new Email($email)); } @@ -95,11 +95,11 @@ public function email($email = null) */ public function bankAccount($bankAccount = null) { - if(is_array($bankAccount)) + if (is_array($bankAccount)) { $this->bankAccount = new BankAccountAdapter(new BankAccount($bankAccount)); } return $this->bankAccount; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/BankAccountAdapter.php b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/BankAccountAdapter.php index 98ce6b09..c88e0228 100644 --- a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/BankAccountAdapter.php +++ b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/BankAccountAdapter.php @@ -23,6 +23,6 @@ class BankAccountAdapter extends CustomerAdapter { protected array $keys = [ - 'iban' => 'ConsumerIban' + 'iban' => 'ConsumerIban', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/CustomerAdapter.php index c7bd6719..2e6e2cba 100644 --- a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/CustomerAdapter.php @@ -25,7 +25,7 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'firstName' => 'ConsumerFirstName', - 'lastName' => 'ConsumerLastName' + 'firstName' => 'ConsumerFirstName', + 'lastName' => 'ConsumerLastName', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/EmailAdapter.php index 3ff47ad6..b1cdc555 100644 --- a/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/BuckarooWallet/Service/ParameterKeys/EmailAdapter.php @@ -23,6 +23,6 @@ class EmailAdapter extends CustomerAdapter { protected array $keys = [ - 'email' => 'ConsumerEmail' + 'email' => 'ConsumerEmail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditCard/CreditCard.php b/src/PaymentMethods/CreditCard/CreditCard.php index 61ab672c..d64d76ca 100644 --- a/src/PaymentMethods/CreditCard/CreditCard.php +++ b/src/PaymentMethods/CreditCard/CreditCard.php @@ -120,6 +120,20 @@ public function payRecurrent(): TransactionResponse return $this->postRequest(); } + /** + * @return TransactionResponse + */ + public function payRemainderEncrypted(): TransactionResponse + { + $cardData = new CardData($this->payload); + + $this->setPayPayload(); + + $this->setServiceList('PayRemainderEncrypted', $cardData); + + return $this->postRequest(); + } + /** * @return TransactionResponse */ @@ -138,7 +152,7 @@ public function cancelAuthorize(): TransactionResponse */ public function paymentName(): string { - if(isset($this->payload['name'])) + if (isset($this->payload['name'])) { return $this->payload['name']; } diff --git a/src/PaymentMethods/CreditCard/Models/CardData.php b/src/PaymentMethods/CreditCard/Models/CardData.php index 64862f8f..67fccafc 100644 --- a/src/PaymentMethods/CreditCard/Models/CardData.php +++ b/src/PaymentMethods/CreditCard/Models/CardData.php @@ -25,4 +25,4 @@ class CardData extends ServiceParameter { protected string $encryptedCardData; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditCard/Models/SecurityCode.php b/src/PaymentMethods/CreditCard/Models/SecurityCode.php index 1cd53a03..f98ecbb6 100644 --- a/src/PaymentMethods/CreditCard/Models/SecurityCode.php +++ b/src/PaymentMethods/CreditCard/Models/SecurityCode.php @@ -25,4 +25,4 @@ class SecurityCode extends ServiceParameter { protected string $encryptedSecurityCode; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditClick/CreditClick.php b/src/PaymentMethods/CreditClick/CreditClick.php index 7b73caba..e1f535dc 100644 --- a/src/PaymentMethods/CreditClick/CreditClick.php +++ b/src/PaymentMethods/CreditClick/CreditClick.php @@ -50,4 +50,4 @@ public function refund(?Model $model = null): TransactionResponse { return parent::refund($model ?? new Refund($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditClick/Models/Pay.php b/src/PaymentMethods/CreditClick/Models/Pay.php index 1d9da959..f5cb5f49 100644 --- a/src/PaymentMethods/CreditClick/Models/Pay.php +++ b/src/PaymentMethods/CreditClick/Models/Pay.php @@ -41,9 +41,9 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { - $this->customer = new Person($customer); + $this->customer = new Person($customer); } return $this->customer; @@ -55,11 +55,11 @@ public function customer($customer = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } return $this->email; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditClick/Models/Refund.php b/src/PaymentMethods/CreditClick/Models/Refund.php index 3de3d816..881cfd99 100644 --- a/src/PaymentMethods/CreditClick/Models/Refund.php +++ b/src/PaymentMethods/CreditClick/Models/Refund.php @@ -25,4 +25,4 @@ class Refund extends ServiceParameter { protected string $refundreason; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditClick/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/CreditClick/Service/ParameterKeys/CustomerAdapter.php index 6466b68d..6f21cb87 100644 --- a/src/PaymentMethods/CreditClick/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/CreditClick/Service/ParameterKeys/CustomerAdapter.php @@ -25,8 +25,8 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'firstName' => 'firstname', - 'lastName' => 'lastname', - 'email' => 'email', + 'firstName' => 'firstname', + 'lastName' => 'lastname', + 'email' => 'email', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/CreditManagement.php b/src/PaymentMethods/CreditManagement/CreditManagement.php index 3c26d89d..9bc70465 100644 --- a/src/PaymentMethods/CreditManagement/CreditManagement.php +++ b/src/PaymentMethods/CreditManagement/CreditManagement.php @@ -169,5 +169,4 @@ public function pauseDebtorFile() return $this->dataRequest(); } - -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/AddOrUpdateProductLines.php b/src/PaymentMethods/CreditManagement/Models/AddOrUpdateProductLines.php index f9d0f854..2bff3a54 100644 --- a/src/PaymentMethods/CreditManagement/Models/AddOrUpdateProductLines.php +++ b/src/PaymentMethods/CreditManagement/Models/AddOrUpdateProductLines.php @@ -46,9 +46,9 @@ class AddOrUpdateProductLines extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'ProductLine' - ] + 'articles' => [ + 'groupType' => 'ProductLine', + ], ]; /** @@ -57,9 +57,9 @@ class AddOrUpdateProductLines extends ServiceParameter */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -67,4 +67,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/Article.php b/src/PaymentMethods/CreditManagement/Models/Article.php index 72b194c9..8dfde249 100644 --- a/src/PaymentMethods/CreditManagement/Models/Article.php +++ b/src/PaymentMethods/CreditManagement/Models/Article.php @@ -32,4 +32,4 @@ class Article extends \Buckaroo\Models\Article protected float $totalVat; protected float $totalAmountExVat; protected float $totalAmount; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/CreditNote.php b/src/PaymentMethods/CreditManagement/Models/CreditNote.php index 9bb0928a..9ed9906a 100644 --- a/src/PaymentMethods/CreditManagement/Models/CreditNote.php +++ b/src/PaymentMethods/CreditManagement/Models/CreditNote.php @@ -29,4 +29,4 @@ class CreditNote extends ServiceParameter protected string $invoiceAmount; protected string $invoiceAmountVAT; protected string $sendCreditNoteMessage; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/Debtor.php b/src/PaymentMethods/CreditManagement/Models/Debtor.php index d9c3bc95..6821462f 100644 --- a/src/PaymentMethods/CreditManagement/Models/Debtor.php +++ b/src/PaymentMethods/CreditManagement/Models/Debtor.php @@ -47,38 +47,38 @@ class Debtor extends Invoice * @var array|\string[][] */ protected array $groupData = [ - 'address' => [ - 'groupType' => 'Address' + 'address' => [ + 'groupType' => 'Address', ], - 'company' => [ - 'groupType' => 'Company' + 'company' => [ + 'groupType' => 'Company', ], - 'person' => [ - 'groupType' => 'Person' + 'person' => [ + 'groupType' => 'Person', ], - 'debtor' => [ - 'groupType' => 'Debtor' + 'debtor' => [ + 'groupType' => 'Debtor', ], - 'email' => [ - 'groupType' => 'Email' + 'email' => [ + 'groupType' => 'Email', ], - 'phone' => [ - 'groupType' => 'Phone' + 'phone' => [ + 'groupType' => 'Phone', ], - 'addressUnreachable' => [ - 'groupType' => 'Address' + 'addressUnreachable' => [ + 'groupType' => 'Address', ], - 'emailUnreachable' => [ - 'groupType' => 'Email' + 'emailUnreachable' => [ + 'groupType' => 'Email', ], - 'mobileUnreachable' => [ - 'groupType' => 'Phone' + 'mobileUnreachable' => [ + 'groupType' => 'Phone', ], - 'landlineUnreachable' => [ - 'groupType' => 'Phone' + 'landlineUnreachable' => [ + 'groupType' => 'Phone', ], - 'faxUnreachable' => [ - 'groupType' => 'Phone' + 'faxUnreachable' => [ + 'groupType' => 'Phone', ], ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/DebtorFile.php b/src/PaymentMethods/CreditManagement/Models/DebtorFile.php index 109a42d0..6737dcfc 100644 --- a/src/PaymentMethods/CreditManagement/Models/DebtorFile.php +++ b/src/PaymentMethods/CreditManagement/Models/DebtorFile.php @@ -25,4 +25,4 @@ class DebtorFile extends ServiceParameter { protected string $debtorFileGuid; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/DebtorInfo.php b/src/PaymentMethods/CreditManagement/Models/DebtorInfo.php index 666cfc7e..8c999e02 100644 --- a/src/PaymentMethods/CreditManagement/Models/DebtorInfo.php +++ b/src/PaymentMethods/CreditManagement/Models/DebtorInfo.php @@ -35,9 +35,9 @@ class DebtorInfo extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'debtor' => [ - 'groupType' => 'Debtor' - ] + 'debtor' => [ + 'groupType' => 'Debtor', + ], ]; /** @@ -46,11 +46,11 @@ class DebtorInfo extends ServiceParameter */ public function debtor($debtor = null) { - if(is_array($debtor)) + if (is_array($debtor)) { $this->debtor = new DebtorInfoAdapter(new Debtor($debtor)); } return $this->debtor; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/Invoice.php b/src/PaymentMethods/CreditManagement/Models/Invoice.php index a56adba6..412547cc 100644 --- a/src/PaymentMethods/CreditManagement/Models/Invoice.php +++ b/src/PaymentMethods/CreditManagement/Models/Invoice.php @@ -20,7 +20,13 @@ namespace Buckaroo\PaymentMethods\CreditManagement\Models; -use Buckaroo\Models\{Address, Company, Debtor, Email, Person, Phone, ServiceParameter}; +use Buckaroo\Models\Address; +use Buckaroo\Models\Company; +use Buckaroo\Models\Debtor; +use Buckaroo\Models\Email; +use Buckaroo\Models\Person; +use Buckaroo\Models\Phone; +use Buckaroo\Models\ServiceParameter; use Buckaroo\PaymentMethods\CreditManagement\Service\ParameterKeys\ArticleAdapter; use Buckaroo\PaymentMethods\Traits\CountableGroupKey; @@ -123,26 +129,26 @@ class Invoice extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'ProductLine' + 'articles' => [ + 'groupType' => 'ProductLine', ], - 'address' => [ - 'groupType' => 'Address' + 'address' => [ + 'groupType' => 'Address', ], - 'company' => [ - 'groupType' => 'Company' + 'company' => [ + 'groupType' => 'Company', ], - 'person' => [ - 'groupType' => 'Person' + 'person' => [ + 'groupType' => 'Person', ], - 'debtor' => [ - 'groupType' => 'Debtor' + 'debtor' => [ + 'groupType' => 'Debtor', ], - 'email' => [ - 'groupType' => 'Email' + 'email' => [ + 'groupType' => 'Email', ], - 'phone' => [ - 'groupType' => 'Phone' + 'phone' => [ + 'groupType' => 'Phone', ], ]; @@ -152,7 +158,7 @@ class Invoice extends ServiceParameter */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new Address($address); } @@ -166,7 +172,7 @@ public function address($address = null) */ public function company($company = null) { - if(is_array($company)) + if (is_array($company)) { $this->company = new Company($company); } @@ -180,7 +186,7 @@ public function company($company = null) */ public function person($person = null) { - if(is_array($person)) + if (is_array($person)) { $this->person = new Person($person); } @@ -194,7 +200,7 @@ public function person($person = null) */ public function debtor($debtor = null) { - if(is_array($debtor)) + if (is_array($debtor)) { $this->debtor = new Debtor($debtor); } @@ -208,7 +214,7 @@ public function debtor($debtor = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } @@ -222,7 +228,7 @@ public function email($email = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new Phone($phone); } @@ -236,9 +242,9 @@ public function phone($phone = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -246,4 +252,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/MultipleInvoiceInfo.php b/src/PaymentMethods/CreditManagement/Models/MultipleInvoiceInfo.php index ffcee630..80f2d970 100644 --- a/src/PaymentMethods/CreditManagement/Models/MultipleInvoiceInfo.php +++ b/src/PaymentMethods/CreditManagement/Models/MultipleInvoiceInfo.php @@ -43,9 +43,9 @@ class MultipleInvoiceInfo extends ServiceParameter */ public function invoices(?array $invoices = null) { - if(is_array($invoices)) + if (is_array($invoices)) { - foreach($invoices as $invoice) + foreach ($invoices as $invoice) { $this->invoices[] = new Invoice($invoice); } @@ -53,4 +53,4 @@ public function invoices(?array $invoices = null) return $this->invoices; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Models/PaymentPlan.php b/src/PaymentMethods/CreditManagement/Models/PaymentPlan.php index cd036c50..5c210839 100644 --- a/src/PaymentMethods/CreditManagement/Models/PaymentPlan.php +++ b/src/PaymentMethods/CreditManagement/Models/PaymentPlan.php @@ -34,4 +34,4 @@ class PaymentPlan extends ServiceParameter protected float $paymentPlanCostAmount; protected float $paymentPlanCostAmountVat; protected string $recipientEmail; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/CreditManagement/Service/ParameterKeys/ArticleAdapter.php index c6d380bb..c998f278 100644 --- a/src/PaymentMethods/CreditManagement/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/CreditManagement/Service/ParameterKeys/ArticleAdapter.php @@ -25,8 +25,8 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'identifier' => 'ProductId', - 'description' => 'ProductName', - 'price' => 'PricePerUnit' + 'identifier' => 'ProductId', + 'description' => 'ProductName', + 'price' => 'PricePerUnit', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/CreditManagement/Service/ParameterKeys/DebtorInfoAdapter.php b/src/PaymentMethods/CreditManagement/Service/ParameterKeys/DebtorInfoAdapter.php index 37c5c5a8..615db330 100644 --- a/src/PaymentMethods/CreditManagement/Service/ParameterKeys/DebtorInfoAdapter.php +++ b/src/PaymentMethods/CreditManagement/Service/ParameterKeys/DebtorInfoAdapter.php @@ -25,6 +25,6 @@ class DebtorInfoAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'code' => 'DebtorCode' + 'code' => 'DebtorCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Emandates/Emandates.php b/src/PaymentMethods/Emandates/Emandates.php index c9118162..8f723616 100644 --- a/src/PaymentMethods/Emandates/Emandates.php +++ b/src/PaymentMethods/Emandates/Emandates.php @@ -105,4 +105,4 @@ public function cancelMandate() return $this->dataRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Emandates/Models/Mandate.php b/src/PaymentMethods/Emandates/Models/Mandate.php index 5de8702a..455b3255 100644 --- a/src/PaymentMethods/Emandates/Models/Mandate.php +++ b/src/PaymentMethods/Emandates/Models/Mandate.php @@ -33,4 +33,4 @@ class Mandate extends ServiceParameter protected string $emandatereason; protected float $maxamount; protected string $originalMandateId; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/GiftCard/GiftCard.php b/src/PaymentMethods/GiftCard/GiftCard.php index f2e1504a..ae3864b2 100644 --- a/src/PaymentMethods/GiftCard/GiftCard.php +++ b/src/PaymentMethods/GiftCard/GiftCard.php @@ -70,11 +70,11 @@ public function payRemainder(?Model $model = null) */ public function paymentName(): string { - if(isset($this->payload['name'])) + if (isset($this->payload['name'])) { return $this->payload['name']; } return 'giftcard'; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/GiftCard/Models/Pay.php b/src/PaymentMethods/GiftCard/Models/Pay.php index 8b55ed8a..7403461d 100644 --- a/src/PaymentMethods/GiftCard/Models/Pay.php +++ b/src/PaymentMethods/GiftCard/Models/Pay.php @@ -32,4 +32,7 @@ class Pay extends ServiceParameter protected string $tcsValidationCode; protected string $lastName; protected string $email; -} \ No newline at end of file + + protected string $cardNumber; + protected string $pin; +} diff --git a/src/PaymentMethods/GiftCard/Models/PayPayload.php b/src/PaymentMethods/GiftCard/Models/PayPayload.php index c57bff60..d0f0cffc 100644 --- a/src/PaymentMethods/GiftCard/Models/PayPayload.php +++ b/src/PaymentMethods/GiftCard/Models/PayPayload.php @@ -18,7 +18,7 @@ * @license https://tldrlegal.com/license/mit-license */ -namespace Buckaroo\PaymentMethods\Giftcard\Models; +namespace Buckaroo\PaymentMethods\GiftCard\Models; class PayPayload extends \Buckaroo\Models\Payload\PayPayload { @@ -34,4 +34,4 @@ class PayPayload extends \Buckaroo\Models\Payload\PayPayload * @var string */ protected string $servicesExcludedForClient; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Giropay/Models/Pay.php b/src/PaymentMethods/Giropay/Models/Pay.php index 561640e1..e4aeae05 100644 --- a/src/PaymentMethods/Giropay/Models/Pay.php +++ b/src/PaymentMethods/Giropay/Models/Pay.php @@ -26,4 +26,4 @@ class Pay extends ServiceParameter { protected string $bic; protected string $customerIBAN; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/In3.php b/src/PaymentMethods/In3/In3.php index 0e5c0b9e..818cdd70 100644 --- a/src/PaymentMethods/In3/In3.php +++ b/src/PaymentMethods/In3/In3.php @@ -60,4 +60,4 @@ public function payInInstallments() return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Models/Pay.php b/src/PaymentMethods/In3/Models/Pay.php index 18ca6708..51241ebb 100644 --- a/src/PaymentMethods/In3/Models/Pay.php +++ b/src/PaymentMethods/In3/Models/Pay.php @@ -27,8 +27,8 @@ use Buckaroo\Models\Phone; use Buckaroo\Models\ServiceParameter; use Buckaroo\PaymentMethods\Billink\Models\Article; -use Buckaroo\PaymentMethods\In3\Service\ParameterKeys\{ArticleAdapter}; use Buckaroo\PaymentMethods\In3\Service\ParameterKeys\AddressAdapter; +use Buckaroo\PaymentMethods\In3\Service\ParameterKeys\ArticleAdapter; use Buckaroo\PaymentMethods\In3\Service\ParameterKeys\CompanyAdapter; use Buckaroo\PaymentMethods\In3\Service\ParameterKeys\PhoneAdapter; use Buckaroo\PaymentMethods\Traits\CountableGroupKey; @@ -85,24 +85,24 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'ProductLine' + 'articles' => [ + 'groupType' => 'ProductLine', ], - 'address' => [ - 'groupType' => 'Address' + 'address' => [ + 'groupType' => 'Address', ], - 'customer' => [ - 'groupType' => 'Person' + 'customer' => [ + 'groupType' => 'Person', ], - 'company' => [ - 'groupType' => 'Company' + 'company' => [ + 'groupType' => 'Company', ], - 'phone' => [ - 'groupType' => 'Phone' + 'phone' => [ + 'groupType' => 'Phone', + ], + 'email' => [ + 'groupType' => 'Email', ], - 'email' => [ - 'groupType' => 'Email' - ] ]; /** @@ -111,9 +111,9 @@ class Pay extends ServiceParameter */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -128,7 +128,7 @@ public function articles(?array $articles = null) */ public function company($company = null) { - if(is_array($company)) + if (is_array($company)) { $this->company = new CompanyAdapter(new Company($company)); } @@ -142,7 +142,7 @@ public function company($company = null) */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new Person($customer); } @@ -156,7 +156,7 @@ public function customer($customer = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -170,7 +170,7 @@ public function address($address = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } @@ -184,7 +184,7 @@ public function email($email = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter(new Phone($phone)); } @@ -198,9 +198,9 @@ public function phone($phone = null) */ public function subtotals(?array $subtotals = null) { - if(is_array($subtotals)) + if (is_array($subtotals)) { - foreach($subtotals as $subtotal) + foreach ($subtotals as $subtotal) { $this->subtotals[] = new Subtotal($subtotal); } @@ -208,4 +208,4 @@ public function subtotals(?array $subtotals = null) return $this->subtotals; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Models/PayPayload.php b/src/PaymentMethods/In3/Models/PayPayload.php index 86d786b0..ad05d9e5 100644 --- a/src/PaymentMethods/In3/Models/PayPayload.php +++ b/src/PaymentMethods/In3/Models/PayPayload.php @@ -38,4 +38,4 @@ public function __construct(?array $payload) parent::__construct($payload); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Models/Subtotal.php b/src/PaymentMethods/In3/Models/Subtotal.php index 0b5a6671..1c1b6fd6 100644 --- a/src/PaymentMethods/In3/Models/Subtotal.php +++ b/src/PaymentMethods/In3/Models/Subtotal.php @@ -26,4 +26,4 @@ class Subtotal extends Model { protected string $name; protected float $value; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/In3/Service/ParameterKeys/AddressAdapter.php index d802a33a..af572101 100644 --- a/src/PaymentMethods/In3/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/In3/Service/ParameterKeys/AddressAdapter.php @@ -25,7 +25,7 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumberAdditional' => 'HouseNumberSuffix', - 'zipcode' => 'ZipCode' + 'houseNumberAdditional' => 'HouseNumberSuffix', + 'zipcode' => 'ZipCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/In3/Service/ParameterKeys/ArticleAdapter.php index 4291c9c0..2afa11b0 100644 --- a/src/PaymentMethods/In3/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/In3/Service/ParameterKeys/ArticleAdapter.php @@ -25,9 +25,9 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'identifier' => 'Code', - 'description' => 'Name', - 'quantity' => 'Quantity', - 'price' => 'Price' + 'identifier' => 'Code', + 'description' => 'Name', + 'quantity' => 'Quantity', + 'price' => 'Price', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Service/ParameterKeys/CompanyAdapter.php b/src/PaymentMethods/In3/Service/ParameterKeys/CompanyAdapter.php index 3e477bfb..868543c1 100644 --- a/src/PaymentMethods/In3/Service/ParameterKeys/CompanyAdapter.php +++ b/src/PaymentMethods/In3/Service/ParameterKeys/CompanyAdapter.php @@ -25,6 +25,6 @@ class CompanyAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'companyName' => 'Name' + 'companyName' => 'Name', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/In3/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/In3/Service/ParameterKeys/PhoneAdapter.php index e6428d50..27fbe7c6 100644 --- a/src/PaymentMethods/In3/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/In3/Service/ParameterKeys/PhoneAdapter.php @@ -25,6 +25,6 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'mobile' => 'Phone' + 'mobile' => 'Phone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Interfaces/Combinable.php b/src/PaymentMethods/Interfaces/Combinable.php index 77fcc994..10f50404 100644 --- a/src/PaymentMethods/Interfaces/Combinable.php +++ b/src/PaymentMethods/Interfaces/Combinable.php @@ -22,5 +22,4 @@ interface Combinable { - -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/KlarnaKP.php b/src/PaymentMethods/KlarnaKP/KlarnaKP.php index 691dbb92..321685e8 100644 --- a/src/PaymentMethods/KlarnaKP/KlarnaKP.php +++ b/src/PaymentMethods/KlarnaKP/KlarnaKP.php @@ -80,4 +80,4 @@ public function updateReserve(): TransactionResponse return $this->dataRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Models/Payload.php b/src/PaymentMethods/KlarnaKP/Models/Payload.php index a63e43ab..cd4a0d78 100644 --- a/src/PaymentMethods/KlarnaKP/Models/Payload.php +++ b/src/PaymentMethods/KlarnaKP/Models/Payload.php @@ -43,14 +43,14 @@ class Payload extends ServiceParameter protected bool $shippingSameAsBilling = true; protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Shipping', $billing); @@ -61,7 +61,7 @@ public function billing($billing = null) public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->shippingSameAsBilling = false; @@ -73,9 +73,9 @@ public function shipping($shipping = null) public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -83,4 +83,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Models/Recipient.php b/src/PaymentMethods/KlarnaKP/Models/Recipient.php index a6e19d4f..242a0836 100644 --- a/src/PaymentMethods/KlarnaKP/Models/Recipient.php +++ b/src/PaymentMethods/KlarnaKP/Models/Recipient.php @@ -3,7 +3,6 @@ namespace Buckaroo\PaymentMethods\KlarnaKP\Models; use Buckaroo\Models\Address; -use Buckaroo\Models\Company; use Buckaroo\Models\Email; use Buckaroo\Models\Person; use Buckaroo\Models\Phone; @@ -12,7 +11,6 @@ use Buckaroo\PaymentMethods\KlarnaKP\Service\ParameterKeys\EmailAdapter; use Buckaroo\PaymentMethods\KlarnaKP\Service\ParameterKeys\PhoneAdapter; use Buckaroo\PaymentMethods\KlarnaKP\Service\ParameterKeys\RecipientAdapter; -use Buckaroo\Resources\Constants\RecipientCategory; class Recipient extends ServiceParameter { @@ -35,9 +33,9 @@ public function __construct(string $type, ?array $values = null) public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { - $this->phone = new PhoneAdapter(new Phone($phone), $this->type); + $this->phone = new PhoneAdapter(new Phone($phone), $this->type); } return $this->phone; @@ -45,9 +43,9 @@ public function phone($phone = null) public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { - $this->email = new EmailAdapter(new Email($email), $this->type); + $this->email = new EmailAdapter(new Email($email), $this->type); } return $this->email; @@ -55,7 +53,7 @@ public function email($email = null) public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address), $this->type); } @@ -65,11 +63,11 @@ public function address($address = null) public function recipient($recipient = null) { - if(is_array($recipient)) + if (is_array($recipient)) { - $this->recipient = new RecipientAdapter(new Person($recipient), $this->type); + $this->recipient = new RecipientAdapter(new Person($recipient), $this->type); } return $this->recipient; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/AddressAdapter.php index 3cae3c1a..5d5083f0 100644 --- a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/AddressAdapter.php @@ -25,7 +25,7 @@ class AddressAdapter extends RecipientAdapter { protected array $keys = [ - 'zipcode' => 'PostalCode', - 'houseNumberAdditional' => 'HouseNumberSuffix' + 'zipcode' => 'PostalCode', + 'houseNumberAdditional' => 'HouseNumberSuffix', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/ArticleAdapter.php index 32831145..92643614 100644 --- a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/ArticleAdapter.php @@ -25,11 +25,11 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'type' => 'ArticleType', - 'description' => 'ArticleTitle', - 'identifier' => 'ArticleNumber', - 'price' => 'ArticlePrice', - 'quantity' => 'ArticleQuantity', - 'vatPercentage' => 'ArticleVat' + 'type' => 'ArticleType', + 'description' => 'ArticleTitle', + 'identifier' => 'ArticleNumber', + 'price' => 'ArticlePrice', + 'quantity' => 'ArticleQuantity', + 'vatPercentage' => 'ArticleVat', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/EmailAdapter.php index 738c63f9..0641fe46 100644 --- a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/EmailAdapter.php @@ -24,4 +24,4 @@ class EmailAdapter extends RecipientAdapter { -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/PhoneAdapter.php index cc86cd17..d1d295fa 100644 --- a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/PhoneAdapter.php @@ -25,7 +25,7 @@ class PhoneAdapter extends RecipientAdapter { protected array $keys = [ - 'landLine' => 'PhoneNumber', - 'mobile' => 'CellPhoneNumber' + 'landLine' => 'PhoneNumber', + 'mobile' => 'CellPhoneNumber', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/RecipientAdapter.php b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/RecipientAdapter.php index d60980b2..0f6be322 100644 --- a/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/RecipientAdapter.php +++ b/src/PaymentMethods/KlarnaKP/Service/ParameterKeys/RecipientAdapter.php @@ -54,4 +54,4 @@ public function serviceParameterKeyOf($propertyName): string return $this->type . $propertyName; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/KlarnaPay.php b/src/PaymentMethods/KlarnaPay/KlarnaPay.php index 449118f3..2741c35b 100644 --- a/src/PaymentMethods/KlarnaPay/KlarnaPay.php +++ b/src/PaymentMethods/KlarnaPay/KlarnaPay.php @@ -59,4 +59,4 @@ public function payInInstallments(): TransactionResponse return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Models/Pay.php b/src/PaymentMethods/KlarnaPay/Models/Pay.php index e5855736..8697ad98 100644 --- a/src/PaymentMethods/KlarnaPay/Models/Pay.php +++ b/src/PaymentMethods/KlarnaPay/Models/Pay.php @@ -52,9 +52,9 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -63,7 +63,7 @@ class Pay extends ServiceParameter */ public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Shipping', $billing); @@ -78,7 +78,7 @@ public function billing($billing = null) */ public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->shippingRecipient = new Recipient('Shipping', $shipping); } @@ -92,9 +92,9 @@ public function shipping($shipping = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -102,4 +102,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Models/PayPayload.php b/src/PaymentMethods/KlarnaPay/Models/PayPayload.php index 106af3d0..69bc7a19 100644 --- a/src/PaymentMethods/KlarnaPay/Models/PayPayload.php +++ b/src/PaymentMethods/KlarnaPay/Models/PayPayload.php @@ -25,4 +25,4 @@ class PayPayload extends \Buckaroo\Models\Payload\PayPayload protected string $servicesSelectableByClient; protected string $servicesExcludedForClient; protected string $originalTransactionReference; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Models/Recipient.php b/src/PaymentMethods/KlarnaPay/Models/Recipient.php index b22b3c90..2dd3ae28 100644 --- a/src/PaymentMethods/KlarnaPay/Models/Recipient.php +++ b/src/PaymentMethods/KlarnaPay/Models/Recipient.php @@ -20,9 +20,14 @@ namespace Buckaroo\PaymentMethods\KlarnaPay\Models; -use Buckaroo\Models\{Address, Company, Email, Person, Phone, ServiceParameter}; +use Buckaroo\Models\Address; +use Buckaroo\Models\Company; +use Buckaroo\Models\Email; use Buckaroo\Models\Interfaces\Recipient as RecipientInterface; -use Buckaroo\PaymentMethods\KlarnaPay\Service\ParameterKeys\{AddressAdapter}; +use Buckaroo\Models\Person; +use Buckaroo\Models\Phone; +use Buckaroo\Models\ServiceParameter; +use Buckaroo\PaymentMethods\KlarnaPay\Service\ParameterKeys\AddressAdapter; use Buckaroo\PaymentMethods\KlarnaPay\Service\ParameterKeys\PhoneAdapter; class Recipient extends ServiceParameter @@ -66,7 +71,7 @@ public function __construct(string $type, ?array $values = null) */ public function recipient($recipient = null) { - if(is_array($recipient)) + if (is_array($recipient)) { $this->recipient = new Person($recipient); } @@ -80,7 +85,7 @@ public function recipient($recipient = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -94,7 +99,7 @@ public function address($address = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter(new Phone($phone)); } @@ -108,7 +113,7 @@ public function phone($phone = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } @@ -123,7 +128,8 @@ public function email($email = null) */ private function getRecipientObject(array $recipient) : RecipientInterface { - switch ($recipient['category']) { + switch ($recipient['category']) + { case 'B2B': return new Company($recipient); case 'B2C': @@ -141,4 +147,4 @@ public function getGroupType(string $key): ?string { return $this->type . 'Customer'; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/AddressAdapter.php index 9f6cf50d..6bd234bf 100644 --- a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/AddressAdapter.php @@ -25,8 +25,8 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumber' => 'StreetNumber', - 'houseNumberAdditional' => 'StreetNumberAdditional', - 'zipcode' => 'PostalCode' + 'houseNumber' => 'StreetNumber', + 'houseNumberAdditional' => 'StreetNumberAdditional', + 'zipcode' => 'PostalCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/ArticleAdapter.php index 10fd9d21..cbcf5bd3 100644 --- a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/ArticleAdapter.php @@ -25,6 +25,6 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'price' => 'GrossUnitPrice' + 'price' => 'GrossUnitPrice', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/PhoneAdapter.php index e8d1e65c..da15397f 100644 --- a/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/KlarnaPay/Service/ParameterKeys/PhoneAdapter.php @@ -25,6 +25,6 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'mobile' => 'Phone' + 'mobile' => 'Phone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Marketplaces/Marketplaces.php b/src/PaymentMethods/Marketplaces/Marketplaces.php index 3a10b5f6..c64946d6 100644 --- a/src/PaymentMethods/Marketplaces/Marketplaces.php +++ b/src/PaymentMethods/Marketplaces/Marketplaces.php @@ -71,4 +71,4 @@ public function refundSupplementary() return $this->dataRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Marketplaces/Models/Marketplace.php b/src/PaymentMethods/Marketplaces/Models/Marketplace.php index 620f62c1..51b64f70 100644 --- a/src/PaymentMethods/Marketplaces/Models/Marketplace.php +++ b/src/PaymentMethods/Marketplaces/Models/Marketplace.php @@ -26,4 +26,4 @@ class Marketplace extends Model { protected float $amount; protected string $description; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Marketplaces/Models/Seller.php b/src/PaymentMethods/Marketplaces/Models/Seller.php index 77559532..d83f389c 100644 --- a/src/PaymentMethods/Marketplaces/Models/Seller.php +++ b/src/PaymentMethods/Marketplaces/Models/Seller.php @@ -27,4 +27,4 @@ class Seller extends Model protected string $accountId; protected float $amount; protected string $description; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Marketplaces/Models/ServiceList.php b/src/PaymentMethods/Marketplaces/Models/ServiceList.php index 047d258d..99e96293 100644 --- a/src/PaymentMethods/Marketplaces/Models/ServiceList.php +++ b/src/PaymentMethods/Marketplaces/Models/ServiceList.php @@ -50,12 +50,12 @@ class ServiceList extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'marketplace' => [ - 'groupType' => 'Marketplace' + 'marketplace' => [ + 'groupType' => 'Marketplace', + ], + 'sellers' => [ + 'groupType' => 'Seller', ], - 'sellers' => [ - 'groupType' => 'Seller' - ] ]; /** @@ -64,7 +64,7 @@ class ServiceList extends ServiceParameter */ public function marketplace($marketplace = null) { - if(is_array($marketplace)) + if (is_array($marketplace)) { $this->marketplace = new Marketplace($marketplace); } @@ -78,9 +78,9 @@ public function marketplace($marketplace = null) */ public function sellers($sellers = null) { - if(is_array($sellers)) + if (is_array($sellers)) { - foreach($sellers as $seller) + foreach ($sellers as $seller) { $this->sellers[] = new Seller($seller); } @@ -88,4 +88,4 @@ public function sellers($sellers = null) return $this->sellers; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/Models/Attachment.php b/src/PaymentMethods/PayPerEmail/Models/Attachment.php index c926f1c8..9703bdb5 100644 --- a/src/PaymentMethods/PayPerEmail/Models/Attachment.php +++ b/src/PaymentMethods/PayPerEmail/Models/Attachment.php @@ -25,4 +25,4 @@ class Attachment extends Model { protected string $name; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/Models/PaymentInvitation.php b/src/PaymentMethods/PayPerEmail/Models/PaymentInvitation.php index 7952589f..5c37879c 100644 --- a/src/PaymentMethods/PayPerEmail/Models/PaymentInvitation.php +++ b/src/PaymentMethods/PayPerEmail/Models/PaymentInvitation.php @@ -74,7 +74,7 @@ class PaymentInvitation extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } @@ -88,7 +88,7 @@ public function customer($customer = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new EmailAdapter(new Email($email)); } @@ -102,9 +102,9 @@ public function email($email = null) */ public function attachments(?array $attachments = null) { - if(is_array($attachments)) + if (is_array($attachments)) { - foreach($attachments as $attachment) + foreach ($attachments as $attachment) { $this->attachments[] = new AttachmentAdapter(new Attachment($attachment)); } @@ -112,4 +112,4 @@ public function attachments(?array $attachments = null) return $this->attachments; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/PayPerEmail.php b/src/PaymentMethods/PayPerEmail/PayPerEmail.php index e032a7db..232dbfab 100644 --- a/src/PaymentMethods/PayPerEmail/PayPerEmail.php +++ b/src/PaymentMethods/PayPerEmail/PayPerEmail.php @@ -46,4 +46,4 @@ public function paymentInvitation() return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/AttachmentAdapter.php b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/AttachmentAdapter.php index 8b1e63a2..414f0d39 100644 --- a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/AttachmentAdapter.php +++ b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/AttachmentAdapter.php @@ -25,6 +25,6 @@ class AttachmentAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'name' => 'attachment' + 'name' => 'attachment', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/CustomerAdapter.php index 93349112..58c017de 100644 --- a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/CustomerAdapter.php @@ -25,8 +25,8 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'gender' => 'customergender', - 'firstName' => 'CustomerFirstName', - 'lastName' => 'CustomerLastName' + 'gender' => 'customergender', + 'firstName' => 'CustomerFirstName', + 'lastName' => 'CustomerLastName', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/EmailAdapter.php index e00abb70..31c2ac13 100644 --- a/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/PayPerEmail/Service/ParameterKeys/EmailAdapter.php @@ -25,6 +25,6 @@ class EmailAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'email' => 'CustomerEmail' + 'email' => 'CustomerEmail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PayablePaymentMethod.php b/src/PaymentMethods/PayablePaymentMethod.php index 87f9ddea..f19fb9d8 100644 --- a/src/PaymentMethods/PayablePaymentMethod.php +++ b/src/PaymentMethods/PayablePaymentMethod.php @@ -101,4 +101,4 @@ protected function setRefundPayload() return $this; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Payconiq/Payconiq.php b/src/PaymentMethods/Payconiq/Payconiq.php index c6938877..451a37d2 100644 --- a/src/PaymentMethods/Payconiq/Payconiq.php +++ b/src/PaymentMethods/Payconiq/Payconiq.php @@ -26,4 +26,4 @@ class Payconiq extends PayablePaymentMethod implements Combinable { protected string $paymentName = 'payconiq'; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PaymentFacade.php b/src/PaymentMethods/PaymentFacade.php index aa81c8ff..ca298f7c 100644 --- a/src/PaymentMethods/PaymentFacade.php +++ b/src/PaymentMethods/PaymentFacade.php @@ -67,6 +67,7 @@ * @method TransactionResponse modifyMandate(array $data) * @method TransactionResponse cancelMandate(array $data) * @method TransactionResponse payRemainder(array $data) + * @method TransactionResponse payRemainderEncrypted(array $data) * @method TransactionResponse generate(array $data) * @method TransactionResponse identify(array $data) * @method TransactionResponse verify(array $data) @@ -125,9 +126,9 @@ public function manually() */ public function combine($combinablePayment) { - if(is_array($combinablePayment)) + if (is_array($combinablePayment)) { - foreach($combinablePayment as $combinable_payment) + foreach ($combinablePayment as $combinable_payment) { $this->combine($combinable_payment); } @@ -135,7 +136,7 @@ public function combine($combinablePayment) return $this; } - if($combinablePayment instanceof Combinable) + if ($combinablePayment instanceof Combinable) { $this->paymentMethod->combinePayment($combinablePayment); } @@ -157,15 +158,20 @@ public function paymentMethod(): PaymentMethod * @return mixed * @throws BuckarooException */ - public function __call(string $name , array $arguments) + public function __call(string $name, array $arguments) { - if(method_exists($this->paymentMethod, $name)) + if (method_exists($this->paymentMethod, $name)) { $this->paymentMethod->setPayload((new PayloadService($arguments[0] ?? []))->toArray()); return $this->paymentMethod->$name(); } - throw new BuckarooException($this->client->config()->getLogger(), "Payment method " . $name . " on payment " . $this->paymentMethod->paymentName() . " you requested does not exist."); + throw new BuckarooException( + $this->client->config()->getLogger(), + "Payment method " . + $name . " on payment " . + $this->paymentMethod->paymentName() . " you requested does not exist." + ); } } diff --git a/src/PaymentMethods/PaymentInterface.php b/src/PaymentMethods/PaymentInterface.php index 753dcb4d..1f8331d9 100644 --- a/src/PaymentMethods/PaymentInterface.php +++ b/src/PaymentMethods/PaymentInterface.php @@ -24,4 +24,4 @@ interface PaymentInterface { public function paymentName(): string; public function serviceVersion(): int; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PaymentMethod.php b/src/PaymentMethods/PaymentMethod.php index 8f59dcda..50a3889d 100644 --- a/src/PaymentMethods/PaymentMethod.php +++ b/src/PaymentMethods/PaymentMethod.php @@ -78,10 +78,8 @@ abstract class PaymentMethod implements PaymentInterface * @param Client $client * @param string|null $serviceCode */ - public function __construct( - Client $client, - ?string $serviceCode - ) { + public function __construct(Client $client, ?string $serviceCode) + { $this->client = $client; $this->request = new TransactionRequest; @@ -108,7 +106,7 @@ public function setPayload(array $payload) */ protected function postRequest() { - if($this->isManually) + if ($this->isManually) { return $this; } @@ -124,7 +122,7 @@ protected function postRequest() */ protected function dataRequest() { - if($this->isManually) + if ($this->isManually) { return $this; } @@ -142,7 +140,7 @@ protected function dataRequest() */ protected function setServiceList(string $action, ?Model $model = null) { - $serviceList = new ServiceList($this->paymentName(), $this->serviceVersion(), $action, $model); + $serviceList = new ServiceList($this->paymentName(), $this->serviceVersion(), $action, $model); $this->request->getServices()->pushServiceList($serviceList); @@ -171,7 +169,7 @@ public function serviceVersion(): int */ public function manually(?bool $isManually = null) { - if($isManually !== null) + if ($isManually !== null) { $this->isManually = $isManually; } @@ -187,16 +185,17 @@ public function combinePayment(Combinable $combinablePayment) { $this->combinablePayment = $combinablePayment; - $payload_data = array_filter($combinablePayment->request->data(), function($key){ - return !in_array($key, ['Services']); - }, ARRAY_FILTER_USE_KEY ); + $payload_data = array_filter($combinablePayment->request->data(), function ($key) + { + return ! in_array($key, ['Services']); + }, ARRAY_FILTER_USE_KEY); - foreach($payload_data as $key => $value) + foreach ($payload_data as $key => $value) { $this->request->setData($key, $value); } - foreach($this->combinablePayment->request->getServices()->serviceList() as $serviceList) + foreach ($this->combinablePayment->request->getServices()->serviceList() as $serviceList) { $this->request->getServices()->pushServiceList($serviceList); } diff --git a/src/PaymentMethods/PaymentMethodFactory.php b/src/PaymentMethods/PaymentMethodFactory.php index 17eedd14..9295c520 100644 --- a/src/PaymentMethods/PaymentMethodFactory.php +++ b/src/PaymentMethods/PaymentMethodFactory.php @@ -20,47 +20,46 @@ namespace Buckaroo\PaymentMethods; -use Buckaroo\Transaction\Client; -use Buckaroo\PaymentMethods\EPS\EPS; -use Buckaroo\PaymentMethods\In3\In3; -use Buckaroo\PaymentMethods\KBC\KBC; -use Buckaroo\Exceptions\SDKException; -use Buckaroo\PaymentMethods\iDin\iDin; -use Buckaroo\PaymentMethods\SEPA\SEPA; -use Buckaroo\PaymentMethods\iDeal\iDeal; -use Buckaroo\PaymentMethods\Tinka\Tinka; use Buckaroo\Exceptions\BuckarooException; +use Buckaroo\PaymentMethods\Afterpay\Afterpay; +use Buckaroo\PaymentMethods\AfterpayDigiAccept\AfterpayDigiAccept; use Buckaroo\PaymentMethods\Alipay\Alipay; -use Buckaroo\PaymentMethods\Paypal\Paypal; -use Buckaroo\PaymentMethods\Sofort\Sofort; +use Buckaroo\PaymentMethods\ApplePay\ApplePay; +use Buckaroo\PaymentMethods\Bancontact\Bancontact; +use Buckaroo\PaymentMethods\BankTransfer\BankTransfer; use Buckaroo\PaymentMethods\Belfius\Belfius; use Buckaroo\PaymentMethods\Billink\Billink; +use Buckaroo\PaymentMethods\BuckarooVoucher\BuckarooVoucher; +use Buckaroo\PaymentMethods\BuckarooWallet\BuckarooWallet; +use Buckaroo\PaymentMethods\CreditCard\CreditCard; +use Buckaroo\PaymentMethods\CreditClick\CreditClick; +use Buckaroo\PaymentMethods\CreditManagement\CreditManagement; +use Buckaroo\PaymentMethods\Emandates\Emandates; +use Buckaroo\PaymentMethods\EPS\EPS; +use Buckaroo\PaymentMethods\GiftCard\GiftCard; use Buckaroo\PaymentMethods\Giropay\Giropay; +use Buckaroo\PaymentMethods\iDeal\iDeal; use Buckaroo\PaymentMethods\iDealQR\iDealQR; -use Buckaroo\PaymentMethods\Surepay\Surepay; -use Buckaroo\PaymentMethods\Trustly\Trustly; -use Buckaroo\PaymentMethods\Afterpay\Afterpay; -use Buckaroo\PaymentMethods\ApplePay\ApplePay; -use Buckaroo\PaymentMethods\GiftCard\GiftCard; +use Buckaroo\PaymentMethods\iDin\iDin; +use Buckaroo\PaymentMethods\In3\In3; +use Buckaroo\PaymentMethods\KBC\KBC; use Buckaroo\PaymentMethods\KlarnaKP\KlarnaKP; -use Buckaroo\PaymentMethods\Payconiq\Payconiq; -use Buckaroo\PaymentMethods\Emandates\Emandates; use Buckaroo\PaymentMethods\KlarnaPay\KlarnaPay; -use Buckaroo\PaymentMethods\WeChatPay\WeChatPay; -use Buckaroo\PaymentMethods\Bancontact\Bancontact; -use Buckaroo\PaymentMethods\CreditCard\CreditCard; -use Buckaroo\PaymentMethods\Przelewy24\Przelewy24; -use Buckaroo\PaymentMethods\BuckarooVoucher\BuckarooVoucher; -use Buckaroo\PaymentMethods\CreditClick\CreditClick; +use Buckaroo\PaymentMethods\Marketplaces\Marketplaces; +use Buckaroo\PaymentMethods\Payconiq\Payconiq; +use Buckaroo\PaymentMethods\Paypal\Paypal; use Buckaroo\PaymentMethods\PayPerEmail\PayPerEmail; use Buckaroo\PaymentMethods\PointOfSale\PointOfSale; -use Buckaroo\PaymentMethods\BankTransfer\BankTransfer; -use Buckaroo\PaymentMethods\Marketplaces\Marketplaces; +use Buckaroo\PaymentMethods\Przelewy24\Przelewy24; use Buckaroo\PaymentMethods\RequestToPay\RequestToPay; +use Buckaroo\PaymentMethods\SEPA\SEPA; +use Buckaroo\PaymentMethods\Sofort\Sofort; use Buckaroo\PaymentMethods\Subscriptions\Subscriptions; -use Buckaroo\PaymentMethods\BuckarooWallet\BuckarooWallet; -use Buckaroo\PaymentMethods\CreditManagement\CreditManagement; -use Buckaroo\PaymentMethods\AfterpayDigiAccept\AfterpayDigiAccept; +use Buckaroo\PaymentMethods\Surepay\Surepay; +use Buckaroo\PaymentMethods\Tinka\Tinka; +use Buckaroo\PaymentMethods\Trustly\Trustly; +use Buckaroo\PaymentMethods\WeChatPay\WeChatPay; +use Buckaroo\Transaction\Client; class PaymentMethodFactory { @@ -68,44 +67,61 @@ class PaymentMethodFactory * @var array|\string[][] */ private static array $payments = [ - ApplePay::class => ['applepay'], - Alipay::class => ['alipay'], - Afterpay::class => ['afterpay'], - AfterpayDigiAccept::class => ['afterpaydigiaccept'], - Bancontact::class => ['bancontactmrcash'], - Billink::class => ['billink'], - Belfius::class => ['belfius'], - BuckarooWallet::class => ['buckaroo_wallet'], - CreditCard::class => ['creditcard', 'mastercard', 'visa', 'amex', 'vpay', 'maestro', 'visaelectron', 'cartebleuevisa', 'cartebancaire', 'dankort', 'nexi', 'postepay'], - CreditClick::class => ['creditclick'], - CreditManagement::class => ['credit_management'], - iDeal::class => ['ideal', 'idealprocessing'], - iDealQR::class => ['ideal_qr'], - iDin::class => ['idin'], - In3::class => ['in3'], - KlarnaPay::class => ['klarna', 'klarnain'], - KlarnaKP::class => ['klarnakp'], - Surepay::class => ['surepay'], - Subscriptions::class => ['subscriptions'], - SEPA::class => ['sepadirectdebit', 'sepa'], - KBC::class => ['kbcpaymentbutton'], - Paypal::class => ['paypal'], - PayPerEmail::class => ['payperemail'], - EPS::class => ['eps'], - Emandates::class => ['emandates'], - Sofort::class => ['sofort', 'sofortueberweisung'], - Tinka::class => ['tinka'], - Marketplaces::class => ['marketplaces'], - Payconiq::class => ['payconiq'], - Przelewy24::class => ['przelewy24'], - PointOfSale::class => ['pospayment'], - Giropay::class => ['giropay'], - GiftCard::class => ['giftcard', 'westlandbon', 'ideal', 'ippies', 'babygiftcard', 'babyparkgiftcard', 'beautywellness', 'boekenbon', 'boekenvoordeel', 'designshopsgiftcard', 'fashioncheque', 'fashionucadeaukaart', 'fijncadeau', 'koffiecadeau', 'kokenzo', 'kookcadeau', 'nationaleentertainmentcard', 'naturesgift', 'podiumcadeaukaart', 'shoesaccessories', 'webshopgiftcard', 'wijncadeau', 'wonenzo', 'yourgift', 'vvvgiftcard', 'parfumcadeaukaart'], - Trustly::class => ['trustly'], - BankTransfer::class => ['transfer'], - RequestToPay::class => ['requesttopay'], - WeChatPay::class => ['wechatpay'], - BuckarooVoucher::class => ['buckaroovoucher'], + ApplePay::class => ['applepay'], + Alipay::class => ['alipay'], + Afterpay::class => ['afterpay'], + AfterpayDigiAccept::class => ['afterpaydigiaccept'], + Bancontact::class => ['bancontactmrcash'], + Billink::class => ['billink'], + Belfius::class => ['belfius'], + BuckarooWallet::class => ['buckaroo_wallet'], + CreditCard::class => + [ + 'creditcard', 'mastercard', 'visa', + 'amex', 'vpay', 'maestro', + 'visaelectron', 'cartebleuevisa', + 'cartebancaire', 'dankort', 'nexi', + 'postepay', + ], + CreditClick::class => ['creditclick'], + CreditManagement::class => ['credit_management'], + iDeal::class => ['ideal', 'idealprocessing'], + iDealQR::class => ['ideal_qr'], + iDin::class => ['idin'], + In3::class => ['in3'], + KlarnaPay::class => ['klarna', 'klarnain'], + KlarnaKP::class => ['klarnakp'], + Surepay::class => ['surepay'], + Subscriptions::class => ['subscriptions'], + SEPA::class => ['sepadirectdebit', 'sepa'], + KBC::class => ['kbcpaymentbutton'], + Paypal::class => ['paypal'], + PayPerEmail::class => ['payperemail'], + EPS::class => ['eps'], + Emandates::class => ['emandates'], + Sofort::class => ['sofort', 'sofortueberweisung'], + Tinka::class => ['tinka'], + Marketplaces::class => ['marketplaces'], + Payconiq::class => ['payconiq'], + Przelewy24::class => ['przelewy24'], + PointOfSale::class => ['pospayment'], + Giropay::class => ['giropay'], + GiftCard::class => [ + 'giftcard', 'westlandbon', 'ideal', + 'ippies', 'babygiftcard', 'babyparkgiftcard', + 'beautywellness', 'boekenbon', 'boekenvoordeel', + 'designshopsgiftcard', 'fashioncheque', 'fashionucadeaukaart', + 'fijncadeau', 'koffiecadeau', 'kokenzo', + 'kookcadeau', 'nationaleentertainmentcard', 'naturesgift', + 'podiumcadeaukaart', 'shoesaccessories', 'webshopgiftcard', + 'wijncadeau', 'wonenzo', 'yourgift', + 'vvvgiftcard', 'parfumcadeaukaart', + ], + Trustly::class => ['trustly'], + BankTransfer::class => ['transfer'], + RequestToPay::class => ['requesttopay'], + WeChatPay::class => ['wechatpay'], + BuckarooVoucher::class => ['buckaroovoucher'], ]; /** @@ -121,10 +137,8 @@ class PaymentMethodFactory * @param Client $client * @param string $paymentMethod */ - public function __construct( - Client $client, - string $paymentMethod - ) { + public function __construct(Client $client, string $paymentMethod) + { $this->client = $client; $this->paymentMethod = strtolower($paymentMethod); } @@ -132,10 +146,12 @@ public function __construct( /** * @return PaymentMethod */ - public function getPaymentMethod() : PaymentMethod + public function getPaymentMethod(): PaymentMethod { - foreach(self::$payments as $class => $alias) { - if(in_array($this->paymentMethod, $alias)) { + foreach (self::$payments as $class => $alias) + { + if (in_array($this->paymentMethod, $alias)) + { return new $class($this->client, $this->paymentMethod); } } @@ -148,11 +164,10 @@ public function getPaymentMethod() : PaymentMethod * @param string $paymentMethod * @return PaymentMethod */ - public static function get( - Client $client, - string $paymentMethod - ): PaymentMethod { + public static function get(Client $client, string $paymentMethod): PaymentMethod + { $factory = new self($client, $paymentMethod); + return $factory->getPaymentMethod(); } } diff --git a/src/PaymentMethods/Paypal/Models/Address.php b/src/PaymentMethods/Paypal/Models/Address.php index 0f8e5e2a..0c6baa54 100644 --- a/src/PaymentMethods/Paypal/Models/Address.php +++ b/src/PaymentMethods/Paypal/Models/Address.php @@ -23,4 +23,4 @@ class Address extends \Buckaroo\Models\Address { protected string $street2; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Paypal/Models/ExtraInfo.php b/src/PaymentMethods/Paypal/Models/ExtraInfo.php index 745ad84e..96665915 100644 --- a/src/PaymentMethods/Paypal/Models/ExtraInfo.php +++ b/src/PaymentMethods/Paypal/Models/ExtraInfo.php @@ -23,7 +23,7 @@ use Buckaroo\Models\Person; use Buckaroo\Models\Phone; use Buckaroo\Models\ServiceParameter; -use Buckaroo\PaymentMethods\Paypal\Service\ParameterKeys\{AddressAdapter}; +use Buckaroo\PaymentMethods\Paypal\Service\ParameterKeys\AddressAdapter; use Buckaroo\PaymentMethods\Paypal\Service\ParameterKeys\PhoneAdapter; class ExtraInfo extends ServiceParameter @@ -56,7 +56,7 @@ class ExtraInfo extends ServiceParameter */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -70,7 +70,7 @@ public function address($address = null) */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new Person($customer); } @@ -84,11 +84,11 @@ public function customer($customer = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter(new Phone($phone)); } return $this->phone; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Paypal/Models/Pay.php b/src/PaymentMethods/Paypal/Models/Pay.php index 98e3b975..582094c1 100644 --- a/src/PaymentMethods/Paypal/Models/Pay.php +++ b/src/PaymentMethods/Paypal/Models/Pay.php @@ -30,4 +30,4 @@ class Pay extends ServiceParameter protected string $pageStyle; protected string $startrecurrent; protected string $payPalOrderId; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Paypal/Paypal.php b/src/PaymentMethods/Paypal/Paypal.php index 70a2e28f..2ec73266 100644 --- a/src/PaymentMethods/Paypal/Paypal.php +++ b/src/PaymentMethods/Paypal/Paypal.php @@ -70,4 +70,4 @@ public function extraInfo() return $this->postRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Paypal/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/Paypal/Service/ParameterKeys/AddressAdapter.php index e098eec9..d74a34eb 100644 --- a/src/PaymentMethods/Paypal/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/Paypal/Service/ParameterKeys/AddressAdapter.php @@ -25,9 +25,9 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'street' => 'Street1', - 'city' => 'CityName', - 'state' => 'StateOrProvince', - 'zipcode' => 'PostalCode' + 'street' => 'Street1', + 'city' => 'CityName', + 'state' => 'StateOrProvince', + 'zipcode' => 'PostalCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Paypal/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/Paypal/Service/ParameterKeys/PhoneAdapter.php index da54a026..c86325eb 100644 --- a/src/PaymentMethods/Paypal/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/Paypal/Service/ParameterKeys/PhoneAdapter.php @@ -25,6 +25,6 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'mobile' => 'Phone' + 'mobile' => 'Phone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PointOfSale/Models/Pay.php b/src/PaymentMethods/PointOfSale/Models/Pay.php index 8558fcc3..25edcdb8 100644 --- a/src/PaymentMethods/PointOfSale/Models/Pay.php +++ b/src/PaymentMethods/PointOfSale/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected string $terminalID; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/PointOfSale/PointOfSale.php b/src/PaymentMethods/PointOfSale/PointOfSale.php index 967fefb4..a8c3bf92 100644 --- a/src/PaymentMethods/PointOfSale/PointOfSale.php +++ b/src/PaymentMethods/PointOfSale/PointOfSale.php @@ -40,4 +40,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Przelewy24/Models/Pay.php b/src/PaymentMethods/Przelewy24/Models/Pay.php index f19bbd35..c76466ff 100644 --- a/src/PaymentMethods/Przelewy24/Models/Pay.php +++ b/src/PaymentMethods/Przelewy24/Models/Pay.php @@ -43,7 +43,7 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } @@ -57,11 +57,11 @@ public function customer($customer = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new EmailAdapter(new Email($email)); } return $this->email; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Przelewy24/Przelewy24.php b/src/PaymentMethods/Przelewy24/Przelewy24.php index ce8189f5..e61a07be 100644 --- a/src/PaymentMethods/Przelewy24/Przelewy24.php +++ b/src/PaymentMethods/Przelewy24/Przelewy24.php @@ -40,4 +40,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Przelewy24/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/Przelewy24/Service/ParameterKeys/CustomerAdapter.php index 68c83ebe..263c8357 100644 --- a/src/PaymentMethods/Przelewy24/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/Przelewy24/Service/ParameterKeys/CustomerAdapter.php @@ -25,8 +25,8 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'firstName' => 'CustomerFirstName', - 'lastName' => 'CustomerLastName', - 'email' => 'CustomerEmail', + 'firstName' => 'CustomerFirstName', + 'lastName' => 'CustomerLastName', + 'email' => 'CustomerEmail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Przelewy24/Service/ParameterKeys/EmailAdapter.php b/src/PaymentMethods/Przelewy24/Service/ParameterKeys/EmailAdapter.php index 1ee93c39..38c038a4 100644 --- a/src/PaymentMethods/Przelewy24/Service/ParameterKeys/EmailAdapter.php +++ b/src/PaymentMethods/Przelewy24/Service/ParameterKeys/EmailAdapter.php @@ -25,6 +25,6 @@ class EmailAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'email' => 'CustomerEmail' + 'email' => 'CustomerEmail', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/RequestToPay/Models/Pay.php b/src/PaymentMethods/RequestToPay/Models/Pay.php index 5048d924..b598063b 100644 --- a/src/PaymentMethods/RequestToPay/Models/Pay.php +++ b/src/PaymentMethods/RequestToPay/Models/Pay.php @@ -37,11 +37,11 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } return $this->customer; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/RequestToPay/RequestToPay.php b/src/PaymentMethods/RequestToPay/RequestToPay.php index ff35e108..41b784dc 100644 --- a/src/PaymentMethods/RequestToPay/RequestToPay.php +++ b/src/PaymentMethods/RequestToPay/RequestToPay.php @@ -40,4 +40,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/RequestToPay/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/RequestToPay/Service/ParameterKeys/CustomerAdapter.php index 046f2acc..a5d808b5 100644 --- a/src/PaymentMethods/RequestToPay/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/RequestToPay/Service/ParameterKeys/CustomerAdapter.php @@ -25,6 +25,6 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'name' => 'DebtorName' + 'name' => 'DebtorName', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/SEPA/Models/ExtraInfo.php b/src/PaymentMethods/SEPA/Models/ExtraInfo.php index 4e34f646..cd8dca24 100644 --- a/src/PaymentMethods/SEPA/Models/ExtraInfo.php +++ b/src/PaymentMethods/SEPA/Models/ExtraInfo.php @@ -53,11 +53,11 @@ class ExtraInfo extends Pay */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } return $this->address; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/SEPA/Models/Pay.php b/src/PaymentMethods/SEPA/Models/Pay.php index dab45f5e..faecafdc 100644 --- a/src/PaymentMethods/SEPA/Models/Pay.php +++ b/src/PaymentMethods/SEPA/Models/Pay.php @@ -62,11 +62,11 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } return $this->customer; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/SEPA/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/SEPA/Service/ParameterKeys/AddressAdapter.php index 41e04994..329efd24 100644 --- a/src/PaymentMethods/SEPA/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/SEPA/Service/ParameterKeys/AddressAdapter.php @@ -25,6 +25,6 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumberAdditional' => 'housenumbersuffix' + 'houseNumberAdditional' => 'housenumbersuffix', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/SEPA/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/SEPA/Service/ParameterKeys/CustomerAdapter.php index f4efc5ec..1d4d369c 100644 --- a/src/PaymentMethods/SEPA/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/SEPA/Service/ParameterKeys/CustomerAdapter.php @@ -25,6 +25,6 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'name' => 'customeraccountname' + 'name' => 'customeraccountname', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/SEPA/Service/ParameterKeys/PayAdapter.php b/src/PaymentMethods/SEPA/Service/ParameterKeys/PayAdapter.php index 150f0e01..8022b218 100644 --- a/src/PaymentMethods/SEPA/Service/ParameterKeys/PayAdapter.php +++ b/src/PaymentMethods/SEPA/Service/ParameterKeys/PayAdapter.php @@ -25,7 +25,7 @@ class PayAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'bic' => 'customerbic', - 'iban' => 'CustomerIBAN' + 'bic' => 'customerbic', + 'iban' => 'CustomerIBAN', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Models/Charge.php b/src/PaymentMethods/Subscriptions/Models/Charge.php index ee10aed9..9657f3b7 100644 --- a/src/PaymentMethods/Subscriptions/Models/Charge.php +++ b/src/PaymentMethods/Subscriptions/Models/Charge.php @@ -31,4 +31,4 @@ class Charge extends Model protected float $pricePerUnit; protected float $vatPercentage; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Models/CombinedPayload.php b/src/PaymentMethods/Subscriptions/Models/CombinedPayload.php index 6ff35521..e25ce36d 100644 --- a/src/PaymentMethods/Subscriptions/Models/CombinedPayload.php +++ b/src/PaymentMethods/Subscriptions/Models/CombinedPayload.php @@ -25,4 +25,4 @@ class CombinedPayload extends Model { protected bool $startRecurrent; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Models/RatePlan.php b/src/PaymentMethods/Subscriptions/Models/RatePlan.php index da822656..06b54a00 100644 --- a/src/PaymentMethods/Subscriptions/Models/RatePlan.php +++ b/src/PaymentMethods/Subscriptions/Models/RatePlan.php @@ -68,9 +68,9 @@ public function __construct(string $type, ?array $values = null) */ public function charge($charge = null) { - if(is_array($charge)) + if (is_array($charge)) { - $this->charge = new Charge($charge); + $this->charge = new Charge($charge); } return $this->charge; @@ -82,11 +82,11 @@ public function charge($charge = null) */ public function getGroupType(string $key): ?string { - if($key == 'charge') + if ($key == 'charge') { return $this->type . 'RatePlanCharge'; } return parent::getGroupKey($key); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Models/ResumeSubscription.php b/src/PaymentMethods/Subscriptions/Models/ResumeSubscription.php index c1ad92a1..6cc7fe59 100644 --- a/src/PaymentMethods/Subscriptions/Models/ResumeSubscription.php +++ b/src/PaymentMethods/Subscriptions/Models/ResumeSubscription.php @@ -23,4 +23,4 @@ class ResumeSubscription extends Subscription { protected string $resumeDate; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Models/Subscription.php b/src/PaymentMethods/Subscriptions/Models/Subscription.php index 98e70ce0..2e6377c7 100644 --- a/src/PaymentMethods/Subscriptions/Models/Subscription.php +++ b/src/PaymentMethods/Subscriptions/Models/Subscription.php @@ -1,4 +1,5 @@ [ - 'groupType' => 'Debtor' + 'debtor' => [ + 'groupType' => 'Debtor', + ], + 'person' => [ + 'groupType' => 'Person', + ], + 'email' => [ + 'groupType' => 'Email', + ], + 'address' => [ + 'groupType' => 'Address', ], - 'addRatePlan' => [ - 'groupType' => 'AddRatePlan' + 'addRatePlan' => [ + 'groupType' => 'AddRatePlan', ], - 'updateRatePlan' => [ - 'groupType' => 'UpdateRatePlan' + 'updateRatePlan' => [ + 'groupType' => 'UpdateRatePlan', ], - 'disableRatePlan' => [ - 'groupType' => 'DisableRatePlan' + 'disableRatePlan' => [ + 'groupType' => 'DisableRatePlan', ], ]; @@ -138,7 +155,7 @@ class Subscription extends ServiceParameter */ public function debtor($debtor = null) { - if(is_array($debtor)) + if (is_array($debtor)) { $this->debtor = new Debtor($debtor); } @@ -152,7 +169,7 @@ public function debtor($debtor = null) */ public function bankAccount($bankAccount = null) { - if(is_array($bankAccount)) + if (is_array($bankAccount)) { $this->bankAccount = new BankAccount($bankAccount); } @@ -166,7 +183,7 @@ public function bankAccount($bankAccount = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { $this->email = new Email($email); } @@ -180,7 +197,7 @@ public function email($email = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new Phone($phone); } @@ -194,7 +211,7 @@ public function phone($phone = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new Address($address); } @@ -208,7 +225,7 @@ public function address($address = null) */ public function person($person = null) { - if(is_array($person)) + if (is_array($person)) { $this->person = new Person($person); } @@ -216,15 +233,25 @@ public function person($person = null) return $this->person; } + public function company($company = null) + { + if (is_array($company)) + { + $this->company = new CompanyAdapter(new Company($company)); + } + + return $this->company; + } + /** * @param $rate_plans * @return $this */ - public function rate_plans($rate_plans = null) + public function ratePlans($rate_plans = null) { - if(is_array($rate_plans)) + if (is_array($rate_plans)) { - foreach($rate_plans as $type => $rate_plan) + foreach ($rate_plans as $type => $rate_plan) { $property = $type . 'RatePlan'; @@ -234,4 +261,4 @@ public function rate_plans($rate_plans = null) return $this; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Subscriptions/Service/ParameterKeys/CompanyAdapter.php b/src/PaymentMethods/Subscriptions/Service/ParameterKeys/CompanyAdapter.php new file mode 100644 index 00000000..02c96541 --- /dev/null +++ b/src/PaymentMethods/Subscriptions/Service/ParameterKeys/CompanyAdapter.php @@ -0,0 +1,30 @@ + 'Name', + ]; +} diff --git a/src/PaymentMethods/Subscriptions/Subscriptions.php b/src/PaymentMethods/Subscriptions/Subscriptions.php index 1d6d2fc4..8dddaf46 100644 --- a/src/PaymentMethods/Subscriptions/Subscriptions.php +++ b/src/PaymentMethods/Subscriptions/Subscriptions.php @@ -144,4 +144,4 @@ public function resume() return $this->dataRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Surepay/Models/Verify.php b/src/PaymentMethods/Surepay/Models/Verify.php index 84acfcb6..512bff6d 100644 --- a/src/PaymentMethods/Surepay/Models/Verify.php +++ b/src/PaymentMethods/Surepay/Models/Verify.php @@ -37,11 +37,11 @@ class Verify extends ServiceParameter */ public function bankAccount($bankAccount = null) { - if(is_array($bankAccount)) + if (is_array($bankAccount)) { - $this->bankAccount = new BankAccountAdapter(new BankAccount($bankAccount)); + $this->bankAccount = new BankAccountAdapter(new BankAccount($bankAccount)); } return $this->bankAccount; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Surepay/Service/ParameterKeys/BankAccountAdapter.php b/src/PaymentMethods/Surepay/Service/ParameterKeys/BankAccountAdapter.php index 14ddd6c2..da3bde3c 100644 --- a/src/PaymentMethods/Surepay/Service/ParameterKeys/BankAccountAdapter.php +++ b/src/PaymentMethods/Surepay/Service/ParameterKeys/BankAccountAdapter.php @@ -25,6 +25,6 @@ class BankAccountAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'accountName' => 'customeraccountname' + 'accountName' => 'customeraccountname', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Surepay/Surepay.php b/src/PaymentMethods/Surepay/Surepay.php index 96582b9c..f2d01d13 100644 --- a/src/PaymentMethods/Surepay/Surepay.php +++ b/src/PaymentMethods/Surepay/Surepay.php @@ -41,5 +41,4 @@ public function verify() return $this->dataRequest(); } - -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Models/Article.php b/src/PaymentMethods/Tinka/Models/Article.php index 509fdeab..1ad39f07 100644 --- a/src/PaymentMethods/Tinka/Models/Article.php +++ b/src/PaymentMethods/Tinka/Models/Article.php @@ -23,4 +23,4 @@ class Article extends \Buckaroo\Models\Article { protected string $color; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Models/Pay.php b/src/PaymentMethods/Tinka/Models/Pay.php index a3d9eed4..7991be1b 100644 --- a/src/PaymentMethods/Tinka/Models/Pay.php +++ b/src/PaymentMethods/Tinka/Models/Pay.php @@ -70,9 +70,9 @@ class Pay extends ServiceParameter * @var array|\string[][] */ protected array $groupData = [ - 'articles' => [ - 'groupType' => 'Article' - ] + 'articles' => [ + 'groupType' => 'Article', + ], ]; /** @@ -81,7 +81,7 @@ class Pay extends ServiceParameter */ public function billing($billing = null) { - if(is_array($billing)) + if (is_array($billing)) { $this->billingRecipient = new Recipient('Billing', $billing); $this->shippingRecipient = new Recipient('Billing', $billing); @@ -96,7 +96,7 @@ public function billing($billing = null) */ public function shipping($shipping = null) { - if(is_array($shipping)) + if (is_array($shipping)) { $this->shippingRecipient = new Recipient('Shipping', $shipping); } @@ -110,7 +110,7 @@ public function shipping($shipping = null) */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } @@ -124,9 +124,9 @@ public function customer($customer = null) */ public function articles(?array $articles = null) { - if(is_array($articles)) + if (is_array($articles)) { - foreach($articles as $article) + foreach ($articles as $article) { $this->articles[] = new ArticleAdapter(new Article($article)); } @@ -134,4 +134,4 @@ public function articles(?array $articles = null) return $this->articles; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Models/Recipient.php b/src/PaymentMethods/Tinka/Models/Recipient.php index 8e087aac..b266423a 100644 --- a/src/PaymentMethods/Tinka/Models/Recipient.php +++ b/src/PaymentMethods/Tinka/Models/Recipient.php @@ -20,9 +20,13 @@ namespace Buckaroo\PaymentMethods\Tinka\Models; -use Buckaroo\Models\{Address, Email, Person, Phone, ServiceParameter}; -use Buckaroo\PaymentMethods\Tinka\Service\ParameterKeys\{CustomerAdapter}; +use Buckaroo\Models\Address; +use Buckaroo\Models\Email; +use Buckaroo\Models\Person; +use Buckaroo\Models\Phone; +use Buckaroo\Models\ServiceParameter; use Buckaroo\PaymentMethods\Tinka\Service\ParameterKeys\AddressAdapter; +use Buckaroo\PaymentMethods\Tinka\Service\ParameterKeys\CustomerAdapter; use Buckaroo\PaymentMethods\Tinka\Service\ParameterKeys\PhoneAdapter; class Recipient extends ServiceParameter @@ -67,7 +71,7 @@ public function __construct(string $type, ?array $values = null) */ public function recipient($recipient = null) { - if(is_array($recipient)) + if (is_array($recipient)) { $this->recipient = new CustomerAdapter(new Person($recipient)); } @@ -81,7 +85,7 @@ public function recipient($recipient = null) */ public function address($address = null) { - if(is_array($address)) + if (is_array($address)) { $this->address = new AddressAdapter(new Address($address)); } @@ -95,7 +99,7 @@ public function address($address = null) */ public function phone($phone = null) { - if(is_array($phone)) + if (is_array($phone)) { $this->phone = new PhoneAdapter(new Phone($phone)); } @@ -109,9 +113,9 @@ public function phone($phone = null) */ public function email($email = null) { - if(is_string($email)) + if (is_string($email)) { - $this->email = new Email($email); + $this->email = new Email($email); } return $this->email; @@ -125,4 +129,4 @@ public function getGroupType(string $key): ?string { return $this->type . 'Customer'; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php index e68fb7b1..bd316ace 100644 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php +++ b/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php @@ -25,8 +25,8 @@ class AddressAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'houseNumber' => 'StreetNumber', + 'houseNumber' => 'StreetNumber', 'houseNumberAdditional' => 'StreetNumberAdditional', - 'zipcode' => 'PostalCode' + 'zipcode' => 'PostalCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php index 1a97a94c..79f51acc 100644 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php +++ b/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php @@ -25,6 +25,6 @@ class ArticleAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'price' => 'UnitGrossPrice' + 'price' => 'UnitGrossPrice', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php index f35a0b57..f868f4e8 100644 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php @@ -25,7 +25,7 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'lastNamePrefix' => 'PrefixLastName', - 'birthDate' => 'DateOfBirth' + 'lastNamePrefix' => 'PrefixLastName', + 'birthDate' => 'DateOfBirth', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php index 9dbf46ce..7107fa2c 100644 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php +++ b/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php @@ -25,6 +25,6 @@ class PhoneAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'mobile' => 'Phone' + 'mobile' => 'Phone', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Tinka/Tinka.php b/src/PaymentMethods/Tinka/Tinka.php index bac43c1e..0363ae78 100644 --- a/src/PaymentMethods/Tinka/Tinka.php +++ b/src/PaymentMethods/Tinka/Tinka.php @@ -34,4 +34,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Traits/CountableGroupKey.php b/src/PaymentMethods/Traits/CountableGroupKey.php index 5c54818d..b2b07461 100644 --- a/src/PaymentMethods/Traits/CountableGroupKey.php +++ b/src/PaymentMethods/Traits/CountableGroupKey.php @@ -29,7 +29,7 @@ trait CountableGroupKey */ public function getGroupKey(string $key, ?int $keyCount = 0): ?int { - if($this->countable($key, $keyCount)) + if ($this->countable($key, $keyCount)) { return intval($keyCount) + 1; } @@ -46,4 +46,4 @@ private function countable(string $key, ?int $keyCount = 0) { return isset($this->countableProperties) && in_array($key, $this->countableProperties) && is_numeric($keyCount); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Trustly/Models/Pay.php b/src/PaymentMethods/Trustly/Models/Pay.php index 375051c7..d2d37cba 100644 --- a/src/PaymentMethods/Trustly/Models/Pay.php +++ b/src/PaymentMethods/Trustly/Models/Pay.php @@ -42,11 +42,11 @@ class Pay extends ServiceParameter */ public function customer($customer = null) { - if(is_array($customer)) + if (is_array($customer)) { $this->customer = new CustomerAdapter(new Person($customer)); } return $this->customer; } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Trustly/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/Trustly/Service/ParameterKeys/CustomerAdapter.php index dce87aa4..2162a1cd 100644 --- a/src/PaymentMethods/Trustly/Service/ParameterKeys/CustomerAdapter.php +++ b/src/PaymentMethods/Trustly/Service/ParameterKeys/CustomerAdapter.php @@ -25,7 +25,7 @@ class CustomerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'firstName' => 'CustomerFirstName', - 'lastName' => 'CustomerLastName', + 'firstName' => 'CustomerFirstName', + 'lastName' => 'CustomerLastName', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Trustly/Service/ParameterKeys/PayAdapter.php b/src/PaymentMethods/Trustly/Service/ParameterKeys/PayAdapter.php index ad791f3a..e0bc27b2 100644 --- a/src/PaymentMethods/Trustly/Service/ParameterKeys/PayAdapter.php +++ b/src/PaymentMethods/Trustly/Service/ParameterKeys/PayAdapter.php @@ -25,6 +25,6 @@ class PayAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'country' => 'CustomerCountryCode' + 'country' => 'CustomerCountryCode', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/Trustly/Trustly.php b/src/PaymentMethods/Trustly/Trustly.php index c8bd450f..1082d855 100644 --- a/src/PaymentMethods/Trustly/Trustly.php +++ b/src/PaymentMethods/Trustly/Trustly.php @@ -34,4 +34,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new PayAdapter(new Pay($this->payload))); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/WeChatPay/Models/Pay.php b/src/PaymentMethods/WeChatPay/Models/Pay.php index 3b2436b7..0fe1678c 100644 --- a/src/PaymentMethods/WeChatPay/Models/Pay.php +++ b/src/PaymentMethods/WeChatPay/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected string $locale; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/WeChatPay/WeChatPay.php b/src/PaymentMethods/WeChatPay/WeChatPay.php index 410230bf..cec8ab41 100644 --- a/src/PaymentMethods/WeChatPay/WeChatPay.php +++ b/src/PaymentMethods/WeChatPay/WeChatPay.php @@ -40,4 +40,4 @@ public function pay(?Model $model = null): TransactionResponse { return parent::pay($model ?? new Pay($this->payload)); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDeal/Models/Pay.php b/src/PaymentMethods/iDeal/Models/Pay.php index 825b1b0c..da7304ea 100644 --- a/src/PaymentMethods/iDeal/Models/Pay.php +++ b/src/PaymentMethods/iDeal/Models/Pay.php @@ -25,4 +25,4 @@ class Pay extends ServiceParameter { protected string $issuer; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDeal/iDeal.php b/src/PaymentMethods/iDeal/iDeal.php index 78216052..cc11f525 100644 --- a/src/PaymentMethods/iDeal/iDeal.php +++ b/src/PaymentMethods/iDeal/iDeal.php @@ -25,6 +25,7 @@ use Buckaroo\Models\Model; use Buckaroo\PaymentMethods\iDeal\Models\Pay; use Buckaroo\PaymentMethods\PayablePaymentMethod; +use Buckaroo\Transaction\Request\TransactionRequest; use Buckaroo\Transaction\Response\TransactionResponse; class iDeal extends PayablePaymentMethod @@ -57,58 +58,35 @@ public function payRemainder(?Model $model = null): TransactionResponse } /** - * @return \string[][] + * @return \mixed * @throws \Buckaroo\Exceptions\BuckarooException */ - public function issuers(): array + public function issuers() : mixed { - $issuers = [ - [ - 'id' => 'ABNANL2A', - 'name' => 'ABN AMRO' - ], - [ - 'id' => 'ASNBNL21', - 'name' => 'ASN Bank' - ], - [ - 'id' => 'BUNQNL2A', - 'name' => 'bunq' - ], - [ - 'id' => 'INGBNL2A', - 'name' => 'ING' - ], - [ - 'id' => 'KNABNL2H', - 'name' => 'Knab' - ], - [ - 'id' => 'RABONL2U', - 'name' => 'Rabobank' - ], - [ - 'id' => 'RBRBNL21', - 'name' => 'RegioBank' - ], - [ - 'id' => 'REVOLT21', - 'name' => 'Revolut' - ], - [ - 'id' => 'SNSBNL2A', - 'name' => 'SNS Bank' - ], - [ - 'id' => 'TRIONL2U', - 'name' => 'Triodos Bank' - ], - [ - 'id' => 'FVLBNL22', - 'name' => 'Van Lanschot' - ] - ]; + $request = new TransactionRequest; - return $issuers; + try + { + $response = $this->client->specification($request, 'ideal', 2); + } + catch (BuckarooException $e) + { + return false; + } + + $issuerList = []; + if (isset($response['Actions']['0']['RequestParameters'][0]['ListItemDescriptions'])) + { + $issuersData = $response['Actions']['0']['RequestParameters'][0]['ListItemDescriptions']; + if (count($issuersData) > 0) + { + foreach ($issuersData as $issuer) + { + $issuerList[] = ['id' => $issuer['Value'], 'name' => $issuer['Description']]; + } + } + } + + return $issuerList; } } diff --git a/src/PaymentMethods/iDealQR/Models/Generate.php b/src/PaymentMethods/iDealQR/Models/Generate.php index 861b5377..ebc20882 100644 --- a/src/PaymentMethods/iDealQR/Models/Generate.php +++ b/src/PaymentMethods/iDealQR/Models/Generate.php @@ -34,4 +34,4 @@ class Generate extends Model protected float $minAmount; protected float $maxAmount; protected int $imageSize; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDealQR/iDealQR.php b/src/PaymentMethods/iDealQR/iDealQR.php index e76c8c92..841b6572 100644 --- a/src/PaymentMethods/iDealQR/iDealQR.php +++ b/src/PaymentMethods/iDealQR/iDealQR.php @@ -20,12 +20,8 @@ namespace Buckaroo\PaymentMethods\iDealQR; -use Buckaroo\Models\ServiceList; use Buckaroo\PaymentMethods\iDealQR\Models\Generate; use Buckaroo\PaymentMethods\PaymentMethod; -use Buckaroo\Services\ServiceListParameters\DefaultParameters; -use Buckaroo\Services\ServiceListParameters\iDealQRParameters; -use Buckaroo\Transaction\Response\TransactionResponse; class iDealQR extends PaymentMethod { @@ -45,4 +41,4 @@ public function generate() return $this->dataRequest(); } -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDin/Models/Issuer.php b/src/PaymentMethods/iDin/Models/Issuer.php index 02a0cbde..2ff7d44a 100644 --- a/src/PaymentMethods/iDin/Models/Issuer.php +++ b/src/PaymentMethods/iDin/Models/Issuer.php @@ -25,4 +25,4 @@ class Issuer extends ServiceParameter { protected string $issuer; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDin/Service/ParameterKeys/IssuerAdapter.php b/src/PaymentMethods/iDin/Service/ParameterKeys/IssuerAdapter.php index f4eb5632..7ada8f16 100644 --- a/src/PaymentMethods/iDin/Service/ParameterKeys/IssuerAdapter.php +++ b/src/PaymentMethods/iDin/Service/ParameterKeys/IssuerAdapter.php @@ -25,6 +25,6 @@ class IssuerAdapter extends ServiceParametersKeysAdapter { protected array $keys = [ - 'issuer' => 'issuerId' + 'issuer' => 'issuerId', ]; -} \ No newline at end of file +} diff --git a/src/PaymentMethods/iDin/iDin.php b/src/PaymentMethods/iDin/iDin.php index d72ff144..74ec8329 100644 --- a/src/PaymentMethods/iDin/iDin.php +++ b/src/PaymentMethods/iDin/iDin.php @@ -25,7 +25,7 @@ use Buckaroo\PaymentMethods\iDin\Service\ParameterKeys\IssuerAdapter; use Buckaroo\PaymentMethods\PaymentMethod; -class iDin extends PaymentMethod +class IDin extends PaymentMethod { /** * @var string @@ -83,5 +83,4 @@ public function login() return $this->dataRequest(); } - -} \ No newline at end of file +} diff --git a/src/Resources/Constants/CreditManagementInstallmentInterval.php b/src/Resources/Constants/CreditManagementInstallmentInterval.php index 0c80fa3f..dbc13dca 100644 --- a/src/Resources/Constants/CreditManagementInstallmentInterval.php +++ b/src/Resources/Constants/CreditManagementInstallmentInterval.php @@ -32,4 +32,4 @@ class CreditManagementInstallmentInterval const QUARTERYEAR = 'QuarterYear'; const HALFYEAR = 'HalfYear'; const YEAR = 'Year'; -} \ No newline at end of file +} diff --git a/src/Resources/Constants/Endpoints.php b/src/Resources/Constants/Endpoints.php index a8b6c119..102a35c2 100644 --- a/src/Resources/Constants/Endpoints.php +++ b/src/Resources/Constants/Endpoints.php @@ -24,4 +24,4 @@ class Endpoints { const LIVE = 'https://checkout.buckaroo.nl/'; const TEST = 'https://testcheckout.buckaroo.nl/'; -} \ No newline at end of file +} diff --git a/src/Resources/Constants/Gender.php b/src/Resources/Constants/Gender.php index 7e5078eb..26e7a1ff 100644 --- a/src/Resources/Constants/Gender.php +++ b/src/Resources/Constants/Gender.php @@ -26,4 +26,4 @@ class Gender const MALE = 1; const FEMALE = 2; const NOT_APPLICABLE = 9; -} \ No newline at end of file +} diff --git a/src/Resources/Constants/RecipientCategory.php b/src/Resources/Constants/RecipientCategory.php index 660dcb25..b64c5939 100644 --- a/src/Resources/Constants/RecipientCategory.php +++ b/src/Resources/Constants/RecipientCategory.php @@ -24,4 +24,4 @@ class RecipientCategory { const PERSON = 'Person'; const COMPANY = 'Company'; -} \ No newline at end of file +} diff --git a/src/Resources/Constants/ResponseStatus.php b/src/Resources/Constants/ResponseStatus.php index c06b2126..f4f5414a 100644 --- a/src/Resources/Constants/ResponseStatus.php +++ b/src/Resources/Constants/ResponseStatus.php @@ -24,19 +24,19 @@ class ResponseStatus { - public const BUCKAROO_STATUSCODE_SUCCESS = '190'; - public const BUCKAROO_STATUSCODE_FAILED = '490'; - public const BUCKAROO_STATUSCODE_VALIDATION_FAILURE = '491'; - public const BUCKAROO_STATUSCODE_TECHNICAL_ERROR = '492'; - public const BUCKAROO_STATUSCODE_REJECTED = '690'; + public const BUCKAROO_STATUSCODE_SUCCESS = '190'; + public const BUCKAROO_STATUSCODE_FAILED = '490'; + public const BUCKAROO_STATUSCODE_VALIDATION_FAILURE = '491'; + public const BUCKAROO_STATUSCODE_TECHNICAL_ERROR = '492'; + public const BUCKAROO_STATUSCODE_REJECTED = '690'; public const BUCKAROO_STATUSCODE_WAITING_ON_USER_INPUT = '790'; - public const BUCKAROO_STATUSCODE_PENDING_PROCESSING = '791'; - public const BUCKAROO_STATUSCODE_WAITING_ON_CONSUMER = '792'; - public const BUCKAROO_STATUSCODE_PAYMENT_ON_HOLD = '793'; - public const BUCKAROO_STATUSCODE_CANCELLED_BY_USER = '890'; + public const BUCKAROO_STATUSCODE_PENDING_PROCESSING = '791'; + public const BUCKAROO_STATUSCODE_WAITING_ON_CONSUMER = '792'; + public const BUCKAROO_STATUSCODE_PAYMENT_ON_HOLD = '793'; + public const BUCKAROO_STATUSCODE_CANCELLED_BY_USER = '890'; public const BUCKAROO_STATUSCODE_CANCELLED_BY_MERCHANT = '891'; - public const BUCKAROO_AUTHORIZE_TYPE_CANCEL = 'I014'; - public const BUCKAROO_AUTHORIZE_TYPE_ACCEPT = 'I013'; + public const BUCKAROO_AUTHORIZE_TYPE_CANCEL = 'I014'; + public const BUCKAROO_AUTHORIZE_TYPE_ACCEPT = 'I013'; public const BUCKAROO_AUTHORIZE_TYPE_GROUP_TRANSACTION = 'I150'; } diff --git a/src/Services/PayloadService.php b/src/Services/PayloadService.php index 85102c73..2e83965d 100644 --- a/src/Services/PayloadService.php +++ b/src/Services/PayloadService.php @@ -33,7 +33,8 @@ class PayloadService implements Arrayable * @param $payload * @throws \Exception */ - public function __construct($payload) { + public function __construct($payload) + { $this->setPayload($payload); } @@ -51,11 +52,13 @@ protected function setPayload($payload) return $this; } - if(is_string($payload)) { + if (is_string($payload)) + { $this->payload = json_decode($payload, true); } - if($this->payload == null) { + if ($this->payload == null) + { throw new \Exception("Invalid or empty payload. Array or json format required."); } @@ -69,4 +72,4 @@ public function toArray(): array { return $this->payload; } -} \ No newline at end of file +} diff --git a/src/Services/ServiceListParameters/DefaultParameters.php b/src/Services/ServiceListParameters/DefaultParameters.php index 274449be..87d0a711 100644 --- a/src/Services/ServiceListParameters/DefaultParameters.php +++ b/src/Services/ServiceListParameters/DefaultParameters.php @@ -28,4 +28,4 @@ public function __construct(ServiceList $serviceList) { $this->serviceList = $serviceList; } -} \ No newline at end of file +} diff --git a/src/Services/ServiceListParameters/ModelParameters.php b/src/Services/ServiceListParameters/ModelParameters.php index 5ef7bff7..63b58bf4 100644 --- a/src/Services/ServiceListParameters/ModelParameters.php +++ b/src/Services/ServiceListParameters/ModelParameters.php @@ -45,8 +45,12 @@ class ModelParameters extends ServiceListParameter * @param string|null $groupType * @param int|null $groupKey */ - public function __construct(ServiceListParameter $serviceListParameter, Model $model, ?string $groupType = '', ?int $groupKey = null) - { + public function __construct( + ServiceListParameter $serviceListParameter, + Model $model, + ?string $groupType = '', + ?int $groupKey = null + ) { $this->model = $model; $this->groupType = $groupType; $this->groupKey = $groupKey; @@ -59,11 +63,16 @@ public function __construct(ServiceListParameter $serviceListParameter, Model $m */ public function data(): ServiceList { - foreach($this->model->toArray() as $key => $value) + foreach ($this->model->toArray() as $key => $value) { - if(!is_array($value)) + if (! is_array($value)) { - $this->appendParameter($this->groupKey($key), $this->groupType($key), $this->model->serviceParameterKeyOf($key), $value); + $this->appendParameter( + $this->groupKey($key), + $this->groupType($key), + $this->model->serviceParameterKeyOf($key), + $value + ); } } @@ -76,7 +85,7 @@ public function data(): ServiceList */ private function groupKey($key) { - if($this->model instanceof ServiceParameter && !$this->groupKey) + if ($this->model instanceof ServiceParameter && ! $this->groupKey) { return $this->model->getGroupKey($key); } @@ -90,11 +99,11 @@ private function groupKey($key) */ private function groupType($key) { - if($this->model instanceof ServiceParameter && !$this->groupType) + if ($this->model instanceof ServiceParameter && ! $this->groupType) { return $this->model->getGroupType($key); } return $this->groupType; } -} \ No newline at end of file +} diff --git a/src/Services/ServiceListParameters/ServiceListParameter.php b/src/Services/ServiceListParameters/ServiceListParameter.php index 082b15c5..6aa54635 100644 --- a/src/Services/ServiceListParameters/ServiceListParameter.php +++ b/src/Services/ServiceListParameters/ServiceListParameter.php @@ -63,23 +63,23 @@ public function data(): ServiceList */ protected function appendParameter(?int $groupKey, ?string $groupType, string $name, $value) { - if(!is_null($value)) { - - if(is_callable($value)) { - + if (! is_null($value)) + { + if (is_callable($value)) + { $this->serviceList->appendParameter($value($groupKey, $groupType)); return $this; } $this->serviceList->appendParameter([ - "Name" => $name, - "Value" => $value, - "GroupType" => (is_null($groupType))? "" : $groupType, - "GroupID" => (is_null($groupKey))? "" : $groupKey, + "Name" => $name, + "Value" => $value, + "GroupType" => (is_null($groupType))? "" : $groupType, + "GroupID" => (is_null($groupKey))? "" : $groupKey, ]); } return $this; } -} \ No newline at end of file +} diff --git a/src/Services/TransactionHeaders/CultureHeader.php b/src/Services/TransactionHeaders/CultureHeader.php index 8f3543cf..2de3e2cd 100644 --- a/src/Services/TransactionHeaders/CultureHeader.php +++ b/src/Services/TransactionHeaders/CultureHeader.php @@ -26,7 +26,8 @@ class CultureHeader extends TransactionHeader * @param TransactionHeader $transactionHeader * @param string|null $locale */ - public function __construct(TransactionHeader $transactionHeader, string $locale = null) { + public function __construct(TransactionHeader $transactionHeader, string $locale = null) + { $this->locale = $locale; parent::__construct($transactionHeader); @@ -35,7 +36,8 @@ public function __construct(TransactionHeader $transactionHeader, string $locale /** * @return array */ - public function getHeaders(): array { + public function getHeaders(): array + { $headers = $this->transactionHeader->getHeaders(); $headers[] = "Culture: " . $this->getLocale(); @@ -48,12 +50,14 @@ public function getHeaders(): array { */ public function getLocale(): string { - switch ($this->locale) { + switch ($this->locale) + { case 'nl': return 'nl-NL'; case 'de': return 'de-DE'; } + return 'en-GB'; } } diff --git a/src/Services/TransactionHeaders/DefaultHeader.php b/src/Services/TransactionHeaders/DefaultHeader.php index 542ed2d0..27fd8bd1 100644 --- a/src/Services/TransactionHeaders/DefaultHeader.php +++ b/src/Services/TransactionHeaders/DefaultHeader.php @@ -26,4 +26,4 @@ public function __construct(?array $headers = null) { $this->headers = $headers ?? []; } -} \ No newline at end of file +} diff --git a/src/Services/TransactionHeaders/HmacHeader.php b/src/Services/TransactionHeaders/HmacHeader.php index c21922b6..c3ce71b2 100644 --- a/src/Services/TransactionHeaders/HmacHeader.php +++ b/src/Services/TransactionHeaders/HmacHeader.php @@ -29,14 +29,22 @@ class HmacHeader extends TransactionHeader { - public function __construct(TransactionHeader $transactionHeader, Config $config, string $requestUri, string $content, string $httpMethod, string $nonce = '', int $timeStamp = 0) - { + public function __construct( + TransactionHeader $transactionHeader, + Config $config, + string $requestUri, + string $content, + string $httpMethod, + string $nonce = '', + int $timeStamp = 0 + ) { $this->hmacGenerator = new Generator($config, $content, $requestUri, $httpMethod); parent::__construct($transactionHeader); } - public function getHeaders(): array { + public function getHeaders(): array + { $headers = $this->transactionHeader->getHeaders(); $headers[] = "Authorization: hmac " . $this->hmacGenerator->generate(); diff --git a/src/Services/TransactionHeaders/SoftwareHeader.php b/src/Services/TransactionHeaders/SoftwareHeader.php index 5ed1c29e..32195133 100644 --- a/src/Services/TransactionHeaders/SoftwareHeader.php +++ b/src/Services/TransactionHeaders/SoftwareHeader.php @@ -27,15 +27,16 @@ class SoftwareHeader extends TransactionHeader /** * @return array */ - public function getHeaders(): array { + public function getHeaders(): array + { $headers = $this->transactionHeader->getHeaders(); $headers[] = "Software: " . json_encode([ - "PlatformName" => "SDK", + "PlatformName" => "SDK", "PlatformVersion" => '0.0.1', - "ModuleSupplier" => "Buckaroo", - "ModuleName" => "BuckarooPayments", - "ModuleVersion" => '0.0.1', + "ModuleSupplier" => "Buckaroo", + "ModuleName" => "BuckarooPayments", + "ModuleVersion" => '0.0.1', ]); return $headers; diff --git a/src/Services/TransactionHeaders/TransactionHeader.php b/src/Services/TransactionHeaders/TransactionHeader.php index 1fe3af67..0fd9bcff 100644 --- a/src/Services/TransactionHeaders/TransactionHeader.php +++ b/src/Services/TransactionHeaders/TransactionHeader.php @@ -47,4 +47,4 @@ public function getHeaders(): array { return $this->headers; } -} \ No newline at end of file +} diff --git a/src/Services/TransactionService.php b/src/Services/TransactionService.php index a178fd17..2ad63b8e 100644 --- a/src/Services/TransactionService.php +++ b/src/Services/TransactionService.php @@ -4,6 +4,7 @@ use Buckaroo\Transaction\Client; use Buckaroo\Transaction\Response\Response; +use Buckaroo\Transaction\Response\TransactionResponse; class TransactionService { @@ -31,12 +32,15 @@ public function __construct(Client $client, string $transactionKey) } /** - * @return Response + * @return TransactionResponse * @throws \Buckaroo\Exceptions\BuckarooException */ - public function status(): Response + public function status(): TransactionResponse { - return $this->client->get(Response::class, $this->client->getEndpoint('json/Transaction/Status/' . $this->transactionKey)); + return $this->client->get( + TransactionResponse::class, + $this->client->getEndpoint('json/Transaction/Status/' . $this->transactionKey) + ); } /** @@ -45,7 +49,10 @@ public function status(): Response */ public function refundInfo(): Response { - return $this->client->get(Response::class, $this->client->getEndpoint('json/Transaction/RefundInfo/' . $this->transactionKey)); + return $this->client->get( + Response::class, + $this->client->getEndpoint('json/Transaction/RefundInfo/' . $this->transactionKey) + ); } /** @@ -54,6 +61,9 @@ public function refundInfo(): Response */ public function cancelInfo(): Response { - return $this->client->get(Response::class, $this->client->getEndpoint('json/Transaction/Cancel/' . $this->transactionKey)); + return $this->client->get( + Response::class, + $this->client->getEndpoint('json/Transaction/Cancel/' . $this->transactionKey) + ); } -} \ No newline at end of file +} diff --git a/src/Tests/BuckarooTestCase.php b/src/Tests/BuckarooTestCase.php index bf4bfda8..bada7b58 100644 --- a/src/Tests/BuckarooTestCase.php +++ b/src/Tests/BuckarooTestCase.php @@ -35,4 +35,4 @@ public function __construct() parent::__construct(); } -} \ No newline at end of file +} diff --git a/src/Tests/ConfirmingCredentialsTest.php b/src/Tests/ConfirmingCredentialsTest.php index 48e5a4b6..e774f77d 100644 --- a/src/Tests/ConfirmingCredentialsTest.php +++ b/src/Tests/ConfirmingCredentialsTest.php @@ -34,4 +34,4 @@ public function it_tests_given_credentials() $this->assertTrue($response); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/AfterpayDigiAcceptTest.php b/src/Tests/Payments/AfterpayDigiAcceptTest.php index db95f40b..cb3fb2d5 100644 --- a/src/Tests/Payments/AfterpayDigiAcceptTest.php +++ b/src/Tests/Payments/AfterpayDigiAcceptTest.php @@ -54,7 +54,7 @@ public function it_creates_a_afterpaydigiaccept_authorize() public function it_creates_a_afterpaydigiaccept_capture() { $response = $this->buckaroo->method('afterpaydigiaccept')->capture($this->getPaymentPayload([ - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ])); $this->assertTrue($response->isFailed()); @@ -84,92 +84,93 @@ public function it_creates_a_afterpaydigiaccept_refund() $response = $this->buckaroo->method('afterpaydigiaccept')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); $this->assertTrue($response->isFailed()); } - private function getPaymentPayload(array $additionalParameters = null): array { - $payload = [ - 'amountDebit' => 40.50, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'b2b' => true, - 'addressesDiffer' => true, - 'customerIPAddress' => '0.0.0.0', - 'shippingCosts' => 0.5, - 'costCentre' => 'Test', - 'department' => 'Test', - 'establishmentNumber' => '123456', - 'billing' => [ - 'recipient' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'AB', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01', - 'culture' => 'NL' + private function getPaymentPayload(array $additionalParameters = null): array + { + $payload = [ + 'amountDebit' => 40.50, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'b2b' => true, + 'addressesDiffer' => true, + 'customerIPAddress' => '0.0.0.0', + 'shippingCosts' => 0.5, + 'costCentre' => 'Test', + 'department' => 'Test', + 'establishmentNumber' => '123456', + 'billing' => [ + 'recipient' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'AB', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + 'culture' => 'NL', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'culture' => 'NL', - 'gender' => Gender::MALE, - 'initials' => 'YJ', - 'lastName' => 'Jansen', - 'companyName' => 'Buckaroo B.V.', - 'birthDate' => '1990-01-01', - 'chamberOfCommerce' => '12345678', - 'vatNumber' => 'NL12345678', + 'shipping' => [ + 'recipient' => [ + 'culture' => 'NL', + 'gender' => Gender::MALE, + 'initials' => 'YJ', + 'lastName' => 'Jansen', + 'companyName' => 'Buckaroo B.V.', + 'birthDate' => '1990-01-01', + 'chamberOfCommerce' => '12345678', + 'vatNumber' => 'NL12345678', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433' + 'phone' => [ + 'mobile' => '0698765433', ], - 'email' => 'test@buckaroo.nl', + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => uniqid(), 'description' => 'Blue Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], [ 'identifier' => uniqid(), 'description' => 'Red Toy Car', 'price' => '10.00', 'quantity' => '2', - 'vatCategory' => '1' + 'vatCategory' => '1', ], - ] + ], ]; - if($additionalParameters) + if ($additionalParameters) { $payload = array_merge($payload, $additionalParameters); } return $payload; } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/AfterpayTest.php b/src/Tests/Payments/AfterpayTest.php index fe2f8cb2..8d64f07a 100644 --- a/src/Tests/Payments/AfterpayTest.php +++ b/src/Tests/Payments/AfterpayTest.php @@ -33,7 +33,7 @@ public function it_creates_a_afterpay_payment() { $response = $this->buckaroo->method('afterpay')->pay($this->getPaymentPayload()); - $this->assertTrue($response->isRejected()); + $this->assertTrue($response->isSuccess()); } /** @@ -69,7 +69,7 @@ public function it_creates_a_afterpay_authorize() public function it_creates_a_afterpay_capture() { $response = $this->buckaroo->method('afterpay')->capture($this->getPaymentPayload([ - 'originalTransactionKey' => 'D5127080BA1D4644856FECDC560FXXXX' + 'originalTransactionKey' => 'D5127080BA1D4644856FECDC560FXXXX', ])); $this->assertTrue($response->isValidationFailure()); @@ -82,9 +82,9 @@ public function it_creates_a_afterpay_capture() public function it_creates_a_afterpay_refund() { $response = $this->buckaroo->method('afterpay')->refund([ - 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund + 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', //Set transaction key of the transaction to refund - 'amountCredit' => 1.23 + 'amountCredit' => 1.23, ]); $this->assertTrue($response->isValidationFailure()); @@ -97,29 +97,31 @@ public function it_creates_a_afterpay_refund() public function it_creates_a_afterpay_partial_refund() { $response = $this->buckaroo->method('afterpay')->refund([ - 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund + 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', //Set transaction key of the transaction to refund 'amountCredit' => 1.23, - 'articles' => [ + 'articles' => [ [ - 'refundType' => 'Return', + 'refundType' => 'Return', 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' - ] - ] + 'price' => '20.10', + ], + ], ]); $this->assertTrue($response->isValidationFailure()); } - private function getPaymentPayload(?array $additional = null): array { + private function getPaymentPayload(?array $additional = null): array + { $payload = [ - 'amountDebit' => 50.30, + 'amountDebit' => 52.30, 'order' => uniqid(), 'invoice' => uniqid(), + 'clientIP' => '127.0.0.1', 'billing' => [ 'recipient' => [ 'category' => RecipientCategory::PERSON, @@ -132,61 +134,69 @@ private function getPaymentPayload(?array $additional = null): array { 'identificationNumber' => 'IdNumber12345', 'customerNumber' => 'customerNumber12345' ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => RecipientCategory::COMPANY, - 'careOf' => 'John Smith', - 'companyName' => 'Buckaroo B.V.', - 'firstName' => 'John', - 'lastName' => 'Do', - 'chamberOfCommerce' => '12345678' + 'shipping' => [ + 'recipient' => [ + 'category' => RecipientCategory::COMPANY, + 'careOf' => 'John Smith', + 'companyName' => 'Buckaroo B.V.', + 'firstName' => 'John', + 'lastName' => 'Do', + 'chamberOfCommerce' => '12345678', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', + ], + [ + 'type' => 'ShippingFee', + 'identifier' => 'USPShippingID', + 'description' => 'UPS', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => '2' ], ] ]; - if($additional) + if ($additional) { return array_merge($additional, $payload); } return $payload; } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/AlipayTest.php b/src/Tests/Payments/AlipayTest.php index 6bbfffcc..47900794 100644 --- a/src/Tests/Payments/AlipayTest.php +++ b/src/Tests/Payments/AlipayTest.php @@ -33,7 +33,7 @@ public function it_creates_a_alipay_payment() $response = $this->buckaroo->method('alipay')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'useMobileView' => true + 'useMobileView' => true, ]); $this->assertTrue($response->isPendingProcessing()); @@ -46,10 +46,10 @@ public function it_creates_a_alipay_refund() { $response = $this->buckaroo->method('alipay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/ApplepayTest.php b/src/Tests/Payments/ApplepayTest.php index efc20d34..3cdb3134 100644 --- a/src/Tests/Payments/ApplepayTest.php +++ b/src/Tests/Payments/ApplepayTest.php @@ -62,9 +62,9 @@ public function it_creates_a_applepay_refund() $response = $this->buckaroo->method('applepay')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/BancontactTest.php b/src/Tests/Payments/BancontactTest.php index c1f9705a..43c124d1 100644 --- a/src/Tests/Payments/BancontactTest.php +++ b/src/Tests/Payments/BancontactTest.php @@ -33,7 +33,7 @@ public function it_creates_a_bancontact_payment() $response = $this->buckaroo->method('bancontactmrcash')->pay([ 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'saveToken' => true + 'saveToken' => true, ]); $this->assertTrue($response->isWaitingOnUserInput()); @@ -47,7 +47,7 @@ public function it_creates_a_bancontact_refund() $response = $this->buckaroo->method('bancontactmrcash')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '0EF39AA94BD64FF38F1540DEB6XXXXXX' + 'originalTransactionKey' => '0EF39AA94BD64FF38F1540DEB6XXXXXX', ]); $this->assertTrue($response->isFailed()); @@ -61,9 +61,9 @@ public function it_creates_a_bancontact_encrypted_payment() { $response = $this->buckaroo->method('bancontactmrcash')->payEncrypted([ 'invoice' => uniqid(), - 'amountDebit' => 10.10, - 'description' => 'Bancontact PayEncrypted Test 123', - 'encryptedCardData' => '001SlXfd8MbiTd/JFwCiGVs3f6o4x6xt0aN29NzOSNZHPKlVsz/EWeQmyhb1gGZ86VY88DP7gfDV+UyjcPfpVfHZd7u+WkO71hnV2QfYILCBNqE1aiPv2GQVGdaGbuoQloKu1o3o3I1UDmVxivXTMQX76ovot89geA6hqbtakmpmvxeiwwea3l4htNoX1IlD1hfYkDDl9rzSu5ypcjvVs6aRGXK5iMHnyrmEsEnfdj/Q5XWbsD5xAm4u3y6J8d4UP7LB31VLECzZUTiJOtKKcCQlT01YThIkQlj8PWBBMtt4H52VN3IH2+wPYtR8HiOZzcA2HA7UxozogIpS53tIURj/g==' + 'amountDebit' => 10.10, + 'description' => 'Bancontact PayEncrypted Test 123', + 'encryptedCardData' => '001SlXfd8MbiTd/JFwCiGVs3f6o4x6xt0aN29NzOSNZHPKlVsz/EWeQmyhb1gGZ86VY88DP7gfDV+UyjcPfpVfHZd7u+WkO71hnV2QfYILCBNqE1aiPv2GQVGdaGbuoQloKu1o3o3I1UDmVxivXTMQX76ovot89geA6hqbtakmpmvxeiwwea3l4htNoX1IlD1hfYkDDl9rzSu5ypcjvVs6aRGXK5iMHnyrmEsEnfdj/Q5XWbsD5xAm4u3y6J8d4UP7LB31VLECzZUTiJOtKKcCQlT01YThIkQlj8PWBBMtt4H52VN3IH2+wPYtR8HiOZzcA2HA7UxozogIpS53tIURj/g==', ]); $this->assertTrue($response->isPendingProcessing()); @@ -76,9 +76,9 @@ public function it_creates_a_bancontact_encrypted_payment() public function it_creates_a_bancontact_recurrent_payment() { $response = $this->buckaroo->method('bancontactmrcash')->payRecurrent([ - 'invoice' => 'testinvoice 123', - 'amountDebit' => 10.50, - 'originalTransactionKey' => '91D08EC01F414926A4CA29C059XXXXXX', + 'invoice' => 'testinvoice 123', + 'amountDebit' => 10.50, + 'originalTransactionKey' => '91D08EC01F414926A4CA29C059XXXXXX', ]); $this->assertTrue($response->isValidationFailure()); @@ -91,17 +91,12 @@ public function it_creates_a_bancontact_recurrent_payment() public function it_creates_a_bancontact_authenticate() { $response = $this->buckaroo->method('bancontactmrcash')->authenticate([ - 'invoice' => 'Bancontact Authenticate SaveToken', - 'description' => 'Bancontact Authenticate SaveToken', - 'amountDebit' => 0.02, - 'savetoken' => false + 'invoice' => 'Bancontact Authenticate SaveToken', + 'description' => 'Bancontact Authenticate SaveToken', + 'amountDebit' => 0.02, + 'savetoken' => false, ]); $this->assertTrue($response->isWaitingOnUserInput()); } - - - - - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/BelfiusTest.php b/src/Tests/Payments/BelfiusTest.php index 76146daa..9fe435a3 100644 --- a/src/Tests/Payments/BelfiusTest.php +++ b/src/Tests/Payments/BelfiusTest.php @@ -46,9 +46,9 @@ public function it_creates_a_belfius_refund() $response = $this->buckaroo->method('belfius')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '0EF39AA94BD64FF38F1540DEB6XXXXXX' + 'originalTransactionKey' => '0EF39AA94BD64FF38F1540DEB6XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/BillinkTest.php b/src/Tests/Payments/BillinkTest.php index 5d70003c..0a7910c1 100644 --- a/src/Tests/Payments/BillinkTest.php +++ b/src/Tests/Payments/BillinkTest.php @@ -53,14 +53,14 @@ public function it_creates_a_billink_capture() 'originalTransactionKey' => '74AD098CCFAA4F739FE16279B5059B6B', //Set transaction key of the transaction to capture 'invoice' => '62905fa2650f4', //Set invoice id 'amountDebit' => 50.30, //set amount to capture - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', 'price' => '20.10', - 'priceExcl' => 5 + 'priceExcl' => 5, ], [ 'identifier' => 'Articlenumber2', @@ -68,9 +68,9 @@ public function it_creates_a_billink_capture() 'vatPercentage' => '21', 'quantity' => '1', 'price' => 10.10, - 'priceExcl' => 5 + 'priceExcl' => 5, ], - ] + ], ]); $this->assertTrue($response->isRejected()); @@ -83,72 +83,73 @@ public function it_creates_a_billink_refund() { $response = $this->buckaroo->method('billink')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', ]); $this->assertTrue($response->isFailed()); } - private function getPaymentPayload(): array { + private function getPaymentPayload(): array + { return [ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'trackAndTrace' => 'TR0F123456789', - 'vATNumber' => '2', - 'billing' => [ - 'recipient' => [ - 'category' => 'B2B', - 'careOf' => 'John Smith', - 'title' => 'Female', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '01-01-1990', - 'chamberOfCommerce' => 'TEST' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'trackAndTrace' => 'TR0F123456789', + 'vATNumber' => '2', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2B', + 'careOf' => 'John Smith', + 'title' => 'Female', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '01-01-1990', + 'chamberOfCommerce' => 'TEST', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2C', - 'careOf' => 'John Smith', - 'title' => 'Male', - 'initials' => 'JD', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2C', + 'careOf' => 'John Smith', + 'title' => 'Male', + 'initials' => 'JD', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', 'price' => '20.10', - 'priceExcl' => 5 + 'priceExcl' => 5, ], [ 'identifier' => 'Articlenumber2', @@ -156,9 +157,9 @@ private function getPaymentPayload(): array { 'vatPercentage' => '21', 'quantity' => '1', 'price' => 10.10, - 'priceExcl' => 5 + 'priceExcl' => 5, ], - ] + ], ]; } @@ -175,4 +176,4 @@ public function it_creates_a_billink_cancel_authorize() $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/BuckarooVoucherTest.php b/src/Tests/Payments/BuckarooVoucherTest.php index ad59c305..bf2d06fd 100644 --- a/src/Tests/Payments/BuckarooVoucherTest.php +++ b/src/Tests/Payments/BuckarooVoucherTest.php @@ -50,9 +50,9 @@ public function it_creates_a_buckaroo_payment() { $response = $this->buckaroo->method('buckaroovoucher')->pay( [ - 'amountDebit' =>'10', + 'amountDebit' => '10', 'invoice' => uniqid(), - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] ); @@ -67,10 +67,10 @@ public function it_creates_a_buckaroo_pay_remainder() { $response = $this->buckaroo->method('buckaroovoucher')->payRemainder( [ - 'amountDebit' =>'10', + 'amountDebit' => '10', 'invoice' => uniqid(), 'vouchercode' => 'vouchercode', - 'originalTransaction' => '4E8BD922192746C3918BF4077CXXXXXX' + 'originalTransaction' => '4E8BD922192746C3918BF4077CXXXXXX', ] ); @@ -87,7 +87,7 @@ public function it_creates_a_buckaroo_refund() [ 'amountCredit' => 10, 'invoice' => uniqid(), - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', ] ); @@ -102,7 +102,7 @@ public function it_creates_a_buckaroo_get_balance() { $response = $this->buckaroo->method('buckaroovoucher')->getBalance( [ - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] ); @@ -117,10 +117,10 @@ public function it_deactivate_a_buckaroo_voucher() { $response = $this->buckaroo->method('buckaroovoucher')->deactivate( [ - 'vouchercode' => 'vouchercode' + 'vouchercode' => 'vouchercode', ] ); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/BuckarooWalletTest.php b/src/Tests/Payments/BuckarooWalletTest.php index 9053d2ae..18157b86 100644 --- a/src/Tests/Payments/BuckarooWalletTest.php +++ b/src/Tests/Payments/BuckarooWalletTest.php @@ -31,15 +31,15 @@ class BuckarooWalletTest extends BuckarooTestCase public function it_creates_a_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->createWallet([ - 'walletId' => uniqid(), - 'email' => 'test@buckaroo.nl', - 'customer' => [ - 'firstName' => 'John', - 'lastName' => 'Doe' + 'walletId' => uniqid(), + 'email' => 'test@buckaroo.nl', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Doe', + ], + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', ], - 'bankAccount' => [ - 'iban' => 'NL13TEST0123456789', - ] ]); $this->assertTrue($response->isSuccess()); @@ -52,16 +52,16 @@ public function it_creates_a_buckaroo_wallet() public function it_updates_a_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->updateWallet([ - 'walletId' => 10, - 'email' => 'test@buckaroo.nl', - 'status' => 'Disabled', - 'customer' => [ - 'firstName' => 'John', - 'lastName' => 'Doe' + 'walletId' => 10, + 'email' => 'test@buckaroo.nl', + 'status' => 'Disabled', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Doe', + ], + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', ], - 'bankAccount' => [ - 'iban' => 'NL13TEST0123456789', - ] ]); $this->assertTrue($response->isSuccess()); @@ -74,7 +74,7 @@ public function it_updates_a_buckaroo_wallet() public function it_get_buckaroo_wallet_info() { $response = $this->buckaroo->method('buckaroo_wallet')->getInfo([ - 'walletId' => 10 + 'walletId' => 10, ]); $this->assertTrue($response->isSuccess()); @@ -87,9 +87,9 @@ public function it_get_buckaroo_wallet_info() public function it_releases_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->release([ - 'amountCredit' => 1, - 'walletId' => 10, - 'walletMutationGuid' => '1757B313E57E4973997DD8C5235A' + 'amountCredit' => 1, + 'walletId' => 10, + 'walletMutationGuid' => '1757B313E57E4973997DD8C5235A', ]); $this->assertTrue($response->isValidationFailure()); @@ -102,10 +102,10 @@ public function it_releases_buckaroo_wallet() public function it_deposit_to_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->deposit([ - 'invoice' => 'BuckarooWalletInvoiceId', - 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', - 'amountCredit' => 1, - 'walletId' => 10 + 'invoice' => 'BuckarooWalletInvoiceId', + 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', + 'amountCredit' => 1, + 'walletId' => 10, ]); $this->assertTrue($response->isValidationFailure()); @@ -118,10 +118,10 @@ public function it_deposit_to_buckaroo_wallet() public function it_reserve_to_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->reserve([ - 'invoice' => 'BuckarooWalletInvoiceId', - 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', - 'amountCredit' => 1, - 'walletId' => 10 + 'invoice' => 'BuckarooWalletInvoiceId', + 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', + 'amountCredit' => 1, + 'walletId' => 10, ]); $this->assertTrue($response->isValidationFailure()); @@ -134,10 +134,10 @@ public function it_reserve_to_buckaroo_wallet() public function it_withdrawal_from_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->withdrawal([ - 'invoice' => 'BuckarooWalletInvoiceId', - 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', - 'amountDebit' => 1, - 'walletId' => 10 + 'invoice' => 'BuckarooWalletInvoiceId', + 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', + 'amountDebit' => 1, + 'walletId' => 10, ]); $this->assertTrue($response->isValidationFailure()); @@ -150,10 +150,10 @@ public function it_withdrawal_from_buckaroo_wallet() public function it_cancel_from_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->cancel([ - 'invoice' => 'BuckarooWalletInvoiceId', - 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', - 'amountDebit' => 1, - 'walletMutationGuid' => '49B018248ECE4346AC20B902' + 'invoice' => 'BuckarooWalletInvoiceId', + 'originalTransactionKey' => '46FB241693914AA4AE7A8B6DB33DE', + 'amountDebit' => 1, + 'walletMutationGuid' => '49B018248ECE4346AC20B902', ]); $this->assertTrue($response->isValidationFailure()); @@ -166,10 +166,10 @@ public function it_cancel_from_buckaroo_wallet() public function it_creates_a_payment_on_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->pay([ - 'invoice' => 'BuckarooWalletInvoiceId', - 'description' => 'Test', - 'amountDebit' => 1, - 'walletId' => 10 + 'invoice' => 'BuckarooWalletInvoiceId', + 'description' => 'Test', + 'amountDebit' => 1, + 'walletId' => 10, ]); $this->assertTrue($response->isValidationFailure()); @@ -183,10 +183,10 @@ public function it_creates_a_refund_on_buckaroo_wallet() { $response = $this->buckaroo->method('buckaroo_wallet')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/CreditClickTest.php b/src/Tests/Payments/CreditClickTest.php index 2bbcd30b..0baa73cb 100644 --- a/src/Tests/Payments/CreditClickTest.php +++ b/src/Tests/Payments/CreditClickTest.php @@ -33,11 +33,11 @@ public function it_creates_a_creditclick_payment() $response = $this->buckaroo->method('creditclick')->pay([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'customer' => [ + 'customer' => [ 'firstName' => 'Test', 'lastName' => 'Aflever', ], - 'email' => 't.tester@test.nl' + 'email' => 't.tester@test.nl', ]); $this->assertTrue($response->isPendingProcessing()); @@ -49,13 +49,13 @@ public function it_creates_a_creditclick_payment() public function it_creates_a_creditclick_refund() { $response = $this->buckaroo->method('creditclick')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'description' => 'refund', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', - 'refundreason' => 'RequestedByCustomer' + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + 'refundreason' => 'RequestedByCustomer', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/CreditManagementTest.php b/src/Tests/Payments/CreditManagementTest.php index e2774d6f..b176bdc7 100644 --- a/src/Tests/Payments/CreditManagementTest.php +++ b/src/Tests/Payments/CreditManagementTest.php @@ -44,52 +44,52 @@ public function it_creates_a_credit_management_invoice() public function it_creates_a_credit_management_invoice_with_product_lines() { $response = $this->buckaroo->method('credit_management')->createInvoice([ - 'invoice' => 'Billingtest101', - 'description' => 'buckaroo_schema_test_PDF', - 'invoiceAmount' => 217.80, - 'invoiceDate' => '2022-01-01', - 'dueDate' => '1990-01-01', - 'schemeKey' => '2amq34', - 'poNumber' => 'PO-12345', - 'debtor' => [ - 'code' => 'johnsmith4' + 'invoice' => 'Billingtest101', + 'description' => 'buckaroo_schema_test_PDF', + 'invoiceAmount' => 217.80, + 'invoiceDate' => '2022-01-01', + 'dueDate' => '1990-01-01', + 'schemeKey' => '2amq34', + 'poNumber' => 'PO-12345', + 'debtor' => [ + 'code' => 'johnsmith4', ], - 'articles' => [ + 'articles' => [ [ - 'productGroupName' => 'Toys', - 'productGroupOrderIndex' => 1, - 'productOrderIndex' => 1, - 'type' => 'Regular', - 'identifier' => 'ART12', - 'description' => 'Blue Toy Car', - 'quantity' => 3, - 'unitOfMeasurement' => 'piece(s)', - 'price' => 10, - 'discountPercentage' => 20, - 'totalDiscount' => 6, - 'vatPercentage' => 21, - 'totalVat' => 0.6, - 'totalAmountExVat' => 8.40, - 'totalAmount' => 123 + 'productGroupName' => 'Toys', + 'productGroupOrderIndex' => 1, + 'productOrderIndex' => 1, + 'type' => 'Regular', + 'identifier' => 'ART12', + 'description' => 'Blue Toy Car', + 'quantity' => 3, + 'unitOfMeasurement' => 'piece(s)', + 'price' => 10, + 'discountPercentage' => 20, + 'totalDiscount' => 6, + 'vatPercentage' => 21, + 'totalVat' => 0.6, + 'totalAmountExVat' => 8.40, + 'totalAmount' => 123, ], [ - 'productGroupName' => 'Toys', - 'productGroupOrderIndex' => 1, - 'productOrderIndex' => 2, - 'type' => 'Regular', - 'identifier' => 'ART12', - 'description' => 'Blue Toy Car', - 'quantity' => 3, - 'unitOfMeasurement' => 'piece(s)', - 'price' => 10, - 'discountPercentage' => 20, - 'totalDiscount' => 6, - 'vatPercentage' => 21, - 'totalVat' => 0.6, - 'totalAmountExVat' => 8.40, - 'totalAmount' => 123 + 'productGroupName' => 'Toys', + 'productGroupOrderIndex' => 1, + 'productOrderIndex' => 2, + 'type' => 'Regular', + 'identifier' => 'ART12', + 'description' => 'Blue Toy Car', + 'quantity' => 3, + 'unitOfMeasurement' => 'piece(s)', + 'price' => 10, + 'discountPercentage' => 20, + 'totalDiscount' => 6, + 'vatPercentage' => 21, + 'totalVat' => 0.6, + 'totalAmountExVat' => 8.40, + 'totalAmount' => 123, ], - ] + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -105,16 +105,16 @@ public function it_creates_a_credit_management_combined_invoice() $response = $this->buckaroo->method('sepadirectdebit')->combine($invoice) ->pay([ - 'invoice' => uniqid(), - 'amountDebit' => 10.10, - 'iban' => 'NL13TEST0123456789', - 'bic' => 'TESTNL2A', - 'collectdate' => '2030-01-01', - 'mandateReference' => '1DCtestreference', - 'mandateDate' => '2022-07-03', - 'customer' => [ - 'name' => 'John Smith' - ] + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'iban' => 'NL13TEST0123456789', + 'bic' => 'TESTNL2A', + 'collectdate' => '2030-01-01', + 'mandateReference' => '1DCtestreference', + 'mandateDate' => '2022-07-03', + 'customer' => [ + 'name' => 'John Smith', + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -128,10 +128,10 @@ public function it_creates_a_credit_management_credit_note() { $response = $this->buckaroo->method('credit_management')->createCreditNote([ 'originalInvoiceNumber' => 'testinvoice1337', - 'invoiceDate' => '2022-01-01', - 'invoiceAmount' => 10.00, - 'invoiceAmountVAT' => 1.00, - 'sendCreditNoteMessage' => 'info@buckaroo.nl' + 'invoiceDate' => '2022-01-01', + 'invoiceAmount' => 10.00, + 'invoiceAmountVAT' => 1.00, + 'sendCreditNoteMessage' => 'info@buckaroo.nl', ]); $this->assertTrue($response->isValidationFailure()); @@ -144,9 +144,9 @@ public function it_creates_a_credit_management_credit_note() public function it_creates_a_credit_management_add_or_update_debtor() { $response = $this->buckaroo->method('credit_management')->addOrUpdateDebtor($this->invoice([ - 'addressUnreachable' => false, - 'emailUnreachable' => false, - 'mobileUnreachable' => false + 'addressUnreachable' => false, + 'emailUnreachable' => false, + 'mobileUnreachable' => false, ])); $this->assertTrue($response->isSuccess()); @@ -159,16 +159,16 @@ public function it_creates_a_credit_management_add_or_update_debtor() public function it_creates_a_credit_management_payment_plan() { $response = $this->buckaroo->method('credit_management')->createPaymentPlan([ - 'description' => 'Payment in two intstallments', - 'includedInvoiceKey' => '20D09973FB5C4DBC9A33DB0F4F707xxx', - 'dossierNumber' => 'PaymentplanJohnsmith123', - 'installmentCount' => 2, - 'initialAmount' => 100, - 'startDate' => '2030-01-01', - 'interval' => CreditManagementInstallmentInterval::MONTH, - 'paymentPlanCostAmount' => 3.50, - 'paymentPlanCostAmountVat' => 1.20, - 'recipientEmail' => 'test@buckaroo.nl' + 'description' => 'Payment in two intstallments', + 'includedInvoiceKey' => '20D09973FB5C4DBC9A33DB0F4F707xxx', + 'dossierNumber' => 'PaymentplanJohnsmith123', + 'installmentCount' => 2, + 'initialAmount' => 100, + 'startDate' => '2030-01-01', + 'interval' => CreditManagementInstallmentInterval::MONTH, + 'paymentPlanCostAmount' => 3.50, + 'paymentPlanCostAmountVat' => 1.20, + 'recipientEmail' => 'test@buckaroo.nl', ]); $this->assertTrue($response->isValidationFailure()); @@ -181,7 +181,7 @@ public function it_creates_a_credit_management_payment_plan() public function it_creates_a_credit_management_terminate_payment_plan() { $response = $this->buckaroo->method('credit_management')->terminatePaymentPlan([ - 'includedInvoiceKey' => '20D09973FB5C4DBC9A33DB0F4F707xxx', + 'includedInvoiceKey' => '20D09973FB5C4DBC9A33DB0F4F707xxx', ]); $this->assertTrue($response->isValidationFailure()); @@ -194,7 +194,7 @@ public function it_creates_a_credit_management_terminate_payment_plan() public function it_creates_a_credit_management_pause_invoice() { $response = $this->buckaroo->method('credit_management')->pauseInvoice([ - 'invoice' => 'Testinvoice184915' + 'invoice' => 'Testinvoice184915', ]); $this->assertTrue($response->isValidationFailure()); @@ -207,7 +207,7 @@ public function it_creates_a_credit_management_pause_invoice() public function it_creates_a_credit_management_unpause_invoice() { $response = $this->buckaroo->method('credit_management')->unpauseInvoice([ - 'invoice' => 'Testinvoice184915' + 'invoice' => 'Testinvoice184915', ]); $this->assertTrue($response->isValidationFailure()); @@ -220,15 +220,15 @@ public function it_creates_a_credit_management_unpause_invoice() public function it_creates_a_credit_management_invoice_info() { $response = $this->buckaroo->method('credit_management')->invoiceInfo([ - 'invoice' => 'INV001', + 'invoice' => 'INV001', 'invoices' => [ // If you want to check multiple invoices [ - 'invoiceNumber' => 'INV002' + 'invoiceNumber' => 'INV002', ], [ - 'invoiceNumber' => 'INV003' + 'invoiceNumber' => 'INV003', ], - ] + ], ]); $this->assertTrue($response->isFailed()); @@ -242,8 +242,8 @@ public function it_creates_a_credit_management_debtor_info() { $response = $this->buckaroo->method('credit_management')->debtorInfo([ 'debtor' => [ - 'code' => 'TestDebtor123123' - ] + 'code' => 'TestDebtor123123', + ], ]); $this->assertTrue($response->isFailed()); @@ -256,29 +256,29 @@ public function it_creates_a_credit_management_debtor_info() public function it_creates_a_credit_management_add_or_update_product_lines() { $response = $this->buckaroo->method('credit_management')->addOrUpdateProductLines([ - 'invoiceKey' => 'xxxxxxxxxxxxxxxxxxxxxxxx', - 'articles' => [ + 'invoiceKey' => 'xxxxxxxxxxxxxxxxxxxxxxxx', + 'articles' => [ [ - 'type' => 'Regular', + 'type' => 'Regular', 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', - 'totalVat' => 12, - 'totalAmount' => 123, + 'totalVat' => 12, + 'totalAmount' => 123, 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ - 'type' => 'Regular', + 'type' => 'Regular', 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', - 'totalVat' => 12, - 'totalAmount' => 123, + 'totalVat' => 12, + 'totalAmount' => 123, 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -291,7 +291,7 @@ public function it_creates_a_credit_management_add_or_update_product_lines() public function it_creates_a_credit_management_resume_debtor_file() { $response = $this->buckaroo->method('credit_management')->resumeDebtorFile([ - 'debtorFileGuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + 'debtorFileGuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', ]); $this->assertTrue($response->isValidationFailure()); @@ -304,7 +304,7 @@ public function it_creates_a_credit_management_resume_debtor_file() public function it_creates_a_credit_management_pause_debtor_file() { $response = $this->buckaroo->method('credit_management')->pauseDebtorFile([ - 'debtorFileGuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + 'debtorFileGuid' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', ]); $this->assertTrue($response->isValidationFailure()); @@ -313,48 +313,47 @@ public function it_creates_a_credit_management_pause_debtor_file() private function invoice(array $append = []): array { return array_merge($append, [ - 'invoice' => rand(1000, 99999999), - 'applyStartRecurrent' => 'False', - 'invoiceAmount' => 10.00, - 'invoiceAmountVAT' => 1.00, - 'invoiceDate' => '2022-01-01', - 'dueDate' => '2030-01-01', - 'schemeKey' => '2amq34', - 'maxStepIndex' => 1, - 'allowedServices' => 'ideal,mastercard', - 'debtor' => [ - 'code' => 'johnsmith4' + 'invoice' => rand(1000, 99999999), + 'applyStartRecurrent' => 'False', + 'invoiceAmount' => 10.00, + 'invoiceAmountVAT' => 1.00, + 'invoiceDate' => '2022-01-01', + 'dueDate' => '2030-01-01', + 'schemeKey' => '2amq34', + 'maxStepIndex' => 1, + 'allowedServices' => 'ideal,mastercard', + 'debtor' => [ + 'code' => 'johnsmith4', ], - 'email' => 'youremail@example.nl', - 'phone' => [ - 'mobile' => '06198765432' + 'email' => 'youremail@example.nl', + 'phone' => [ + 'mobile' => '06198765432', ], - 'person' => [ - 'culture' => 'nl-NL', - 'title' => 'Msc', - 'initials' => 'JS', + 'person' => [ + 'culture' => 'nl-NL', + 'title' => 'Msc', + 'initials' => 'JS', 'firstName' => 'Test', 'lastNamePrefix' => 'Jones', 'lastName' => 'Aflever', - 'gender' => Gender::MALE + 'gender' => Gender::MALE, ], - 'company' => [ - 'culture' => 'nl-NL', - 'name' => 'My Company Corporation', + 'company' => [ + 'culture' => 'nl-NL', + 'name' => 'My Company Corporation', 'vatApplicable' => true, - 'vatNumber' => 'NL140619562B01', - 'chamberOfCommerce' => '20091741' + 'vatNumber' => 'NL140619562B01', + 'chamberOfCommerce' => '20091741', ], - 'address' => [ - 'street' => 'Hoofdtraat', - 'houseNumber' => '90', + 'address' => [ + 'street' => 'Hoofdtraat', + 'houseNumber' => '90', 'houseNumberSuffix' => 'A', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'country' => 'NL' - ] + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'country' => 'NL', + ], ]); } - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/CreditcardTest.php b/src/Tests/Payments/CreditcardTest.php index f7bfaadc..b3a55602 100644 --- a/src/Tests/Payments/CreditcardTest.php +++ b/src/Tests/Payments/CreditcardTest.php @@ -31,9 +31,9 @@ class CreditcardTest extends BuckarooTestCase public function it_creates_a_creditcard_payment() { $response = $this->buckaroo->method('creditcard')->pay([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'name' => 'visa' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'visa', ]); $this->assertTrue($response->isWaitingOnUserInput()); @@ -46,10 +46,10 @@ public function it_creates_a_creditcard_payment() public function it_creates_a_creditcard_encrypted_payment() { $response = $this->buckaroo->method('creditcard')->payEncrypted([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'name' => 'mastercard', - 'encryptedCardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'mastercard', + 'encryptedCardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); $this->assertTrue($response->isValidationFailure()); @@ -62,11 +62,11 @@ public function it_creates_a_creditcard_encrypted_payment() public function it_creates_a_creditcard_security_code_payment() { $response = $this->buckaroo->method('creditcard')->payWithSecurityCode([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'encryptedSecurityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'encryptedSecurityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); $this->assertTrue($response->isValidationFailure()); @@ -79,10 +79,10 @@ public function it_creates_a_creditcard_security_code_payment() public function it_creates_a_creditcard_refund() { $response = $this->buckaroo->method('creditcard')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '13FAF43579D94F5FB8119A6819XXXXXX', - 'name' => 'mastercard' + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '13FAF43579D94F5FB8119A6819XXXXXX', + 'name' => 'mastercard', ]); $this->assertTrue($response->isFailed()); @@ -95,9 +95,9 @@ public function it_creates_a_creditcard_refund() public function it_creates_a_creditcard_authorize() { $response = $this->buckaroo->method('creditcard')->authorize([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'name' => 'mastercard' + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'name' => 'mastercard', ]); $this->assertTrue($response->isWaitingOnUserInput()); @@ -110,10 +110,10 @@ public function it_creates_a_creditcard_authorize() public function it_creates_a_creditcard_encrypted_authorize() { $response = $this->buckaroo->method('creditcard')->authorizeEncrypted([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'name' => 'mastercard', - 'encryptedCardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'mastercard', + 'encryptedCardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); $this->assertTrue($response->isValidationFailure()); @@ -126,11 +126,11 @@ public function it_creates_a_creditcard_encrypted_authorize() public function it_creates_a_creditcard_security_code_authorize() { $response = $this->buckaroo->method('creditcard')->authorizeWithSecurityCode([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard', - 'encryptedSecurityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'encryptedSecurityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', ]); $this->assertTrue($response->isValidationFailure()); @@ -143,10 +143,10 @@ public function it_creates_a_creditcard_security_code_authorize() public function it_creates_a_creditcard_capture() { $response = $this->buckaroo->method('creditcard')->capture([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', ]); $this->assertTrue($response->isFailed()); @@ -159,10 +159,10 @@ public function it_creates_a_creditcard_capture() public function it_creates_a_creditcard_pay_recurrent() { $response = $this->buckaroo->method('creditcard')->payRecurrent([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', - 'name' => 'mastercard' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', ]); $this->assertTrue($response->isSuccess()); @@ -175,12 +175,12 @@ public function it_creates_a_creditcard_pay_recurrent() public function it_creates_a_creditcard_cancel_authorize() { $response = $this->buckaroo->method('creditcard')->cancelAuthorize([ - 'name' => 'mastercard', - 'amountCredit' => 10, - 'originalTransactionKey' => 'F86579ECED1D493887ECAE7C287BXXXX', - 'invoice' => 'testinvoice12345cvx' + 'name' => 'mastercard', + 'amountCredit' => 10, + 'originalTransactionKey' => 'F86579ECED1D493887ECAE7C287BXXXX', + 'invoice' => 'testinvoice12345cvx', ]); $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/EPSTest.php b/src/Tests/Payments/EPSTest.php index 780659ef..fa529f35 100644 --- a/src/Tests/Payments/EPSTest.php +++ b/src/Tests/Payments/EPSTest.php @@ -32,7 +32,7 @@ public function it_creates_a_eps_payment() { $response = $this->buckaroo->method('eps')->pay([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); $this->assertTrue($response->isSuccess()); @@ -44,12 +44,12 @@ public function it_creates_a_eps_payment() public function it_creates_a_eps_refund() { $response = $this->buckaroo->method('eps')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'description' => 'refund', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/EmandatesTest.php b/src/Tests/Payments/EmandatesTest.php index 74763aa0..5805d387 100644 --- a/src/Tests/Payments/EmandatesTest.php +++ b/src/Tests/Payments/EmandatesTest.php @@ -42,13 +42,13 @@ public function it_get_emandates_issuer_list() public function it_creates_mandante_on_emandates() { $response = $this->buckaroo->method('emandates')->createMandate([ - 'emandatereason' => 'testing', - 'sequencetype' => '1', - 'purchaseid' => 'purchaseid1234', - 'debtorbankid' => 'INGBNL2A', - 'debtorreference' => 'klant1234', - 'language' => 'nl', - 'mandateid' => '1DC1234567890' + 'emandatereason' => 'testing', + 'sequencetype' => '1', + 'purchaseid' => 'purchaseid1234', + 'debtorbankid' => 'INGBNL2A', + 'debtorreference' => 'klant1234', + 'language' => 'nl', + 'mandateid' => '1DC1234567890', ]); $this->assertTrue($response->isPendingProcessing()); @@ -61,7 +61,7 @@ public function it_creates_mandante_on_emandates() public function it_get_status_from_emandates() { $response = $this->buckaroo->method('emandates')->status([ - 'mandateid' => '1DC1234567890' + 'mandateid' => '1DC1234567890', ]); $this->assertTrue($response->isPendingProcessing()); @@ -74,8 +74,8 @@ public function it_get_status_from_emandates() public function it_modifies_mandante_on_emandates() { $response = $this->buckaroo->method('emandates')->modifyMandate([ - 'originalMandateId' => '1DC1234567890', - 'debtorbankid' => 'ABNANL2A', + 'originalMandateId' => '1DC1234567890', + 'debtorbankid' => 'ABNANL2A', ]); $this->assertTrue($response->isFailed()); @@ -88,11 +88,11 @@ public function it_modifies_mandante_on_emandates() public function it_cancels_mandante_on_emandates() { $response = $this->buckaroo->method('emandates')->cancelMandate([ - 'mandateid' => '1DC1234567890', - 'emandatereason' => 'testing cancel', - 'purchaseid' => 'purchaseid1234', + 'mandateid' => '1DC1234567890', + 'emandatereason' => 'testing cancel', + 'purchaseid' => 'purchaseid1234', ]); $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/GiftcardsTest.php b/src/Tests/Payments/GiftcardsTest.php index 729cf7d4..7e5fdf96 100644 --- a/src/Tests/Payments/GiftcardsTest.php +++ b/src/Tests/Payments/GiftcardsTest.php @@ -30,11 +30,11 @@ class GiftcardsTest extends BuckarooTestCase public function it_creates_a_giftcards_payment() { $response = $this->buckaroo->method('giftcard')->pay([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'name' => 'boekenbon', - 'intersolveCardnumber' => '0000000000000000001', - 'intersolvePIN' => '1000' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'boekenbon', + 'intersolveCardnumber' => '0000000000000000001', + 'intersolvePIN' => '1000', ]); $this->assertTrue($response->isSuccess()); @@ -46,20 +46,20 @@ public function it_creates_a_giftcards_payment() public function it_creates_a_giftcards_partial_payment() { $giftCardResponse = $this->buckaroo->method('giftcard')->pay([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'name' => 'boekenbon', - 'intersolveCardnumber' => '0000000000000000001', - 'intersolvePIN' => '500' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'boekenbon', + 'intersolveCardnumber' => '0000000000000000001', + 'intersolvePIN' => '500', ]); $this->assertTrue($giftCardResponse->isSuccess()); $response = $this->buckaroo->method('ideal')->payRemainder([ - 'originalTransactionKey' => $giftCardResponse->data('RelatedTransactions')[0]['RelatedTransactionKey'], - 'invoice' => $giftCardResponse->data('Invoice'), - 'amountDebit' => 10.10, - 'issuer' => 'ABNANL2A' + 'originalTransactionKey' => $giftCardResponse->data('RelatedTransactions')[0]['RelatedTransactionKey'], + 'invoice' => $giftCardResponse->data('Invoice'), + 'amountDebit' => 10.10, + 'issuer' => 'ABNANL2A', ]); $this->assertTrue($response->isPendingProcessing()); @@ -71,12 +71,12 @@ public function it_creates_a_giftcards_partial_payment() public function it_creates_a_giftcards_refund() { $response = $this->buckaroo->method('giftcard')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', - 'name' => 'boekenbon' + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + 'name' => 'boekenbon', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/GiropayTest.php b/src/Tests/Payments/GiropayTest.php index a802196b..61ca6a88 100644 --- a/src/Tests/Payments/GiropayTest.php +++ b/src/Tests/Payments/GiropayTest.php @@ -32,8 +32,8 @@ public function it_creates_a_giropay_payment() { $response = $this->buckaroo->method('giropay')->pay([ 'invoice' => uniqid(), - 'bic' => 'GENODETT488', - 'amountDebit' => 10.10 + 'bic' => 'GENODETT488', + 'amountDebit' => 10.10, ]); $this->assertTrue($response->isPendingProcessing()); @@ -46,12 +46,12 @@ public function it_creates_a_giropay_payment() public function it_creates_a_giropay_refund() { $response = $this->buckaroo->method('giropay')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'description' => 'refund', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/IdealQRTest.php b/src/Tests/Payments/IdealQRTest.php index c3b2ee12..acf8e4d8 100644 --- a/src/Tests/Payments/IdealQRTest.php +++ b/src/Tests/Payments/IdealQRTest.php @@ -30,18 +30,18 @@ class IdealQRTest extends BuckarooTestCase public function it_creates_a_ideal_qr() { $response = $this->buckaroo->method('ideal_qr')->generate([ - 'description' => 'Test purchase', - 'minAmount' => '0.10', - 'maxAmount' => '10.0', - 'imageSize' => '2000', - 'purchaseId' => 'Testpurchase123', - 'isOneOff' => false, - 'amount' => '1.00', - 'amountIsChangeable' => true, - 'expiration' => '2030-09-30', - 'isProcessing' => false + 'description' => 'Test purchase', + 'minAmount' => '0.10', + 'maxAmount' => '10.0', + 'imageSize' => '2000', + 'purchaseId' => 'Testpurchase123', + 'isOneOff' => false, + 'amount' => '1.00', + 'amountIsChangeable' => true, + 'expiration' => '2030-09-30', + 'isProcessing' => false, ]); $this->assertTrue($response->isSuccess()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/IdealTest.php b/src/Tests/Payments/IdealTest.php index 394bf2f9..43637a2d 100644 --- a/src/Tests/Payments/IdealTest.php +++ b/src/Tests/Payments/IdealTest.php @@ -42,30 +42,30 @@ protected function setUp(): void 'invoice' => uniqid(), 'amountDebit' => 10.10, 'issuer' => 'ABNANL2A', - 'pushURL' => 'https://buckaroo.nextto.dev/push', + 'pushURL' => 'https://buckaroo.nextto.dev/push', 'returnURL' => 'https://buckaroo.nextto.dev/return', 'clientIP' => [ - 'address' => '123.456.789.123', - 'type' => 0 + 'address' => '123.456.789.123', + 'type' => 0, + ], + 'additionalParameters' => [ + 'initiated_by_magento' => 1, + 'service_action' => 'something', ], - 'additionalParameters' => [ - 'initiated_by_magento' => 1, - 'service_action' => 'something' - ] ]); $this->refundPayload = [ - 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund + 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', //Set transaction key of the transaction to refund 'amountCredit' => 1.23, 'clientIP' => [ - 'address' => '123.456.789.123', - 'type' => 0 + 'address' => '123.456.789.123', + 'type' => 0, + ], + 'additionalParameters' => [ + 'initiated_by_magento' => '1', + 'service_action' => 'something', ], - 'additionalParameters' => [ - 'initiated_by_magento' => '1', - 'service_action' => 'something' - ] ]; } @@ -95,4 +95,4 @@ public function it_creates_a_ideal_refund() $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/In3Test.php b/src/Tests/Payments/In3Test.php index ecb7b0a9..9d1ba572 100644 --- a/src/Tests/Payments/In3Test.php +++ b/src/Tests/Payments/In3Test.php @@ -56,7 +56,7 @@ public function it_creates_a_afterpaydigiaccept_refund() $response = $this->buckaroo->method('in3')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); $this->assertTrue($response->isFailed()); @@ -65,59 +65,59 @@ public function it_creates_a_afterpaydigiaccept_refund() private function getPaymentPayload(): array { return [ - 'amountDebit' => 9.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'invoiceDate' => '22-01-2018', - 'customerType' => 'Company', - 'email' => 'test@buckaroo.nl', - 'phone' => [ - 'mobile' => '0612345678' + 'amountDebit' => 9.5, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'description' => 'This is a test order', + 'invoiceDate' => '22-01-2018', + 'customerType' => 'Company', + 'email' => 'test@buckaroo.nl', + 'phone' => [ + 'mobile' => '0612345678', ], - 'articles' => [ + 'articles' => [ [ - 'identifier' => uniqid(), - 'description' => 'Blue Toy Car', - 'quantity' => '1', - 'price' => 10.00 - ] + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'quantity' => '1', + 'price' => 10.00, + ], ], - 'company' => [ - 'companyName' => 'My Company B.V.', - 'chamberOfCommerce' => '123456' + 'company' => [ + 'companyName' => 'My Company B.V.', + 'chamberOfCommerce' => '123456', ], - 'customer' => [ - 'gender' => Gender::FEMALE, - 'initials' => 'J.S.', - 'lastName' => 'Aflever', - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => '0610000000', - 'culture' => 'nl-NL', - 'birthDate' => '1990-01-01', + 'customer' => [ + 'gender' => Gender::FEMALE, + 'initials' => 'J.S.', + 'lastName' => 'Aflever', + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => '0610000000', + 'culture' => 'nl-NL', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '2', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '2', 'houseNumberAdditional' => 'a', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'subtotals' => [ + 'subtotals' => [ [ - 'name' => 'Korting', - 'value' => -2.00 + 'name' => 'Korting', + 'value' => -2.00, ], [ - 'name' => 'Betaaltoeslag', - 'value' => 0.50 + 'name' => 'Betaaltoeslag', + 'value' => 0.50, ], [ - 'name' => 'Verzendkosten', - 'value' => 1.00 - ] - ] + 'name' => 'Verzendkosten', + 'value' => 1.00, + ], + ], ]; } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/KBCTest.php b/src/Tests/Payments/KBCTest.php index 32863c8b..9732deb3 100644 --- a/src/Tests/Payments/KBCTest.php +++ b/src/Tests/Payments/KBCTest.php @@ -28,7 +28,7 @@ protected function setUp(): void { $this->paymentPayload = ([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); } @@ -41,5 +41,4 @@ public function it_creates_a_kbc_payment() $response = $this->buckaroo->method('kbcpaymentbutton')->pay($this->paymentPayload); $this->assertTrue($response->isPendingProcessing()); } - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/KlarnaKPTest.php b/src/Tests/Payments/KlarnaKPTest.php index 3b877c22..249be58a 100644 --- a/src/Tests/Payments/KlarnaKPTest.php +++ b/src/Tests/Payments/KlarnaKPTest.php @@ -20,7 +20,6 @@ namespace Buckaroo\Tests\Payments; -use Buckaroo\Resources\Constants\Gender; use Buckaroo\Tests\BuckarooTestCase; class KlarnaKPTest extends BuckarooTestCase @@ -32,22 +31,22 @@ class KlarnaKPTest extends BuckarooTestCase public function it_creates_a_klarnakp_payment() { $response = $this->buckaroo->method('klarnakp')->pay([ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), 'reservationNumber' => '2377577452', 'serviceParameters' => [ - 'articles' => [ + 'articles' => [ [ 'identifier' => uniqid(), - 'quantity' => '2' + 'quantity' => '2', ], [ 'identifier' => uniqid(), - 'quantity' => '2' + 'quantity' => '2', ], - ] - ] + ], + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -60,57 +59,57 @@ public function it_creates_a_klarnakp_payment() public function it_creates_a_klarnakp_reserve() { $response = $this->buckaroo->method('klarnakp')->reserve([ - 'invoice' => uniqid(), - 'gender' => "1", - 'operatingCountry' => 'NL', - 'pno' => '01011990', - 'billing' => [ - 'recipient' => [ - 'firstName' => 'John', - 'lastName' => 'Do' + 'invoice' => uniqid(), + 'gender' => "1", + 'operatingCountry' => 'NL', + 'pno' => '01011990', + 'billing' => [ + 'recipient' => [ + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Neherkade', - 'houseNumber' => '1', - 'zipcode' => '2521VA', - 'city' => 'Gravenhage', - 'country' => 'NL' + 'address' => [ + 'street' => 'Neherkade', + 'houseNumber' => '1', + 'zipcode' => '2521VA', + 'city' => 'Gravenhage', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0612345678', + 'phone' => [ + 'mobile' => '0612345678', ], - 'email' => 'youremail@example.nl' + 'email' => 'youremail@example.nl', ], - 'shipping' => [ - 'recipient' => [ - 'firstName' => 'John', - 'lastName' => 'Do' + 'shipping' => [ + 'recipient' => [ + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Rosenburglaan', - 'houseNumber' => '216', - 'zipcode' => '4385 JM', - 'city' => 'Vlissingen', - 'country' => 'NL' + 'address' => [ + 'street' => 'Rosenburglaan', + 'houseNumber' => '216', + 'zipcode' => '4385 JM', + 'city' => 'Vlissingen', + 'country' => 'NL', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' - ] - ] + 'price' => '10.10', + ], + ], ]); $this->assertTrue($response->isPendingProcessing()); @@ -136,59 +135,59 @@ public function it_creates_a_klarnakp_cancel_reservation() public function it_creates_a_klarnakp_update_reservation() { $response = $this->buckaroo->method('klarnakp')->updateReserve([ - 'invoice' => 'testinvoice 1234', - 'billing' => [ - 'recipient' => [ - 'careOf' => 'Person', - 'firstName' => 'John', - 'lastName' => 'Do' + 'invoice' => 'testinvoice 1234', + 'billing' => [ + 'recipient' => [ + 'careOf' => 'Person', + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'GB' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'GB', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landLine' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landLine' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'careOf' => 'Company', - 'firstName' => 'John', - 'lastName' => 'Do' + 'shipping' => [ + 'recipient' => [ + 'careOf' => 'Company', + 'firstName' => 'John', + 'lastName' => 'Do', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'GB' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'GB', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' - ] - ] + 'price' => '10.10', + ], + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -203,9 +202,9 @@ public function it_creates_a_klarnakp_refund() $response = $this->buckaroo->method('klarnakp')->refund([ 'amountCredit' => 10, 'invoice' => '10000480', - 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX' + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', ]); $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/KlarnaTest.php b/src/Tests/Payments/KlarnaTest.php index 5efc91bb..dcbd16f2 100644 --- a/src/Tests/Payments/KlarnaTest.php +++ b/src/Tests/Payments/KlarnaTest.php @@ -20,7 +20,6 @@ namespace Buckaroo\Tests\Payments; -use Buckaroo\Resources\Constants\Gender; use Buckaroo\Tests\BuckarooTestCase; class KlarnaTest extends BuckarooTestCase @@ -47,132 +46,134 @@ public function it_creates_a_klarna_payment_installment() $this->assertTrue($response->isPendingProcessing()); } - private function getPaymentPayload(): array { + private function getPaymentPayload(): array + { return [ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'billing' => [ - 'recipient' => [ - 'category' => 'B2C', - 'gender' => 'female', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'billing' => [ + 'recipient' => [ + 'category' => 'B2C', + 'gender' => 'female', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2B', - 'gender' => 'male', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'NL' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]; } - private function getPaymentInstallmentPayload(): array { + private function getPaymentInstallmentPayload(): array + { return [ - 'amountDebit' => 50.30, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'currency' => 'GBP', - 'billing' => [ - 'recipient' => [ - 'category' => 'B2C', - 'gender' => 'female', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'amountDebit' => 50.30, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'currency' => 'GBP', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2C', + 'gender' => 'female', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'GB' + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'GB', ], - 'phone' => [ - 'mobile' => '0698765433', - 'landline' => '0109876543' + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'shipping' => [ - 'recipient' => [ - 'category' => 'B2B', - 'gender' => 'male', - 'firstName' => 'John', - 'lastName' => 'Do', - 'birthDate' => '1990-01-01' + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', ], - 'address' => [ - 'street' => 'Kalverstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'b', - 'zipcode' => '4321EB', - 'city' => 'Amsterdam', - 'country' => 'GB' + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'GB', ], - 'email' => 'test@buckaroo.nl' + 'email' => 'test@buckaroo.nl', ], - 'articles' => [ + 'articles' => [ [ 'identifier' => 'Articlenumber1', 'description' => 'Blue Toy Car', 'vatPercentage' => '21', 'quantity' => '2', - 'price' => '20.10' + 'price' => '20.10', ], [ 'identifier' => 'Articlenumber2', 'description' => 'Red Toy Car', 'vatPercentage' => '21', 'quantity' => '1', - 'price' => '10.10' + 'price' => '10.10', ], - ] + ], ]; } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/MarketplacesTest.php b/src/Tests/Payments/MarketplacesTest.php index 33c2d1fa..3e13e900 100644 --- a/src/Tests/Payments/MarketplacesTest.php +++ b/src/Tests/Payments/MarketplacesTest.php @@ -31,28 +31,28 @@ public function it_creates_marketplaces_split() { $marketplace = $this->buckaroo->method('marketplaces')->manually()->split([ 'daysUntilTransfer' => 2, - 'marketplace' => [ - 'amount' => 10, - 'description' => 'INV0001 Commission Marketplace' + 'marketplace' => [ + 'amount' => 10, + 'description' => 'INV0001 Commission Marketplace', ], - 'sellers' => [ + 'sellers' => [ [ - 'accountId' => '789C60F316D24B088ACD471', - 'amount' => 50, - 'description' => 'INV001 Payout Make-Up Products BV' + 'accountId' => '789C60F316D24B088ACD471', + 'amount' => 50, + 'description' => 'INV001 Payout Make-Up Products BV', ], [ - 'accountId' => '369C60F316D24B088ACD238', - 'amount' => 35, - 'description' => 'INV0001 Payout Beauty Products BV' - ] - ] + 'accountId' => '369C60F316D24B088ACD238', + 'amount' => 35, + 'description' => 'INV0001 Payout Beauty Products BV', + ], + ], ]); $response = $this->buckaroo->method('ideal')->combine($marketplace)->pay([ - 'invoice' => uniqid(), + 'invoice' => uniqid(), 'amountDebit' => 95.00, - 'issuer' => 'ABNANL2A' + 'issuer' => 'ABNANL2A', ]); $this->assertTrue($response->isValidationFailure()); @@ -64,18 +64,18 @@ public function it_creates_marketplaces_split() public function it_creates_marketplaces_transfer() { $response = $this->buckaroo->method('marketplaces')->transfer([ - 'originalTransactionKey' => 'D3732474ED0', - 'marketplace' => [ - 'amount' => 10, - 'description' => 'INV0001 Commission Marketplace' + 'originalTransactionKey' => 'D3732474ED0', + 'marketplace' => [ + 'amount' => 10, + 'description' => 'INV0001 Commission Marketplace', ], - 'sellers' => [ + 'sellers' => [ [ - 'accountId' => '789C60F316D24B088ACD471', - 'amount' => 50, - 'description' => 'INV001 Payout Make-Up Products BV' - ] - ] + 'accountId' => '789C60F316D24B088ACD471', + 'amount' => 50, + 'description' => 'INV001 Payout Make-Up Products BV', + ], + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -87,21 +87,21 @@ public function it_creates_marketplaces_transfer() public function it_creates_marketplaces_refund() { $marketplace = $this->buckaroo->method('marketplaces')->manually()->refundSupplementary([ - 'sellers' => [ + 'sellers' => [ [ - 'accountId' => '789C60F316D24B088ACD471', + 'accountId' => '789C60F316D24B088ACD471', // 'amount' => 30, - 'description' => 'INV001 Payout Make-Up Products BV' - ] - ] + 'description' => 'INV001 Payout Make-Up Products BV', + ], + ], ]); $response = $this->buckaroo->method('ideal')->combine($marketplace)->refund([ - 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund + 'invoice' => 'testinvoice 123', //Set invoice number of the transaction to refund 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', //Set transaction key of the transaction to refund - 'amountCredit' => 30 + 'amountCredit' => 30, ]); $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/PayPerEmailTest.php b/src/Tests/Payments/PayPerEmailTest.php index 2c8bc01d..5bea74ef 100644 --- a/src/Tests/Payments/PayPerEmailTest.php +++ b/src/Tests/Payments/PayPerEmailTest.php @@ -32,18 +32,18 @@ class PayPerEmailTest extends BuckarooTestCase public function it_invites_pay_per_email() { $response = $this->buckaroo->method('payperemail')->paymentInvitation([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'merchantSendsEmail' => false, - 'email' => 'johnsmith@gmail.com', - 'expirationDate' => '2030-01-01', + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'merchantSendsEmail' => false, + 'email' => 'johnsmith@gmail.com', + 'expirationDate' => '2030-01-01', 'paymentMethodsAllowed' => 'ideal,mastercard,paypal', - 'attachment' => '', - 'customer' => [ - 'gender' => Gender::FEMALE, - 'firstName' => 'John', - 'lastName' => 'Smith' - ] + 'attachment' => '', + 'customer' => [ + 'gender' => Gender::FEMALE, + 'firstName' => 'John', + 'lastName' => 'Smith', + ], ]); $this->assertTrue($response->isAwaitingConsumer()); @@ -56,25 +56,24 @@ public function it_invites_pay_per_email() public function it_invites_pay_per_email_with_attachments() { $response = $this->buckaroo->method('payperemail')->paymentInvitation([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'merchantSendsEmail' => false, - 'email' => 'johnsmith@gmail.com', - 'expirationDate' => '2030-01-01', + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'merchantSendsEmail' => false, + 'email' => 'johnsmith@gmail.com', + 'expirationDate' => '2030-01-01', 'paymentMethodsAllowed' => 'ideal,mastercard,paypal', - 'attachment' => '', - 'customer' => [ - 'gender' => Gender::FEMALE, - 'firstName' => 'John', - 'lastName' => 'Smith' + 'attachment' => '', + 'customer' => [ + 'gender' => Gender::FEMALE, + 'firstName' => 'John', + 'lastName' => 'Smith', + ], + 'attachments' => [ + ['name' => 'bijlage1.pdf'], + ['name' => 'bijlage2.pdf'], ], - 'attachments' => [ - ['name' => 'bijlage1.pdf'], - ['name' => 'bijlage2.pdf'] - ] ]); $this->assertTrue($response->isFailed()); - } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/PayconiqTest.php b/src/Tests/Payments/PayconiqTest.php index d43d92d1..7a0705b4 100644 --- a/src/Tests/Payments/PayconiqTest.php +++ b/src/Tests/Payments/PayconiqTest.php @@ -32,7 +32,7 @@ public function it_creates_a_payconiq_payment() $response = $this->buckaroo->method('payconiq')->pay([ 'amountDebit' => 10, 'description' => 'Payment for testinvoice123', - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); $this->assertTrue($response->isFailed()); @@ -45,10 +45,10 @@ public function it_creates_a_payconiq_refund() { $response = $this->buckaroo->method('payconiq')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/PaypalTest.php b/src/Tests/Payments/PaypalTest.php index eeba76cc..bc3c522d 100644 --- a/src/Tests/Payments/PaypalTest.php +++ b/src/Tests/Payments/PaypalTest.php @@ -32,7 +32,7 @@ public function it_creates_a_paypal_payment() { $response = $this->buckaroo->method('paypal')->pay([ 'amountDebit' => 10, - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); $this->assertTrue($response->isPendingProcessing()); @@ -46,7 +46,7 @@ public function it_creates_a_paypal_recurrent_payment() $response = $this->buckaroo->method('paypal')->payRecurrent([ 'amountDebit' => 10, 'originalTransactionKey' => 'C32C0B52E1FE4A37835FFB1716XXXXXX', - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); $this->assertTrue($response->isFailed()); @@ -60,20 +60,20 @@ public function it_creates_a_paypal_extra_info() $response = $this->buckaroo->method('paypal')->extraInfo([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'customer' => [ - 'name' => 'John Smith' + 'customer' => [ + 'name' => 'John Smith', ], - 'address' => [ - 'street' => 'Hoofstraat 90', - 'street2' => 'Street 2', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'zipcode' => '8441AB', - 'country' => 'NL' + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' - ] ]); $this->assertTrue($response->isPendingProcessing()); @@ -86,8 +86,8 @@ public function it_creates_a_paypal_refund() { $response = $this->buckaroo->method('paypal')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); @@ -99,64 +99,62 @@ public function it_creates_a_paypal_refund() public function it_creates_a_combined_subscriptions_with_paypal_and_extra_info() { $subscriptions = $this->buckaroo->method('subscriptions')->manually()->createCombined([ - 'includeTransaction' => false, - 'transactionVatPercentage' => 5, - 'configurationCode' => 'xxxxx', - 'email' => 'test@buckaroo.nl', - 'rate_plans' => [ - 'add' => [ - 'startDate' => '2022-01-01', - 'ratePlanCode' => 'xxxxxx', - ] + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'xxxxx', + 'email' => 'test@buckaroo.nl', + 'rate_plans' => [ + 'add' => [ + 'startDate' => '2022-01-01', + 'ratePlanCode' => 'xxxxxx', + ], + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' + 'debtor' => [ + 'code' => 'xxxxxx', ], - 'debtor' => [ - 'code' => 'xxxxxx' + 'person' => [ + 'firstName' => 'John', + 'lastName' => 'Do', + 'gender' => Gender::FEMALE, + 'culture' => 'nl-NL', + 'birthDate' => '1990-01-01', ], - 'person' => [ - 'firstName' => 'John', - 'lastName' => 'Do', - 'gender' => Gender::FEMALE, - 'culture' => 'nl-NL', - 'birthDate' => '1990-01-01' + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '90', + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '90', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'country' => 'NL' - ] ]); $paypal_extra_info = $this->buckaroo->method('paypal')->manually()->extraInfo([ 'amountDebit' => 10, 'invoice' => uniqid(), - 'customer' => [ - 'name' => 'John Smith' + 'customer' => [ + 'name' => 'John Smith', ], - 'address' => [ - 'street' => 'Hoofstraat 90', - 'street2' => 'Street 2', - 'city' => 'Heerenveen', - 'state' => 'Friesland', - 'zipcode' => '8441AB', - 'country' => 'NL' + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' - ] ]); $response = $this->buckaroo->method('paypal')->combine([$subscriptions, $paypal_extra_info])->pay([ 'amountDebit' => 10, - 'invoice' => uniqid() + 'invoice' => uniqid(), ]); $this->assertTrue($response->isValidationFailure()); - } - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/PosTest.php b/src/Tests/Payments/PosTest.php index 2a7990ce..542e83b4 100644 --- a/src/Tests/Payments/PosTest.php +++ b/src/Tests/Payments/PosTest.php @@ -37,6 +37,5 @@ public function it_creates_a_pos_payment() ]); $this->assertTrue($response->isSuccess()); - } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/Przelewy24Test.php b/src/Tests/Payments/Przelewy24Test.php index a4dd6a26..246fa88d 100644 --- a/src/Tests/Payments/Przelewy24Test.php +++ b/src/Tests/Payments/Przelewy24Test.php @@ -30,13 +30,13 @@ class Przelewy24Test extends BuckarooTestCase public function it_creates_przelewy24_payment() { $response = $this->buckaroo->method("przelewy24")->pay([ - 'amountDebit' => 3.5, - 'invoice' => uniqid(), - 'email' => 'test@test.nl', - 'customer' => [ - 'firstName' => 'John', - 'lastName' => 'Smith' - ] + 'amountDebit' => 3.5, + 'invoice' => uniqid(), + 'email' => 'test@test.nl', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Smith', + ], ]); $this->assertTrue($response->isPendingProcessing()); @@ -49,10 +49,10 @@ public function it_creates_a_przelewy24_refund() { $response = $this->buckaroo->method('przelewy24')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/PushTest.php b/src/Tests/Payments/PushTest.php index 35b96981..82fb5b52 100644 --- a/src/Tests/Payments/PushTest.php +++ b/src/Tests/Payments/PushTest.php @@ -42,7 +42,7 @@ public function it_test_the_push_response() $auth_header = 'IBjihN7Fhp:0YvyjYAzDQ28W+hQi80f2nhe0Z1QFJLbz7IH//6LsAU=:cad1832100784f57a6e6de835d9f3638:1658227572'; $post_data = '{"Transaction":{"Key":"5340604668D74435AA344E1428ED1292","Invoice":"62d68b6c8ab0c","ServiceCode":"ideal","Status":{"Code":{"Code":190,"Description":"Success"},"SubCode":{"Code":"S001","Description":"Transaction successfully processed"},"DateTime":"2022-07-19T12:46:12"},"IsTest":true,"Order":"ORDER_NO_62d68b6ca2df3","Currency":"EUR","AmountDebit":10.1,"TransactionType":"C021","Services":[{"Name":"ideal","Action":null,"Parameters":[{"Name":"consumerIssuer","Value":"ABN AMRO"},{"Name":"transactionId","Value":"0000000000000001"},{"Name":"consumerName","Value":"J. de Tèster"},{"Name":"consumerIBAN","Value":"NL44RABO0123456789"},{"Name":"consumerBIC","Value":"RABONL2U"}],"VersionAsProperty":2}],"CustomParameters":null,"AdditionalParameters":{"List":[{"Name":"initiated_by_magento","Value":"1"},{"Name":"service_action","Value":"something"}]},"MutationType":1,"RelatedTransactions":null,"IsCancelable":false,"IssuingCountry":null,"StartRecurrent":false,"Recurring":false,"CustomerName":"J. de Tèster","PayerHash":"2d26d34584a4eafeeaa97eed10cfdae22ae64cdce1649a80a55fafca8850e3e22cb32eb7c8fc95ef0c6f96669a21651d4734cc568816f9bd59c2092911e6c0da","PaymentKey":"AEC974D455FF4A4B9B4C21E437A04838","Description":null}}'; - $uri = 'https://buckaroo.nextto.dev/push'; + $uri = 'https://buckaroo.nextto.dev/push'; $post_data = [ "brq_amount" => "10.10", @@ -101,4 +101,3 @@ public function it_test_the_push_response() $this->assertTrue($reply_handler->isValid()); } } - diff --git a/src/Tests/Payments/RequestToPayTest.php b/src/Tests/Payments/RequestToPayTest.php index 71cf7381..96c0942d 100644 --- a/src/Tests/Payments/RequestToPayTest.php +++ b/src/Tests/Payments/RequestToPayTest.php @@ -47,10 +47,10 @@ public function it_creates_a_request_to_pay_refund() { $response = $this->buckaroo->method('requesttopay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/SepaTest.php b/src/Tests/Payments/SepaTest.php index c2807236..7e069750 100644 --- a/src/Tests/Payments/SepaTest.php +++ b/src/Tests/Payments/SepaTest.php @@ -11,14 +11,14 @@ protected function setUp(): void $this->paymentPayload = ([ 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'iban' => 'NL13TEST0123456789', - 'bic' => 'TESTNL2A', - 'collectdate' => '2022-12-01', - 'mandateReference' => '1DCtestreference', - 'mandateDate' => '2022-07-03', - 'customer' => [ - 'name' => 'John Smith' - ] + 'iban' => 'NL13TEST0123456789', + 'bic' => 'TESTNL2A', + 'collectdate' => '2022-12-01', + 'mandateReference' => '1DCtestreference', + 'mandateDate' => '2022-07-03', + 'customer' => [ + 'name' => 'John Smith', + ], ]); } @@ -41,8 +41,8 @@ public function it_creates_a_sepa_refund() { $response = $this->buckaroo->method('sepadirectdebit')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '3D175524FCF94C94A23B67E8DCXXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '3D175524FCF94C94A23B67E8DCXXXXXX', ]); $this->assertTrue($response->isValidationFailure()); @@ -66,10 +66,10 @@ public function it_creates_a_sepa_authorize() public function it_creates_a_sepa_recurrent_payment() { $response = $this->buckaroo->method('sepadirectdebit')->payRecurrent([ - 'amountDebit' => 10, - 'originalTransactionKey' => 'FDA9EEEEA53C42BF875C35C6C2B7xxxx', - 'invoice' => 'testinvoice 123', - 'collectdate' => '2030-07-03', + 'amountDebit' => 10, + 'originalTransactionKey' => 'FDA9EEEEA53C42BF875C35C6C2B7xxxx', + 'invoice' => 'testinvoice 123', + 'collectdate' => '2030-07-03', ]); $this->assertTrue($response->isFailed()); @@ -82,24 +82,24 @@ public function it_creates_a_sepa_recurrent_payment() public function it_creates_a_sepa_extra_info() { $response = $this->buckaroo->method('sepadirectdebit')->extraInfo([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'iban' => 'NL13TEST0123456789', - 'bic' => 'TESTNL2A', - 'contractID' => 'TEST', - 'mandateDate' => '2022-07-03', - 'customerReferencePartyName' => 'Lorem', - 'customer' => [ - 'name' => 'John Smith' + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'iban' => 'NL13TEST0123456789', + 'bic' => 'TESTNL2A', + 'contractID' => 'TEST', + 'mandateDate' => '2022-07-03', + 'customerReferencePartyName' => 'Lorem', + 'customer' => [ + 'name' => 'John Smith', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '13', + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', 'houseNumberAdditional' => 'a', - 'zipcode' => '1234AB', - 'city' => 'Heerenveen', - 'country' => 'NL' - ] + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], ]); $this->assertTrue($response->isPendingProcessing()); @@ -112,11 +112,11 @@ public function it_creates_a_sepa_extra_info() public function it_creates_a_sepa_pay_with_emandate() { $response = $this->buckaroo->method('sepadirectdebit')->payWithEmandate([ - 'amountDebit' => 10, - 'invoice' => 'testinvoice 123', - 'mandateReference' => '001D284C4A887F84756A1425A369997xxxx', + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'mandateReference' => '001D284C4A887F84756A1425A369997xxxx', ]); $this->assertTrue($response->isValidationFailure()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/SofortTest.php b/src/Tests/Payments/SofortTest.php index f5bc8676..753fc556 100644 --- a/src/Tests/Payments/SofortTest.php +++ b/src/Tests/Payments/SofortTest.php @@ -28,7 +28,7 @@ protected function setUp(): void { $this->paymentPayload = ([ 'invoice' => uniqid(), - 'amountDebit' => 10.10 + 'amountDebit' => 10.10, ]); } @@ -42,5 +42,4 @@ public function it_creates_a_sofort_payment() $this->assertTrue($response->isPendingProcessing()); } - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/SubscriptionsTest.php b/src/Tests/Payments/SubscriptionsTest.php index 7a7c70be..07d20248 100644 --- a/src/Tests/Payments/SubscriptionsTest.php +++ b/src/Tests/Payments/SubscriptionsTest.php @@ -32,16 +32,16 @@ class SubscriptionsTest extends BuckarooTestCase public function it_creates_a_subscription() { $response = $this->buckaroo->method('subscriptions')->create([ - 'rate_plans' => [ - 'add' => [ - 'startDate' => '2022-01-01', - 'ratePlanCode' => 'xxxxxx', - ] + 'ratePlans' => [ + 'add' => [ + 'startDate' => '2023-01-01', + 'ratePlanCode' => 'xxxxxx', + ], ], 'configurationCode' => 'xxxxx', - 'debtor' => [ - 'code' => 'xxxxxx' - ] + 'debtor' => [ + 'code' => 'xxxxxx', + ], ]); $this->assertTrue($response->isValidationFailure()); @@ -54,45 +54,54 @@ public function it_creates_a_subscription() public function it_creates_a_combined_subscription() { $subscriptions = $this->buckaroo->method('subscriptions')->manually()->createCombined([ - 'includeTransaction' => false, - 'transactionVatPercentage' => 5, - 'configurationCode' => 'xxxxx', - 'email' => 'test@buckaroo.nl', - 'rate_plans' => [ - 'add' => [ - 'startDate' => '2022-01-01', - 'ratePlanCode' => 'xxxxxx', - ] + 'pushURL' => 'https://buckaroo.nextto.dev/push', + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'gfyh9fe4', + 'email' => 'test@buckaroo.nl', + 'ratePlans' => [ + 'add' => [ + 'startDate' => '2033-01-01', + 'ratePlanCode' => '9863hdcj', + ], + ], + 'phone' => [ + 'mobile' => '0612345678', ], - 'phone' => [ - 'mobile' => '0612345678' + 'debtor' => [ + 'code' => 'johnsmith4', ], - 'debtor' => [ - 'code' => 'xxxxxx' +// 'person' => [ +// 'firstName' => 'John', +// 'lastName' => 'Do', +// 'gender' => Gender::FEMALE, +// 'culture' => 'nl-NL', +// 'birthDate' => '1990-01-01' +// ], + 'company' => [ + 'culture' => 'nl-NL', + 'companyName' => 'My Company Coporation', + 'vatApplicable' => true, + 'vatNumber' => 'NL140619562B01', + 'chamberOfCommerce' => '20091741', ], - 'person' => [ - 'firstName' => 'John', - 'lastName' => 'Do', - 'gender' => Gender::FEMALE, - 'culture' => 'nl-NL', - 'birthDate' => '1990-01-01' + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '90', + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'country' => 'NL', ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '90', - 'zipcode' => '8441ER', - 'city' => 'Heerenveen', - 'country' => 'NL' - ] ]); $response = $this->buckaroo->method('ideal')->combine($subscriptions)->pay([ - 'invoice' => uniqid(), + 'startRecurrent' => true, + 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'issuer' => 'ABNANL2A' + 'issuer' => 'ABNANL2A', ]); - $this->assertTrue($response->isValidationFailure()); + $this->assertTrue($response->isPendingProcessing()); } /** @@ -102,20 +111,20 @@ public function it_creates_a_combined_subscription() public function it_updates_subscription() { $response = $this->buckaroo->method('subscriptions')->update([ - 'subscriptionGuid' => 'FC512FC9CC3A485D8CF3D1804FF6xxxx', + 'subscriptionGuid' => 'FC512FC9CC3A485D8CF3D1804FF6xxxx', 'configurationCode' => '9wqe32ew', - 'rate_plans' => [ - 'update' => [ - 'ratePlanGuid' => 'F075470B1BB24B9291943A888A2Fxxxx', + 'ratePlans' => [ + 'update' => [ + 'ratePlanGuid' => 'F075470B1BB24B9291943A888A2Fxxxx', 'startDate' => '2022-01-01', - 'endDate' => '2030-01-01', - 'charge' => [ - 'ratePlanChargeGuid' => 'AD375E2E188747159673440898B9xxxx', + 'endDate' => '2030-01-01', + 'charge' => [ + 'ratePlanChargeGuid' => 'AD375E2E188747159673440898B9xxxx', 'baseNumberOfUnits' => '1', - 'pricePerUnit' => 10 - ] - ] - ] + 'pricePerUnit' => 10, + ], + ], + ], ]); $this->assertTrue($response->isFailed()); @@ -128,14 +137,14 @@ public function it_updates_subscription() public function it_updates_combined_subscription() { $subscription = $this->buckaroo->method('subscriptions')->manually()->updateCombined([ - 'startRecurrent' => true, - 'subscriptionGuid' => '65EB06079D854B0C9A9ECB0E2C1Cxxxx' + 'startRecurrent' => true, + 'subscriptionGuid' => '65EB06079D854B0C9A9ECB0E2C1Cxxxx', ]); $response = $this->buckaroo->method('ideal')->combine($subscription)->pay([ - 'invoice' => uniqid(), + 'invoice' => uniqid(), 'amountDebit' => 10.10, - 'issuer' => 'ABNANL2A' + 'issuer' => 'ABNANL2A', ]); @@ -149,7 +158,7 @@ public function it_updates_combined_subscription() public function it_stops_subscription() { $response = $this->buckaroo->method('subscriptions')->stop([ - 'subscriptionGuid' => 'A8A3DF828F0E4706B50191D3D1C88xxx' + 'subscriptionGuid' => 'A8A3DF828F0E4706B50191D3D1C88xxx', ]); $this->assertTrue($response->isFailed()); @@ -162,7 +171,7 @@ public function it_stops_subscription() public function it_get_info_of_subscription() { $response = $this->buckaroo->method('subscriptions')->info([ - 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx' + 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx', ]); $this->assertTrue($response->isFailed()); @@ -175,7 +184,7 @@ public function it_get_info_of_subscription() public function it_delete_payment_config_of_subscription() { $response = $this->buckaroo->method('subscriptions')->deletePaymentConfig([ - 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx' + 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx', ]); $this->assertTrue($response->isFailed()); @@ -188,8 +197,8 @@ public function it_delete_payment_config_of_subscription() public function it_pauses_of_subscription() { $response = $this->buckaroo->method('subscriptions')->pause([ - 'resumeDate' => '2030-01-01', - 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx' + 'resumeDate' => '2030-01-01', + 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx', ]); $this->assertTrue($response->isFailed()); @@ -202,8 +211,8 @@ public function it_pauses_of_subscription() public function it_resumes_of_subscription() { $response = $this->buckaroo->method('subscriptions')->resume([ - 'resumeDate' => '2030-01-01', - 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx' + 'resumeDate' => '2030-01-01', + 'subscriptionGuid' => '6ABDB214C4944B5C8638420CE9ECxxxx', ]); $this->assertTrue($response->isFailed()); diff --git a/src/Tests/Payments/SurepayTest.php b/src/Tests/Payments/SurepayTest.php index 9dc59353..40909f86 100644 --- a/src/Tests/Payments/SurepayTest.php +++ b/src/Tests/Payments/SurepayTest.php @@ -31,12 +31,12 @@ class SurepayTest extends BuckarooTestCase public function it_verify_with_surepay() { $response = $this->buckaroo->method('surepay')->verify([ - 'bankAccount' => [ - 'iban' => 'NL13TEST0123456789', - 'accountName' => 'John Doe' - ] + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', + 'accountName' => 'John Doe', + ], ]); $this->assertTrue($response->isSuccess()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/TinkaTest.php b/src/Tests/Payments/TinkaTest.php index 22651290..451254d1 100644 --- a/src/Tests/Payments/TinkaTest.php +++ b/src/Tests/Payments/TinkaTest.php @@ -42,8 +42,8 @@ public function it_creates_a_tinka_refund() { $response = $this->buckaroo->method('tinka')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); @@ -52,67 +52,67 @@ public function it_creates_a_tinka_refund() private function getPaymentPayload(): array { return [ - 'amountDebit' => 3.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'paymentMethod' => 'Credit', - 'deliveryMethod' => 'Locker', - 'deliveryDate' => '2030-01-01', - 'articles' => [ + 'amountDebit' => 3.5, + 'order' => uniqid(), + 'invoice' => uniqid(), + 'description' => 'This is a test order', + 'paymentMethod' => 'Credit', + 'deliveryMethod' => 'Locker', + 'deliveryDate' => '2030-01-01', + 'articles' => [ [ - 'type' => 1, - 'description' => 'Blue Toy Car', - 'brand' => 'Ford Focus', - 'manufacturer' => 'Ford', - 'color' => 'Red', - 'size' => 'Small', - 'quantity' => '1', - 'price' => '3.5', - 'unitCode' => 'test' - ] + 'type' => 1, + 'description' => 'Blue Toy Car', + 'brand' => 'Ford Focus', + 'manufacturer' => 'Ford', + 'color' => 'Red', + 'size' => 'Small', + 'quantity' => '1', + 'price' => '3.5', + 'unitCode' => 'test', + ], ], - 'customer' => [ - 'gender' => Gender::MALE, - 'firstName' => 'Buck', - 'lastName' => 'Aroo', - 'initials' => 'BA', - 'birthDate' => '1990-01-01', + 'customer' => [ + 'gender' => Gender::MALE, + 'firstName' => 'Buck', + 'lastName' => 'Aroo', + 'initials' => 'BA', + 'birthDate' => '1990-01-01', ], - 'billing' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the' + 'billing' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', ], 'email' => 'billingcustomer@buckaroo.nl', 'phone' => [ 'mobile' => '0109876543', ], - 'address' => [ + 'address' => [ 'street' => 'Hoofdstraat', 'houseNumber' => '80', 'houseNumberAdditional' => 'A', 'zipcode' => '8441EE', 'city' => 'Heerenveen', 'country' => 'NL', - ] + ], ], - 'shipping' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the' + 'shipping' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', ], 'email' => 'billingcustomer@buckaroo.nl', 'phone' => [ 'mobile' => '0109876543', ], - 'address' => [ + 'address' => [ 'street' => 'Hoofdstraat', 'houseNumber' => '80', 'houseNumberAdditional' => 'A', 'zipcode' => '8441EE', 'city' => 'Heerenveen', 'country' => 'NL', - ] - ] + ], + ], ]; } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/TransferTest.php b/src/Tests/Payments/TransferTest.php index 87615d92..627bc1f9 100644 --- a/src/Tests/Payments/TransferTest.php +++ b/src/Tests/Payments/TransferTest.php @@ -20,8 +20,8 @@ namespace Buckaroo\Tests\Payments; -use Buckaroo\Tests\BuckarooTestCase; use Buckaroo\Resources\Constants\Gender; +use Buckaroo\Tests\BuckarooTestCase; class TransferTest extends BuckarooTestCase { @@ -41,8 +41,8 @@ public function it_creates_a_transfer_payment() 'customer' => [ 'gender' => Gender::MALE, 'firstName' => 'John', - 'lastName' => 'Smith' - ] + 'lastName' => 'Smith', + ], ]); $this->assertTrue($response->isAwaitingConsumer()); @@ -55,11 +55,10 @@ public function it_creates_a_transfer_refund() { $response = $this->buckaroo->method('transfer')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } - -} \ No newline at end of file +} diff --git a/src/Tests/Payments/TrustlyTest.php b/src/Tests/Payments/TrustlyTest.php index 74129696..4e2947e7 100644 --- a/src/Tests/Payments/TrustlyTest.php +++ b/src/Tests/Payments/TrustlyTest.php @@ -33,10 +33,10 @@ public function it_creates_a_trustly_payment() 'amountDebit' => 10, 'invoice' => uniqid(), 'country' => 'DE', - 'customer' => [ + 'customer' => [ 'firstName' => 'Test', - 'lastName' => 'Aflever' - ] + 'lastName' => 'Aflever', + ], ]); $this->assertTrue($response->isPendingProcessing()); @@ -49,10 +49,10 @@ public function it_creates_a_trustly_refund() { $response = $this->buckaroo->method('trustly')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX' + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/WeChatPayTest.php b/src/Tests/Payments/WeChatPayTest.php index 728c09da..0b655fa0 100644 --- a/src/Tests/Payments/WeChatPayTest.php +++ b/src/Tests/Payments/WeChatPayTest.php @@ -30,9 +30,9 @@ class WeChatPayTest extends BuckarooTestCase public function it_creates_a_wechat_payment() { $response = $this->buckaroo->method('wechatpay')->pay([ - 'amountDebit' => 10, - 'invoice' => uniqid(), - 'locale' => 'en-US' + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'locale' => 'en-US', ]); $this->assertTrue($response->isPendingProcessing()); @@ -45,10 +45,10 @@ public function it_creates_a_wechat_refund() { $response = $this->buckaroo->method('wechatpay')->refund([ 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', + 'invoice' => 'testinvoice 123', 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', ]); $this->assertTrue($response->isFailed()); } -} \ No newline at end of file +} diff --git a/src/Tests/Payments/iDinTest.php b/src/Tests/Payments/iDinTest.php index 439e531d..22b85992 100644 --- a/src/Tests/Payments/iDinTest.php +++ b/src/Tests/Payments/iDinTest.php @@ -30,7 +30,7 @@ class iDinTest extends BuckarooTestCase public function it_identify_with_idin() { $response = $this->buckaroo->method('idin')->identify([ - 'issuer' => 'BANKNL2Y' + 'issuer' => 'BANKNL2Y', ]); $this->assertTrue($response->isPendingProcessing()); @@ -42,7 +42,7 @@ public function it_identify_with_idin() public function it_verify_with_idin() { $response = $this->buckaroo->method('idin')->verify([ - 'issuer' => 'BANKNL2Y' + 'issuer' => 'BANKNL2Y', ]); $this->assertTrue($response->isPendingProcessing()); @@ -54,9 +54,9 @@ public function it_verify_with_idin() public function it_login_with_idin() { $response = $this->buckaroo->method('idin')->login([ - 'issuer' => 'BANKNL2Y' + 'issuer' => 'BANKNL2Y', ]); $this->assertTrue($response->isPendingProcessing()); } -} \ No newline at end of file +} diff --git a/src/Transaction/Client.php b/src/Transaction/Client.php index 157d62f8..435f497d 100644 --- a/src/Transaction/Client.php +++ b/src/Transaction/Client.php @@ -38,7 +38,7 @@ class Client { - private const METHOD_GET = 'GET'; + private const METHOD_GET = 'GET'; private const METHOD_POST = 'POST'; /** @@ -60,7 +60,7 @@ class Client public function __construct(?Config $config) { $this->config = $config; - $this->httpClient = new HttpClientGuzzle($config->getLogger()); + $this->httpClient = new HttpClientGuzzle($config->getLogger()); } /** @@ -93,7 +93,7 @@ protected function getHeaders(string $url, string $data, string $method): array { $headers = new DefaultHeader([ 'Content-Type: application/json; charset=utf-8', - 'Accept: application/json' + 'Accept: application/json', ]); $headers = new HmacHeader($headers, $this->config, $url, $data, $method); @@ -130,7 +130,7 @@ public function post(Request $data = null, $responseClass = TransactionResponse: * @return mixed * @throws BuckarooException */ - public function dataRequest(Request $data = null, $responseClass = TransactionResponse::class) + public function dataRequest(Request $data = null, $responseClass = TransactionResponse::class) { $endPoint = $this->getEndpoint('json/DataRequest/'); @@ -146,7 +146,10 @@ public function dataRequest(Request $data = null, $responseClass = TransactionR */ public function specification(Request $data = null, string $paymentName, int $serviceVersion = 0) { - $endPoint = $this->getEndpoint('json/Transaction/Specification/' . $paymentName . '?serviceVersion=' . $serviceVersion); + $endPoint = $this->getEndpoint( + 'json/Transaction/Specification/' . $paymentName . + '?serviceVersion=' . $serviceVersion + ); return $this->call(self::METHOD_GET, $data, TransactionResponse::class, $endPoint); } @@ -171,12 +174,19 @@ protected function call($method, Request $data = null, string $responseClass, st $this->config->getLogger()->info($method . ' ' . $endPoint); $this->config->getLogger()->info('HEADERS: ' . json_encode($headers)); - if($data) + if ($data) { - $this->config->getLogger()->info('PAYLOAD: ' . $data->toJson()); + $this->config->getLogger()->info( + 'PAYLOAD: ' . $data->toJson() + ); } - list($response, $decodedResult) = $this->httpClient->call($endPoint, $headers, $method, ($data)? $data->toJson() : ''); + list($response, $decodedResult) = $this->httpClient->call( + $endPoint, + $headers, + $method, + ($data)? $data->toJson() : '' + ); $response = new $responseClass($response, $decodedResult); @@ -190,14 +200,18 @@ protected function call($method, Request $data = null, string $responseClass, st */ public function config(?Config $config = null) { - if($config) + if ($config) { $this->config = $config; } - if(!$this->config) + if (! $this->config) { - throw new BuckarooException($this->logger, "No config has been configured. Please pass your credentials to the constructor or set up a Config object."); + throw new BuckarooException( + $this->logger, + "No config has been configured. + Please pass your credentials to the constructor or set up a Config object." + ); } return $this->config; diff --git a/src/Transaction/Request/HttpClient/HttpClientAbstract.php b/src/Transaction/Request/HttpClient/HttpClientAbstract.php index 2b482898..52a2d087 100644 --- a/src/Transaction/Request/HttpClient/HttpClientAbstract.php +++ b/src/Transaction/Request/HttpClient/HttpClientAbstract.php @@ -67,12 +67,18 @@ protected function getDecodedResult($response, $result): array { $decoded_result = json_decode($result, true); - if(is_array($decoded_result)) + if (is_array($decoded_result)) { return $decoded_result; } - throw new BuckarooException($this->logger, 'Status code: ' . $response->getStatusCode() . ' Message: ' . $result); + throw new BuckarooException( + $this->logger, + 'Status code: ' . + $response->getStatusCode() . + ' Message: ' . + $result + ); } /** diff --git a/src/Transaction/Request/HttpClient/HttpClientGuzzle.php b/src/Transaction/Request/HttpClient/HttpClientGuzzle.php index b01dccf7..b0b2a102 100644 --- a/src/Transaction/Request/HttpClient/HttpClientGuzzle.php +++ b/src/Transaction/Request/HttpClient/HttpClientGuzzle.php @@ -28,7 +28,6 @@ use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use Psr\Log\LoggerInterface; class HttpClientGuzzle extends HttpClientAbstract { @@ -48,7 +47,7 @@ public function __construct(Subject $logger) $this->httpClient = new Client([ RequestOptions::TIMEOUT => self::TIMEOUT, - RequestOptions::CONNECT_TIMEOUT => self::CONNECT_TIMEOUT + RequestOptions::CONNECT_TIMEOUT => self::CONNECT_TIMEOUT, ]); } @@ -67,23 +66,25 @@ public function call(string $url, array $headers, string $method, string $data = $request = new Request($method, $url, $headers, $data); - try { + try + { $response = $this->httpClient->send($request, ['http_errors' => false]); $result = (string) $response->getBody(); $this->logger->info('RESPONSE HEADERS: ' . json_encode($response->getHeaders())); $this->logger->info('RESPONSE BODY: ' . $response->getBody()); - - } catch (GuzzleException $e) { + } + catch (GuzzleException $e) + { throw new TransferException($this->logger, "Transfer failed", 0, $e); } $result = $this->getDecodedResult($response, $result); - return array( + return [ $response, - $result - ); + $result, + ]; } } diff --git a/src/Transaction/Request/Request.php b/src/Transaction/Request/Request.php index 854de6bc..4cfe62f7 100644 --- a/src/Transaction/Request/Request.php +++ b/src/Transaction/Request/Request.php @@ -45,9 +45,12 @@ class Request implements JsonSerializable, ArrayAccess, Arrayable */ public function offsetSet($offset, $value): void { - if (is_null($offset)) { + if (is_null($offset)) + { $this->data[] = $value; - } else { + } + else + { $this->data[$offset] = $value; } } @@ -88,12 +91,15 @@ public function jsonSerialize(): mixed public function __call($method, $args) { $prefix = substr($method, 0, 3); - $param = substr($method, 3); - $arg = isset($args[0]) ? $args[0] : null; + $param = substr($method, 3); + $arg = isset($args[0]) ? $args[0] : null; - if ($prefix === 'set') { + if ($prefix === 'set') + { return $this->offsetSet($param, $arg); - } elseif ($prefix === 'get') { + } + elseif ($prefix === 'get') + { return $this->offsetGet($param); } @@ -129,7 +135,8 @@ public function setHeader($name, $value) */ public function getHeader($name) { - if (isset($this->headers[strtolower($name)])) { + if (isset($this->headers[strtolower($name)])) + { return $this->headers[strtolower($name)]; } @@ -141,7 +148,8 @@ public function getHeader($name) */ public function getHeaders(): array { - return array_map(function ($value, $key) { + return array_map(function ($value, $key) + { return $key . ': ' . $value; }, $this->headers); } diff --git a/src/Transaction/Request/TransactionRequest.php b/src/Transaction/Request/TransactionRequest.php index 3b376399..bd0bb600 100644 --- a/src/Transaction/Request/TransactionRequest.php +++ b/src/Transaction/Request/TransactionRequest.php @@ -31,7 +31,7 @@ class TransactionRequest extends Request */ public function __construct() { - $this->data['ClientUserAgent'] = $_SERVER['HTTP_USER_AGENT'] ?? ''; + $this->data['ClientUserAgent'] = $_SERVER['HTTP_USER_AGENT'] ?? ''; } /** @@ -40,7 +40,7 @@ public function __construct() */ public function setPayload(Model $model) { - foreach($model->toArray() as $key => $value) + foreach ($model->toArray() as $key => $value) { $this->data[$model->serviceParameterKeyOf($key)] = $value; } @@ -83,9 +83,9 @@ public function getServices() : Services */ public function toArray(): array { - foreach($this->data as $key => $value) + foreach ($this->data as $key => $value) { - if(is_a($value, Arrayable::class)) + if (is_a($value, Arrayable::class)) { $this->data[$key] = $value->toArray(); } diff --git a/src/Transaction/Response/Response.php b/src/Transaction/Response/Response.php index a664f646..c3400314 100644 --- a/src/Transaction/Response/Response.php +++ b/src/Transaction/Response/Response.php @@ -39,7 +39,7 @@ class Response implements ArrayAccess, Arrayable public function __construct($response, $data) { $this->httpResponse = $response; - $this->data = $data; + $this->data = $data; } /** Implement ArrayAccess */ @@ -78,10 +78,11 @@ public function offsetGet($offset): mixed public function __call($method, $args) { $prefix = substr($method, 0, 3); - $param = substr($method, 3); + $param = substr($method, 3); // $arg = isset($args[0]) ? $args[0] : null; - if ($prefix === 'get') { + if ($prefix === 'get') + { return $this->offsetGet($param); } diff --git a/src/Transaction/Response/TransactionResponse.php b/src/Transaction/Response/TransactionResponse.php index a4335021..454255e4 100644 --- a/src/Transaction/Response/TransactionResponse.php +++ b/src/Transaction/Response/TransactionResponse.php @@ -97,7 +97,7 @@ public function isValidationFailure(): bool */ public function data(?string $key = null) { - if($key && isset($this->data[$key])) + if ($key && isset($this->data[$key])) { return $this->data[$key]; } @@ -110,7 +110,7 @@ public function data(?string $key = null) */ public function hasRedirect(): bool { - return !empty($this->data['RequiredAction']['RedirectURL']) + return ! empty($this->data['RequiredAction']['RedirectURL']) && $this->data['RequiredAction']['Name'] == 'Redirect'; } @@ -119,7 +119,8 @@ public function hasRedirect(): bool */ public function getRedirectUrl(): string { - if ($this->hasRedirect()) { + if ($this->hasRedirect()) + { return $this->data['RequiredAction']['RedirectURL']; } @@ -149,12 +150,14 @@ public function getServiceAction(): string */ public function getServiceParameters() { - if (!empty($this->data['Services'][0]['Parameters'])) { + if (! empty($this->data['Services'][0]['Parameters'])) + { $parameters = $this->data['Services'][0]['Parameters']; $params = []; - foreach ($parameters as $key => $parameter) { + foreach ($parameters as $key => $parameter) + { // key to lowercase to be consistent with PaymentResult version of getServiceParameters $params[strtolower($parameter['Name'])] = $parameter['Value']; } @@ -170,12 +173,14 @@ public function getServiceParameters() */ public function getCustomParameters(): array { - if (!empty($this->data['CustomParameters']['List'])) { + if (! empty($this->data['CustomParameters']['List'])) + { $parameters = $this->data['CustomParameters']['List']; $params = []; - foreach ($parameters as $key => $parameter) { + foreach ($parameters as $key => $parameter) + { $params[$parameter['Name']] = $parameter['Value']; } @@ -190,12 +195,14 @@ public function getCustomParameters(): array */ public function getAdditionalParameters(): array { - if (!empty($this->data['AdditionalParameters']['AdditionalParameter'])) { + if (! empty($this->data['AdditionalParameters']['AdditionalParameter'])) + { $parameters = $this->data['AdditionalParameters']['AdditionalParameter']; $params = []; - foreach ($parameters as $key => $parameter) { + foreach ($parameters as $key => $parameter) + { $params[$parameter['Name']] = $parameter['Value']; } @@ -227,6 +234,7 @@ public function getPaymentKey(): string public function getToken(): string { $params = $this->getAdditionalParameters(); + return trim($params['token']); } @@ -236,6 +244,7 @@ public function getToken(): string public function getSignature(): string { $params = $this->getAdditionalParameters(); + return trim($params['signature']); } @@ -268,7 +277,8 @@ public function getInvoice(): string */ public function getStatusCode(): ?int { - if (!empty($this->data['Status']['Code']['Code'])) { + if (! empty($this->data['Status']['Code']['Code'])) + { return $this->data['Status']['Code']['Code']; } @@ -280,7 +290,8 @@ public function getStatusCode(): ?int */ public function getSubStatusCode(): ?int { - if (!empty($this->data['Status']['SubCode']['Code'])) { + if (! empty($this->data['Status']['SubCode']['Code'])) + { return $this->data['Status']['SubCode']['Code']; } @@ -293,7 +304,8 @@ public function getSubStatusCode(): ?int public function hasSomeError(): bool { $getError = $this->getSomeError(); - return !empty($getError); + + return ! empty($getError); } /** @@ -301,20 +313,25 @@ public function hasSomeError(): bool */ public function getSomeError(): string { - if ($this->hasError()) { + if ($this->hasError()) + { $error = $this->getFirstError(); + return $error['ErrorMessage']; } - if ($this->hasConsumerMessage()) { + if ($this->hasConsumerMessage()) + { return $this->getConsumerMessage(); } - if ($this->hasMessage()) { + if ($this->hasMessage()) + { return $this->getMessage(); } - if ($this->hasSubCodeMessage()) { + if ($this->hasSubCodeMessage()) + { return $this->getSubCodeMessage(); } @@ -326,12 +343,12 @@ public function getSomeError(): string */ public function hasError(): bool { - return !empty($this->data['RequestErrors']) && ( - !empty($this->data['RequestErrors']['ChannelErrors']) || - !empty($this->data['RequestErrors']['ServiceErrors']) || - !empty($this->data['RequestErrors']['ActionErrors']) || - !empty($this->data['RequestErrors']['ParameterErrors']) || - !empty($this->data['RequestErrors']['CustomParameterErrors']) + return ! empty($this->data['RequestErrors']) && ( + ! empty($this->data['RequestErrors']['ChannelErrors']) || + ! empty($this->data['RequestErrors']['ServiceErrors']) || + ! empty($this->data['RequestErrors']['ActionErrors']) || + ! empty($this->data['RequestErrors']['ParameterErrors']) || + ! empty($this->data['RequestErrors']['CustomParameterErrors']) ); } @@ -342,10 +359,12 @@ public function getFirstError(): array { $errorTypes = ['ChannelErrors', 'ServiceErrors', 'ActionErrors', 'ParameterErrors', 'CustomParameterErrors']; - if ($this->hasError()) { - - foreach ($errorTypes as $errorType) { - if (!empty($this->data['RequestErrors'][$errorType])) { + if ($this->hasError()) + { + foreach ($errorTypes as $errorType) + { + if (! empty($this->data['RequestErrors'][$errorType])) + { return $this->data['RequestErrors'][$errorType][0]; } } @@ -359,7 +378,7 @@ public function getFirstError(): array */ public function hasMessage(): bool { - return !empty($this->data['Message']); + return ! empty($this->data['Message']); } /** @@ -375,7 +394,7 @@ public function getMessage(): string */ public function hasConsumerMessage(): bool { - return !empty($this->data['ConsumerMessage']['HtmlText']); + return ! empty($this->data['ConsumerMessage']['HtmlText']); } /** @@ -383,7 +402,8 @@ public function hasConsumerMessage(): bool */ public function getConsumerMessage(): string { - if ($this->hasConsumerMessage()) { + if ($this->hasConsumerMessage()) + { return $this->data['ConsumerMessage']['HtmlText']; } @@ -395,7 +415,7 @@ public function getConsumerMessage(): string */ public function hasSubCodeMessage(): bool { - return !empty($this->data['Status']['SubCode']['Description']); + return ! empty($this->data['Status']['SubCode']['Description']); } /** @@ -403,7 +423,8 @@ public function hasSubCodeMessage(): bool */ public function getSubCodeMessage(): string { - if ($this->hasSubCodeMessage()) { + if ($this->hasSubCodeMessage()) + { return $this->data['Status']['SubCode']['Description']; }