X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   Paypal DPM Payment Method (https://forum.x-cart.com/showthread.php?t=73404)

BCSE 11-08-2017 07:12 AM

Re: Paypal DPM Payment Method
 
Quote:

Originally Posted by mattstyle2
what's the advantage of the new api?


We've updated it to the latest paypal updates and have change how it posts to paypal. It's a bit more robust now.

Thanks,

Carrie

BCSE 02-27-2018 12:01 PM

Re: Paypal DPM Payment Method
 
We are TLS 1.2 compliant as well if anyone needs a quick solution.

Carrie

BCSE 04-09-2018 07:08 AM

Re: Paypal DPM Payment Method
 
Paypal DPM Blow out sale! $100 off one week only!!

https://www.bcsengineering.com/store/paypal-dpm-for-x-cart.html

Grab this popular module to make your PCI compliance easier! :)

Carrie

mattstyle2 04-20-2018 05:54 AM

Re: Paypal DPM Payment Method
 
Quote:

Originally Posted by BCSE
Paypal DPM Blow out sale! $100 off one week only!!

https://www.bcsengineering.com/store/paypal-dpm-for-x-cart.html

Grab this popular module to make your PCI compliance easier! :)

Carrie


Updated to version 3

did you forget an important element? accounting for coupons, reward points

I had to remove these lines from api.php

'ITEMAMT' => $cart['subtotal'],
'TAXAMT' => $cart['tax_cost'],
'FREIGHTAMT' => $cart['shipping_cost'],


in the post array because kept getting this error:

Field format error: 10413-The totals of the cart item amounts do not match order amounts.

Orders without coupon codes processed fine.. now after removing those three items and telling paypal only the AMT, orders with coupons work.

also got 'not finished' orders again so the new version doesn't seem to fix that either..
--special characters need to be handled when posting to paypal (address, name, city, etc).

-- there was also an ssl issue.. forcing curl to use tls1.2 might fix that one..


--- added a check in finish-order for not-finished orders:
first I had to make it so the module used SECURETOKEN instead of SECURETOKENID in the token.php file
then I added a function to api.php to return the array of secure tokens and orderids
then put a check in finish_order.php in the event the getPaymentRepsonse() returns a blank value.

here's some code..

Code:


require_once $xcart_dir . '/include/payment_wait.php';

$api = bcse_pp_get_api();
 
//bcse_pp_log_error("api get token\n".print_r ($api->getSecureTokenOrders2(),true));
//bcse_pp_log_error("orderid: $orderid token: $token ids $orderids");

//exit;
$response = $api->getPaymentResponse();
//bcse_pp_log_error("RESPONSE:\n".print_r ($api->getPaymentResponse(),true)."setting to blank!\n");  //for testing
//$response=''; //for testing

if (empty($response)) {  //matt add - if response is empty perform an inquiry using the secure token or custref
        bcse_pp_log_error("Empty response found in finish_order.php\n");
        $tokens=$api->getSecureTokenOrders2(); //new function
       
        foreach ($tokens as $k=>$v) {
                $token=$k;
                $orderid=addslashes($v[0]);
                break;
        }
        bcse_pp_log_error("acquired token: $token and orderid: $orderid\n");
        //perform inquiry on token
        if ($token!='' && $orderid!='' && is_numeric($orderid)) {
                $orderids=array();
                $orderids[]=$orderid;
                $response = $api->tokenInquire($token); //new function
                bcse_pp_log_error("Token-Inquire RESPONSE:\n".print_r ($response,true)."\n");
                if ($response['RESULT']==99){
                        $response = $api->custRefInquire($orderid);  //new function requires CUSTREF to be set in the orderdetails POST
                        bcse_pp_log_error("custRef-Inquire RESPONSE:\n".print_r ($response,true)."\n");
                }

.
.
.
comparison code to check silent post .. I use some custom-code and a dbase table to handle silentposts..
.
.
.

if (isset($silent['amount']) && isset($response['AMT']) && $silent['orderid']==$response['CUSTREF'] && $silent['amount']==$response['AMT'] && $silent['transaction']==$response['ORIGPNREF']) {

$response['RESULT']=$response['ORIGRESULT'];
                        $response['PNREF']=$response['ORIGPNREF'];
                        if (!isset($response['AUTHCODE'])) {
                                $response['AUTHCODE']='';
                               
                        }


                } else {
                        $response='';
                        bcse_pp_log_error("ERROR: could not match inquiry with empty response!\n");
                }

                $api->clearSecureTokenOrders($token); //cleanup - new function
} else { //done with an empty result
$orderids = $api->getSecureTokenOrders($response['SECURETOKEN']); //changed to use securetoken - normalshit
}

in this case, the module will now perform an inquiry on the SECURETOKEN and compare results with silent post values..
if it fails to get anything from the securetoken it'll perform an inquiry on CUSTREF



was a bi*tch to setup and took many hours but I feel as this should solve a majority of the "not finished" errors.

hope that helps someone..

please send tips:
BTC: 17jAfPFZ9waexTbGdtCZM4LgAn56qZ7bZh

mattstyle2 04-20-2018 10:37 AM

Re: Paypal DPM Payment Method
 
nice.. breaks amazon payments advanced too..

blah!

people need to test modules..


fix:

in /skin/common_files/modules/BCSE_Paypal_DPM/service_head.tpl

change the first if statement to this:

{if $main eq 'checkout' AND $checkout_module ne 'Amazon_Payments_Advanced'}

please send tips:
BTC: 17jAfPFZ9waexTbGdtCZM4LgAn56qZ7bZh

BCSE 04-23-2018 05:23 AM

Re: Paypal DPM Payment Method
 
Could you please email this in to us so I can have my staff review? I do not believe we are aware of any issues like this and we'd like to review them to make sure they are fixed.

Thank you!

Carrie




Quote:

Originally Posted by mattstyle2
Updated to version 3



All times are GMT -8. The time now is 12:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.