Tokenising CVV for Braintree vaulted cards in hosted fields - braintree

I have integrated Braintree HostedFields and it's working fine, Now I am trying to add vault feature to it.
I managed to retrieve all the payment methods from vault using vaultManager in client-side JS.
My question is how do I just tokenize the CVV and not all other details as if a customer selects a card from the displayed option then they won't expecting to enter their card details and expiry date. And if I don't have these data how do I tokenize card.
Do I bother to ask for the CVV at all, because I tried sending the payment method token to server side and charged it by passing it to 'paymentMethodToken' in transaction()->sale()?
I am just not sure what I am supposed to do on the client side once the customer has selected the stored card to pay with.

Related

Braintree drop in UI generate new nonce

I've integrated the braintree drop in UI in my project and have added paypal, google pay and visa payments. Everything works fine, payments are submitting to the API etc. But if I use submit a payment which fails using the values from - https://developers.braintreepayments.com/reference/general/testing/php#transaction-amounts. The nonce has then been used, amending my basket price and submitting again fails as the nonce has already been used. I've looked through the documentation and all I can find about nonces is that it can only be used once (https://developers.braintreepayments.com/guides/payment-method-nonces) and nothing around refreshing or requesting a new nonce. Ideally I'd like to avoid having to force the user to enter the payment details again.
Is there another way of automatically requesting a new nonce?

Braintree hosted fields integration - edit existing card data

I'm using Braintree hosted fields to allow credit card payments, and users can use multiple cards.
How can I allow users to edit existing cards? For example, when a card is renewed by the bank, it keeps the same card number, but the expiration date and CVV change. I want users to be able to edit the expiration date and CVV to keep the card active. Is this possible, or does the user have to enter in a new card from scratch with the same card number?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support
Once your customer has their payment method stored in a Vault record you can use their associated payment method token to run a PaymentMethod.update() call. Using the payment method update you can change most attributes of the stored method, and you can find a full list of those attributes here. When updating actual card information, such as CC number, expiration date, etc. it is recommended that you generate a nonce with the new information rather than entering it manually, but either will work just fine.

Braintree payment validation

Currently i am using braintree hosted fields for a project.Its integrated successfully. but what if the user remove the card details after recieving the payment method nonce token. is there any callback for validate in such a case ?
I tried onError function but its not working after recieving payment method nonce token.
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
Not sure, but it sounds like you’re asking what happens if the user deletes the card after Hosted Fields tokenizes the card; If the user removes the card information after the tokenization process, it doesn’t matter--- the card is already tokenized. This shouldn’t be caught in the onError function, as this isn’t an error. It's just a change in what occupies the UI in the DOM.

Omnipay-Stripe storing creditcard details from form to database

I'm using Omnipay-stripe in laravel 5.2 and is working fine. I want to store credit card details of customers to pre-populate stripe popup with creditcard details while making another payment.
You need to register the card against stripe using createCard which will get you back a card reference. You can then use that instead of the actual card data when making a purchase.
You should be calling create customer as well. Check the documentation in the class docblocks

How can I extend Magento to override payment info validation?

I am building a Magento extension to handle Level 3 payments through PayTrace's payment gateway. This particular payment method allows customers to select a saved credit card via Paytrace's customer info management (tokenized saved cards) instead of entering credit card information.
I can use Prototype, I understand how to add validation classes to the HTML in the template.
But the other validation is stumping me. I want to be able to submit the payment card's Paytrace id and not a credit card # and expiration date. When I add a select to the template and submit the selected card id, it pops up a javascript alert telling me "Incorrect credit card expiration date".
There is a request to "/checkout/onepage/savePayment" when I click "continue" that comes back with json {"error":"Incorrect credit card expiration date."} so this validation appears to occur via PHP on the server side.
My question here is "how do I extend Magento to override the server side one page checkout validation for payment?"

Resources