Braintree\Util::buildClassName PHP Method

buildClassName() public static method

public static buildClassName ( string $name ) : string
$name string className
return string ClassName
    public static function buildClassName($name)
    {
        $responseKeysToClassNames = ['creditCard' => 'Braintree\\CreditCard', 'customer' => 'Braintree\\Customer', 'subscription' => 'Braintree\\Subscription', 'transaction' => 'Braintree\\Transaction', 'verification' => 'Braintree\\CreditCardVerification', 'addOn' => 'Braintree\\AddOn', 'discount' => 'Braintree\\Discount', 'plan' => 'Braintree\\Plan', 'address' => 'Braintree\\Address', 'settlementBatchSummary' => 'Braintree\\SettlementBatchSummary', 'merchantAccount' => 'Braintree\\MerchantAccount'];
        return (string) $responseKeysToClassNames[$name];
    }

Usage Example

Esempio n. 1
0
 public function testBuildClassName()
 {
     $cn = Braintree\Util::buildClassName('creditCard');
     $this->assertEquals('Braintree\\CreditCard', $cn);
 }