本文整理汇总了PHP中Braintree_Util::verifyKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Util::verifyKeys方法的具体用法?PHP Braintree_Util::verifyKeys怎么用?PHP Braintree_Util::verifyKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_Util
的用法示例。
在下文中一共展示了Braintree_Util::verifyKeys方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($subscriptionId, $attributes)
{
Braintree_Util::verifyKeys(self::_updateSignature(), $attributes);
$path = $this->_config->merchantPath() . '/subscriptions/' . $subscriptionId;
$response = $this->_http->put($path, array('subscription' => $attributes));
return $this->_verifyGatewayResponse($response);
}
示例2: conditionallyVerifyKeys
public function conditionallyVerifyKeys($params)
{
if (array_key_exists("customerId", $params)) {
Braintree_Util::verifyKeys($this->generateWithCustomerIdSignature(), $params);
} else {
Braintree_Util::verifyKeys($this->generateWithoutCustomerIdSignature(), $params);
}
}
示例3: testVerifyKeys
function testVerifyKeys()
{
$signature = array('amount', 'customerId', 'orderId', 'paymentMethodToken', 'type', array('creditCard' => array('token', 'cvv', 'expirationDate', 'number')), array('customer' => array('id', 'company', 'email', 'fax', 'firstName', 'lastName', 'phone', 'website')), array('billing' => array('firstName', 'lastName', 'company', 'countryName', 'extendedAddress', 'locality', 'postalCode', 'region', 'streetAddress')), array('shipping' => array('firstName', 'lastName', 'company', 'countryName', 'extendedAddress', 'locality', 'postalCode', 'region', 'streetAddress')), array('options' => array('storeInVault', 'submitForSettlement', 'addBillingAddressToPaymentMethod')), array('customFields' => array('_anyKey_')));
// test valid
$userKeys = array('amount' => '100.00', 'customFields' => array('HEY' => 'HO', 'WAY' => 'NO'), 'creditCard' => array('number' => '5105105105105100', 'expirationDate' => '05/12'));
$n = Braintree_Util::verifyKeys($signature, $userKeys);
$this->assertNull($n);
$userKeys = array('amount' => '100.00', 'customFields' => array('HEY' => 'HO', 'WAY' => 'NO'), 'bogus' => 'FAKE', 'totallyFake' => 'boom', 'creditCard' => array('number' => '5105105105105100', 'expirationDate' => '05/12'));
// test invalid
$this->setExpectedException('InvalidArgumentException');
Braintree_Util::verifyKeys($signature, $userKeys);
}
示例4: update
public function update($token, $attribs)
{
Braintree_Util::verifyKeys(self::updateSignature(), $attribs);
return $this->_doUpdate('/payment_methods/any/' . $token, array('payment_method' => $attribs));
}
示例5: create
/**
* @ignore
* @access public
* @param array $attribs
* @return object
*/
private static function create($attribs)
{
Braintree_Util::verifyKeys(self::createSignature(), $attribs);
return self::_doCreate('/transactions', array('transaction' => $attribs));
}
示例6: update
/**
* updates the creditcard record
*
* if calling this method in static context, $token
* is the 2nd attribute. $token is not sent in object context.
*
* @access public
* @param array $attributes
* @param string $token (optional)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public static function update($token, $attributes)
{
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
self::_validateId($token);
return self::_doUpdate('put', '/payment_methods/' . $token, array('creditCard' => $attributes));
}
示例7: update
/**
* updates the customer record
*
* if calling this method in static context, customerId
* is the 2nd attribute. customerId is not sent in object context.
*
* @access public
* @param array $attributes
* @param string $customerId (optional)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public function update($customerId, $attributes)
{
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$this->_validateId($customerId);
return $this->_doUpdate('put', '/customers/' . $customerId, array('customer' => $attributes));
}
示例8: update
/**
* 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 object Braintree_Result_Successful or Braintree_Result_Error
*/
public function update($customerOrId, $addressId, $attributes)
{
$this->_validateId($addressId);
$customerId = $this->_determineCustomerId($customerOrId);
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId;
$response = $this->_http->put($path, array('address' => $attributes));
return $this->_verifyGatewayResponse($response);
}
示例9: update
public static function update($merchant_account_id, $attributes)
{
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
return self::_doUpdate('/merchant_accounts/' . $merchant_account_id . '/update_via_api', array('merchant_account' => $attributes));
}
示例10: update
/**
* updates the address record
*
* if calling this method in static 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 static call)
* @param string $addressId (only used in static call)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public static function update($customerOrId, $addressId, $attributes)
{
self::_validateId($addressId);
$customerId = self::_determineCustomerId($customerOrId);
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$response = Braintree_Http::put('/customers/' . $customerId . '/addresses/' . $addressId, array('address' => $attributes));
return self::_verifyGatewayResponse($response);
}
示例11: update
public static function update($subscriptionId, $attributes)
{
Braintree_Util::verifyKeys(self::_updateSignature(), $attributes);
$response = Braintree_Http::put('/subscriptions/' . $subscriptionId, array('subscription' => $attributes));
return self::_verifyGatewayResponse($response);
}
示例12: updateCustomerData
/**
* Returns the trData string for updating a customer.
*
* The customerId of the customer to update is required.
*
* <code>
* $trData = Braintree_TransparentRedirect::updateCustomerData(array(
* 'redirectUrl' => 'http://example.com/redirect_here',
* 'customerId' => 'customer123',
* ));
* </code>
*
* @param array $params
* @return string
*/
public function updateCustomerData($params)
{
Braintree_Util::verifyKeys(self::$_updateCustomerSignature, $params);
if (!isset($params['customerId'])) {
throw new InvalidArgumentException('expected params to contain customerId of customer to update');
}
$params["kind"] = Braintree_TransparentRedirect::UPDATE_CUSTOMER;
return $this->_data($params);
}
示例13: update
/**
* updates the paypalAccount record
*
* if calling this method in context, $token
* is the 2nd attribute. $token is not sent in object context.
*
* @access public
* @param array $attributes
* @param string $token (optional)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public function update($token, $attributes)
{
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$this->_validateId($token);
return $this->_doUpdate('put', '/payment_methods/paypal_account/' . $token, array('paypalAccount' => $attributes));
}
示例14: create
public static function create($attribs)
{
Braintree_Util::verifyKeys(self::createSignature(), $attribs);
return self::_doCreate('/payment_methods', array('payment_method' => $attribs));
}