I configured PayFlow Pro on Magento 2.1.9 and I tried Test mode which seems to work fine, however when switching to Live mode, I'm getting the following Result from the debug log.

'RESULT' => '12',
'RESPMSG' => 'Declined',
'HOSTCODE' => '58', (or) '57'

I've gone through with the following link from PayPal to go through with the issue but I feel everything fine (IDK if I need to check with Card Issuer (I also tried using Different Cards))


This issue is only related to Australian based PayFlow Pro setup. which uses the processor PayPal Australia in your Payflow account.


  1. Payment Processor: PayPal Australia didn't accept $0 Authorization which is sent by Magento 2 as default.

How to Resolve This?

I have answered it. please review and put your comment if you have a better idea

1 Answer 1


Override the Model Magento\Paypal\Model\Payflow\Service\Request\SecureToken from PayPal using di.xml as below in your custom module (Hope you know to do that).

Create: Vendor/Module/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Paypal\Model\Payflow\Service\Request\SecureToken" type="Vendor\Module\Model\Rewrite\Payflow\Service\Request\SecureToken" />

Now create a Model Rewrite for SecureToken,

Create: Vendor\Module\Model\Rewrite\Payflow\Service\Request\SecureToken

 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

namespace Vendor\Module\Model\Rewrite\Payflow\Service\Request;

use Magento\Framework\Math\Random;
use Magento\Framework\DataObject;
use Magento\Framework\UrlInterface;
use Magento\Paypal\Model\Payflow\Transparent;
use Magento\Paypal\Model\Payflowpro;
use Magento\Quote\Model\Quote;

 * Class SecureToken
class SecureToken extends \Magento\Paypal\Model\Payflow\Service\Request\SecureToken
     * @var UrlInterface
    private $url;

     * @var Random
    private $mathRandom;

     * @var Transparent
    private $transparent;

     * @param UrlInterface $url
     * @param Random $mathRandom
     * @param Transparent $transparent
    public function __construct(
        UrlInterface $url,
        Random $mathRandom,
        Transparent $transparent
    ) {
        $this->url = $url;
        $this->mathRandom = $mathRandom;
        $this->transparent = $transparent;

     * Get the Secure Token from Paypal for TR
     * @param Quote $quote
     * @return DataObject
     * @throws \Exception
    public function requestToken(Quote $quote)
        $request = $this->transparent->buildBasicRequest();
        $request->setAmt(1); // Set authorization amount as 1 by default its 0
        $this->transparent->fillCustomerContacts($quote, $request);
        $result = $this->transparent->postRequest($request, $this->transparent->getConfig());
        return $result;

Changes Made in the above file is $request->setAmt(0); to $request->setAmt(1);.

This resolved the transaction declined issue from the PayPal Australia Processor.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.