Devdocs: Can the vault only be used to store credit card information or can I implement it on other payment methods as well?

Created on 3 Feb 2021  路  14Comments  路  Source: magento/devdocs

General issue

Description:


Feedback on page: /guides/v2.4/payments-integrations/vault/vault-intro.html

Can the vault only be used to store credit card information or can I implement it on other custom payment methods like "invoice" as well?

done Waiting for Response

All 14 comments

Hi @Eddcapone. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


Vault does not store credit card information, it stores tokens which can then be used for payments. It does have "masked card details" for confirmation. Why would invoice need this, no payment is exchanged? I'm unsure as to what you are trying to achieve and why?

The goal is to let the user save their payment method, so that they don't have to choose it everytime. You also need to save a payment method, to be able to use the "instant purchase" feature.

I guess you would need to create payment method that was linked to vault but doesn't actually store any data (or it could be fake data) but to use the Vault with payment methods that are not storing card tokens, is outside the designed use. So you'd have to work out how to extend it. I don't think any updates are needed for the DEVDOCS as what you want is Out Of Scope.

So the feature "instant purchase" from magento is only available for credit card payment method?

The way I read it, if you can develop a payment gateway that has vault enabled and the customer can store the payment, then it should be usable for Instant Payment. There is no mention that the saved method HAS to be a credit card. This feels feels like you should be conferring with a Magento Developer/Architect rather than raising an issue on DEVDOCS?

@jeff-matthews - Can we get a Magento Developer to confirm if what @Eddcapone wants to do IS possible?

@joni-jones, can you help us out here?

@joni-jones Can you comment as to whether the vault can be used for features such as instant payment?

The "Instant Purchase" uses Vault functionality to proceed with a payment process during checkout. To be able to use "Instant Purchase" a customer should already have some stored payment method via Vault, usually, it is done automatically when a customer chooses "Save for later use" on the payment form while placing the previous order.

The vault itself can support not only credit cards, for instance, PayPal provides a possibility to use Vault for credit cards and customer accounts (which also tokenized). A list of payment solutions is only limited by a specific payment gateway that provides Vault. Out-of-the-box, Magento supports credit cards and accounts, which potentially could be any Vault solution provided by a payment gateway because, as mentioned above, Magento doesn't store card details for Vault, it uses payment tokens provided by Vault.

Is there a guide on how to make any custom payment method vault compatible so I can use instant purchase?

The official dev docs cover this topic https://devdocs.magento.com/guides/v2.4/payments-integrations/vault/payment-token.html

There are two available types of payment tokens:

\Magento\Vault\Api\Data\PaymentTokenFactoryInterface::TOKEN_TYPE_CREDIT_CARD is used for credit cards
\Magento\Vault\Api\Data\PaymentTokenFactoryInterface::TOKEN_TYPE_ACCOUNT is used for payment accounts like PayPal

My custom payment method is not about credit cards. It is a Cash payment, where customers pickup the stuff at our store and give us cash. Is it not possible in my case, or do I just have to use TOKEN_TYPE_CREDIT_CARD anyways?
My main goal is to let the customer "instant purchase", but to do this, the customer has to store the payment method.

@Eddcapone if you do not use credit cards then you can use account type and \Magento\Vault\Api\Data\PaymentTokenFactoryInterface::TOKEN_TYPE_ACCOUNT for the token creation.

Ok nice, thank you for your input. I will close this for now! :)

Was this page helpful?
0 / 5 - 0 ratings