All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
/** * @param WC_Order $order * @param Mollie_API_Object_Payment $payment * @param bool $admin_instructions * @param bool $plain_text * @return string|null */ protected function getInstructions(WC_Order $order, Mollie_API_Object_Payment $payment, $admin_instructions, $plain_text) { if ($payment->isPaid() && $payment->details) { return sprintf(__('Payment completed by <strong>%s</strong> (IBAN: %s, BIC: %s)', 'mollie-payments-for-woocommerce'), $payment->details->consumerName, implode(' ', str_split($payment->details->consumerAccount, 4)), $payment->details->consumerBic); } return parent::getInstructions($order, $payment, $admin_instructions, $plain_text); }
/** * @param WC_Order $order * @param Mollie_API_Object_Payment $payment * @param bool $admin_instructions * @param bool $plain_text * @return string|null */ protected function getInstructions(WC_Order $order, Mollie_API_Object_Payment $payment, $admin_instructions, $plain_text) { $instructions = ''; if ($payment->isPaid() && $payment->details) { $instructions .= sprintf(__('Payment completed by <strong>%s</strong>', 'mollie-payments-for-woocommerce'), $payment->details->cardHolder); } return $instructions; }
/** * @param WC_Order $order * @param Mollie_API_Object_Payment $payment * @param bool $admin_instructions * @param bool $plain_text * @return string|null */ protected function getInstructions(WC_Order $order, Mollie_API_Object_Payment $payment, $admin_instructions, $plain_text) { $instructions = ''; if ($payment->isPaid() && $payment->details) { $instructions .= sprintf(__("Payment completed by <strong>%s</strong> - %s (PayPal transaction ID: %s)", 'mollie-payments-for-woocommerce'), $payment->details->consumerName, $payment->details->consumerAccount, $payment->details->paypalReference); } return $instructions; }
/** * @param WC_Order $order * @param Mollie_API_Object_Payment $payment * @param bool $admin_instructions * @param bool $plain_text * @return string|null */ protected function getInstructions(WC_Order $order, Mollie_API_Object_Payment $payment, $admin_instructions, $plain_text) { $instructions = ''; if (!$payment->details) { return null; } $data_helper = Mollie_WC_Plugin::getDataHelper(); if ($payment->isPaid()) { $instructions .= sprintf(__('Payment completed by <strong>%s</strong> (IBAN: %s, BIC: %s)', 'mollie-payments-for-woocommerce'), $payment->details->consumerName, implode(' ', str_split($payment->details->consumerAccount, 4)), $payment->details->consumerBic); } elseif ($data_helper->hasOrderStatus($order, 'on-hold')) { if (!$admin_instructions) { $instructions .= __('Please complete your payment by transferring the total amount to the following bank account:', 'mollie-payments-for-woocommerce') . "\n\n\n"; } /* translators: Placeholder 1: 'Stichting Mollie Payments' */ $instructions .= sprintf(__('Beneficiary: %s', 'mollie-payments-for-woocommerce'), $payment->details->bankName) . "\n"; $instructions .= sprintf(__('IBAN: <strong>%s</strong>', 'mollie-payments-for-woocommerce'), implode(' ', str_split($payment->details->bankAccount, 4))) . "\n"; $instructions .= sprintf(__('BIC: %s', 'mollie-payments-for-woocommerce'), $payment->details->bankBic) . "\n"; if ($admin_instructions) { /* translators: Placeholder 1: Payment reference e.g. RF49-0000-4716-6216 (SEPA) or +++513/7587/59959+++ (Belgium) */ $instructions .= sprintf(__('Payment reference: %s', 'mollie-payments-for-woocommerce'), $payment->details->transferReference) . "\n"; } else { /* translators: Placeholder 1: Payment reference e.g. RF49-0000-4716-6216 (SEPA) or +++513/7587/59959+++ (Belgium) */ $instructions .= sprintf(__('Please provide the payment reference <strong>%s</strong>', 'mollie-payments-for-woocommerce'), $payment->details->transferReference) . "\n"; } if (!empty($payment->expiryPeriod) && class_exists('DateTime') && class_exists('DateInterval')) { $expiry_date = DateTime::createFromFormat('U', time()); $expiry_date->add(new DateInterval($payment->expiryPeriod)); if ($admin_instructions) { $instructions .= "\n" . sprintf(__('The payment will expire on <strong>%s</strong>.', 'mollie-payments-for-woocommerce'), $expiry_date->format(wc_date_format())) . "\n"; } else { $instructions .= "\n" . sprintf(__('The payment will expire on <strong>%s</strong>. Please make sure you transfer the total amount before this date.', 'mollie-payments-for-woocommerce'), $expiry_date->format(wc_date_format())) . "\n"; } } } return $instructions; }
/** * @param WC_Order $order * @param Mollie_API_Object_Payment $payment * @param bool $admin_instructions * @param bool $plain_text * @return string|null */ protected function getInstructions(WC_Order $order, Mollie_API_Object_Payment $payment, $admin_instructions, $plain_text) { // No definite payment status if ($payment->isOpen()) { if ($admin_instructions) { // Message to admin return __('We have not received a definite payment status.', 'mollie-payments-for-woocommerce'); } else { // Message to customer return __('We have not received a definite payment status. You will receive an email as soon as we receive a confirmation of the bank/merchant.', 'mollie-payments-for-woocommerce'); } } elseif ($payment->isPaid()) { return sprintf(__('Payment completed with <strong>%s</strong>', 'mollie-payments-for-woocommerce'), $this->get_title()); } return null; }