How to get nonce from Braintree iOs SDK










2















I'm trying to get nonce from Braintree. I have not found any documentation Braintree provided that how to get nonce from Braintree SDK in following documentation.



https://developers.braintreepayments.com/start/hello-client/ios/v4



Please let me know how to get nonce from Braintree iOs SDK










share|improve this question


























    2















    I'm trying to get nonce from Braintree. I have not found any documentation Braintree provided that how to get nonce from Braintree SDK in following documentation.



    https://developers.braintreepayments.com/start/hello-client/ios/v4



    Please let me know how to get nonce from Braintree iOs SDK










    share|improve this question
























      2












      2








      2


      1






      I'm trying to get nonce from Braintree. I have not found any documentation Braintree provided that how to get nonce from Braintree SDK in following documentation.



      https://developers.braintreepayments.com/start/hello-client/ios/v4



      Please let me know how to get nonce from Braintree iOs SDK










      share|improve this question














      I'm trying to get nonce from Braintree. I have not found any documentation Braintree provided that how to get nonce from Braintree SDK in following documentation.



      https://developers.braintreepayments.com/start/hello-client/ios/v4



      Please let me know how to get nonce from Braintree iOs SDK







      ios paypal braintree paypal-rest-sdk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 4 '16 at 10:59









      PPSheinPPShein

      4,7252382144




      4,7252382144






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.



          Getting the nonce is documented in the Presenting Drop-in UI section of the page you linked. Once you have the Drop-in active, you need to implement a delegate so the Drop-in can find where to send the nonce it produces. Without a delegate like the one specified you won't receive the nonce from the Drop-in:




          Then implement BTDropInViewControllerDelegate to obtain the payment method nonce on success, and dismiss the Drop In UI in either case:




          - (void)dropInViewController:(BTDropInViewController *)viewController 
          didSucceedWithTokenization:(BTPaymentMethodNonce *)paymentMethodNonce
          // Send payment method nonce to your server for processing
          [self postNonceToServer:paymentMethodNonce.nonce];
          [self dismissViewControllerAnimated:YES completion:nil];


          - (void)dropInViewControllerDidCancel:(__unused BTDropInViewController *)viewController
          [self dismissViewControllerAnimated:YES completion:nil];




          If you look at the first function you can see that a variable paymentMethodNonce (type: BTPaymentMethodNonce) is passed into your app. This sample code expects that you have another function (postNonceToServer) to actually handle the nonce once you get it.






          share|improve this answer


















          • 2





            And for version 4? Where there is no delegate.

            – Pedro.Alonso
            Dec 8 '16 at 16:28






          • 3





            @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

            – Richard Shin
            Dec 11 '16 at 1:26











          • how to convert payment method nonce to nssting? @Richard Shin

            – Jason
            Mar 17 '17 at 12:08







          • 1





            @Jason The nonce property of BTPaymentMethodNonce is an NSString.

            – Richard Shin
            Mar 18 '17 at 20:02











          • @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

            – Abhishek Thapliyal
            Sep 20 '17 at 11:22



















          2














          You can get Payment nonce in drop in method by using
          let nonce = result.paymentMethod!.nonce



          Example :-



          func showDropIn(clientTokenOrTokenizationKey: String) 
          let request = BTDropInRequest()
          let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
          (controller, result, error) in
          if (error != nil)
          print("ERROR")
          else if (result?.isCancelled == true)
          print("CANCELLED")
          else if let result = result

          let nonce = result.paymentMethod!.nonce

          print( nonce)


          controller.dismiss(animated: true, completion: nil)

          self.present(dropIn!, animated: true, completion: nil)






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35199248%2fhow-to-get-nonce-from-braintree-ios-sdk%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.



            Getting the nonce is documented in the Presenting Drop-in UI section of the page you linked. Once you have the Drop-in active, you need to implement a delegate so the Drop-in can find where to send the nonce it produces. Without a delegate like the one specified you won't receive the nonce from the Drop-in:




            Then implement BTDropInViewControllerDelegate to obtain the payment method nonce on success, and dismiss the Drop In UI in either case:




            - (void)dropInViewController:(BTDropInViewController *)viewController 
            didSucceedWithTokenization:(BTPaymentMethodNonce *)paymentMethodNonce
            // Send payment method nonce to your server for processing
            [self postNonceToServer:paymentMethodNonce.nonce];
            [self dismissViewControllerAnimated:YES completion:nil];


            - (void)dropInViewControllerDidCancel:(__unused BTDropInViewController *)viewController
            [self dismissViewControllerAnimated:YES completion:nil];




            If you look at the first function you can see that a variable paymentMethodNonce (type: BTPaymentMethodNonce) is passed into your app. This sample code expects that you have another function (postNonceToServer) to actually handle the nonce once you get it.






            share|improve this answer


















            • 2





              And for version 4? Where there is no delegate.

              – Pedro.Alonso
              Dec 8 '16 at 16:28






            • 3





              @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

              – Richard Shin
              Dec 11 '16 at 1:26











            • how to convert payment method nonce to nssting? @Richard Shin

              – Jason
              Mar 17 '17 at 12:08







            • 1





              @Jason The nonce property of BTPaymentMethodNonce is an NSString.

              – Richard Shin
              Mar 18 '17 at 20:02











            • @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

              – Abhishek Thapliyal
              Sep 20 '17 at 11:22
















            1














            Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.



            Getting the nonce is documented in the Presenting Drop-in UI section of the page you linked. Once you have the Drop-in active, you need to implement a delegate so the Drop-in can find where to send the nonce it produces. Without a delegate like the one specified you won't receive the nonce from the Drop-in:




            Then implement BTDropInViewControllerDelegate to obtain the payment method nonce on success, and dismiss the Drop In UI in either case:




            - (void)dropInViewController:(BTDropInViewController *)viewController 
            didSucceedWithTokenization:(BTPaymentMethodNonce *)paymentMethodNonce
            // Send payment method nonce to your server for processing
            [self postNonceToServer:paymentMethodNonce.nonce];
            [self dismissViewControllerAnimated:YES completion:nil];


            - (void)dropInViewControllerDidCancel:(__unused BTDropInViewController *)viewController
            [self dismissViewControllerAnimated:YES completion:nil];




            If you look at the first function you can see that a variable paymentMethodNonce (type: BTPaymentMethodNonce) is passed into your app. This sample code expects that you have another function (postNonceToServer) to actually handle the nonce once you get it.






            share|improve this answer


















            • 2





              And for version 4? Where there is no delegate.

              – Pedro.Alonso
              Dec 8 '16 at 16:28






            • 3





              @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

              – Richard Shin
              Dec 11 '16 at 1:26











            • how to convert payment method nonce to nssting? @Richard Shin

              – Jason
              Mar 17 '17 at 12:08







            • 1





              @Jason The nonce property of BTPaymentMethodNonce is an NSString.

              – Richard Shin
              Mar 18 '17 at 20:02











            • @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

              – Abhishek Thapliyal
              Sep 20 '17 at 11:22














            1












            1








            1







            Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.



            Getting the nonce is documented in the Presenting Drop-in UI section of the page you linked. Once you have the Drop-in active, you need to implement a delegate so the Drop-in can find where to send the nonce it produces. Without a delegate like the one specified you won't receive the nonce from the Drop-in:




            Then implement BTDropInViewControllerDelegate to obtain the payment method nonce on success, and dismiss the Drop In UI in either case:




            - (void)dropInViewController:(BTDropInViewController *)viewController 
            didSucceedWithTokenization:(BTPaymentMethodNonce *)paymentMethodNonce
            // Send payment method nonce to your server for processing
            [self postNonceToServer:paymentMethodNonce.nonce];
            [self dismissViewControllerAnimated:YES completion:nil];


            - (void)dropInViewControllerDidCancel:(__unused BTDropInViewController *)viewController
            [self dismissViewControllerAnimated:YES completion:nil];




            If you look at the first function you can see that a variable paymentMethodNonce (type: BTPaymentMethodNonce) is passed into your app. This sample code expects that you have another function (postNonceToServer) to actually handle the nonce once you get it.






            share|improve this answer













            Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.



            Getting the nonce is documented in the Presenting Drop-in UI section of the page you linked. Once you have the Drop-in active, you need to implement a delegate so the Drop-in can find where to send the nonce it produces. Without a delegate like the one specified you won't receive the nonce from the Drop-in:




            Then implement BTDropInViewControllerDelegate to obtain the payment method nonce on success, and dismiss the Drop In UI in either case:




            - (void)dropInViewController:(BTDropInViewController *)viewController 
            didSucceedWithTokenization:(BTPaymentMethodNonce *)paymentMethodNonce
            // Send payment method nonce to your server for processing
            [self postNonceToServer:paymentMethodNonce.nonce];
            [self dismissViewControllerAnimated:YES completion:nil];


            - (void)dropInViewControllerDidCancel:(__unused BTDropInViewController *)viewController
            [self dismissViewControllerAnimated:YES completion:nil];




            If you look at the first function you can see that a variable paymentMethodNonce (type: BTPaymentMethodNonce) is passed into your app. This sample code expects that you have another function (postNonceToServer) to actually handle the nonce once you get it.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 4 '16 at 19:54









            Raymond BergRaymond Berg

            721415




            721415







            • 2





              And for version 4? Where there is no delegate.

              – Pedro.Alonso
              Dec 8 '16 at 16:28






            • 3





              @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

              – Richard Shin
              Dec 11 '16 at 1:26











            • how to convert payment method nonce to nssting? @Richard Shin

              – Jason
              Mar 17 '17 at 12:08







            • 1





              @Jason The nonce property of BTPaymentMethodNonce is an NSString.

              – Richard Shin
              Mar 18 '17 at 20:02











            • @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

              – Abhishek Thapliyal
              Sep 20 '17 at 11:22













            • 2





              And for version 4? Where there is no delegate.

              – Pedro.Alonso
              Dec 8 '16 at 16:28






            • 3





              @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

              – Richard Shin
              Dec 11 '16 at 1:26











            • how to convert payment method nonce to nssting? @Richard Shin

              – Jason
              Mar 17 '17 at 12:08







            • 1





              @Jason The nonce property of BTPaymentMethodNonce is an NSString.

              – Richard Shin
              Mar 18 '17 at 20:02











            • @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

              – Abhishek Thapliyal
              Sep 20 '17 at 11:22








            2




            2





            And for version 4? Where there is no delegate.

            – Pedro.Alonso
            Dec 8 '16 at 16:28





            And for version 4? Where there is no delegate.

            – Pedro.Alonso
            Dec 8 '16 at 16:28




            3




            3





            @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

            – Richard Shin
            Dec 11 '16 at 1:26





            @Pedro.Alonso The new Braintree iOS Drop-in takes a completion callback that returns a BTDropInResult object, which contains the payment method nonce. (Disclosure: I work at Braintree)

            – Richard Shin
            Dec 11 '16 at 1:26













            how to convert payment method nonce to nssting? @Richard Shin

            – Jason
            Mar 17 '17 at 12:08






            how to convert payment method nonce to nssting? @Richard Shin

            – Jason
            Mar 17 '17 at 12:08





            1




            1





            @Jason The nonce property of BTPaymentMethodNonce is an NSString.

            – Richard Shin
            Mar 18 '17 at 20:02





            @Jason The nonce property of BTPaymentMethodNonce is an NSString.

            – Richard Shin
            Mar 18 '17 at 20:02













            @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

            – Abhishek Thapliyal
            Sep 20 '17 at 11:22






            @Raymond Berg : BTDropInViewControllerDelegate getting unresolved identifier in latest SDK

            – Abhishek Thapliyal
            Sep 20 '17 at 11:22














            2














            You can get Payment nonce in drop in method by using
            let nonce = result.paymentMethod!.nonce



            Example :-



            func showDropIn(clientTokenOrTokenizationKey: String) 
            let request = BTDropInRequest()
            let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
            (controller, result, error) in
            if (error != nil)
            print("ERROR")
            else if (result?.isCancelled == true)
            print("CANCELLED")
            else if let result = result

            let nonce = result.paymentMethod!.nonce

            print( nonce)


            controller.dismiss(animated: true, completion: nil)

            self.present(dropIn!, animated: true, completion: nil)






            share|improve this answer



























              2














              You can get Payment nonce in drop in method by using
              let nonce = result.paymentMethod!.nonce



              Example :-



              func showDropIn(clientTokenOrTokenizationKey: String) 
              let request = BTDropInRequest()
              let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
              (controller, result, error) in
              if (error != nil)
              print("ERROR")
              else if (result?.isCancelled == true)
              print("CANCELLED")
              else if let result = result

              let nonce = result.paymentMethod!.nonce

              print( nonce)


              controller.dismiss(animated: true, completion: nil)

              self.present(dropIn!, animated: true, completion: nil)






              share|improve this answer

























                2












                2








                2







                You can get Payment nonce in drop in method by using
                let nonce = result.paymentMethod!.nonce



                Example :-



                func showDropIn(clientTokenOrTokenizationKey: String) 
                let request = BTDropInRequest()
                let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
                (controller, result, error) in
                if (error != nil)
                print("ERROR")
                else if (result?.isCancelled == true)
                print("CANCELLED")
                else if let result = result

                let nonce = result.paymentMethod!.nonce

                print( nonce)


                controller.dismiss(animated: true, completion: nil)

                self.present(dropIn!, animated: true, completion: nil)






                share|improve this answer













                You can get Payment nonce in drop in method by using
                let nonce = result.paymentMethod!.nonce



                Example :-



                func showDropIn(clientTokenOrTokenizationKey: String) 
                let request = BTDropInRequest()
                let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
                (controller, result, error) in
                if (error != nil)
                print("ERROR")
                else if (result?.isCancelled == true)
                print("CANCELLED")
                else if let result = result

                let nonce = result.paymentMethod!.nonce

                print( nonce)


                controller.dismiss(animated: true, completion: nil)

                self.present(dropIn!, animated: true, completion: nil)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 14 '18 at 6:39









                Prakash salawriaPrakash salawria

                313




                313



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35199248%2fhow-to-get-nonce-from-braintree-ios-sdk%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kleinkühnau

                    Makov (Slowakei)

                    Deutsches Schauspielhaus