xfrocks / bdPaygates

4 stars 8 forks source link

eCheck Payment Issues #4

Open md-5 opened 9 years ago

md-5 commented 9 years ago

Hi,

Couple of related issue: 1) eChecks are processed immediately, there should be a new payment_status == Completed filter in PayPal.php

        switch ($filtered['txn_type'])
        {
            case 'web_accept':
                if ($filtered['payment_status'] == 'Completed')
                {
                    $paymentStatus = bdPaygate_Processor_Abstract::PAYMENT_STATUS_ACCEPTED;
                }
                break;
            case 'subscr_signup':
                $transactionDetails[bdPaygate_Processor_Abstract::TRANSACTION_DETAILS_SUBSCRIPTION_ID] = $filtered['subscr_id'];
                break;
            case 'subscr_payment':
                $paymentStatus = bdPaygate_Processor_Abstract::PAYMENT_STATUS_ACCEPTED;
                $transactionDetails[bdPaygate_Processor_Abstract::TRANSACTION_DETAILS_SUBSCRIPTION_ID] = $filtered['subscr_id'];
                break;
        }

2) I don't think this filter will work due to the duplicate transaction checking:

                    $logMessage = "Transaction {$transactionId}/{$paymentStatus} has already been processed";
                    $paymentStatus = bdPaygate_Processor_Abstract::PAYMENT_STATUS_OTHER;

                    $response->setHttpResponseCode(403);

3) I think this duplicate transaction warning with echecks as currently is, is what is causing users to receive warnings from PayPal.

daohoangson commented 9 years ago

Thank you for the report. It's a bit unclear right now, please help me by clarify it a bit.

1) There is a check for "Completed" already in the quoted part? 2) I'm not sure what does not work due to the duplicate tracking? If a transaction goes through, it will be marked for future duplication check. Otherwise, the next "accepted" transaction should be handled without issue? 3) In any case, the response always has 200 HTTP status code so I don't think this is related to those reports. Do you have any clues regarding this?

md-5 commented 9 years ago

Sorry, forgot about this.

1) No there is not, that is me showing pseudocode. This is where the above code should be added: https://github.com/xfrocks/bdPaygates/blob/master/library/bdPaygate/Processor/PayPal.php#L118-L120

2) Adding this code may break the subsequent echeck notification. I'm not sure on this front, it would need to be tested (https://github.com/xfrocks/bdPaygates/blob/master/bdpaygate/callback.php#L99).

3) No it doesn't, see here for it returning 403: https://github.com/xfrocks/bdPaygates/blob/master/bdpaygate/callback.php#L109