Jump to:

2081 Posts in 1001 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » paying by bill?

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, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1428 Views
  • wilhelm oder wil er nicht
    Avatar
    Community Member
    16 Posts

    paying by bill? Link to this post

    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!

  • wilhelm oder wil er nicht
    Avatar
    Community Member
    16 Posts

    Re: paying by bill? Link to this post

    come on, nobody does know?

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: paying by bill? Link to this post

    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... ;-) ....

  • wilhelm oder wil er nicht
    Avatar
    Community Member
    16 Posts

    Re: paying by bill? Link to this post

    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?

  • Digital-Punk.co.uk
    Avatar
    Community Member
    51 Posts

    Re: paying by bill? Link to this post

    Hi there

    as default u can use cheque option - this is like bank transfer (bill payment).

    Best regards,
    Mind

  • Phill
    Avatar
    Community Member
    75 Posts

    Re: paying by bill? Link to this post

    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

    1428 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.