Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Missing CUSTOM payment option
Author « Topic »  

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 04/21/2021 :  11:08:57  
I think my site is missing ./inc/customppplugin.php to allow me to modify the customppsend.php file for my customer.

I am trying to setup TYL for Natwest and cannot use the customer payment provider as it does not appear in the payment providers in the admin section.

The updater of course does not have this php file included in it.

Please help.

Vince
Administrator

42756 Posts

Posted - 04/21/2021 :  13:56:12  
Hi Kraken17
Just go to the payment providers admin page and look in the full list of payment providers for "Custom". It's always there so you don't need to do anything for it to show up in the list. For the customppsend.php, customppreturn.php and if necessary customppplugin.php files, if they are not there you can just create them.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 04/22/2021 :  01:44:01  
Vince,

It is not there.

I have a screenshot but cannot figure out how to attach it in the forum. Also ./inc/customppplugin.php do I need to put anything in the file or just create it?

Vince
Administrator

42756 Posts

Posted - 04/22/2021 :  06:40:53  
Hi Kraken17
If the Custom payment provider really is missing and you are able to access your database directly, look in the table "payprovider" and the "Custom" one is the one with the ID 14. If there is already a row with ID 14 then look for the column payProvEnabled and make sure that is set to 1. If it's not, then just add a row with ID 14, call it whatever you like and set the payProvEnabled to 1.
Most custom payment providers do not need a customppplugin which just allows you to modify / extend the interface in the Admin Payment Providers page and the Admin Orders page. If you are defining your own payment provider you can make changes directly in the customppsend.php and customppreturn.php files anyway. But if you want I can send you a copy of one and you can see how it works. Just send me an email to vince AT ecommercetemplates DOT com so I have your email.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 05/24/2021 :  07:44:36  
Vince,

Can you give me a list of variables I can use in customppsend.php please? Or point me in the correct direction.

Vince
Administrator

42756 Posts

Posted - 05/24/2021 :  11:27:26  
Sure, this is a dummy customppsend.php and it should have all the ones you need...

<?php
// This is an example of how you would go about setting up a custom payment
// provider for the Ecommerce Plus template range. More information can be found
// at https://www.ecommercetemplates.com
// Here we have used the 2Checkout.com system as an example of how a common payment
// processor works. You can edit this file to match the details of your particular payment system
// Other useful parameters are countryCode, shipCountryCode, countryCurrency
// Firstly you will need to set the URL to pass payment variables below in the FORM action ?>
<form method="post" action="https://www.2checkout.com/cgi-bin/sbuyers/cartpurchase.2c">
<?php // A unique id is assigned to each order so that we can track the order. This is available as the orderid. Edit the name cart_order_id to that which is used by your payment system. ?>
<input type="hidden" name="cart_order_id" value="<?php print $orderid?>" />
<?php // In the Ecommerce Templates admin section for the Custom Payment System, up to 2 pieces of data can be entered ?>
<?php // to configure a payment system. These are Data 1 and Data 2 and are available in the variables data1 and data2 ?>
<input type="hidden" name="sid" value="<?php print $data1?>" />
<?php // Our example of 2Checkout.com does not require a return URL, but I´ve included one below as an example if needed ?>
<input type="hidden" name="returnurl" value="<?php print $storeurl?>thanks.php" />
<?php // The variable ppmethod is available if needed to choose between authorize only and authorize capture payments. If this does not apply to your payment system just delete the line below ?>
<input type="hidden" name="paymenttype" value="<?php if($ppmethod==1) print "1"; else print "0" ?>" />
<?php // The following should be quite self explanatory ?>
<input type="hidden" name="total" value="<?php print $grandtotal?>" />
<input type="hidden" name="card_holder_name" value="<?php print $ordName?>" />
<input type="hidden" name="street_address" value="<?php print $ordAddress?>" />
<input type="hidden" name="city" value="<?php print $ordCity?>" />
<input type="hidden" name="state" value="<?php print $ordState?>" />
<input type="hidden" name="zip" value="<?php print $ordZip?>" />
<input type="hidden" name="country" value="<?php print $ordCountry?>" />
<input type="hidden" name="email" value="<?php print $ordEmail?>" />
<input type="hidden" name="phone" value="<?php print $ordPhone?>" />
<?php if($ordShipName != '' || $ordShipAddress != ''){ ?>
<input type="hidden" name="ship_name" value="<?php print $ordShipName?>" />
<input type="hidden" name="ship_street_address" value="<?php print $ordShipAddress?>" />
<input type="hidden" name="ship_city" value="<?php print $ordShipCity?>" />
<input type="hidden" name="ship_state" value="<?php print $ordShipState?>" />
<input type="hidden" name="ship_zip" value="<?php print $ordShipZip?>" />
<input type="hidden" name="ship_country" value="<?php print $ordShipCountry?>" />
<?php } ?>
<?php // A variable "demomode" is made available to the admin section that signals the payment method is in demo mode
if($demomode) print '<input type="hidden" name="demo" value="Y" />';
// IMPORTANT NOTE ! You may notice there is not closing <FORM> tag. This is intentional. ?>



Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/02/2021 :  13:45:18  
Hi Vince,

Me again. It seems that when the provider returns the header to our website to the 'siteurl\thanks.php' file that customppreturn.php is not run by anything.

The customppsend.php works wonderfully now, after a few trials and error - from both the tyl supplier and me the programmer. Just need to get the customppreturn to work.

When I have it working would you like a copy as TYL is fast becoming a leader in card processing - natwest provider.

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/02/2021 :  13:57:47  
Update to this - it seems unstripslashes() is missing from my server. I am trying to find out which php module to install onto my server.

