Php Braintree客户端令牌无效

Php Braintree客户端令牌无效,php,ios,braintree,Php,Ios,Braintree,我能够生成客户端令牌,但它说BTClient无法初始化,因为当我在iOS客户端上使用时,提供的clientToken无效 服务器端代码是用php编写的:- $encodedClientToken = Braintree_ClientToken::generate(); echo ( $clientToken = base64_decode($encodedClientToken)); 编辑1:- 在这里,我只是想模拟从我们的服务器获取客户端令牌,就像braintree在这里所做的那样 我按照

我能够生成客户端令牌,但它说BTClient无法初始化,因为当我在iOS客户端上使用时,提供的clientToken无效

服务器端代码是用php编写的:-

$encodedClientToken = Braintree_ClientToken::generate();
echo (  $clientToken = base64_decode($encodedClientToken));
编辑1:- 在这里,我只是想模拟从我们的服务器获取客户端令牌,就像braintree在这里所做的那样 我按照您的指示从这里创建简单服务器,我的文件也会生成客户端令牌,但当我在iOS应用程序中使用时,它会给我一个错误,BTClient无法初始化,因为提供的clientToken无效

这是我的iOS代码

NSURL *clientTokenURL = [NSURL URLWithString:@"http://192.168.1.1:8888/gettoken.php"];
    NSMutableURLRequest *clientTokenRequest = [NSMutableURLRequest requestWithURL:clientTokenURL];
    [clientTokenRequest setValue:@"text/plain" forHTTPHeaderField:@"Accept"];

    [NSURLConnection
     sendAsynchronousRequest:clientTokenRequest
     queue:[NSOperationQueue mainQueue]
     completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
         // TODO: Handle errors in [(NSHTTPURLResponse *)response statusCode] and connectionError
         NSString *clientToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

         // Initialize `Braintree` once per checkout session
         self.braintree = [Braintree braintreeWithClientToken:clientToken];

         // As an example, you may wish to present our Drop-In UI at this point.
         // Continue to the next section to learn more...
     }];

我在Braintree工作。您既没有向我们展示在服务器端将客户端令牌添加到页面的完整代码,也没有展示在客户端使用客户端令牌的代码,因此我们无法看到您做错了什么。我建议您向他们发送更多信息。您是否正在对客户端令牌进行base64_解码?你不应该那样做。如果不这样做会发生什么?如果我只使用echo$clientToken=Braintree\u clientToken::generate;我想你需要。请向他们提供尽可能多的信息/代码。已提供,但他们尚未回复,仅等待回复