Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Ecommerce need help add more payment gateway

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 3678 Views
  • snovvvolf
    Avatar
    Community Member
    51 Posts

    Ecommerce need help add more payment gateway Link to this post

    i know that when need to add more then one payment gateway must add in the code, can some one show me how to add in the code.

    For example:

    class CustomPayment extends Payment {

    // insert your payment code here, refer to DPSPayment.php or WorldpayPayment.php
    // for reference.

    }

    what code to write in the //???,what is the payment code, where can i find it?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    refer to DPSPayment.php or WorldpayPayment.php..

    The code you write in there is whatever custom code you need to connect/sync with the payment system. You need to at least overload these methods with your custom payment code

       function getPaymentFormFields() {
    // your payment gateway fields
       }
       
       function processPayment($data, $form) {
    // how to process your payment - send to server etc
       }
       
       function getPaymentFormRequirements() {
    // required fields
       }

  • snovvvolf
    Avatar
    Community Member
    51 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    HI willr

    i still every ble ble, what is the code you show me, no too detail.

    can write down the code like wordpay and paypal payment gateway i want to add in my ecommerce.

    give me the guide can follow step by step.

    thank

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    can write down the code like wordpay and paypal payment gateway i want to add in my ecommerce.

    The code for those 2 gateways are bundled with the Ecommerce module I suggest you dig round inside those and play around with how they work. The most simiplest (well the easiest to follow is the DPSPayment.php

    give me the guide can follow step by step.
    There is no written guide on how to setup a custom payment, Ive never written one but if you use DPSPayment.php as a good start then your CustomPayment.php file would look like http://pastie.org/223108

    Again, best bit is to dig round WorldPayPayment.php, DPSPayment.php and PaypalPayment.php for examples

  • snovvvolf
    Avatar
    Community Member
    51 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    willr

    can i just copy and paste the code from the pastie.org site, do i need to edit any think on the code?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    do i need to edit any think on the code?

    You need to edit it to support your payment gateway. What payment gateway are you trying to support?

  • snovvvolf
    Avatar
    Community Member
    51 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    i try to use paypal payment gateway. what shut i edit?, i already download a new paypal.php on the forum, can i upload to my ecommerce file to add in the new paypal.php. and one more fill is paypal payment gateway file.ss where i must upload this .ss file to wich folder?

    the paypal payment.ss file code is like below:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
    <% base_tag %>
    <title>$Title</title>
    <link href="$project/css/typography.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #paypalPaymentPage {
    margin: 200px;
    }
    </style>
    </head>
    <body id="paypalPaymentPage">
    <div class="typography">
    $PayPalInstructions
    $Content
    </div>
    </body>
    </html>

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce need help add more payment gateway Link to this post

    I believe that code should go in themes/yourtheme/Templates/

    3678 Views
Page: 1 2
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.