/home/desid573/public_html/app/braintree/lib/Braintree
NameSizeModeActions
Dispute/-0755rm
Error/-0755rm
Exception/-0755rm
MerchantAccount/-0755rm
Result/-0755rm
Subscription/-0755rm
Test/-0755rm
Transaction/-0755rm
Xml/-0755rm
AccountUpdaterDailyReport.php10060644editdlrm
AchMandate.php12510644editdlrm
AddOn.php10150644editdlrm
AddOnGateway.php9520644editdlrm
Address.php39930644editdlrm
AddressGateway.php90730644editdlrm
AmexExpressCheckoutCard.php23260644editdlrm
AndroidPayCard.php26330644editdlrm
ApplePayCard.php28660644editdlrm
ApplePayGateway.php20550644editdlrm
ApplePayOptions.php5890644editdlrm
AuthorizationAdjustment.php8300644editdlrm
Base.php18250644editdlrm
BinData.php9600644editdlrm
ClientToken.php11490644editdlrm
ClientTokenGateway.php32790644editdlrm
CoinbaseAccount.php27220644editdlrm
Collection.php33210644editdlrm
Configuration.php175510644editdlrm
ConnectedMerchantPayPalStatusChanged.php8730644editdlrm
ConnectedMerchantStatusTransitioned.php8680644editdlrm
CredentialsParser.php42310644editdlrm
CreditCard.php103360644editdlrm
CreditCardGateway.php152700644editdlrm
CreditCardVerification.php21680644editdlrm
CreditCardVerificationGateway.php23040644editdlrm
CreditCardVerificationSearch.php15010644editdlrm
Customer.php134820644editdlrm
CustomerGateway.php214730644editdlrm
CustomerSearch.php26740644editdlrm
Descriptor.php2280644editdlrm
Digest.php16030644editdlrm
Disbursement.php17480644editdlrm
DisbursementDetails.php6700644editdlrm
Discount.php9060644editdlrm
DiscountGateway.php7440644editdlrm
Dispute.php60740644editdlrm
DisputeGateway.php86490644editdlrm
DisputeSearch.php18510644editdlrm
DocumentUpload.php15290644editdlrm
DocumentUploadGateway.php18430644editdlrm
EndsWithNode.php4370644editdlrm
EqualityNode.php2470644editdlrm
EuropeBankAccount.php16930644editdlrm
Exception.php2310644editdlrm
FacilitatedDetails.php7940644editdlrm
FacilitatorDetails.php8230644editdlrm
Gateway.php47620644editdlrm
GrantedPaymentInstrumentUpdate.php20820644editdlrm
GraphQL.php11450644editdlrm
Http.php93770644editdlrm
IbanBankAccount.php14150644editdlrm
IdealPayment.php23620644editdlrm
IdealPaymentGateway.php28970644editdlrm
Instance.php18100644editdlrm
IsNode.php4070644editdlrm
KeyValueNode.php4090644editdlrm
LocalPaymentCompleted.php17000644editdlrm
MasterpassCard.php43930644editdlrm
Merchant.php9520644editdlrm
MerchantAccount.php26120644editdlrm
MerchantAccountGateway.php57610644editdlrm
MerchantGateway.php13310644editdlrm
Modification.php5310644editdlrm
MultipleValueNode.php9050644editdlrm
MultipleValueOrTextNode.php9880644editdlrm
OAuthAccessRevocation.php5770644editdlrm
OAuthCredentials.php7420644editdlrm
OAuthGateway.php38850644editdlrm
OAuthResult.php7210644editdlrm
PaginatedCollection.php28220644editdlrm
PaginatedResult.php6590644editdlrm
PartialMatchNode.php4120644editdlrm
PartnerMerchant.php9090644editdlrm
PaymentInstrumentType.php7550644editdlrm
PaymentMethod.php9800644editdlrm
PaymentMethodGateway.php96420644editdlrm
PaymentMethodNonce.php16330644editdlrm
PaymentMethodNonceGateway.php15500644editdlrm
PaymentMethodParser.php22510644editdlrm
PayPalAccount.php29030644editdlrm
PayPalAccountGateway.php51700644editdlrm
Plan.php19410644editdlrm
PlanGateway.php8200644editdlrm
ProcessorResponseTypes.php3320644editdlrm
RangeNode.php7820644editdlrm
ResourceCollection.php34150644editdlrm
RevokedPaymentMethodMetadata.php14270644editdlrm
RiskData.php7430644editdlrm
SamsungPayCard.php41600644editdlrm
SettlementBatchSummary.php11310644editdlrm
SettlementBatchSummaryGateway.php28400644editdlrm
SignatureService.php4620644editdlrm
Subscription.php54880644editdlrm
SubscriptionGateway.php75350644editdlrm
SubscriptionSearch.php15620644editdlrm
TestingGateway.php14420644editdlrm
TextNode.php2570644editdlrm
ThreeDSecureInfo.php7860644editdlrm
Transaction.php230450644editdlrm
TransactionGateway.php204480644editdlrm
TransactionLineItem.php13780644editdlrm
TransactionLineItemGateway.php18890644editdlrm
TransactionSearch.php78800644editdlrm
TransparentRedirect.php30490644editdlrm
TransparentRedirectGateway.php89930644editdlrm
UnknownPaymentMethod.php15610644editdlrm
UsBankAccount.php31220644editdlrm
UsBankAccountGateway.php29020644editdlrm
UsBankAccountVerification.php27180644editdlrm
UsBankAccountVerificationGateway.php40230644editdlrm
UsBankAccountVerificationSearch.php15420644editdlrm
Util.php169740644editdlrm
VenmoAccount.php19890644editdlrm
Version.php5910644editdlrm
VisaCheckoutCard.php50340644editdlrm
WebhookNotification.php58220644editdlrm
WebhookNotificationGateway.php25160644editdlrm
WebhookTesting.php3280644editdlrm
WebhookTestingGateway.php194830644editdlrm
Xml.php6580644editdlrm
Edit: /home/desid573/public_html/app/braintree/lib/Braintree/AddressGateway.php (9073B)
_gateway = $gateway; $this->_config = $gateway->config; $this->_config->assertHasAccessTokenOrKeys(); $this->_http = new Http($gateway->config); } /* public class methods */ /** * * @access public * @param array $attribs * @return Result\Successful|Result\Error */ public function create($attribs) { Util::verifyKeys(self::createSignature(), $attribs); $customerId = isset($attribs['customerId']) ? $attribs['customerId'] : null; $this->_validateCustomerId($customerId); unset($attribs['customerId']); try { return $this->_doCreate( '/customers/' . $customerId . '/addresses', ['address' => $attribs] ); } catch (Exception\NotFound $e) { throw new Exception\NotFound( 'Customer ' . $customerId . ' not found.' ); } } /** * attempts the create operation assuming all data will validate * returns a Address object instead of a Result * * @access public * @param array $attribs * @return self * @throws Exception\ValidationError */ public function createNoValidate($attribs) { $result = $this->create($attribs); return Util::returnObjectOrThrowException(__CLASS__, $result); } /** * delete an address by id * * @param mixed $customerOrId * @param string $addressId */ public function delete($customerOrId = null, $addressId = null) { $this->_validateId($addressId); $customerId = $this->_determineCustomerId($customerOrId); $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; $this->_http->delete($path); return new Result\Successful(); } /** * find an address by id * * 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. * * * @access public * @param mixed $customerOrId * @param string $addressId * @return Address * @throws Exception\NotFound */ public function find($customerOrId, $addressId) { $customerId = $this->_determineCustomerId($customerOrId); $this->_validateId($addressId); try { $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; $response = $this->_http->get($path); return Address::factory($response['address']); } catch (Exception\NotFound $e) { throw new Exception\NotFound( 'address for customer ' . $customerId . ' with id ' . $addressId . ' not found.' ); } } /** * updates the address record * * if calling this method in context, * customerOrId is the 2nd attribute, addressId 3rd. * customerOrId & addressId are not sent in object context. * * * @access public * @param array $attributes * @param mixed $customerOrId (only used in call) * @param string $addressId (only used in call) * @return Result\Successful|Result\Error */ public function update($customerOrId, $addressId, $attributes) { $this->_validateId($addressId); $customerId = $this->_determineCustomerId($customerOrId); Util::verifyKeys(self::updateSignature(), $attributes); $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId; $response = $this->_http->put($path, ['address' => $attributes]); return $this->_verifyGatewayResponse($response); } /** * update an address record, assuming validations will pass * * if calling this method in context, * customerOrId is the 2nd attribute, addressId 3rd. * customerOrId & addressId are not sent in object context. * * @access public * @param array $transactionAttribs * @param string $customerId * @return Transaction * @throws Exception\ValidationsFailed * @see Address::update() */ public function updateNoValidate($customerOrId, $addressId, $attributes) { $result = $this->update($customerOrId, $addressId, $attributes); return Util::returnObjectOrThrowException(__CLASS__, $result); } /** * creates a full array signature of a valid create request * @return array gateway create request format */ public static function createSignature() { return [ 'company', 'countryCodeAlpha2', 'countryCodeAlpha3', 'countryCodeNumeric', 'countryName', 'customerId', 'extendedAddress', 'firstName', 'lastName', 'locality', 'postalCode', 'region', 'streetAddress' ]; } /** * creates a full array signature of a valid update request * @return array gateway update request format */ public static function updateSignature() { // TODO: remove customerId from update signature return self::createSignature(); } /** * verifies that a valid address id is being used * @ignore * @param string $id address id * @throws InvalidArgumentException */ private function _validateId($id = null) { if (empty($id) || trim($id) == "") { throw new InvalidArgumentException( 'expected address id to be set' ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { throw new InvalidArgumentException( $id . ' is an invalid address id.' ); } } /** * verifies that a valid customer id is being used * @ignore * @param string $id customer id * @throws InvalidArgumentException */ private function _validateCustomerId($id = null) { if (empty($id) || trim($id) == "") { throw new InvalidArgumentException( 'expected customer id to be set' ); } if (!preg_match('/^[0-9A-Za-z_-]+$/', $id)) { throw new InvalidArgumentException( $id . ' is an invalid customer id.' ); } } /** * determines if a string id or Customer object was passed * @ignore * @param mixed $customerOrId * @return string customerId */ private function _determineCustomerId($customerOrId) { $customerId = ($customerOrId instanceof Customer) ? $customerOrId->id : $customerOrId; $this->_validateCustomerId($customerId); return $customerId; } /* private class methods */ /** * sends the create request to the gateway * @ignore * @param string $subPath * @param array $params * @return Result\Successful|Result\Error */ private function _doCreate($subPath, $params) { $fullPath = $this->_config->merchantPath() . $subPath; $response = $this->_http->post($fullPath, $params); return $this->_verifyGatewayResponse($response); } /** * generic method for validating incoming gateway responses * * creates a new Address object and encapsulates * it inside a Result\Successful object, or * encapsulates an Errors object inside a Result\Error * alternatively, throws an Unexpected exception if the response is invalid * * @ignore * @param array $response gateway response values * @return Result\Successful|Result\Error * @throws Exception\Unexpected */ private function _verifyGatewayResponse($response) { if (isset($response['address'])) { // return a populated instance of Address return new Result\Successful( Address::factory($response['address']) ); } else if (isset($response['apiErrorResponse'])) { return new Result\Error($response['apiErrorResponse']); } else { throw new Exception\Unexpected( "Expected address or apiErrorResponse" ); } } } class_alias('Braintree\AddressGateway', 'Braintree_AddressGateway');