PrestaShopCorp / vtpayment

Accept payments with UnionPay cards by using VTPayment
2 stars 2 forks source link

verifyPaymentDatafeed(...) structure improvement #7

Closed Quetzacoalt91 closed 10 years ago

Quetzacoalt91 commented 10 years ago

In unionpay.php, the function verifyPaymentDatafeed(...) needs (too ?) many arguments. It would be better if the function is called this way: public function verifyPaymentDatafeed($data) instead of public function verifyPaymentDatafeed($src, $prc, $success_code, $merchant_reference_number, $unionpaydollar_reference_number, $currency_code, $amount, $payer_authentication_status, $secure_hash_secret, $secure_hash)

The whole arguments would be store in the variable $data, defined as an array.

Quetzacoalt91 commented 10 years ago

We still can improve it:

Here is a suggestion for this function, I let you see if it does what we expect from her :)

    public function verifyPaymentDatafeed($dataAry, $secure_hash)
    {
        return $secure_hash == sha1(implode('|', $dataAry));
    }