hi there, I'm thinking about using the e-commerce module but the payment options are kinda debar me. the favourite payment method of my client would be just paying by bill (it's national anyway, Switzerland) and I was wondering if that's possible or at least if it's possible to add this as a second payment method?
thanks for any help!
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
E-Commerce Modules /
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba
paying by bill?
come on, nobody does know?
Hi Wilhelm,
I have never used the commerce module , but I know for sure that it is possible to build your own payment options. (you are lucky, paying by bill sounds like a very easy one... ;-) ....
yes I know. well I'm not really good at PHP and not really familiar with e-shops - yet - but well, everybody needs to start somewhere, right. I thought probably somebody would have already created a payment option like that and could give me some advices?
Hi there
as default u can use cheque option - this is like bank transfer (bill payment).
Best regards,
Mind
This might help i've done similar
##### ecommerce/code/Ivoicepayment #####
<?php
/**
* @package ecommerce
*/
/**
* Payment object representing a invoice payment
*/
class InvoicePayment extends Payment {
/**
* Process the Cheque payment method
*/
function processPayment($data, $form) {
if(!$this->PaymentMethod)
$this->PaymentMethod = "InvoicePayment";
if(!$this->Status)
$this->Status = "Pending";
if(!$this->Message)
$this->Message = "<p class=\"warningMessage\">Payment is outstanding.</p>";
$result['Success'] = "Success";
$result['PaymentID'] = $this->write();
return $result;
}
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("Invoice", "Invoice", 0)
);
}
function getPaymentFormRequirements() {
return null;
}
/**
* Returns the Cheque content from the CheckoutPage
*/
function ChequeContent() {
return "Payment is outstanding.";
}
/**
* Function used for in template to check if payment is cheque.
*/
function IsInvoicePayment(){
return true;
}
}
?>
// Then to add this new payment type add the following to you config file
Payment::set_supported_methods(array(
//'DPSPayment' => 'Credit Card (DPS)',
//'ChequePayment' => 'Cheque',
'InvoicePayment' => 'Invoice Payment'
));
Hope thats some help