Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
fake_payment_token.php
Go to the documentation of this file.
1 <?php
10 
12 $repository = Bootstrap::getObjectManager()->get(PaymentTokenRepositoryInterface::class);
14 $token = Bootstrap::getObjectManager()->create(PaymentTokenInterface::class);
15 $token->setCustomerId(1);
16 $token->setPaymentMethodCode('fake');
17 $token->setPublicHash('fakePublicHash');
18 $token->setIsActive(true);
19 $token->setIsVisible(true);
20 $token->setCreatedAt(strtotime('-1 day'));
21 $token->setExpiresAt(strtotime('+1 day'));
22 $repository->save($token);