VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: mkycler on October 13, 2005, 00:06:55 AM

Title: Platnosci.pl payment module
Post by: mkycler on October 13, 2005, 00:06:55 AM
Hi, everybody.
I,ve just finished intergration of mambo-phpshop with Platnosci.pl (polish online payment service). Here come short tips how to use it:
copy two ps_ files to your administrator/components/com_phpshop/classes/payment directory. Copy platnosci_notify.php to your administrator/components/com_phpshop directory. Copy checkout.PPL_result.php to your administrator/components/com_phpshop/html directory.
Create a new payment method with "PayPal (or related)" type and "ps_platnosci" as payment class name. Fill configuration options with values provided by Platnosci.pl for your POS.

Insert the following code as Payment Extra Info (sorry for Polish language, but it's a polish service anyway :)):
<script language="JavaScript" type="text/JavaScript" src="https://www.platnosci.pl/paygw/ISO/js/<?php echo PLATNOSCI_POS_ID ?>/<?php echo substr(PLATNOSCI_KEY1,0,2?>/paytype.js"></script>
<strong>Wybierz typ płatności i kliknij na obrazek "Obsługa transakcji", aby zapłacić za złożone zamówienie.</strong>
<form action="https://www.platnosci.pl/paygw/ISO/NewPayment" method="POST"
name="payform">
<script language="JavaScript" type="text/JavaScript">
    PlnDrawRadioImg(4);
</script>
<div align="center"><input type="image" name="submit" src="/images/stories/zaplac.gif" border="0" alt="Zapłać poprzez Platnosci.pl"></div>
<input type="hidden" name="pos_id" value="<?php echo PLATNOSCI_POS_ID ?>">
<input type="hidden" name="session_id" value="<?php $db->p("order_number"?>">
<input type="hidden" name="order_id" value="<?php $db->p("order_id"?>">
<input type="hidden" name="amount" value="<?php printf("%d"$db->f("order_total")*100)?>">
<input type="hidden" name="desc" value="YourShopName Zamówienie <?php echo $order_id ?>">
<input type="hidden" name="first_name" value="<?php echo $auth["first_name"?>">
<input type="hidden" name="last_name" value="<?php echo $auth["last_name"?>">
<?php
      $qv 
"SELECT email FROM #__users ";
      
$qv .= "WHERE id=".$auth["user_id"];
      
$dbbt = new ps_DB;
      
$dbbt->query($qv);
      
$dbbt->next_record();
      
$user_email $dbbt->f("email");
?>

<input type="hidden" name="email" value="<?php echo $user_email ?>">
<input type="hidden" name="client_ip" value="<?php echo $_SERVER['REMOTE_ADDR'?>">
<input type="hidden" name="js" value="0">
</form>
<script language="JavaScript" type="text/javascript">
<!--
document.forms['payform'].js.value=1;
-->
</script>

When configuring your POS with Platnosci.pl mind the following parameters:
Adres powrotu błędnego (Return address when fail): http://www.yourURL.pl/index.php?option=com_phpshop&page=checkout.PPL_result&order_id=%orderId%&error_code=%error%
Adres powrotu pozytywnego (Return address when succeed): http://www.yourURL.pl/index.php?option=com_phpshop&page=checkout.PPL_result&order_id=%orderId%
Adres raportów (Reporting address): http://www.yourURL.pl/administrator/components/com_phpshop/platnosci_notify.php

Thats it. I've tested it with Platnosci.pl "test payment service" and it works good.

[attachment cleanup by admin]
Title: Re: Platnosci.pl payment module
Post by: ozdoby on October 18, 2005, 13:12:43 PM
Witam,

w paczce brakuje "platnosci_notify.php".
jest szansa na doslanie ewentualne ponowne umieszczenie?
pozdrawiam
Title: Re: Platnosci.pl payment module
Post by: mkycler on October 31, 2005, 21:27:05 PM
I've been informed, that file "platnosci_notify.php" is missing from zip file. Sorry for any problems related to my mistake. I've replaced whole zip file with a proper one - now everything should be in order.
Regards.
Title: Re: Platnosci.pl payment module
Post by: qwas0987 on November 23, 2005, 13:27:44 PM
great job. I think I will use it as soon as I get a Polish language file.
mkycler - do you have Polish language file for php shop? I would appreciate your help.

Marcin
http://www.emaestro.pl
Title: Re: Platnosci.pl payment module
Post by: Mr_Smurf on November 24, 2005, 15:57:26 PM
Yey.. Another online payment service without any security in mind...  ;D

I can now go to your shop and buy stuff for $1000, then change the value to $1 before i submit the payment. :o
Or I can charge that $1000 to any one I like (or don't like) by changing the email address  ::)

When did people stop using checksums? 
Title: Re: Platnosci.pl payment module
Post by: mkycler on November 26, 2005, 23:27:05 PM
Quote from: Mr_Smurf on November 24, 2005, 15:57:26 PM
When did people stop using checksums? 
Perhaps the answer is: when they forgot about their brains...  ???

Thanks for bringing me to reality. Of course they use checksums. I don't know, why I've forgotten them. Now everything should be in order. File platnosci_notify.php needs to be replaced. I've updated the zipfile.
Title: Re: Platnosci.pl payment module
Post by: Mr_Smurf on November 26, 2005, 23:36:16 PM
Now I am happy as a Clown again  ::) ;D
Title: Re: Platnosci.pl payment module
Post by: pielgrzym on November 29, 2005, 11:16:03 AM
No matter how the transaction ends I recieve such text:
"Given filename does not exist. Cannot find file:checkout.PPL_result.php Error Type: Page Does Not Exist"

All the files are in the right place - including 'checkout.PPL_result.php' :(

Is there a possibility to add a function that multiplies the price? All the prices are in dollars and no damned polish company allows foreign currencies in transactions. So when somebody buys some stuff for 20$ he actually pays 20zl.... Pls, help...
Title: Re: Platnosci.pl payment module
Post by: mkycler on November 29, 2005, 11:23:12 AM
What version do you use? VirtueMart or former mambo-phpshop?
I didn't tested this module with VirtueMart.

Please note, that in VirtueMart some paths are changed: com_phpshop is replaced with com_virtuemart.

Please be aware, that you have to modify line 6 in platnosci_notify.php - you have to replace my email with your one. Ohterwise all notifications will go straight into my mailbox. ;D
Title: Re: Platnosci.pl payment module
Post by: pielgrzym on November 29, 2005, 11:32:37 AM
Sorry for that notification ;D

I use good old mambo php shop  :(

The thing that concerns me most is this currency stuff :( is it possible to add a function that will multiply the payment by a number I choose? I mean - I don't have any vague idea about the checksums stuff - is it possible?
Title: Re: Platnosci.pl payment module
Post by: mkycler on November 29, 2005, 11:45:07 AM
I think that such multiplication is not a good idea.
If you have time - please wait a couple days. Now I'm working on Allpay.pl payment module - they allow to charge customers in US Dollars as well. I think I'll be ready with it next weekend.
Title: Re: Platnosci.pl payment module
Post by: pielgrzym on November 29, 2005, 12:08:26 PM
I'll wait then :) thanks for help!

I know a some php - what shall I look at (which files etc.) to understand how php shop performs such transaction? Not to write my own module (my php knowledge is too small), but just to feel safer :)

PS. I recieve loads of e-mail about unknown status (code 888) after a test transaction. This is probably related to the missing file?

Title: Re: Platnosci.pl payment module
Post by: mkycler on November 29, 2005, 12:39:44 PM
Don't know.
To make sure it is not related to checksums slightly change the body of message sent in case of wrong checksum. Then you will see what is the problem.
I think it might be related to missing file. Platnosci.pl try to pass transaction result to shop application. If it fails, then another attempt is made, according to Platnosci.pl schedule (see documentation). After 100 unsuccessful attempts transaction result is considered as undeliverable.
See transaction details log in Platnosci.pl customer panel - maybe this will help.
Title: Re: Platnosci.pl payment module
Post by: xsayo on March 15, 2006, 00:23:39 AM
I've installed module and everything works fine - thanks.

But I have only one problem - In my shop prices are rounded to 1 polish zloty (In my shop I configured decimals = 0)
All prices like 55,43 are rounded to 55.
When I'm shopping I got price for example 36, but when I'm redirected to Platnosci.pl
I see 35,90 - how can I change this?



Title: Re: Platnosci.pl payment module
Post by: mkycler on March 15, 2006, 22:50:06 PM
I think you should play with the following line in Payment Extra Info:
<input type="hidden" name="amount" value="<?php printf("%d"$db->f("order_total")*100)?>">
It means that for some reason order_total is not rounded according to your shop's rules. Please give me your URL, I'll try to figure what's wrong. You can reach me on GG:3766000 or skype me (evenings only) - user the same as my forum nick. If you prefer email - write to mkycler(at)maciejka(dot)net.
Title: Re: Platnosci.pl payment module
Post by: nahagel on May 12, 2006, 00:56:15 AM
Quote from: xsayo on March 15, 2006, 00:23:39 AM
But I have only one problem - In my shop prices are rounded to 1 polish zloty (In my shop I configured decimals = 0)
All prices like 55,43 are rounded to 55.
When I'm shopping I got price for example 36, but when I'm redirected to Platnosci.pl
I see 35,90 - how can I change this?

I used to spend a lot of time finding the reason...
Check your country setting (Edit shop). It cannot be empty.
Title: Re: Platnosci.pl payment module
Post by: Maciek on April 27, 2007, 23:08:46 PM
Hi there

I'm facing one serious problem with this module. After going thru all steps I can see (after doing test payment with "test payment' option I can see OK (v) mark, but failure note below. In Platnosci.pl backoffice there is an error report regarding to the transaction:

"NOT OK RESPONSE
<br />
<b>Fatal error</b>:  Class vmlanguage:  Cannot inherit from undefined class vmabstractlanguage in <b>/portal/administrator/components/com_virtuemart/languages/polish.php</b> on line <b>18</b><br />"

in history reports

Actually line 18 is the first line of the language file:
class vmLanguage extends vmAbstractLanguage {

Does anyone have any idea, what's wrong with?

TIA for help
maciek
Greetings
Title: Re: Platnosci.pl payment module
Post by: DannyM on August 03, 2009, 21:32:32 PM
http://www.3dstudiopro.com/pl/dodatki-joomla/28-platnosci-pl-dla-virtuemart-1x.html