PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Приватные методы

Метод Описание
_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

Описание методов

__construct() публичный Метод

public __construct ( Gateway $gateway )
$gateway Gateway

create() публичный Метод

public create ( array $attribs ) : Braintree\Result\Successful | Error
$attribs array
Результат Braintree\Result\Successful | Braintree\Result\Error

createNoValidate() публичный Метод

attempts the create operation assuming all data will validate returns a Address object instead of a Result
public createNoValidate ( array $attribs ) : self
$attribs array
Результат self

createSignature() публичный статический Метод

creates a full array signature of a valid create request
public static createSignature ( ) : array
Результат array gateway create request format

delete() публичный Метод

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

find() публичный Метод

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
Результат braintree\Address

update() публичный Метод

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
Результат Braintree\Result\Successful | Braintree\Result\Error

updateNoValidate() публичный Метод

if calling this method in context, customerOrId is the 2nd attribute, addressId 3rd. customerOrId & addressId are not sent in object context.
См. также: Address::update()
public updateNoValidate ( $customerOrId, $addressId, $attributes ) : Transaction
Результат Transaction

updateSignature() публичный статический Метод

creates a full array signature of a valid update request
public static updateSignature ( ) : array
Результат array gateway update request format