diff --git a/.github/index.php b/.github/index.php new file mode 100644 index 000000000..97ec565fb --- /dev/null +++ b/.github/index.php @@ -0,0 +1,25 @@ + + * @copyright Copyright (c) Buckaroo B.V. + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/.github/workflows/index.php b/.github/workflows/index.php new file mode 100644 index 000000000..97ec565fb --- /dev/null +++ b/.github/workflows/index.php @@ -0,0 +1,25 @@ + + * @copyright Copyright (c) Buckaroo B.V. + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 000000000..fc77b34e3 --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,21 @@ +on: + push: + branches: + - master + - develop + - 'releases/**' + pull_request: + types: [opened, synchronize, reopened] +name: SonarQube PR Analysis +jobs: + sonarqube: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} diff --git a/.gitignore b/.gitignore index 0bdc59ba5..ecb3ecca0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ -certificate/BuckarooPrivateKey.pem -/api/log \ No newline at end of file +/api/log +composer.lock +.php-cs-fixer.cache +var +tools +dev/node_modules +.idea diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 000000000..b3d4b82a1 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,48 @@ +in([ + __DIR__, +])->notPath([ + 'vendor', + 'dev' +]); + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + 'array_indentation' => true, + 'cast_spaces' => [ + 'space' => 'single', + ], + 'combine_consecutive_issets' => true, + 'concat_space' => [ + 'spacing' => 'one', + ], + 'error_suppression' => [ + 'mute_deprecation_error' => false, + 'noise_remaining_usages' => false, + 'noise_remaining_usages_exclude' => [], + ], + 'function_to_constant' => false, + 'method_chaining_indentation' => true, + 'no_alias_functions' => false, + 'no_superfluous_phpdoc_tags' => false, + 'non_printable_character' => [ + 'use_escape_sequences_in_strings' => true, + ], + 'phpdoc_summary' => false, + 'protected_to_private' => false, + 'psr_autoloading' => false, + 'self_accessor' => false, + 'yoda_style' => false, + 'single_line_throw' => false, + 'no_alias_language_construct_call' => false, + 'phpdoc_align' => [ + 'align' => 'vertical', + ], + ]) + ->setFinder($finder) + ->setCacheFile(__DIR__.'/var/.php_cs.cache'); \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..9fdd00224 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contribution Guidelines + +### Repository setup: +- Fork the repository to your account. +- More details about [how to fork a repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) can be found [here](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo). + +### Making changes: +- Create a branch from the develop branch. +- The name of the branch should be something like: `feature/GITHUB-ISSUE-ID-slug` (eg: `feature/50-configprovider-update`) +- Your code changes should follow the PrestaShop coding standard. +- Including unit tests is encouraged. + +### Pull Request: +- Open the PR to develop branch. +- If there is no issue referenced, add a description about the problem and the way it is being solved. +- Allow edits from maintainers. \ No newline at end of file diff --git a/README.md b/README.md index 6ce4cd540..d379df3c0 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,66 @@ -# Buckaroo PrestaShop Extension +
+ +
-### Installation & Configuration +# Buckaroo PrestaShop Payments Plugin +[![Latest release](https://badgen.net/github/release/buckaroo-it/PrestaShop)](https://github.com/buckaroo-it/PrestaShop/releases) -Below you will find a link to the installation and configuration manual of the Buckaroo PrestaShop extension. This will provide you a step-by-step description of how you can install the extension on your environment. +### Index +- [About](#about) +- [Requirements](#requirements) +- [Installation](#installation) +- [Configuration](#configuration) +- [Contribute](#contribute) +- [Versioning](#versioning) +- [Additional information](#additional-information) +--- -https://support.buckaroo.nl/categorieen/plugins/prestashop +### About -### Additional information +PrestaShop started in 2005 as a student project. It was originally named phpOpenStore. +Between May 2010 and April 2012, PrestaShop grew from 17 employees to more than a hundred. As of April 2016, PrestaShop has over 120 employees and offices in 6 countries. +PrestaShop is currently used by more then 300,000 shops worldwide and it is available in 60 different languages. + +The Buckaroo PrestaShop Payments Plugin ([Dutch](https://support.buckaroo.nl/categorieen/plugins/prestashop) or [English](https://support.buckaroo.eu/categories/plugins)) is convenient and works like a charm, it's easy to install and takes all the trouble out of your hands. It is a plugin with many different payment methods, all of which are SEPA proof. Last but not least the plugin is completely free to download as well. + +### Requirements + +To use the Buckaroo plugin, please be aware of the following minimum requirements: +- A Buckaroo account ([Dutch](https://www.buckaroo.nl/start) or [English](https://www.buckaroo.eu/solutions/request-form)) +- PrestaShop 1.7.x or 8.1.2 +- PHP 7.4 or higher + +### Installation -Release notes: +1. Go to our [PrestaShop Github repository](https://github.com/buckaroo-it/PrestaShop) and go to → [Releases](https://github.com/buckaroo-it/PrestaShop/releases). +2. Click on the latest **Buckaroo plugin version** and download the → **.ZIP file**. +3. Now login to your **PrestaShop backend** and go to → **Modules** → **Module Manager** → **Upload Module** → and select the downloaded .ZIP file of the Buckaroo plugin to upload it (the installation will start automatically.) +4. The Buckaroo plugin will be visible once the installation is completed. +In your **Plugin Manager** tab it will appear at the **Payment** section. -https://support.buckaroo.nl/categorie%C3%ABn/plugins/prestashop/release-notes +### Configuration -Knowledge base & FAQ: +For the configuration of the plugin, please refer to our [Dutch](https://support.buckaroo.nl/categorieen/plugins/prestashop) or [English](https://support.buckaroo.eu/categories/plugins) support website. You'll find all the needed information there. +You can also contact our [technical support department](mailto:support@buckaroo.nl) if you still have some unanswered questions. -https://support.buckaroo.nl/categorie%C3%ABn/plugins/prestashop +### Contribute -Support: +We really appreciate it when developers contribute to improve the Buckaroo plugins. +If you want to contribute as well, then please follow our [Contribution Guidelines](CONTRIBUTING.md). + +### Versioning ++ +
+ +- **MAJOR:** Breaking changes that require additional testing/caution. +- **MINOR:** Changes that should not have a big impact. +- **PATCHES:** Bug and hotfixes only. + +### Additional information +- **Knowledge base & FAQ:** Available in [Dutch](https://support.buckaroo.nl/categorieen/plugins/prestashop) or [English](https://support.buckaroo.eu/categories/plugins). +- **Support:** https://support.buckaroo.eu/contact +- **Contact:** [support@buckaroo.nl](mailto:support@buckaroo.nl) or [+31 (0)30 711 50 50](tel:+310307115050) -https://support.buckaroo.nl/contact +Please note:+ {{ $t(`dashboard.pages.order_payment_methods.explanation_intro`) }} +
+ + + ++ {{ $t('dashboard.pages.order_payment_methods.if_you_have_any_questions') }} + support@buckaroo.nl + {{ $t('dashboard.pages.settings.if_you_have_any_questions_link') }} + +31 (0) 30 711 50 20. +
++
+ + + ++ {{$t('dashboard.pages.settings.if_you_have_any_questions')}} + support@buckaroo.nl + {{$t('dashboard.pages.settings.if_you_have_any_questions_link')}} + +31 (0) 30 711 50 20. +
++ +
+ +# Buckaroo PHP SDK +[![Latest release](https://badgen.net/github/release/buckaroo-it/BuckarooSDK_PHP)](https://github.com/buckaroo-it/BuckarooSDK_PHP/releases) + ++ +
+ +--- +### Index +- [About](#about) +- [Requirements](#requirements) +- [Composer Installation](#composer-installation) +- [Requirements](#requirements) +- [Example](#example) +- [Contribute](#contribute) +- [Versioning](#versioning) +- [Additional information](#additional-information) +--- + +### About + +Buckaroo is the the Payment Service Provider for all your online payments with more than 30,000 companies relying on Buckaroo's platform to securely process their payments, subscriptions and unpaid invoices. +Buckaroo developed their own PHP SDK. The SDK is a modern, open-source PHP library that makes it easy to integrate your PHP application with Buckaroo's services. +Start accepting payments today with Buckaroo. + +### Requirements + +To use the Buckaroo API client, the following things are required: + ++ A Buckaroo account ([Dutch](https://www.buckaroo.nl/start) or [English](https://www.buckaroo.eu/solutions/request-form)) ++ PHP >= 7.4 ++ Up-to-date OpenSSL (or other SSL/TLS toolkit) + +### Composer Installation + +By far the easiest way to install the Buckaroo API client is to require it with [Composer](http://getcomposer.org/doc/00-intro.md). + + $ composer require buckaroo/sdk:^1.0 + + { + "require": { + "buckaroo/sdk": "^1.0" + } + } + +### Example +Create and config the Buckaroo object. +You can find your credentials in plaza [WEBSITE_KEY](https://plaza.buckaroo.nl/Configuration/Website/Index/) and [SECRET_KEY](https://admin.buckaroo.nl/Configuration/Merchant/SecretKey) + +```php +require __DIR__ . '/vendor/autoload.php'; + +# Get your website & secret key in your plaza. +# You can perform a test payment by giving the third param with the string "test", on default it is set on "live" +$buckaroo = new \BuckarooClient('WEBSITE_KEY', 'SECRET_KEY', 'test'); +``` + +Create a payment with all the available payment methods. In this example, we show how to create a credit card payment. Each payment has a slightly different payload. +```php +# Create a new payment +$buckaroo->method('creditcard') // Input the desire payment method. + ->pay([ + 'name' => 'visa', // Request to pay with Visa + 'amountDebit' => 10, // The amount we want to charge + 'invoice' => 'UNIQUE-INVOICE-NO', // Each payment must contain a unique invoice number + ]); +``` + +After you create a transaction, you can retrieve several transaction information on demand. +```php +# Retrieve transaction information +$transaction = $buckaroo->transaction('YOUR-TRANSACTION-KEY') + +$transaction->status(); // Retrieve transaction status +$transaction->refundInfo(); // Retrieve refund info +$transaction->cancelInfo() // Retrieve cancellation info +``` + +Find our full documentation online on [docs.buckaroo.io](https://docs.buckaroo.io). + +### Contribute + +We really appreciate it when developers contribute to improve the Buckaroo plugins. +If you want to contribute as well, then please follow our [Contribution Guidelines](CONTRIBUTING.md). + +### Versioning ++ +
+ +- **MAJOR:** Breaking changes that require additional testing/caution +- **MINOR:** Changes that should not have a big impact +- **PATCHES:** Bug and hotfixes only + +### Additional information +- **Support:** https://docs.buckaroo.io/docs/contact-us +- **Contact:** [support@buckaroo.nl](mailto:support@buckaroo.nl) or [+31 (0)30 711 50 50](tel:+310307115050) + +## License +Buckaroo PHP SDK is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/vendor/buckaroo/sdk/composer.json b/vendor/buckaroo/sdk/composer.json new file mode 100644 index 000000000..dd0a93fb7 --- /dev/null +++ b/vendor/buckaroo/sdk/composer.json @@ -0,0 +1,40 @@ +{ + "name": "buckaroo/sdk", + "description": "Buckaroo payment SDK", + "license": "MIT", + "version": "1.8.1", + "type": "library", + "require": { + "php": ">=7.4|^8.0", + "ext-json": "*", + "ext-pcre": "*", + "ext-fileinfo": "*", + "monolog/monolog": "^2.2|^3", + "guzzlehttp/guzzle": "^7.0", + "composer/ca-bundle": "^1.3", + "ramsey/uuid": "^3.9.7|^4" + }, + "require-dev": { + "squizlabs/php_codesniffer": "3.*", + "symfony/var-dumper": "^5.4.9", + "phpunit/phpunit": "^9.5", + "vlucas/phpdotenv": "^5.4", + "friendsofphp/php-cs-fixer": "^3.13" + }, + "authors": [{ + "name": "Buckaroo", + "email": "support@buckaroo.nl", + "homepage": "https://www.buckaroo.nl", + "role": "Developer" + }], + "autoload": { + "psr-4": { + "Buckaroo\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + } +} diff --git a/vendor/buckaroo/sdk/example/additional_services/credit_management.php b/vendor/buckaroo/sdk/example/additional_services/credit_management.php new file mode 100644 index 000000000..e26bd257f --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/credit_management.php @@ -0,0 +1,71 @@ +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', + ], + 'email' => 'youremail@example.nl', + 'phone' => [ + 'mobile' => '06198765432', + ], + 'person' => [ + 'culture' => 'nl-NL', + 'title' => 'Msc', + 'initials' => 'JS', + 'firstName' => 'Test', + 'lastNamePrefix' => 'Jones', + 'lastName' => 'Aflever', + 'gender' => Gender::MALE, + ], + 'company' => [ + 'culture' => 'nl-NL', + 'name' => 'My Company Corporation', + 'vatApplicable' => true, + 'vatNumber' => 'NL140619562B01', + 'chamberOfCommerce' => '20091741', + ], + 'address' => [ + 'street' => 'Hoofdtraat', + 'houseNumber' => '90', + 'houseNumberSuffix' => 'A', + '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', + ], +]); diff --git a/vendor/buckaroo/sdk/example/additional_services/idin.php b/vendor/buckaroo/sdk/example/additional_services/idin.php new file mode 100644 index 000000000..8fe3a8b68 --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/idin.php @@ -0,0 +1,22 @@ +method('idin')->identify([ + 'issuer' => 'BANKNL2Y', +]); + +//Verify +$response = $buckaroo->method('idin')->verify([ + 'issuer' => 'BANKNL2Y', +]); + +//Login +$response = $buckaroo->method('idin')->login([ + 'issuer' => 'BANKNL2Y', +]); diff --git a/vendor/buckaroo/sdk/example/additional_services/marketplaces.php b/vendor/buckaroo/sdk/example/additional_services/marketplaces.php new file mode 100644 index 000000000..2091ec037 --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/marketplaces.php @@ -0,0 +1,33 @@ +method('marketplaces')->manually()->split([ + 'daysUntilTransfer' => 2, + 'marketplace' => [ + 'amount' => 10, + 'description' => 'INV0001 Commission Marketplace', + ], + 'sellers' => [ + [ + 'accountId' => '789C60F316D24B088ACD471', + 'amount' => 50, + 'description' => 'INV001 Payout Make-Up Products BV', + ], + [ + 'accountId' => '369C60F316D24B088ACD238', + 'amount' => 35, + 'description' => 'INV0001 Payout Beauty Products BV', + ], + ], +]); + +$response = $buckaroo->method('ideal')->combine($marketplace)->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 95.00, + 'issuer' => 'ABNANL2A', +]); diff --git a/vendor/buckaroo/sdk/example/additional_services/pay_per_email.php b/vendor/buckaroo/sdk/example/additional_services/pay_per_email.php new file mode 100644 index 000000000..c45ec115f --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/pay_per_email.php @@ -0,0 +1,23 @@ +method('payperemail')->paymentInvitation([ + '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', + ], +]); diff --git a/vendor/buckaroo/sdk/example/additional_services/subscriptions.php b/vendor/buckaroo/sdk/example/additional_services/subscriptions.php new file mode 100644 index 000000000..d41677feb --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/subscriptions.php @@ -0,0 +1,124 @@ +method('subscriptions')->manually()->createCombined([ + 'pushURL' => 'https://buckaroo.dev/push', + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'gfyh9fe4', + 'email' => 'test@buckaroo.nl', + 'ratePlans' => [ + 'add' => [ + 'startDate' => '2033-01-01', + 'ratePlanCode' => '9863hdcj', + ], + ], + 'phone' => [ + 'mobile' => '0612345678', + ], + 'debtor' => [ + 'code' => 'johnsmith4', + ], +// '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', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '90', + 'zipcode' => '8441ER', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], +]); + +$response = $buckaroo->method('ideal')->combine($subscriptions)->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'issuer' => 'ABNANL2A', +]); +//** END Create Duo Combined */ + +//** START Create Triple Combined */ +$subscriptions = $buckaroo->method('subscriptions')->manually()->createCombined([ + 'pushURL' => 'https://buckaroo.dev/push', + 'includeTransaction' => false, + 'transactionVatPercentage' => 5, + 'configurationCode' => 'gfyh9fe4', + 'email' => 'test@buckaroo.nl', + 'ratePlans' => [ + 'add' => [ + 'startDate' => '2033-01-01', + 'ratePlanCode' => '9863hdcj', + ], + ], + 'phone' => [ + 'mobile' => '0612345678', + ], + 'debtor' => [ + 'code' => 'johnsmith4', + ], +// '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', + ], + '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', + ], + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', + ], +]); + +$response = $buckaroo->method('paypal')->combine($subscriptions)->combine($paypal_extra_info)->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), +]); +//** END Create Triple Combined */ diff --git a/vendor/buckaroo/sdk/example/additional_services/surepay.php b/vendor/buckaroo/sdk/example/additional_services/surepay.php new file mode 100644 index 000000000..33f5017b7 --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/surepay.php @@ -0,0 +1,15 @@ +method('surepay')->verify([ + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', + 'accountName' => 'John Doe', + ], +]); diff --git a/vendor/buckaroo/sdk/example/additional_services/voucher.php b/vendor/buckaroo/sdk/example/additional_services/voucher.php new file mode 100644 index 000000000..4567fa5fc --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/voucher.php @@ -0,0 +1,62 @@ +method('buckaroovoucher')->create( + [ + 'usageType' => '2', + 'validFrom' => '2022-01-01', + 'validUntil' => '2024-01-01', + 'creationBalance' => '5', + ] +); + +//Pay +$response = $buckaroo->method('buckaroovoucher')->pay( + [ + 'amountDebit' => '10', + 'invoice' => uniqid(), + 'vouchercode' => 'vouchercode', + ] +); + + +//Pay +$response = $buckaroo->method('buckaroovoucher')->payRemainder( + [ + 'amountDebit' => '10', + 'invoice' => uniqid(), + 'vouchercode' => 'vouchercode', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', + ] +); + + +//Refund +$response = $buckaroo->method('buckaroovoucher')->refund( + [ + 'amountCredit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', + ] +); + +//Get Balance +$response = $buckaroo->method('buckaroovoucher')->getBalance( + [ + 'vouchercode' => 'vouchercode', + ] +); + +//Deactivate +$response = $buckaroo->method('buckaroovoucher')->deactivate( + [ + 'vouchercode' => 'vouchercode', + ] +); diff --git a/vendor/buckaroo/sdk/example/additional_services/wallets.php b/vendor/buckaroo/sdk/example/additional_services/wallets.php new file mode 100644 index 000000000..ffd0a5bcb --- /dev/null +++ b/vendor/buckaroo/sdk/example/additional_services/wallets.php @@ -0,0 +1,19 @@ +method('buckaroo_wallet')->createWallet([ + 'walletId' => uniqid(), + 'email' => 'test@buckaroo.nl', + 'customer' => [ + 'firstName' => 'John', + 'lastName' => 'Doe', + ], + 'bankAccount' => [ + 'iban' => 'NL13TEST0123456789', + ], +]); diff --git a/vendor/buckaroo/sdk/example/bootstrap.php b/vendor/buckaroo/sdk/example/bootstrap.php new file mode 100644 index 000000000..cb429d0c7 --- /dev/null +++ b/vendor/buckaroo/sdk/example/bootstrap.php @@ -0,0 +1,9 @@ +load(); diff --git a/vendor/buckaroo/sdk/example/responses/push.php b/vendor/buckaroo/sdk/example/responses/push.php new file mode 100644 index 000000000..05ec5e977 --- /dev/null +++ b/vendor/buckaroo/sdk/example/responses/push.php @@ -0,0 +1,49 @@ + "10.10", + "brq_currency" => "EUR", + "brq_customer_name" => "J. de Tèster", + "brq_invoicenumber" => "SDKDevelopment.com_INVOICE_NO_628c6d032af90", + "brq_ordernumber" => "SDKDevelopment.com_ORDER_NO_628c6d032af95", + "brq_payer_hash" => "2d26d34584a4eafeeaa97eed10cfdae22ae64cdce1649a80a55fafca8850e3e22cb32eb7c8fc95ef0c6f96669a21651d4734cc568816f9bd59c2092911e6c0da", + "brq_payment" => "D44ACDD0F99D4A1C811D2CD3EFDB05BA", + "brq_payment_method" => "ideal", + "brq_SERVICE_ideal_consumerBIC" => "RABONL2U", + "brq_SERVICE_ideal_consumerIBAN" => "NL44RABO0123456789", + "brq_SERVICE_ideal_consumerIssuer" => "ABN AMRO", + "brq_SERVICE_ideal_consumerName" => "J. de Tèster", + "brq_SERVICE_ideal_transactionId" => "0000000000000001", + "brq_statuscode" => "190", + "brq_statuscode_detail" => "S001", + "brq_statusmessage" => "Transaction successfully processed", + "brq_test" => "true", + "brq_timestamp" => "2022-05-24 07:29:09", + "brq_transactions" => "4C1BE53E2C42412AB32A799D9316E7DD", + "brq_websitekey" => "IBjihN7Fhp", + "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5", +]; + +$reply_handler = new ReplyHandler($buckaroo->client()->config(), $post_data); +$reply_handler->validate(); +$reply_handler->isValid(); // Return either true or false +//END HTTP POST PUSH + + +//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.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 diff --git a/vendor/buckaroo/sdk/example/responses/return.php b/vendor/buckaroo/sdk/example/responses/return.php new file mode 100644 index 000000000..319091bc3 --- /dev/null +++ b/vendor/buckaroo/sdk/example/responses/return.php @@ -0,0 +1,36 @@ + "10.10", + "brq_currency" => "EUR", + "brq_customer_name" => "J. de Tèster", + "brq_invoicenumber" => "SDKDevelopment.com_INVOICE_NO_628c6d032af90", + "brq_ordernumber" => "SDKDevelopment.com_ORDER_NO_628c6d032af95", + "brq_payer_hash" => "2d26d34584a4eafeeaa97eed10cfdae22ae64cdce1649a80a55fafca8850e3e22cb32eb7c8fc95ef0c6f96669a21651d4734cc568816f9bd59c2092911e6c0da", + "brq_payment" => "D44ACDD0F99D4A1C811D2CD3EFDB05BA", + "brq_payment_method" => "ideal", + "brq_SERVICE_ideal_consumerBIC" => "RABONL2U", + "brq_SERVICE_ideal_consumerIBAN" => "NL44RABO0123456789", + "brq_SERVICE_ideal_consumerIssuer" => "ABN AMRO", + "brq_SERVICE_ideal_consumerName" => "J. de Tèster", + "brq_SERVICE_ideal_transactionId" => "0000000000000001", + "brq_statuscode" => "190", + "brq_statuscode_detail" => "S001", + "brq_statusmessage" => "Transaction successfully processed", + "brq_test" => "true", + "brq_timestamp" => "2022-05-24 07:29:09", + "brq_transactions" => "4C1BE53E2C42412AB32A799D9316E7DD", + "brq_websitekey" => "IBjihN7Fhp", + "brq_signature" => "bf7a62c830da2d2e004199919a8fe0d53b0668f5", +]; + +$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']); + +$replyHandler = $buckaroo->payment($returnReponse['brq_payment_method'])->handleReply($returnReponse); +$replyHandler->validate(); + +$replyHandler->isValid(); diff --git a/vendor/buckaroo/sdk/example/transactions/afterpay.php b/vendor/buckaroo/sdk/example/transactions/afterpay.php new file mode 100644 index 000000000..80ff3eab8 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/afterpay.php @@ -0,0 +1,179 @@ +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', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', + ], + 'email' => 'test@buckaroo.nl', + ], + 'shipping' => [ + 'recipient' => [ + 'category' => RecipientCategory::COMPANY, + 'careOf' => 'John Smith', + 'companyName' => 'Buckaroo B.V.', + 'firstName' => 'John', + 'lastName' => 'Do', + 'chamberOfCommerce' => '12345678', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => '10.10', + ], + ], +]); + +//Authorize +$response = $buckaroo->method('afterpay')->authorize([ + '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', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'grossUnitPrice' => '10.10', + ], + ], + 'customer' => [ + 'useBillingInfoForShipping' => false, + 'billing' => [ + 'firstName' => 'Test', + 'lastName' => 'Acceptatie', + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => '0109876543', + 'street' => 'Hoofdstraat', + 'streetNumber' => '80', + 'streetNumberAdditional' => 'A', + 'postalCode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', + 'salutation' => 'Mr', + 'birthDate' => '01-01-1990', + ], + 'shipping' => [ + 'firstName' => 'Test', + 'lastName' => 'Aflever', + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => '0109876543', + 'street' => 'Hoofdstraat', + 'streetNumber' => '80', + 'streetNumberAdditional' => 'A', + 'postalCode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', + 'salutation' => 'Mr', + 'birthDate' => '01-01-1990', + ], + ], +]); + +//Capture +$response = $buckaroo->method('afterpay')->capture([ + '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' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'grossUnitPrice' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + '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, +]); + +//Partial refund +$response = $buckaroo->method('afterpay')->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' => [ + [ + 'refundType' => 'Return', + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + ], +]); diff --git a/vendor/buckaroo/sdk/example/transactions/afterpaydigiaccept.php b/vendor/buckaroo/sdk/example/transactions/afterpaydigiaccept.php new file mode 100644 index 000000000..eb9f01b10 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/afterpaydigiaccept.php @@ -0,0 +1,241 @@ +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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + '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', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'price' => '10.00', + 'quantity' => '2', + 'vatCategory' => '1', + ], + [ + 'identifier' => uniqid(), + 'description' => 'Red Toy Car', + 'price' => '10.00', + 'quantity' => '2', + '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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + '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', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'price' => '10.00', + 'quantity' => '2', + 'vatCategory' => '1', + ], + [ + 'identifier' => uniqid(), + 'description' => 'Red Toy Car', + 'price' => '10.00', + 'quantity' => '2', + '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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + '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', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'price' => '10.00', + 'quantity' => '2', + 'vatCategory' => '1', + ], + [ + 'identifier' => uniqid(), + 'description' => 'Red Toy Car', + 'price' => '10.00', + 'quantity' => '2', + 'vatCategory' => '1', + ], + ], +]); + +//Refund +$response = $buckaroo->method('afterpaydigiaccept')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/alipay.php b/vendor/buckaroo/sdk/example/transactions/alipay.php new file mode 100644 index 000000000..9d0ff33bd --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/alipay.php @@ -0,0 +1,21 @@ +method('alipay')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'useMobileView' => true, +]); + +//Refund +$response = $buckaroo->method('alipay')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/applepay.php b/vendor/buckaroo/sdk/example/transactions/applepay.php new file mode 100644 index 000000000..4cc4a12e9 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/applepay.php @@ -0,0 +1,31 @@ +method('applepay')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'paymentData' => uniqid(), + 'customerCardName' => 'Buck Aroo', +]); + +//Pay Redirect +$response = $buckaroo->method('applepay')->payRedirect([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'servicesSelectableByClient' => 'applepay', + 'continueOnIncomplete' => '1', +]); + +//Refund +$response = $buckaroo->method('applepay')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/applepay_redirect.php b/vendor/buckaroo/sdk/example/transactions/applepay_redirect.php new file mode 100644 index 000000000..e1e4a63bd --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/applepay_redirect.php @@ -0,0 +1,24 @@ +method('applepay')->payRedirect([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'servicesSelectableByClient' => 'applepay', + 'continueOnIncomplete' => '1', +]); + + +//Refund +$response = $buckaroo->method('applepay')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/bancontact.php b/vendor/buckaroo/sdk/example/transactions/bancontact.php new file mode 100644 index 000000000..fbfa1e1d8 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/bancontact.php @@ -0,0 +1,39 @@ +method('bancontactmrcash')->pay([ + //'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, +]); + +//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==', +]); + +//Recurrent payment +$response = $buckaroo->method('bancontactmrcash')->payRecurrent([ + 'invoice' => 'testinvoice 123', + 'amountDebit' => 10.50, + 'originalTransactionKey' => '91D08EC01F414926A4CA29C059XXXXXX', +]); + + +//Refund +$response = $buckaroo->method('bancontactmrcash')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/belfius.php b/vendor/buckaroo/sdk/example/transactions/belfius.php new file mode 100644 index 000000000..06945fd06 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/belfius.php @@ -0,0 +1,21 @@ +method('belfius')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, +]); + +//Refund +$response = $buckaroo->method('belfius')->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, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/billink.php b/vendor/buckaroo/sdk/example/transactions/billink.php new file mode 100644 index 000000000..2fcfb3a18 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/billink.php @@ -0,0 +1,189 @@ +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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', + ], + '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', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + 'priceExcl' => 5, + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => 10.10, + '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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', + ], + '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', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + 'priceExcl' => 5, + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => 10.10, + 'priceExcl' => 5, + ], + ], +]); + +//Capture +$response = $buckaroo->method('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' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + 'priceExcl' => 5, + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => 10.10, + 'priceExcl' => 5, + ], + ], +]); + +//Cancel authorize +$response = $buckaroo->method('billink')->cancelAuthorize([ + 'originalTransactionKey' => '74AD098CCFAA4F739FE16279B5059B6B', //Set transaction key of the authorized transaction to cancel + 'invoice' => '62905fa2650f4', //Set invoice id + 'AmountCredit' => 10, //set amount to capture +]); + +//Refund +$response = $buckaroo->method('billink')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/credit_click.php b/vendor/buckaroo/sdk/example/transactions/credit_click.php new file mode 100644 index 000000000..32187c1fc --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/credit_click.php @@ -0,0 +1,30 @@ +method('creditclick')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'email' => 'billingcustomer@buckaroo.nl', + 'customer' => [ + 'firstName' => 'Test', + 'lastName' => 'Aflever', + ], +]); + +//Refund +$response = $buckaroo->method('creditclick')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + 'serviceParameters' => [ + 'reason' => 'RequestedByCustomer', + ], +]); diff --git a/vendor/buckaroo/sdk/example/transactions/creditcard.php b/vendor/buckaroo/sdk/example/transactions/creditcard.php new file mode 100644 index 000000000..b94da1e06 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/creditcard.php @@ -0,0 +1,81 @@ +method('creditcard')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'visa', +]); + +//Pay Encrypted +$response = $buckaroo->method('creditcard')->payEncrypted([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'mastercard', + 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); + +//Pay with security code +$response = $buckaroo->method('creditcard')->payWithSecurityCode([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); + +//Refund +$response = $buckaroo->method('creditcard')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '13FAF43579D94F5FB8119A6819XXXXXX', + 'name' => 'mastercard', +]); + +//Authorize +$response = $buckaroo->method('creditcard')->authorize([ + 'amountDebit' => 10, + 'invoice' => 'testinvoice 123', + 'name' => 'mastercard', +]); + +//Authorize Encrypted +$response = $buckaroo->method('creditcard')->authorizeEncrypted([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'mastercard', + 'cardData' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); + +//Authorize with security code +$response = $buckaroo->method('creditcard')->authorizeWithSecurityCode([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); + +//Capture +$response = $buckaroo->method('creditcard')->capture([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); + +//Pay Recurrent +$response = $buckaroo->method('creditcard')->payRecurrent([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'originalTransactionKey' => '6C5DBB69E74644958F8C25199514DC6C', + 'name' => 'mastercard', + 'securityCode' => '001u8gJNwngKubFCO6FmJod6aESlIFATkKYaj47KlgBp7f3NeVxUzChg1Aug7WD2vc5wut2KU9NPLUaO0tFmzhVLZoDWn7dX4AzGxSjPrsPmDMWYcEkIwMZfcyJqoRfFkF3j15mil3muXxhR1a609NfkTo11J3ENVsvU3k60z', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/eps.php b/vendor/buckaroo/sdk/example/transactions/eps.php new file mode 100644 index 000000000..426ed7ae4 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/eps.php @@ -0,0 +1,21 @@ +method('eps')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, +]); + +//Refund +$response = $buckaroo->method('eps')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/giftcards.php b/vendor/buckaroo/sdk/example/transactions/giftcards.php new file mode 100644 index 000000000..a01fdd31e --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/giftcards.php @@ -0,0 +1,25 @@ +method('giftcard')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'name' => 'boekenbon', + 'intersolveCardnumber' => '0000000000000000001', + 'intersolvePIN' => '1000', +]); + +//Refund +$response = $buckaroo->method('giftcard')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + 'name' => 'boekenbon', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/giftcards_redirect.php b/vendor/buckaroo/sdk/example/transactions/giftcards_redirect.php new file mode 100644 index 000000000..007e2ae64 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/giftcards_redirect.php @@ -0,0 +1,25 @@ +method('giftcard')->payRedirect([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'servicesSelectableByClient' => 'westlandbon,ideal,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', + 'originalTransactionKey' => '50891AED2D9647668A2F48C87B3000EE', + 'name' => 'boekenbon', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/giropay.php b/vendor/buckaroo/sdk/example/transactions/giropay.php new file mode 100644 index 000000000..d1cfbac06 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/giropay.php @@ -0,0 +1,22 @@ +method('giropay')->pay([ + 'invoice' => uniqid(), + 'bic' => 'GENODETT488', + 'amountDebit' => 10.10, +]); + +//Refund +$response = $buckaroo->method('giropay')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/ideal.php b/vendor/buckaroo/sdk/example/transactions/ideal.php new file mode 100644 index 000000000..4400853b1 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/ideal.php @@ -0,0 +1,26 @@ +method('ideal')->pay([ + '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 + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); + +//Get issuers +$buckaroo->method('ideal')->issuers(); diff --git a/vendor/buckaroo/sdk/example/transactions/ideal_qr.php b/vendor/buckaroo/sdk/example/transactions/ideal_qr.php new file mode 100644 index 000000000..053d91763 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/ideal_qr.php @@ -0,0 +1,23 @@ +method('ideal_qr')->generate([ + 'description' => 'Test purchase', + 'returnURL' => 'https://buckaroo.dev./return', + '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/vendor/buckaroo/sdk/example/transactions/in3.php b/vendor/buckaroo/sdk/example/transactions/in3.php new file mode 100644 index 000000000..64ec35dff --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/in3.php @@ -0,0 +1,98 @@ + 52.30, + 'description' => 'in3 pay', + 'order' => uniqid(), + 'invoice' => uniqid(), + 'clientIP' => '127.0.0.1', + 'billing' => [ + 'recipient' => [ + 'category' => 'B2C', + 'initials' => 'J', + 'firstName' => 'John', + 'lastName' => 'Dona', + 'birthDate' => '1990-01-01', + 'customerNumber' => '12345', + 'phone' => '0612345678', + 'country' => 'NL', + 'companyName' => 'My Company B.V.', + 'chamberOfCommerce' => '123456' + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'phone' => '0698765433', + ], + 'email' => 'test@buckaroo.nl', + ], + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2C', + 'careOf' => 'John Smith', + 'firstName' => 'John', + 'lastName' => 'Do', + 'chamberOfCommerce' => '123456' + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'type' => 'Physical', + 'description' => 'Blue Toy Car', + 'category' => 'test product', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'type' => 'Physical', + 'description' => 'Red Toy Car', + 'category' => 'test product', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => '10.10', + ], + [ + 'identifier' => 'USPShippingID', + 'type' => 'Physical', + 'description' => 'UPS', + 'category' => 'test product', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => '2', + ], + ] +]; + +//Also accepts json +//Pay +$response = $buckaroo->method('in3')->pay($payload); + +//Refund +$response = $buckaroo->method('in3')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/in3old.php b/vendor/buckaroo/sdk/example/transactions/in3old.php new file mode 100644 index 000000000..77272c075 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/in3old.php @@ -0,0 +1,78 @@ + 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' => [ + [ + 'identifier' => uniqid(), + 'description' => 'Blue Toy Car', + 'quantity' => '1', + 'price' => 10.00, + ], + ], + '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', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '2', + 'houseNumberAdditional' => 'a', + 'zipcode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'subtotals' => [ + [ + 'name' => 'Korting', + 'value' => -2.00, + ], + [ + 'name' => 'Betaaltoeslag', + 'value' => 0.50, + ], + [ + 'name' => 'Verzendkosten', + 'value' => 1.00, + ], + ], +]; + +//Also accepts json +//Pay +$response = $buckaroo->method('in3Old')->pay($payload); + +//Pay installment +$response = $buckaroo->method('in3Old')->payInInstallments($payload); + +//Refund +$response = $buckaroo->method('in3Old')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/kbc.php b/vendor/buckaroo/sdk/example/transactions/kbc.php new file mode 100644 index 000000000..a3e056a41 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/kbc.php @@ -0,0 +1,22 @@ +method('kbcpaymentbutton')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, +]); + + +//Refund +$response = $buckaroo->method('kbcpaymentbutton')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/klarna.php b/vendor/buckaroo/sdk/example/transactions/klarna.php new file mode 100644 index 000000000..5ea0e212f --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/klarna.php @@ -0,0 +1,141 @@ +method('klarna')->pay([ + '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', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', + ], + 'email' => 'test@buckaroo.nl', + ], + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'NL', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + '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', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'a', + 'zipcode' => '1234AB', + 'city' => 'Heerenveen', + 'country' => 'GB', + ], + 'phone' => [ + 'mobile' => '0698765433', + 'landline' => '0109876543', + ], + 'email' => 'test@buckaroo.nl', + ], + 'shipping' => [ + 'recipient' => [ + 'category' => 'B2B', + 'gender' => 'male', + 'firstName' => 'John', + 'lastName' => 'Do', + 'birthDate' => '1990-01-01', + ], + 'address' => [ + 'street' => 'Kalverstraat', + 'houseNumber' => '13', + 'houseNumberAdditional' => 'b', + 'zipcode' => '4321EB', + 'city' => 'Amsterdam', + 'country' => 'GB', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + '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, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/klarnakp.php b/vendor/buckaroo/sdk/example/transactions/klarnakp.php new file mode 100644 index 000000000..15f878870 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/klarnakp.php @@ -0,0 +1,68 @@ +method('klarnakp')->reserve([ + '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', + ], + 'phone' => [ + 'mobile' => '0612345678', + ], + 'email' => 'youremail@example.nl', + ], + 'shipping' => [ + 'recipient' => [ + 'firstName' => 'John', + 'lastName' => 'Do', + ], + 'address' => [ + 'street' => 'Rosenburglaan', + 'houseNumber' => '216', + 'zipcode' => '4385 JM', + 'city' => 'Vlissingen', + 'country' => 'NL', + ], + 'email' => 'test@buckaroo.nl', + ], + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'vatPercentage' => '21', + 'quantity' => '2', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'vatPercentage' => '21', + 'quantity' => '1', + 'price' => '10.10', + ], + ], +]); + +//Refund +$response = $buckaroo->method('klarnakp')->refund([ + 'amountCredit' => 10, + 'invoice' => '10000480', + 'originalTransactionKey' => '9AA4C81A08A84FA7B68E6A6A6291XXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/noservicespecified.php b/vendor/buckaroo/sdk/example/transactions/noservicespecified.php new file mode 100644 index 000000000..c68fde4f4 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/noservicespecified.php @@ -0,0 +1,27 @@ +method(null)->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'servicesSelectableByClient' => 'ideal,bancontactmrcash,paypal', + 'servicesExcludedForClient' => 'ideal', + 'continueOnIncomplete' => '1', +]); + + +//Refund +$response = $buckaroo->method(null)->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/payconiq.php b/vendor/buckaroo/sdk/example/transactions/payconiq.php new file mode 100644 index 000000000..af2521f99 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/payconiq.php @@ -0,0 +1,22 @@ +method('payconiq')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'description' => 'Payment for testinvoice123', +]); + +//Refund +$response = $buckaroo->method('payconiq')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '4E8BD922192746C3918BF4077CXXXXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/payment_initiation.php b/vendor/buckaroo/sdk/example/transactions/payment_initiation.php new file mode 100644 index 000000000..b8eb9eb2f --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/payment_initiation.php @@ -0,0 +1,23 @@ +method('paybybank')->pay([ + 'returnURL' => 'https://example.com/return', + 'amountDebit' => 10, + 'description' => 'Payment for testinvoice123', + 'issuer' => 'ABNANL2A', +]); + +//Refund +$response = $buckaroo->method('paybybank')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10, +]); \ No newline at end of file diff --git a/vendor/buckaroo/sdk/example/transactions/paypal.php b/vendor/buckaroo/sdk/example/transactions/paypal.php new file mode 100644 index 000000000..d29585276 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/paypal.php @@ -0,0 +1,48 @@ +method('paypal')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), +]); + +//Recurrent Payment +$response = $buckaroo->method('paypal')->payRecurrent([ + 'amountDebit' => 10, + 'originalTransactionKey' => 'C32C0B52E1FE4A37835FFB1716XXXXXX', + 'invoice' => uniqid(), +]); + +//Pay with extra info +$response = $buckaroo->method('paypal')->extraInfo([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'customer' => [ + 'name' => 'John Smith', + ], + 'address' => [ + 'street' => 'Hoofstraat 90', + 'street2' => 'Street 2', + 'city' => 'Heerenveen', + 'state' => 'Friesland', + 'zipcode' => '8441AB', + 'country' => 'NL', + ], + 'phone' => [ + 'mobile' => '0612345678', + ], +]); + +//Refund +$response = $buckaroo->method('paypal')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/pos.php b/vendor/buckaroo/sdk/example/transactions/pos.php new file mode 100644 index 000000000..d0b9b4b96 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/pos.php @@ -0,0 +1,15 @@ +method('pospayment')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'terminalID' => '50000001', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/przelewy24.php b/vendor/buckaroo/sdk/example/transactions/przelewy24.php new file mode 100644 index 000000000..70ceaaaf4 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/przelewy24.php @@ -0,0 +1,26 @@ +method("przelewy24")->pay([ + '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', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/sepa.php b/vendor/buckaroo/sdk/example/transactions/sepa.php new file mode 100644 index 000000000..f46409760 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/sepa.php @@ -0,0 +1,29 @@ +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', + ], +]); + +//Refund +$response = $buckaroo->method('sepadirectdebit')->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, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/sofort.php b/vendor/buckaroo/sdk/example/transactions/sofort.php new file mode 100644 index 000000000..877c8f599 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/sofort.php @@ -0,0 +1,22 @@ +method('sofortueberweisung')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, +]); + + +//Refund +$response = $buckaroo->method('sofortueberweisung')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/thunes.php b/vendor/buckaroo/sdk/example/transactions/thunes.php new file mode 100644 index 000000000..0551656fd --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/thunes.php @@ -0,0 +1,29 @@ +method('thunes')->pay([ + 'amountDebit' => 30.20, + 'name' => 'monizzeecovoucher', + 'order' => uniqid(), + 'invoice' => uniqid(), + 'clientIP' => '127.0.0.1', + 'articles' => [ + [ + 'identifier' => 'Articlenumber1', + 'description' => 'Blue Toy Car', + 'price' => '20.10', + ], + [ + 'identifier' => 'Articlenumber2', + 'description' => 'Red Toy Car', + 'price' => '10.10', + ], + ], +]); diff --git a/vendor/buckaroo/sdk/example/transactions/tinka.php b/vendor/buckaroo/sdk/example/transactions/tinka.php new file mode 100644 index 000000000..441b53e0b --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/tinka.php @@ -0,0 +1,81 @@ +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' => [ + [ + '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', + ], + 'billing' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', + ], + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => [ + 'mobile' => '0109876543', + ], + 'address' => [ + 'street' => 'Hoofdstraat', + 'houseNumber' => '80', + 'houseNumberAdditional' => 'A', + 'zipcode' => '8441EE', + 'city' => 'Heerenveen', + 'country' => 'NL', + ], + ], + 'shipping' => [ + 'recipient' => [ + 'lastNamePrefix' => 'the', + ], + 'email' => 'billingcustomer@buckaroo.nl', + 'phone' => [ + 'mobile' => '0109876543', + ], + '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', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/transfer.php b/vendor/buckaroo/sdk/example/transactions/transfer.php new file mode 100644 index 000000000..0e8ad539f --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/transfer.php @@ -0,0 +1,31 @@ +method('transfer')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'email' => 'your@email.com', + 'country' => 'NL', + 'dateDue' => date("Y-m-d"), + 'sendMail' => true, + 'customer' => [ + 'gender' => Gender::MALE, + 'firstName' => 'John', + 'lastName' => 'Smith', + ], +]); + +//Refund +$response = $buckaroo->method('transfer')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/vendor/buckaroo/sdk/example/transactions/trustly.php b/vendor/buckaroo/sdk/example/transactions/trustly.php new file mode 100644 index 000000000..fca9c7fa4 --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/trustly.php @@ -0,0 +1,26 @@ +method('trustly')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'country' => 'DE', + 'customer' => [ + 'firstName' => 'Test', + 'lastName' => 'Aflever', + ], +]); + +//Refund +$response = $buckaroo->method('trustly')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/vendor/buckaroo/sdk/example/transactions/wechat.php b/vendor/buckaroo/sdk/example/transactions/wechat.php new file mode 100644 index 000000000..fbf1ff56a --- /dev/null +++ b/vendor/buckaroo/sdk/example/transactions/wechat.php @@ -0,0 +1,22 @@ +method('wechatpay')->pay([ + 'amountDebit' => 10, + 'invoice' => uniqid(), + 'locale' => 'en-US', +]); + +//Refund +$response = $buckaroo->method('wechatpay')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', +]); diff --git a/vendor/buckaroo/sdk/phpcs.xml b/vendor/buckaroo/sdk/phpcs.xml new file mode 100644 index 000000000..e60e272dc --- /dev/null +++ b/vendor/buckaroo/sdk/phpcs.xml @@ -0,0 +1,22 @@ + +ErrorHandler::register($logger);
+ *
+ * @author Jordi Boggiano '.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').''; + } + + return "
+ A PHP library for generating and working with UUIDs. +
+ + + +ramsey/uuid is a PHP library for generating and working with universally unique +identifiers (UUIDs). + +This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). +By participating in this project and its community, you are expected to +uphold this code. + +Much inspiration for this library came from the [Java][javauuid] and +[Python][pyuuid] UUID libraries. + +## Installation + +The preferred method of installation is via [Composer][]. Run the following +command to install the package and add it as a requirement to your project's +`composer.json`: + +```bash +composer require ramsey/uuid +``` + +## Upgrading to Version 4 + +See the documentation for a thorough upgrade guide: + +* [Upgrading ramsey/uuid Version 3 to 4](https://uuid.ramsey.dev/en/stable/upgrading/3-to-4.html) + +## Documentation + +Please see