Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BA-591: add ArticleProductUrl and ArticleImageUrl Parameters to KlarnaKP #197

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/PaymentMethods/KlarnaKP/Models/Article.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact [email protected] for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\PaymentMethods\KlarnaKP\Models;

class Article extends \Buckaroo\Models\Article
{
protected ?string $imageUrl;
protected ?string $productUrl;
}
1 change: 0 additions & 1 deletion src/PaymentMethods/KlarnaKP/Models/Payload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

namespace Buckaroo\PaymentMethods\KlarnaKP\Models;

use Buckaroo\Models\Article;
use Buckaroo\Models\ServiceParameter;
use Buckaroo\PaymentMethods\KlarnaKP\Service\ParameterKeys\ArticleAdapter;
use Buckaroo\PaymentMethods\Traits\CountableGroupKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ class ArticleAdapter extends ServiceParametersKeysAdapter
'price' => 'ArticlePrice',
'quantity' => 'ArticleQuantity',
'vatPercentage' => 'ArticleVat',
'imageUrl' => 'ArticleImageUrl',
'productUrl' => 'ArticleProductUrl',
];
}
9 changes: 9 additions & 0 deletions tests/Buckaroo/Payments/KlarnaKPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,17 @@ public function it_creates_a_klarnakp_update_reservation()
'vatPercentage' => '21',
'quantity' => '2',
'price' => '20.10',
'imageUrl' => 'https://example.com/image',
'productUrl' => 'https://example.com/product',
],
[
'identifier' => 'Articlenumber2',
'description' => 'Red Toy Car',
'vatPercentage' => '21',
'quantity' => '1',
'price' => '10.10',
'imageUrl' => 'https://example.com/image',
'productUrl' => 'https://example.com/product',
],
],
]);
Expand All @@ -143,6 +147,7 @@ public function it_creates_a_klarnakp_refund()
private function getPaymentPayload(?array $additional = null): array
{
$payload = [
'clientIP' => '198.162.1.1',
'currency' => 'EUR',
'amountDebit' => 50.30,
'order' => uniqid(),
Expand Down Expand Up @@ -187,13 +192,17 @@ private function getPaymentPayload(?array $additional = null): array
'vatPercentage' => '21',
'quantity' => '2',
'price' => '20.10',
'imageUrl' => 'https://example.com/image',
'productUrl' => 'https://example.com/product',
],
[
'identifier' => 'Articlenumber2',
'description' => 'Red Toy Car',
'vatPercentage' => '21',
'quantity' => '1',
'price' => '10.10',
'imageUrl' => 'https://example.com/image',
'productUrl' => 'https://example.com/product',
],
]
];
Expand Down
Loading