PHP 클래스 Braintree\CustomerGateway

== More information == For more detailed information on Customers, see {@link http://www.braintreepayments.com/gateway/customer-api http://www.braintreepaymentsolutions.com/gateway/customer-api}
파일 보기 프로젝트 열기: braintree/braintree_php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_attributes registry of customer data

공개 메소드들

메소드 설명
__construct ( $gateway )
__toString ( ) : string returns a string representation of the customer
_defaultPaymentMethodFilter ( $paymentMethod )
_doCreate ( string $subPath, array $params ) : mixed sends the create request to the gateway
all ( )
create ( array $attribs = [] ) : Braintree_Result_Successful | Braintree_Result_Error Creates a customer using the given +attributes+. If :id is not passed, the gateway will generate it.
createCustomerUrl ( ) : string
createFromTransparentRedirect ( $queryString ) : Customer create a customer from a TransparentRedirect operation
createNoValidate ( array $attribs = [] ) : Customer attempts the create operation assuming all data will validate returns a Customer object instead of a Result
createSignature ( ) : array creates a full array signature of a valid create request
credit ( integer $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error credit a customer for the passed transaction
creditNoValidate ( integer $customerId, array $transactionAttribs ) : Transaction credit a customer, assuming validations will pass
defaultPaymentMethod ( ) : CreditCard | braintree\PayPalAccount | braintree\ApplePayCard | braintree\AndroidPayCard returns the customer's default payment method
delete ( string $customerId ) delete a customer by id
fetch ( $query, $ids )
find ( $id ) : Customer | boolean find a customer by id
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 ( string $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error create a new sale for a customer
saleNoValidate ( string $customerId, array $transactionAttribs ) : Transaction create a new sale for a customer, assuming validations will pass
search ( mixed $query ) : ResourceCollection Returns a ResourceCollection of customers matching the search query.
update ( string $customerId, array $attributes ) : Braintree\Result\Successful | Error updates the customer record
updateCustomerUrl ( ) : string
updateFromTransparentRedirect ( string $queryString ) : object update a customer from a TransparentRedirect operation
updateNoValidate ( string $customerId, array $attributes ) : Customer update a customer record, assuming validations will pass
updateSignature ( ) : array creates a full array signature of a valid update request

보호된 메소드들

메소드 설명
_initialize ( array $customerAttribs ) : void sets instance properties from an array of values

비공개 메소드들

메소드 설명
_doUpdate ( $httpVerb, string $subPath, array $params ) : mixed sends the update request to the gateway
_validateId ( $id = null ) verifies that a valid customer id is being used
_verifyGatewayResponse ( array $response ) : Braintree\Result\Successful | Error generic method for validating incoming gateway responses

메소드 상세

__construct() 공개 메소드

public __construct ( $gateway )

__toString() 공개 메소드

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

_defaultPaymentMethodFilter() 공개 정적인 메소드

public static _defaultPaymentMethodFilter ( $paymentMethod )

_doCreate() 공개 메소드

sends the create request to the gateway
public _doCreate ( string $subPath, array $params ) : mixed
$subPath string
$params array
리턴 mixed

_initialize() 보호된 메소드

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

all() 공개 메소드

public all ( )

create() 공개 메소드

$result = Customer::create(array( 'first_name' => 'John', 'last_name' => 'Smith', 'company' => 'Smith Co.', 'email' => '[email protected]', 'website' => 'www.smithco.com', 'fax' => '419-555-1234', 'phone' => '614-555-1234' )); if($result->success) { echo 'Created customer ' . $result->customer->id; } else { echo 'Could not create customer, see result->errors'; }
public create ( array $attribs = [] ) : Braintree_Result_Successful | Braintree_Result_Error
$attribs array
리턴 Braintree_Result_Successful | Braintree_Result_Error

createCustomerUrl() 공개 메소드

사용 중단: since version 2.3.0
public createCustomerUrl ( ) : string
리턴 string

createFromTransparentRedirect() 공개 메소드

create a customer from a TransparentRedirect operation
사용 중단: since version 2.3.0
public createFromTransparentRedirect ( $queryString ) : Customer
리턴 Customer

createNoValidate() 공개 메소드

attempts the create operation assuming all data will validate returns a Customer object instead of a Result
public createNoValidate ( array $attribs = [] ) : Customer
$attribs array
리턴 Customer

createSignature() 공개 정적인 메소드

creates a full array signature of a valid create request
public static createSignature ( ) : array
리턴 array gateway create request format

credit() 공개 메소드

credit a customer for the passed transaction
public credit ( integer $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error
$customerId integer
$transactionAttribs array
리턴 Braintree\Result\Successful | Braintree\Result\Error

creditNoValidate() 공개 메소드

returns a Transaction object on success
public creditNoValidate ( integer $customerId, array $transactionAttribs ) : Transaction
$customerId integer
$transactionAttribs array
리턴 Transaction

defaultPaymentMethod() 공개 메소드

returns the customer's default payment method
public defaultPaymentMethod ( ) : CreditCard | braintree\PayPalAccount | braintree\ApplePayCard | braintree\AndroidPayCard
리턴 CreditCard | braintree\PayPalAccount | braintree\ApplePayCard | braintree\AndroidPayCard

delete() 공개 메소드

delete a customer by id
public delete ( string $customerId )
$customerId string

fetch() 공개 메소드

public fetch ( $query, $ids )

find() 공개 메소드

find a customer by id
public find ( $id ) : Customer | boolean
리턴 Customer | boolean The customer object or false if the request fails.

isEqual() 공개 메소드

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
리턴 boolean

paymentMethods() 공개 메소드

returns an array containt all of the customer's payment methods
public paymentMethods ( ) : array
리턴 array

sale() 공개 메소드

create a new sale for a customer
또한 보기: Transaction::sale()
public sale ( string $customerId, array $transactionAttribs ) : Braintree\Result\Successful | Error
$customerId string
$transactionAttribs array
리턴 Braintree\Result\Successful | Braintree\Result\Error

saleNoValidate() 공개 메소드

returns a Transaction object on success
또한 보기: Transaction::sale()
public saleNoValidate ( string $customerId, array $transactionAttribs ) : Transaction
$customerId string
$transactionAttribs array
리턴 Transaction

update() 공개 메소드

if calling this method in static context, customerId is the 2nd attribute. customerId is not sent in object context.
public update ( string $customerId, array $attributes ) : Braintree\Result\Successful | Error
$customerId string (optional)
$attributes array
리턴 Braintree\Result\Successful | Braintree\Result\Error

updateCustomerUrl() 공개 메소드

사용 중단: since version 2.3.0
public updateCustomerUrl ( ) : string
리턴 string

updateFromTransparentRedirect() 공개 메소드

update a customer from a TransparentRedirect operation
사용 중단: since version 2.3.0
public updateFromTransparentRedirect ( string $queryString ) : object
$queryString string
리턴 object

updateNoValidate() 공개 메소드

if calling this method in static context, customerId is the 2nd attribute. customerId is not sent in object context. returns a Customer object on success
public updateNoValidate ( string $customerId, array $attributes ) : Customer
$customerId string
$attributes array
리턴 Customer

updateSignature() 공개 정적인 메소드

creates a full array signature of a valid update request
public static updateSignature ( ) : array
리턴 array update request format

프로퍼티 상세

$_attributes 보호되어 있는 프로퍼티

registry of customer data
protected $_attributes