How is the «vault_payment_token» database table implemented and used?

database
vault
payment
payment-token
customer
braintree
(Dmitry Fedyuk) #1

The structure

CREATE TABLE `vault_payment_token` (
  `entity_id` int(10) UNSIGNED NOT NULL COMMENT 'Entity Id',
  `customer_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Customer Id',
  `public_hash` varchar(128) NOT NULL COMMENT 'Hash code for using on frontend',
  `payment_method_code` varchar(128) NOT NULL COMMENT 'Payment method code',
  `type` varchar(128) NOT NULL COMMENT 'Type',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
  `expires_at` timestamp NULL DEFAULT NULL COMMENT 'Expires At',
  `gateway_token` varchar(255) NOT NULL COMMENT 'Gateway Token',
  `details` text COMMENT 'Details',
  `is_active` tinyint(1) NOT NULL COMMENT 'Is active flag',
  `is_visible` tinyint(1) NOT NULL COMMENT 'Is visible flag'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Vault tokens of payment';

A sample row

entity_id 1
customer_id 1
public_hash beb166f1a00a8cf7c3088fccba1e5fc857acb6b842a582e3b94a0f70f5f5b354
payment_method_code braintree
type card
created_at 2017-06-06 01:35:35
expires_at 2017-08-01 03:00:00
gateway_token kpvhv8
details {"type":"MC","maskedCC":"4444","expirationDate":"07\/2017"}
is_active 1
is_visible 1

Usages

It is used through the Magento\Vault\Model\ResourceModel\PaymentToken resource model.
Details:

0 Likes

How does Magento 2 detect which module should handle a vault payment?
How does the Braintree module save the current bank card for a later use?
How is the «Stored Payment Methods» customer account section implemented?
How is Magento\Vault\Api\PaymentTokenManagementInterface::getByGatewayToken() implemented and used?
How is Magento\Vault\Model\ResourceModel\PaymentToken::getByGatewayToken() implemented and used?
How is Magento\Vault\Api\PaymentTokenManagementInterface::getByPublicHash() implemented and used?
How is Magento\Vault\Model\ResourceModel\PaymentToken::getByPublicHash() implemented and used?
How to fix the «Unknown column 'is_visible' in 'where clause'» failure on the «Stored Payment Methods» click inside a customer's account?
How does Magento\Vault\Model\Method\Vault::attachTokenExtensionAttribute() work?
(Dmitry Fedyuk) #2

See also:

0 Likes