-
Notifications
You must be signed in to change notification settings - Fork 1
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
Handle Blik Level 0 payments #14
Conversation
ff36684
to
4c2868a
Compare
6995cbd
to
3cffa46
Compare
3cffa46
to
ddf63ec
Compare
26475bf
to
914043f
Compare
914043f
to
69bc7fd
Compare
Missing points:
|
I'll make a separate task to cover non happy path cases. |
'sylius.shop.checkout.complete.summary' => [ | ||
'blocks' => [ | ||
'blik' => [ | ||
'template' => '@CommerceWeaversSyliusTpayPlugin/blik.html.twig', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Templates like that should be rather placed in some subfolder. Shop prefix should be placed at least
@@ -4,6 +4,7 @@ | |||
|
|||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | |||
|
|||
use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateBlik0TransactionAction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's adjust naming to @coldic3 suggestion
use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateBlik0TransactionAction; | |
use CommerceWeavers\SyliusTpayPlugin\Payum\Action\Api\CreateBlikLevelZeroTransactionAction; |
if @jakubtobiasz is fine with that
@@ -20,6 +21,7 @@ | |||
$services->set(CaptureAction::class) | |||
->args([ | |||
service('commerce_weavers.tpay.payum.factory.create_transaction'), | |||
service('commerce_weavers.tpay.payum.factory.create_blik0_transaction'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or at least we can adjust service names
service('commerce_weavers.tpay.payum.factory.create_blik0_transaction'), | |
service('commerce_weavers.tpay.payum.factory.create_blik_level_zero_transaction'), |
@@ -28,4 +29,8 @@ | |||
$services->set('commerce_weavers.tpay.payum.factory.create_transaction', CreateTransactionFactory::class) | |||
->alias(CreateTransactionFactoryInterface::class, 'commerce_weavers.tpay.payum.factory.create_transaction') | |||
; | |||
|
|||
$services->set('commerce_weavers.tpay.payum.factory.create_blik0_transaction', CreateBlik0TransactionFactory::class) | |||
->alias(CreateTransactionFactoryInterface::class, 'commerce_weavers.tpay.payum.factory.create_blik0_transaction') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
trait OrderLastNewPaymentAwareTrait | ||
{ | ||
public function getLastNewPayment(): ?PaymentInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading naming. Payment on its own has new
state and according to name I would expect such a payment.
public function getLastNewPayment(): ?PaymentInterface | |
public function getLastCartPayment(): ?PaymentInterface |
class name should be changed as well
{ | ||
$builder->add('others', PaymentDetailsType::class, [ | ||
'label' => 'commerce_weavers_sylius_tpay.payment.blik.token', | ||
// TODO some validation that works becuase this kind does not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No todos nor comments should be committed to the codebase. You are more than welcome to open an issue and add it to board
@@ -29,6 +30,14 @@ public function execute($request): void | |||
/** @var PaymentInterface $model */ | |||
$model = $request->getModel(); | |||
|
|||
if ($this->transactionIsBlik($model)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'mon, it is widely accepted practice to put is
and other verbs at the beginning of functions, please adjust code to informal standard
if ($this->transactionIsBlik($model)) { | |
if ($this->isBlikTransaction($model)) { |
closes #6