diff --git a/Command/TreatOrderMultiPaymentCommand.php b/Command/TreatOrderMultiPaymentCommand.php index 7efe8d4..8b39515 100755 --- a/Command/TreatOrderMultiPaymentCommand.php +++ b/Command/TreatOrderMultiPaymentCommand.php @@ -6,6 +6,7 @@ use PayPlugModule\Model\OrderPayPlugMultiPayment; use PayPlugModule\Model\OrderPayPlugMultiPaymentQuery; use Propel\Runtime\ActiveQuery\Criteria; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Thelia\Command\ContainerAwareCommand; @@ -45,5 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $todayPlannedOrderPayment->setPaymentId($paymentEvent->getPaymentId()) ->save(); } + + return Command::SUCCESS; } } \ No newline at end of file diff --git a/Config/module.xml b/Config/module.xml index 7072428..7ed0c5d 100755 --- a/Config/module.xml +++ b/Config/module.xml @@ -17,7 +17,7 @@ en_US fr_FR - 3.0.0 + 3.1.0 Vincent Lopes-Vicente diff --git a/Service/PaymentService.php b/Service/PaymentService.php index 0e7c623..eccbacc 100755 --- a/Service/PaymentService.php +++ b/Service/PaymentService.php @@ -42,9 +42,9 @@ public function isPayPlugAvailable() */ public function sendOrderPayment( Order $order, - bool $capture = false, - bool $allowSaveCard = false, - int $paymentSlice = 1, + bool $capture, + bool $allowSaveCard, + int $paymentSlice, float $totalOrder ) { $paymentEvent = (new PayPlugPaymentEvent()) diff --git a/templates/backOffice/default/PayPlugModule/assets/logo-payplug.png b/templates/backOffice/default/PayPlugModule/assets/logo-payplug.png deleted file mode 100755 index fbc631c..0000000 Binary files a/templates/backOffice/default/PayPlugModule/assets/logo-payplug.png and /dev/null differ diff --git a/templates/backOffice/default/PayPlugModule/configuration.html b/templates/backOffice/default/PayPlugModule/configuration.html deleted file mode 100755 index 1f2cd9f..0000000 --- a/templates/backOffice/default/PayPlugModule/configuration.html +++ /dev/null @@ -1,408 +0,0 @@ -{extends file="admin-layout.tpl"} - -{block name="after-bootstrap-css"} - -{/block} - -{block name="no-return-functions"} -{$admin_current_location = 'module'} -{/block} - -{block name="page-title"}{intl l='PayPlug module configuration' d='payplugmodule.bo.default'}{/block} - -{block name="check-resource"}admin.module{/block} -{block name="check-access"}view{/block} -{block name="check-module"}PayPlug{/block} - -{block name="main-content"} - -
-
- {form name="payplugmodule_configuration_form"} -
- {form_hidden_fields form=$form} - - {if $form_error} -
{$form_error_message}
- {/if} - - {form_field form=$form field='success_url'} - - {/form_field} - -
-
-
- Payment configuration -
-
-
-

{intl l="PayPlug offer" d='payplugmodule.bo.default'}

-
-
- {form_field form=$form field="offer"} -
- -
- {$inputOfferName = {$name}} - {foreach from=$choices item=choice} - value}checked{/if} /> - - {/foreach} - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
-
-
-

{intl l="PayPlug API configuration" d='payplugmodule.bo.default'}

-
-
- {form_field form=$form field="api_mode"} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {form_field form=$form field='live_api_key'} - - - {if ! empty($label_attr.help)} - {$label_attr.help nofilter} - {/if} - {/form_field} -
-
- {form_field form=$form field='test_api_key'} - - - {if ! empty($label_attr.help)} - {$label_attr.help nofilter} - {/if} - {/form_field} -
-
-
-
-

{intl l="PayPlug basic payment configuration" d='payplugmodule.bo.default'}

-
-
- {form_field form=$form field="payment_enabled"} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {form_field form=$form field="payment_page_type"} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {render_form_field field="send_confirmation_message_only_if_paid"} -
-
-
-
-

