Zen Cart Logo
Forums / Addon Payment Modules / Atos Payment Module (French Users) -- need to customize payment amount

Atos Payment Module (French Users) -- need to customize payment amount

Views: 20,507

Results 1 to 20 of 48
17 Mar 2008, 8:42 AM
#1
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Atos Payment Module (French Users) -- need to customize payment amount

I'm desperate on this - I've searched high and low on multiple forums (even OsC where I was treated very harshly for daring to use zc instead of OsC) and cannot find anyone who has successfully installed the Atos payment module which will allow me to use the credit card payment facility offered by French banks. I'm stuck because of a silly language configuration problem so if anyone can help, please holler !

Thanks

Pete

27 Mar 2008, 9:10 PM
#2
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

I use a contributed payment module (Atos, found on the French Zen Cart site) and it works perfectly except that it only sends 1% of the order to the payment gateway and ignores the 70% discount I give (via another add-on) when the order is placed (the rest is payable when the goods are ready). This only occurs with this module, Paypal IPN works perfectly. Where can I find where the error is coming from ? Any ideas anyone ? This is ruining my sleep !

Thanks

Pete

28 Mar 2008, 6:19 AM
#3
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Solved. Forget it.

28 Mar 2008, 8:09 AM
#4
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

OK, I've figured the 1% problem, the gateways needs 2 decimal places to be displayed in the on-line store so that's sorted. However, it still insists on ignoring the discount given when the order is placed taking only the sub total + shipping whereas only the amount immediately due - 30% of the order total - should be sent to the gateway. I'm nearly there !

Any ideas ?

Cheers

Pete

28 Mar 2008, 8:22 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Atos Payment Module (French Users) -- need to customize payment amount

petek:

it still insists on ignoring the discount given when the order is placed taking only the sub total + shipping whereas only the amount immediately due - 30% of the order total - should be sent to the gateway.Check what fields it's calculating the transaction total from, and compare that against the other working module.

28 Mar 2008, 8:32 AM
#6
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

DrByte:

Check what fields it's calculating the transaction total from, and compare that against the other working module.

Precisely but for people who aren't php wizkids, its always a pain locating the correct line of code that's causing the bother ! Oh well, there's no other way I suppose.

Thanks

Pete

28 Mar 2008, 10:03 AM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Atos Payment Module (French Users) -- need to customize payment amount

petek:

even OsC where I was treated very harshly for daring to use zc instead of OsCYou've got to feel sorry for them really. It can't be easy being fully committed to a cart while knowing deep down that there's a much better one that they could be using instead.

28 Mar 2008, 10:56 AM
#8
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

kuroi:

You've got to feel sorry for them really. It can't be easy being fully committed to a cart while knowing deep down that there's a much better one that they could be using instead.

Oh, they're very bolshy. When I opted for zc, I was under the impression that OsC basically wasn't being developed any more. Not true it would appear. And they do have masses more info on their site (particularly the OsC French-language site) !

Cheers

28 Mar 2008, 5:52 PM
#9
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

The other module that works is Paypal IPN.

In the confirmation function of Atos, I have this line of code which in case I'm mistaken is how the order is retreived :

$sips = $this->makeRequest($order->info['total'], $currency);

whilst in Paypal, the equivalent (appears) to be this :

$this->totalsum = $order->info['total'];

They are similar but I could be off the mark.

Any ideas ?

28 Mar 2008, 8:36 PM
#10
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Hi,

In one (custom) module, I think it retrieves the order info here :

$sips = $this->makeRequest($order->info['total'], $currency);
```. I have problems with this modules which ignores all discounts.

In this (Paypal IPN - works perfactly) module, I see this : 

```php
    $this->totalsum = $order->info['total'];
