Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

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

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

Ecommerce need help add more payment gateway


Go to End
Reply

10 Posts   3692 Views

Avatar
snovvvolf

27 June 2008 at 4:47am Community Member, 51 Posts

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?

Avatar
Willr

27 June 2008 at 9:31am Forum Moderator, 5511 Posts

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
   }

Avatar
snovvvolf

27 June 2008 at 3:30pm Community Member, 51 Posts

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

Avatar
Willr

27 June 2008 at 3:59pm Forum Moderator, 5511 Posts

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

Avatar
snovvvolf

28 June 2008 at 8:50pm Community Member, 51 Posts

willr

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

Avatar
Willr

28 June 2008 at 8:57pm Forum Moderator, 5511 Posts

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?

Avatar
snovvvolf

28 June 2008 at 9:10pm Community Member, 51 Posts

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>

Avatar
Willr

28 June 2008 at 9:16pm Forum Moderator, 5511 Posts

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

Go to Top