NAME

WebService::Braintree::CreditCard

PURPOSE

This class creates, updates, deletes, and finds credit cards.

CLASS METHODS

create()

This takes a hashref of parameters and returns the credit card created.

create()

This takes a nonce and returns the credit card (if it exists).

find()

This takes a token and returns the credit card (if it exists).

update()

This takes a token and a hashref of parameters. It will update the corresponding credit card (if found) and returns the updated credit card.

update()

This takes a token. It will delete the corresponding credit card (if found).

OBJECT METHODS

In addition to the methods provided by the keys returned from Braintree, this class provides the following methods:

billing_address()

This returns the credit card's billing address (if it exists). This will be an object of type "" in WebService::Braintree::Address.

masked_number()

This returns a masked credit card number suitable for display.

expiration_date()

This returns the credit card's expiration in MM/YY format.

is_default()

This returns true if this credit card is the default credit card.

is_venmo_sdk()

This returns true if this credit card uses the Venmo SDK.

NOTES

Most of the classes normally used in WebService::Braintree inherit from "" in WebService::Braintree::ResultObject. This class, however, inherits from "" in WebService::Braintree::PaymentMethod. The primary benefit of this is that these objects have a token() attribute.

TODO

Need to document the keys and values that are returned
Need to document the required and optional input parameters
Need to document the possible errors/exceptions