Source of file ChequePayment.php
Size: 1,249 Bytes - Last Modified: 2021-12-23T10:33:28+00:00
/var/www/docs.ssmods.com/process/src/code/ChequePayment/ChequePayment.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <?php /** * Payment object representing a cheque payment. * * @package payment */ class ChequePayment extends Payment { /** * Process the Cheque payment method */ public function processPayment($data, $form) { $this->Status = 'Pending'; $this->Message = '<p class="warningMessage">' . _t('ChequePayment.MESSAGE', 'Payment accepted via Cheque. Please note : products will not be shipped until payment has been received.') . '</p>'; $this->write(); return new Payment_Success(); } public function getPaymentFormFields() { return new FieldSet( // retrieve cheque content from the ChequeContent() method on this class new LiteralField("Chequeblurb", '<div id="Cheque" class="typography">' . $this->ChequeContent() . '</div>'), new HiddenField("Cheque", "Cheque", 0) ); } public function getPaymentFormRequirements() { return null; } /** * Returns the Cheque content from the CheckoutPage */ public function ChequeContent() { if (class_exists('CheckoutPage')) { return DataObject::get_one('CheckoutPage')->ChequeMessage; } } } |