catalog/includes/apps/braintree/lib/Braintree/AddressGateway.php 1 location
|
@@ 298-313 (lines=16) @@
|
| 295 |
|
* @return Result\Successful|Result\Error |
| 296 |
|
* @throws Exception\Unexpected |
| 297 |
|
*/ |
| 298 |
|
private function _verifyGatewayResponse($response) |
| 299 |
|
{ |
| 300 |
|
if (isset($response['address'])) { |
| 301 |
|
// return a populated instance of Address |
| 302 |
|
return new Result\Successful( |
| 303 |
|
Address::factory($response['address']) |
| 304 |
|
); |
| 305 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 306 |
|
return new Result\Error($response['apiErrorResponse']); |
| 307 |
|
} else { |
| 308 |
|
throw new Exception\Unexpected( |
| 309 |
|
"Expected address or apiErrorResponse" |
| 310 |
|
); |
| 311 |
|
} |
| 312 |
|
|
| 313 |
|
} |
| 314 |
|
} |
| 315 |
|
class_alias('Braintree\AddressGateway', 'Braintree_AddressGateway'); |
| 316 |
|
|
catalog/includes/apps/braintree/lib/Braintree/CreditCardGateway.php 1 location
|
@@ 471-485 (lines=15) @@
|
| 468 |
|
* @return Result\Successful|Result\Error |
| 469 |
|
* @throws Exception\Unexpected |
| 470 |
|
*/ |
| 471 |
|
private function _verifyGatewayResponse($response) |
| 472 |
|
{ |
| 473 |
|
if (isset($response['creditCard'])) { |
| 474 |
|
// return a populated instance of Address |
| 475 |
|
return new Result\Successful( |
| 476 |
|
CreditCard::factory($response['creditCard']) |
| 477 |
|
); |
| 478 |
|
} elseif (isset($response['apiErrorResponse'])) { |
| 479 |
|
return new Result\Error($response['apiErrorResponse']); |
| 480 |
|
} else { |
| 481 |
|
throw new Exception\Unexpected( |
| 482 |
|
"Expected address or apiErrorResponse" |
| 483 |
|
); |
| 484 |
|
} |
| 485 |
|
} |
| 486 |
|
} |
| 487 |
|
class_alias('Braintree\CreditCardGateway', 'Braintree_CreditCardGateway'); |
| 488 |
|
|
catalog/includes/apps/braintree/lib/Braintree/CreditCardVerificationGateway.php 1 location
|
@@ 24-38 (lines=15) @@
|
| 21 |
|
return $this->_verifyGatewayResponse($response); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
|
private function _verifyGatewayResponse($response) |
| 25 |
|
{ |
| 26 |
|
|
| 27 |
|
if(isset($response['verification'])){ |
| 28 |
|
return new Result\Successful( |
| 29 |
|
CreditCardVerification::factory($response['verification']) |
| 30 |
|
); |
| 31 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 32 |
|
return new Result\Error($response['apiErrorResponse']); |
| 33 |
|
} else { |
| 34 |
|
throw new Exception\Unexpected( |
| 35 |
|
"Expected transaction or apiErrorResponse" |
| 36 |
|
); |
| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public function fetch($query, $ids) |
| 41 |
|
{ |
catalog/includes/apps/braintree/lib/Braintree/CustomerGateway.php 1 location
|
@@ 610-624 (lines=15) @@
|
| 607 |
|
* @return Result\Successful|Result\Error |
| 608 |
|
* @throws Exception\Unexpected |
| 609 |
|
*/ |
| 610 |
|
private function _verifyGatewayResponse($response) |
| 611 |
|
{ |
| 612 |
|
if (isset($response['customer'])) { |
| 613 |
|
// return a populated instance of Customer |
| 614 |
|
return new Result\Successful( |
| 615 |
|
Customer::factory($response['customer']) |
| 616 |
|
); |
| 617 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 618 |
|
return new Result\Error($response['apiErrorResponse']); |
| 619 |
|
} else { |
| 620 |
|
throw new Exception\Unexpected( |
| 621 |
|
"Expected customer or apiErrorResponse" |
| 622 |
|
); |
| 623 |
|
} |
| 624 |
|
} |
| 625 |
|
} |
| 626 |
|
class_alias('Braintree\CustomerGateway', 'Braintree_CustomerGateway'); |
| 627 |
|
|
catalog/includes/apps/braintree/lib/Braintree/MerchantAccountGateway.php 1 location
|
@@ 138-152 (lines=15) @@
|
| 135 |
|
return $this->_verifyGatewayResponse($response); |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
private function _verifyGatewayResponse($response) |
| 139 |
|
{ |
| 140 |
|
if (isset($response['merchantAccount'])) { |
| 141 |
|
// return a populated instance of merchantAccount |
| 142 |
|
return new Result\Successful( |
| 143 |
|
MerchantAccount::factory($response['merchantAccount']) |
| 144 |
|
); |
| 145 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 146 |
|
return new Result\Error($response['apiErrorResponse']); |
| 147 |
|
} else { |
| 148 |
|
throw new Exception\Unexpected( |
| 149 |
|
"Expected merchant account or apiErrorResponse" |
| 150 |
|
); |
| 151 |
|
} |
| 152 |
|
} |
| 153 |
|
} |
| 154 |
|
class_alias('Braintree\MerchantAccountGateway', 'Braintree_MerchantAccountGateway'); |
| 155 |
|
|
catalog/includes/apps/braintree/lib/Braintree/PayPalAccountGateway.php 1 location
|
@@ 143-157 (lines=15) @@
|
| 140 |
|
* @return Result\Successful|Result\Error |
| 141 |
|
* @throws Exception\Unexpected |
| 142 |
|
*/ |
| 143 |
|
private function _verifyGatewayResponse($response) |
| 144 |
|
{ |
| 145 |
|
if (isset($response['paypalAccount'])) { |
| 146 |
|
// return a populated instance of PayPalAccount |
| 147 |
|
return new Result\Successful( |
| 148 |
|
PayPalAccount::factory($response['paypalAccount']) |
| 149 |
|
); |
| 150 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 151 |
|
return new Result\Error($response['apiErrorResponse']); |
| 152 |
|
} else { |
| 153 |
|
throw new Exception\Unexpected( |
| 154 |
|
'Expected paypal account or apiErrorResponse' |
| 155 |
|
); |
| 156 |
|
} |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* verifies that a valid paypal account identifier is being used |
catalog/includes/apps/braintree/lib/Braintree/SettlementBatchSummaryGateway.php 1 location
|
@@ 91-104 (lines=14) @@
|
| 88 |
|
* @return Result\Successful|Result\Error |
| 89 |
|
* @throws Exception\Unexpected |
| 90 |
|
*/ |
| 91 |
|
private function _verifyGatewayResponse($response) |
| 92 |
|
{ |
| 93 |
|
if (isset($response['settlementBatchSummary'])) { |
| 94 |
|
return new Result\Successful( |
| 95 |
|
SettlementBatchSummary::factory($response['settlementBatchSummary']) |
| 96 |
|
); |
| 97 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 98 |
|
return new Result\Error($response['apiErrorResponse']); |
| 99 |
|
} else { |
| 100 |
|
throw new Exception\Unexpected( |
| 101 |
|
"Expected settlementBatchSummary or apiErrorResponse" |
| 102 |
|
); |
| 103 |
|
} |
| 104 |
|
} |
| 105 |
|
} |
| 106 |
|
class_alias('Braintree\SettlementBatchSummaryGateway', 'Braintree_SettlementBatchSummaryGateway'); |
| 107 |
|
|
catalog/includes/apps/braintree/lib/Braintree/TransactionGateway.php 1 location
|
@@ 504-518 (lines=15) @@
|
| 501 |
|
* @return Result\Successful|Result\Error |
| 502 |
|
* @throws Exception\Unexpected |
| 503 |
|
*/ |
| 504 |
|
private function _verifyGatewayResponse($response) |
| 505 |
|
{ |
| 506 |
|
if (isset($response['transaction'])) { |
| 507 |
|
// return a populated instance of Transaction |
| 508 |
|
return new Result\Successful( |
| 509 |
|
Transaction::factory($response['transaction']) |
| 510 |
|
); |
| 511 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 512 |
|
return new Result\Error($response['apiErrorResponse']); |
| 513 |
|
} else { |
| 514 |
|
throw new Exception\Unexpected( |
| 515 |
|
"Expected transaction or apiErrorResponse" |
| 516 |
|
); |
| 517 |
|
} |
| 518 |
|
} |
| 519 |
|
} |
| 520 |
|
class_alias('Braintree\TransactionGateway', 'Braintree_TransactionGateway'); |
| 521 |
|
|
catalog/includes/apps/braintree/lib/Braintree/UsBankAccountGateway.php 1 location
|
@@ 92-106 (lines=15) @@
|
| 89 |
|
* @return Result\Successful|Result\Error |
| 90 |
|
* @throws Exception\Unexpected |
| 91 |
|
*/ |
| 92 |
|
private function _verifyGatewayResponse($response) |
| 93 |
|
{ |
| 94 |
|
if (isset($response['usBankAccount'])) { |
| 95 |
|
// return a populated instance of UsBankAccount |
| 96 |
|
return new Result\Successful( |
| 97 |
|
UsBankAccount::factory($response['usBankAccount']) |
| 98 |
|
); |
| 99 |
|
} else if (isset($response['apiErrorResponse'])) { |
| 100 |
|
return new Result\Error($response['apiErrorResponse']); |
| 101 |
|
} else { |
| 102 |
|
throw new Exception\Unexpected( |
| 103 |
|
'Expected US bank account or apiErrorResponse' |
| 104 |
|
); |
| 105 |
|
} |
| 106 |
|
} |
| 107 |
|
} |
| 108 |
|
class_alias('Braintree\UsBankAccountGateway', 'Braintree_UsBankAccountGateway'); |
| 109 |
|
|