```. Paypal works fine; I'd like to know why the other doesn't but I'm having a little difficulty understanding exactly where and how the payment modules get their order info from. Can someone enlighten me ?

Thanks

Pete
29 Mar 2008, 7:55 PM
#11
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Anyone ?

30 Mar 2008, 9:02 AM
#12
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Me again. If I read $order in the Atos module, I get this :

order Object
(
    [info] => Array
        (
            [order_status] => 1
            [currency] => EUR
            [currency_value] => 1.00000000
            [payment_method] => 
            [payment_module_code] =>
            [coupon_code] => 
            [shipping_method] => Frais de Livraison (Montant)
            [shipping_module_code] => flat_flat
            [shipping_cost] => 60
            [subtotal] => 955
            [tax] => 0
            [total] => 1015
            [tax_groups] => Array
                (
                    [Taux de Taxes Inconnu] => 0
                )

            [comments] => 
            [ip_address] => XXXXXXXXX - XXXXXXXXXXXXX
        )

whereas doing the same thing with the Paypal module, I get this

order Object
(
    [info] => Array
        (
            [order_status] => 1
            [currency] => EUR
            [currency_value] => 1.00000000
            [payment_method] => 
            [payment_module_code] => 
            [coupon_code] => 
            [shipping_method] => Frais de Livraison (Montant)
            [shipping_module_code] => flat_flat
            [shipping_cost] => 60
            [subtotal] => 955
            [tax] => 0
            [total] => 346.5
            [tax_groups] => Array
                (
                    [Taux de Taxes Inconnu] => 0
                )

            [comments] => 
            [ip_address] => XXXXXXXXXXXXXXXX - XXXXXXXXXXXXXXX
        )

The two [total] fields send different values. Why ? I want the Atos module to pick up the same total as Paypal, ie the deposit due when the order is placed. How can I get the Atos module to behave in the same way as Paypal's ?

Cheers

Pete

3 Apr 2008, 6:43 AM
#13
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Is there anywhere in the forums where we could submit php code problems ? I'm not talking about anything vastly complicated because there are specialist forums out there but it would be nice if we could post a snippet or two so as to obtain some quick advice from fellow Zen users !

Cheers

Pete

3 Apr 2008, 7:47 AM
#14
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Atos Payment Module (French Users) -- need to customize payment amount

This facility already exists
i.e.
when posting message, require code insert,
click hash key icon..WRAP code tags around
selected text.

3 Apr 2008, 9:45 AM
#15
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

I know the wrap-around function exists but what I meant was is there a specific place to post ? There doesn't appear to be.

I have a problem with a piece of code but will make one or two more tests before posting here.

Cheers

Pete

3 Apr 2008, 7:14 PM
#16
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Simple for the php savvies really : in a payment module, for orders having a value of >200, I want 30% of the order to be sent to the bank. For the rest, 100% of the order is due. Here is the code (which doesn't work) :

$sips = $this->makeRequest($order->info['total'], $currency);
	  
	   if ($sips > 200)  { 
	 echo $sips = $this->makeRequest($order->info['total']*0.30, $currency);
} else {
    echo $sips = $this->makeRequest($order->info['total'], $currency);
}
echo '">'."\n";

Only the first part of the code, ie: php echo $sips = $this->makeRequest($order->info['total']*0.30, $currency); works, the second part, ie : ```php
echo $sips = $this->makeRequest($order->info['total'], $currency);
}

3 Apr 2008, 7:44 PM
#17
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Atos Payment Module (French Users) -- need to customize payment amount

How about separating out the assignment and the echo by changing the whole thing to:

$sips = $this->makeRequest($order->info['total'], $currency); 
if ($sips > 200)  {  
  $sips = number_format($sips*0.30,2); 
} 
echo $sips . '">'."\n";
4 Apr 2008, 9:32 AM
#18
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

Thanks. Unfortunately that doesn't work either. In fact, its even worse. Another board, someone told me that I must && statements without saying how. As I only have one variable - $sips - I don't what I'm supposed to compare with it. I'll get there in the end but this is a tad frustrating !

What do you think ?

Cheers

4 Apr 2008, 3:46 PM
#19
petek avatar

petek

Zen Follower

Join Date:
Jan 2008
Location:
Chevreuse, France
Posts:
278
Plugin Contributions:
0

Re: Atos Payment Module (French Users) -- need to customize payment amount

I see in the payment modules that this line is what fishes out the order amount. The question is : where does the info come from, ie which files ? I ask the question because I need to add an if...else statement so that only 30% of orders over 200 Euros are debited. I've added the statement to the Paypal module and it works but it doesn't work with the custom module : 30% is debitted whether the order exceeds 200 Euros or not.

The custom payment module's order info line is ```php
$sips = $this->makeRequest($order->info['total'], $currency);


Whereas Paypal's is 
```php
$this->totalsum = $order->info['total'];

They look similar to me !

Thanks

Pete

4 Apr 2008, 4:17 PM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Atos Payment Module (French Users) -- need to customize payment amount

How many more threads are you going to open on the same question?

And, which payment module is this for now? You've been talking about paypal, atos, payline ... how many modules are you altering? How many modules do you need to run on your site?

Having your disjointed questions scattered all over makes it hard to follow the "why" behind your posts. And, frankly, when I see that, I click "next" and move on to another topic, ignoring yours.

So ... you might reconsider your approach.