You can create the credit card by submitting all the details like this:
result = Braintree_CreditCard::create([
'cardholder_name' => 'John Doe',
'cvv' => '123',
'expiration_date' => '12/2019,
'number' => '4111111111111111',
'options' => [
'verify_card' => True
]
])
# use this credit card token(5mk3f2).
print(result.credit_card.token)
We this credit card token to update the credit card by as follows:
$result = Braintree_PaymentMethod::update(
'5mk3f2',
[
'cardholder_name' => 'Doe Jhon',
'cvv' => 'XXX',
'expiration_date' => '8/2020,
'number' => '4111111111111118',
'billingAddress' => [
'streetAddress' => '100 Maple Lane',
'options' => [
'updateExisting' => true
]
]
]);