2016-08-09 9 views
0

Braintree SDKを私のapp.Myアプリに組み込みます。Swift言語でビルドします。私の質問は、私がiOS SDKを使っているのであれば、それはサーバ側でpaymentMethodNonceの設定が必要なのでしょうか?Braintree iOS v4 SDK

答えて

0

Braintree

// Example: Tokenize the Apple Pay payment 
    BTApplePayClient *applePayClient = [[BTApplePayClient alloc] 
             initWithAPIClient:self.braintreeClient]; 
    [applePayClient tokenizeApplePayPayment:payment 
           completion:^(BTApplePayCardNonce *tokenizedApplePayPayment, 
               NSError *error) 
               { 
            if (tokenizedApplePayPayment) 
            { 
            NSLog(@"nonce = %@", tokenizedApplePayPayment.nonce); 
            } 
           else 
            { 
             // Tokenization failed. Check `error` for the cause of the failure. 

             // Indicate failure via the completion callback: 
             completion(PKPaymentAuthorizationStatusFailure);           

            } 
           }]; 
を使用して Apple Payため Nonceを生成 Braintree

BTPayPalRequest *request= [[BTPayPalRequest alloc] initWithAmount:amount]; 
     request.currencyCode = @"USD"; // Optional; see BTPayPalRequest.h for other options 

     [payPalDriver requestOneTimePayment:request completion:^(BTPayPalAccountNonce * _Nullable tokenizedPayPalAccount, NSError * _Nullable error) 
      { 
      if (tokenizedPayPalAccount) 
       { 
       NSLog(@"Got a nonce: %@", tokenizedPayPalAccount.nonce); 
       } 
      else { 
       // Buyer canceled payment approval 
       // Tokenization failed. Check `error` for the cause of the failure.     
      } 
     }]; 

を使用してPayPalためNonceを生成します

関連する問題