1

I need to configure subscription product in Magento 2 while placing an order with Paypal payment option

In Magento 1 I have done this rewriting method the getStandardCheckoutFormFields file Mage_Paypal_Model_Standard

where I can merge the additional params of recurring profile by follwoing way

public function getStandardCheckoutFormFields()
{
    $result = parent::getStandardCheckoutFormFields();

    $result["redirect_cmd"] = "_xclick-subscriptions";

    $result = array_merge($result, array(

      "a3" => round(500,2),
      "p3" =>"6" ,
      "t3" => "M",
      "src" => "1",
      "sra" => "1",
      "item_name" => "Subscription Product",
      "item_number" => "12345",

    ));

    return $result;

}   

How can I do this in Magento 2

I have found instead of form submitting these all things are done by API call from vendor\magento\module-paypal\Model\Api\Nvp.php.

But I don't know how this get here from

vendor\magento\module-paypal\Controller\Express\Start.php

to

vendor\magento\module-paypal\Model\Api\Nvp.php

file this will be great help if anyone can parse the path.

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.