-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FEATURE]Plugin development #3
Conversation
$orderData = $this->prepareOrderData($order, $token); | ||
|
||
$model['tokenHash'] = $token->getHash(); | ||
$model['statusImoje'] = ImojeApiInterface::NEW_STATUS; |
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.
I think it will be better if you move the field names to the common model interface. In other actions you also use these field.
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.
I think I should leave it like that - it's kind of standard in payum and this model doesn't have a specific interface
src/Action/CaptureAction.php
Outdated
return $orderData; | ||
} | ||
|
||
private function createSignature(array $fields, string $serviceKey): string |
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.
it can be simple separate service (I'm not sure because I don't know the requirements of the gateway but if someone who is going to use the plugin wants to change these signatures then all they need to do is overwrite this one small service without dependencies)
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.
moved to SignatureResolver
src/Action/NotifyAction.php
Outdated
$serviceKey = $this->api->getServiceKey(); | ||
|
||
$parts = []; | ||
parse_str(str_replace([';', '='], ['&', '='], $headerSignature), $parts); |
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.
you can also move these strings to this common interface
public const SANDBOX_PAYWALL_URL = 'https://sandbox.paywall.imoje.pl/payment'; | ||
public const PRODUCTION_PAYWALL_URL = 'https://paywall.imoje.pl/payment'; |
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.
Isn't it better to have it as parameter in case they change something?
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.
I think there is not much chance of changing this link and they are not available in the imoje admin panel, so the end user would have to look for it in the API documentation
src/Controller/NotifyController.php
Outdated
public function verifyImojeNotification(Request $request): Response | ||
{ | ||
if (!$request->getContent()) { | ||
return new Response('', 204); |
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.
return new Response('', 204); | |
return new Response('', Response::HTTP_NO_CONTENT); |
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.
changed
src/Controller/NotifyController.php
Outdated
|
||
$gateway->execute(new Notify($notifyToken)); | ||
|
||
return new JsonResponse(['status' => 'ok'], 200); |
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.
return new JsonResponse(['status' => 'ok'], 200); | |
return new JsonResponse(['status' => 'ok']); |
You don't need to pass default value of the argument
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.
changed
No description provided.