{intl l="PayPlug pro offer configuration" d='payplugmodule.bo.default'}

-
-
- {form_field form=$form field="one_click_payment_enabled"} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {form_field form=$form field="multi_payment_enabled"} - {$inputMultiPaymentName = $name} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
-
- {intl l="Payments in several times are not guaranteed, a default may occur on future due dates." d='payplugmodule.bo.default'} -
-
- {form_field form=$form field='multi_payment_minimum'} - - - {/form_field} -
-
- {form_field form=$form field='multi_payment_maximum'} - - - {/form_field} -
-
- {form_field form=$form field="multi_payment_times"} -
- - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
-

- {intl l="To trigger the payments on planned date please add a daily cron on this Thelia command " d='payplugmodule.bo.default'} - php Thelia payplug:treat:multi_payment -

-
-
-
-
-
-

{intl l="PayPlug premium offer configuration" d='payplugmodule.bo.default'}

-
-
- {form_field form=$form field="differed_payment_enabled"} - {$inputDifferedPaymentName = $name} -
- - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
-
- {form_field form=$form field="differed_payment_authorized_capture_status"} -
- - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {form_field form=$form field="differed_payment_trigger_capture_status"} -
- - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
- {form_field form=$form field="differed_payment_capture_expired_status"} -
- - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} -
-
-
-
-
-

{intl l="PayPlug delivery type configuration" d='payplugmodule.bo.default'}

-

{intl l="Please select a Pay Plug delivery type correspondance for each delivery modules" d='payplugmodule.bo.default'}

-
-
- {foreach from=$deliveryModuleFormFields item="deliveryModuleFormField"} -
- {form_field form=$form field=$deliveryModuleFormField['name']} - - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} - {/form_field} -
- {/foreach} -
-
-
-
-
-
- -
-
-
-
- {/form} -
- {hook name="payplugmodule.configuration.bottom"} -
-{/block} - -{block name="javascript-initialization"} - -{/block} - -{block name="javascript-last-call"} - -{/block} diff --git a/templates/backOffice/default/PayPlugModule/order_pay_plug.html b/templates/backOffice/default/PayPlugModule/order_pay_plug.html deleted file mode 100644 index bd9cee4..0000000 --- a/templates/backOffice/default/PayPlugModule/order_pay_plug.html +++ /dev/null @@ -1,168 +0,0 @@ -
-
-

{intl l="PayPlug order data" d='payplugmodule.bo.default'}

