PHP Class Braintree\Customer

== More information == For more detailed information on Customers, see {@link http://www.braintreepayments.com/gateway/customer-api http://www.braintreepaymentsolutions.com/gateway/customer-api}
Inheritance: extends braintree\Base
Exibir arquivo Open project: braintree/braintree_php Class Usage Examples

Protected Properties

Property Type Description
$_attributes registry of customer data

Public Methods

Method Description
__toString ( ) : string returns a string representation of the customer
_defaultPaymentMethodFilter ( $paymentMethod )
all ( ) : Customer[]
create ( array $attribs = [] ) : Braintree\Result\Successful | Error
createCustomerUrl ( ) : string
createFromTransparentRedirect ( string $queryString ) : Braintree\Result\Successful
createNoValidate ( array $attribs = [] ) : Customer
credit ( integer $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error
creditNoValidate ( type $customerId, type $transactionAttribs ) : Transaction
defaultPaymentMethod ( ) : CreditCard | braintree\PayPalAccount returns the customer's default payment method
delete ( integer $customerId ) : Braintree\Result\Successful
factory ( array $attributes ) : Customer factory method: returns an instance of Customer to the requesting method, with populated properties
fetch ( string $query, int[] $ids ) : Customer | Customer[]
find ( string $id ) : Customer
isEqual ( object $otherCust ) : boolean returns false if comparing object is not a Customer, or is a Customer with a different id
paymentMethods ( ) : array returns an array containt all of the customer's payment methods
sale ( integer $customerId, array $transactionAttribs ) : Transaction
saleNoValidate ( integer $customerId, array $transactionAttribs ) : Transaction
search ( string $query ) : ResourceCollection
update ( integer $customerId, array $attributes ) : Braintree\Result\Successful | Error
updateCustomerUrl ( ) : string
updateFromTransparentRedirect ( string $queryString ) : Braintree\Result\Successful | Error
updateNoValidate ( integer $customerId, array $attributes ) : CustomerGateway

Protected Methods

Method Description
_initialize ( array $customerAttribs ) sets instance properties from an array of values

Method Details

__toString() public method

returns a string representation of the customer
public __toString ( ) : string
return string

_defaultPaymentMethodFilter() public static method

public static _defaultPaymentMethodFilter ( $paymentMethod )

_initialize() protected method

sets instance properties from an array of values
protected _initialize ( array $customerAttribs )
$customerAttribs array array of customer data

all() public static method

public static all ( ) : Customer[]
return Customer[]

create() public static method

public static create ( array $attribs = [] ) : Braintree\Result\Successful | Error
$attribs array
return Braintree\Result\Successful | Braintree\Result\Error

createCustomerUrl() public static method

Deprecation: since version 2.3.0
public static createCustomerUrl ( ) : string
return string

createFromTransparentRedirect() public static method

Deprecation: since version 2.3.0
public static createFromTransparentRedirect ( string $queryString ) : Braintree\Result\Successful
$queryString string
return Braintree\Result\Successful

createNoValidate() public static method

public static createNoValidate ( array $attribs = [] ) : Customer
$attribs array
return Customer

credit() public static method

public static credit ( integer $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error
$customerId integer
$transactionAttribs array
return Braintree\Result\Successful | Braintree\Result\Error

creditNoValidate() public static method

public static creditNoValidate ( type $customerId, type $transactionAttribs ) : Transaction
$customerId type
$transactionAttribs type
return Transaction

defaultPaymentMethod() public method

returns the customer's default payment method
public defaultPaymentMethod ( ) : CreditCard | braintree\PayPalAccount
return CreditCard | braintree\PayPalAccount

delete() public static method

public static delete ( integer $customerId ) : Braintree\Result\Successful
$customerId integer
return Braintree\Result\Successful

factory() public static method

factory method: returns an instance of Customer to the requesting method, with populated properties
public static factory ( array $attributes ) : Customer
$attributes array
return Customer

fetch() public static method

public static fetch ( string $query, int[] $ids ) : Customer | Customer[]
$query string
$ids int[]
return Customer | Customer[]

find() public static method

public static find ( string $id ) : Customer
$id string customer id
return Customer

isEqual() public method

returns false if comparing object is not a Customer, or is a Customer with a different id
public isEqual ( object $otherCust ) : boolean
$otherCust object customer to compare against
return boolean

paymentMethods() public method

returns an array containt all of the customer's payment methods
Deprecation: since version 3.1.0 - use the paymentMethods property directly
public paymentMethods ( ) : array
return array

sale() public static method

public static sale ( integer $customerId, array $transactionAttribs ) : Transaction
$customerId integer
$transactionAttribs array
return Transaction

saleNoValidate() public static method

public static saleNoValidate ( integer $customerId, array $transactionAttribs ) : Transaction
$customerId integer
$transactionAttribs array
return Transaction

update() public static method

public static update ( integer $customerId, array $attributes ) : Braintree\Result\Successful | Error
$customerId integer
$attributes array
return Braintree\Result\Successful | Braintree\Result\Error

updateCustomerUrl() public static method

Deprecation: since version 2.3.0
public static updateCustomerUrl ( ) : string
return string

updateFromTransparentRedirect() public static method

Deprecation: since version 2.3.0
public static updateFromTransparentRedirect ( string $queryString ) : Braintree\Result\Successful | Error
$queryString string
return Braintree\Result\Successful | Braintree\Result\Error

updateNoValidate() public static method

public static updateNoValidate ( integer $customerId, array $attributes ) : CustomerGateway
$customerId integer
$attributes array
return CustomerGateway

Property Details

$_attributes protected_oe property

registry of customer data
protected $_attributes