insight
ECT Moderator

USA
4479 Posts

Posted - 06/02/2021 :  14:07:00  
quote:
Update to this - it seems unstripslashes() is missing from my server. I am trying to find out which php module to install onto my server.
It's an ECT function in vsadmin/inc/incfunctions.php.

Peter


Professional ecommerce web hosting services
Shared hosting Windows & Linux | Dedicated servers | Domains | SSL
Ecommerce Templates specialists since 2003
https://servelink.com

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/02/2021 :  14:35:17  
Ok - so I cannot run that customppreturn.php from a commandline to test it.

So when I use customppsend.php is sends to TYL, but it does not seem to use the customppreturn.php when called from thanks.php. I know this because I put a mail sender in that php to mail me me results sent back from the payment provider, and it does not send the email.

Vince
Administrator

42756 Posts

Posted - 06/03/2021 :  04:11:56  
quote:
Ok - so I cannot run that customppreturn.php from a commandline to test it.
There wouldn't be a lot of sense trying to run the script in isolation.

quote:
I know this because I put a mail sender in that php to mail me me results sent back from the payment provider, and it does not send the email.
Why not just put a "print" statement or a bit of HTML in that page? This script should just be run on return from the payment provider. It's not something that is run invisibly in the background.

Vince


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/03/2021 :  08:22:12  
Am I being thick?

This is customppreturn.php - but I do not know if it is even running. I am not getting the 'got here' on the webpage

<?php
// This is an example of how you would go about setting up a custom payment
// provider for the Ecommerce Plus template range. More information can be found
// at https://www.ecommercetemplates.com
// Here we have used the 2Checkout.com system as an example of how a common payment
// processor works. You can edit this file to match the details of your particular payment system

// Payment systems will normally pass back 3 different pieces of information. One will be the order
// id that we sent with the transaction. The second will be the authorization code and sometimes a
// variable will be passed back indicating the success of the transaction. You can use these to
// check that the order did indeed come from the payment system you are implementing
$theorderid=unstripslashes(trim(@$_POST['cart_order_id']));
$theauthcode=unstripslashes(trim(@$_POST['ipgTransactionId']));
$thesuccess=unstripslashes(trim(@$_POST['success']));
print "Got here";
if($theorderid != '' && $theauthcode != '' && $thesuccess=='APPROVED'){
// You should not normally need to change the code below
$sSQL="UPDATE cart SET cartCompleted=1 WHERE cartOrderID='" . mysql_escape_string($theorderid) . "'";
mysql_query($sSQL) or print(mysql_error());
$sSQL="UPDATE orders SET ordStatus=3,ordAuthNumber='" . mysql_escape_string($theauthcode) . "' WHERE ordPayProvider=14 AND ordID=" . mysql_escape_string($theorderid);
mysql_query($sSQL) or print(mysql_error());
order_success($theorderid,$emailAddr,$sendEmail);
}else{
// Make sure you leave this condition here. It calls a failure routine if no match is found for any payment system.
order_failed();
}
?>

Vince
Administrator

42756 Posts

Posted - 06/04/2021 :  01:50:35  
Can you let us know the link to the test site maybe and then we can take a look?

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/04/2021 :  05:12:08  
http://safetyknives.co.uk - I will put the system into test mode first. TYL is the third option on the payment dropdown.

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/04/2021 :  06:20:33  
I have put it into sandbox mode.

Card details to test = 4035874000424977 / Any Date in future / Any three CVV numbers / The secret comes up and tell you.

Vince
Administrator

42756 Posts

Posted - 06/04/2021 :  10:43:00  
With that test card number I get a failed transaction so get taken to a page /failed.php. Is this what is happening to you? Do you actually get to the thanks.php page?

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/08/2021 :  08:16:49  
Thanks for your patience Vince. The provider was erroring even before giving out the card number details etc. Can you retest please?

Vince
Administrator

42756 Posts

Posted - 06/08/2021 :  09:41:21  
Hi Kraken17
This isn't the cause of the problem I don't think, but there seems to be lots of...

<SCRIPT LANGUAGE="php">
if(false){
</SCRIPT>

...in the code. I think the server isn't set to access the <script> tag so try replacing those with...

<?php

...and...

?>

But no, I can't see your "Got here" print statement either. So for starters try setting the following in your vsadmin/includes.php file...

$debugmode=TRUE;

...and that will display the GET and POST values sent to the page. Then open incthanks.php in notepad and try searching for "customppreturn.php" and you should see this...

if(getpayprovdetails(14,$data1,$data2,$data3,$demomode,$ppmethod)){
@include './vsadmin/inc/customppreturn.php';
}else{
$errtext='No matching payment system';
order_failed();
}

Try adding another debug print line there like this...

print "Another debug line<br>";
if(getpayprovdetails(14,$data1,$data2,$data3,$demomode,$ppmethod)){
@include './vsadmin/inc/customppreturn.php';
}else{
$errtext='No matching payment system';
order_failed();
}

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

kraken17
Starting Member

United Kingdom
11 Posts

Pre-sales questions only
(More Details...)

Posted - 06/09/2021 :  07:30:26  
Hi Vince,

Did as you requested - and left it in that mode - does not get to my debug line before provider 14. Got to be something to do with the logic.

Vince
Administrator

42756 Posts

Posted - 06/10/2021 :  05:19:47  
Hi Kraken17
In that case can you send the site FTP login to my email (vince AT ecommercetemplates DOT com) and I'll see what is up.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000