After some R&D I got the solution myself.
First I created a class in my module:
namespace VendorName\ModuleName\Model\Payment;
class Payflowpro
{
public function __construct(
\Magento\Vault\Model\VaultPaymentInterface $vault
) {
$this->vault = $vault
}
public function mymethod($payment,$amount)
{
$this->vault->authorize($payment,$amount);
}
}
hereHere I passed an object of Vault
Class.
In second step I1 created di.xml
in my module and write below code:
<type name="VendorName\ModuleName\Model\Payment\Payflowpro">
<arguments>
<argument name="vault" xsi:type="object">PayflowProCreditCardVaultFacade</argument>
</arguments>
</type>
here type is used for assigning object value which I passed in my module class
Now last steps I createcreates VirtualType
in my di.xml
for assigning provider
to Vault Class.
<virtualType name="PayflowProCreditCardVaultFacade" type="Magento\Vault\Model\Method\Vault">
<arguments>
<argument name="config" xsi:type="object">PayflowProVaultPaymentConfig</argument>
<argument name="valueHandlerPool" xsi:type="object">PayflowProVaultPaymentValueHandlerPool</argument>
<argument name="vaultProvider" xsi:type="object">Magento\Paypal\Model\Payflow\Transparent</argument>
<argument name="code" xsi:type="const">Magento\Paypal\Model\Payflow\Transparent::CC_VAULT_CODE</argument>
</arguments>
</virtualType>