WebSite X5Help Center

 
Raphael L.
Raphael L.
User

Payment: Custom Code  en

Auteur : Raphael L.
Visité 2897, Followers 2, Partagé 32  
Mots-clés :: code,custom,payment

Hello,

I am not able to write a working HTML code for my custom payment. Here you have an exemple of the custom code:

<form action="custompayment.php" method="post">
<input type="hidden" name="imOrderNo" value="[ORDER_NO]">
<input type="hidden" name="imPrice" value="[PRICE]">
<input type='submit' value='Pay Now' />
</form> 

The problem is that when I add this code to the website, it brokes the javascript and I am not able to add any object to my cart!

Do you have working exemple: the documentation is quite inexsistent on this functionality.

Posté le
5 RéPONSES
Incomedia
Claudio N.
Incomedia

Hello Rapahel,

I've tested your code but I get no JS errors. Of course, the page custompayement.php is not present in my test project so I can't do further tests.

Could you upload the site on a test folder of your server and provide me the link? I'll do a test on it and see which error is thrown by JS.

Thank you!

Lire plus
Posté le de Claudio N.
Raphael L.
Raphael L.
User
Auteur

Okay, I prefere to continue this post on the english forum:

I have just create a simple test website here: http://www.kit-boitier-ethanol.fr/test/products.html

and custompayement.php is actually a simple test page where I print all the $_POST variables in php.

And it is the same problem than in the new version of my website.

Lire plus
Posté le de Raphael L.
Incomedia
Claudio N.
Incomedia

Thanks for the link. As I can see, the error is caused by the new lines characters of your custom HTML code.

We have fixed this problem since version 9.0.3.1722 (beta) where the newline chars are escaped.

You can solve that problem in 3 ways:

  1. Type your HTML code on a single line. It means that you should not press the return button while typing your custom HTML code in the payment settings.
  2. Update to the latest beta version as described here: http://beta.websitex5.com
  3. Wait for the next stable release (available in the next 1-2 days).

Thank you!

Lire plus
Posté le de Claudio N.
Raphael L.
Raphael L.
User
Auteur

And the error with Chrome is x5cart.js:75 Uncaught SyntaxErrror: Unexepected token ILLEGAL

Lire plus
Posté le de Raphael L.
Incomedia
Claudio N.
Incomedia

Hi,

That's the same error. Did you remove all the line feeds from the HTML code?

On Chrome make sure your pressed CTRL+F5 to reload the js file.

Thank you!

Lire plus
Posté le de Claudio N.