PHP Class Braintree\AddressGateway

An Address belongs to a Customer. It can be associated to a CreditCard as the billing address. It can also be used as the shipping address when creating a Transaction.
Afficher le fichier Open project: braintree/braintree_php Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Gateway $gateway )
create ( array $attribs ) : Braintree\Result\Successful | Error
createNoValidate ( array $attribs ) : self attempts the create operation assuming all data will validate returns a Address object instead of a Result
createSignature ( ) : array creates a full array signature of a valid create request
delete ( mixed $customerOrId = null, string $addressId = null ) delete an address by id
find ( mixed $customerOrId, string $addressId ) : braintree\Address find an address by id
update ( mixed $customerOrId, string $addressId, array $attributes ) : Braintree\Result\Successful | Error updates the address record
updateNoValidate ( $customerOrId, $addressId, $attributes ) : Transaction update an address record, assuming validations will pass
updateSignature ( ) : array creates a full array signature of a valid update request

Private Methods

Méthode Description
_determineCustomerId ( mixed $customerOrId ) : string determines if a string id or Customer object was passed
_doCreate ( string $subPath, array $params ) : Braintree\Result\Successful | Error sends the create request to the gateway
_validateCustomerId ( string $id = null ) verifies that a valid customer id is being used
_validateId ( string $id = null ) verifies that a valid address id is being used
_verifyGatewayResponse ( array $response ) : Braintree\Result\Successful | Error generic method for validating incoming gateway responses

Method Details

__construct() public méthode

public __construct ( Gateway $gateway )
$gateway Gateway

create() public méthode

public create ( array $attribs ) : Braintree\Result\Successful | Error
$attribs array
Résultat Braintree\Result\Successful | Braintree\Result\Error

createNoValidate() public méthode

attempts the create operation assuming all data will validate returns a Address object instead of a Result
public createNoValidate ( array $attribs ) : self
$attribs array
Résultat self

createSignature() public static méthode

creates a full array signature of a valid create request
public static createSignature ( ) : array
Résultat array gateway create request format

delete() public méthode

delete an address by id
public delete ( mixed $customerOrId = null, string $addressId = null )
$customerOrId mixed
$addressId string

find() public méthode

Finds the address with the given addressId that is associated to the given customerOrId. If the address cannot be found, a NotFound exception will be thrown.
public find ( mixed $customerOrId, string $addressId ) : braintree\Address
$customerOrId mixed
$addressId string
Résultat braintree\Address

update() public méthode

if calling this method in context, customerOrId is the 2nd attribute, addressId 3rd. customerOrId & addressId are not sent in object context.
public update ( mixed $customerOrId, string $addressId, array $attributes ) : Braintree\Result\Successful | Error
$customerOrId mixed (only used in call)
$addressId string (only used in call)
$attributes array
Résultat Braintree\Result\Successful | Braintree\Result\Error

updateNoValidate() public méthode

if calling this method in context, customerOrId is the 2nd attribute, addressId 3rd. customerOrId & addressId are not sent in object context.
See also: Address::update()
public updateNoValidate ( $customerOrId, $addressId, $attributes ) : Transaction
Résultat Transaction

updateSignature() public static méthode

creates a full array signature of a valid update request
public static updateSignature ( ) : array
Résultat array gateway update request format