-
-
- {form name="payplugmodule_order_action_form_refund"} - {if $form_error} -
{$form_error_message}
- {/if} - {/form} - {form name="payplugmodule_order_action_form"} - {if $form_error} -
{$form_error_message}
- {/if} - {/form} -
- - - {if $amountRefunded || $isPaid} - - - - - - {/if} - {if $needCapture} - - - {if null == $capturedAt} - - - {else} - - - {/if} - - {/if} - {if count($multiPayments) > 0} - - - - - {/if} - -
{intl l="Refund" d='payplugmodule.bo.default'} - {loop type="order" name="refund-order-amount" id=$order_id customer="*" with_prev_next_info="true" backend_context="1"} - {$orderTotalAmount = $TOTAL_TAXED_AMOUNT} - {$orderTotalAmountWithoutShipping = $TOTAL_TAXED_AMOUNT-$POSTAGE} - {/loop} - {if $amountRefunded} -
{format_money number=$amountRefunded/100} {intl l=" refunded" d='payplugmodule.bo.default'}
- {/if} - {if $orderTotalAmount > ($amountRefunded/100) } -
-
- - -
-
- -
- - - {currency attr="symbol"} -
-
- -
- {/if} -
{intl l="Differed payment" d='payplugmodule.bo.default'}{intl l="Payment capture will expire on " d='payplugmodule.bo.default'}{format_date date=$captureExpireAt} - - {intl l="Force the capture for this order" d='payplugmodule.bo.default'} - - - {intl l="Payment was captured at " d='payplugmodule.bo.default'}{format_date date=$capturedAt} -
{intl l="Multi payment" d='payplugmodule.bo.default'} - - - - - - - - - {$paymentCount = 1} - {foreach from=$multiPayments item=multiPayment} - - - - - - - - {$paymentCount = $paymentCount + 1} - {/foreach} -
{intl l="Payment n° " d='payplugmodule.bo.default'}{intl l="Amount" d='payplugmodule.bo.default'}{intl l="Planned at" d='payplugmodule.bo.default'}{intl l="Paid at" d='payplugmodule.bo.default'}{intl l="Refunded at" d='payplugmodule.bo.default'}
{$paymentCount}{format_money number=$multiPayment['amount']/100}{if $multiPayment['plannedAt']}{format_date date=$multiPayment['plannedAt']}{else}{intl l="Canceled" d='payplugmodule.bo.default'}{/if}{if $multiPayment['paidAt']}{format_date date=$multiPayment['paidAt']}{/if}{if $multiPayment['refundedAt']}{format_date date=$multiPayment['refundedAt']}{/if}
-
-
- -{capture "refund_dialog"} - {form name="payplugmodule_order_action_form_refund"} - {form_hidden_fields form=$form} - {if $form_error} -
{$form_error_message}
- {/if} - {form_field form=$form field='success_url'} - - {/form_field} - {form_field form=$form field="order_id"} - - {/form_field} - {form_field form=$form field="refund_amount"} - - {/form_field} - {/form} -{/capture} - -{include - file = "includes/generic-confirm-dialog.html" - - dialog_id = "order_refund_dialog" - dialog_title = {intl l="Refund order" d="payplugmodule.bo.default"} - dialog_message = {intl l="Do you really want to refund this order ?" d="payplugmodule.bo.default"} - -form_method = "POST" -form_action = {url path='/admin/payplugmodule/order/refund'} -form_content = {$smarty.capture.refund_dialog nofilter} -} - -{capture "capture_dialog"} - {form name="payplugmodule_order_action_form"} - {form_hidden_fields form=$form} - {if $form_error} -
{$form_error_message}
- {/if} - {form_field form=$form field='success_url'} - - {/form_field} - {form_field form=$form field="order_id"} - - {/form_field} - {/form} -{/capture} - -{include -file = "includes/generic-confirm-dialog.html" - -dialog_id = "order_capture_dialog" -dialog_title = {intl l="Capture order" d="payplugmodule.bo.default"} -dialog_message = {intl l="Do you really want to capture this order ?" d="payplugmodule.bo.default"} - -form_method = "POST" -form_action = {url path='/admin/payplugmodule/order/capture'} -form_content = {$smarty.capture.capture_dialog nofilter} -} \ No newline at end of file diff --git a/templates/backOffice/default/PayPlugModule/order_pay_plug.js b/templates/backOffice/default/PayPlugModule/order_pay_plug.js deleted file mode 100644 index 93f4b03..0000000 --- a/templates/backOffice/default/PayPlugModule/order_pay_plug.js +++ /dev/null @@ -1,21 +0,0 @@ -var inputAmountRefund = $('#input_amount_refund'); -var maxAmountRefund = parseFloat(inputAmountRefund.attr('max')); - -$("#quick_select_amount_refund").change(function (e) { - var amountToRefund = 0; - var selected = $(e.target).val(); - - if (null !== selected) { - amountToRefund = selected.reduce(function (a, c) { - return parseFloat(a) + parseFloat(c); - }); - } - - amountToRefund = amountToRefund > maxAmountRefund ? maxAmountRefund : amountToRefund; - inputAmountRefund.val(amountToRefund).trigger('change'); -}); - -inputAmountRefund.change(function (e) { - var amountToRefund = $(e.target).val() > maxAmountRefund ? maxAmountRefund : $(e.target).val(); - $("#refund_amount").val(amountToRefund); -}); \ No newline at end of file