angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.13k stars 1.24k forks source link

implementing the braintree-angular payment gateway #2757

Closed JDevjs closed 5 years ago

JDevjs commented 5 years ago

i tried so many times that i became bald using braintree-angular and braintree-web with angularjs fullstack but when im in the chekout page i get a token error and no payment options are not showing...

product-checkout.html //ngcart working fine btw

<div class="container">
    <div class="row">
        <h1>Cart</h1>
        <ngcart-cart template-url="components/ngcart/cart.html"></ngcart-cart>
    </div>
    <div class="row">
        <h1>Choose a payment method</h1>
        <p class="help-block">{{ errors }}</p>
        <br>
        <div class="col-md-6">
            <form>
                <braintree-dropin options="paymentOptions">Loading...</braintree-dropin>

                    <input type="submit" value="Purchase" />
            </form>
        </div>
    </div>
    </div>

(i think braintree-dropin is not working anymore because its deprecated)

ERORRS i get everytime im in the checkout page

angular.js:14961 TypeError: $braintree.getClientToken(...).success is not a function
    at Object.$braintree.setupDropin (braintree-factory.js:28)
    at controller (braintree-angular.js:24)
    at Object.invoke (angular.js:5117)
    at $controllerInit (angular.js:11139)
    at nodeLinkFn (angular.js:10002)
    at compositeLinkFn (angular.js:9311)
    at nodeLinkFn (angular.js:10065)
    at compositeLinkFn (angular.js:9311)
    at compositeLinkFn (angular.js:9314)
    at compositeLinkFn (angular.js:9314)
    at compositeLinkFn (angular.js:9314)
    at nodeLinkFn (angular.js:10065)
    at compositeLinkFn (angular.js:9311)
    at publicLinkFn (angular.js:9176)
    at Object.<anonymous> (angular-ui-router.js:4138)
    at angular.js:1393
    at invokeLinkFn (angular.js:10682)
    at nodeLinkFn (angular.js:10071)
    at compositeLinkFn (angular.js:9311)
    at publicLinkFn (angular.js:9176)
    at lazyCompilation (angular.js:9567)
    at updateView (angular-ui-router.js:4056)
    at angular-ui-router.js:4005
    at Scope.$broadcast (angular.js:19123)
    at angular-ui-router.js:3369
    at processQueue (angular.js:17330)
    at angular.js:17378
    at Scope.$digest (angular.js:18515)
    at Scope.$apply (angular.js:18903)
    at angular.js:20829
    at completeOutstandingRequest (angular.js:6439)
    at angular.js:6718 "<div ui-view="" class="ng-scope">"
(anonymous) @ angular.js:14961
api/braintree/client_token:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
angular.js:14961 Possibly unhandled rejection: {"data":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>TypeError: _braintree2.default.findById is not a function<br> &nbsp; &nbsp;at show (D:/Projects/meanstore/server/api/braintree/braintree.controller.js:70:20)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\layer.js:95:5)<br> &nbsp; &nbsp;at next (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\route.js:137:13)<br> &nbsp; &nbsp;at Route.dispatch (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\route.js:112:3)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\layer.js:95:5)<br> &nbsp; &nbsp;at D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:281:22<br> &nbsp; &nbsp;at param (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:354:14)<br> &nbsp; &nbsp;at param (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:365:14)<br> &nbsp; &nbsp;at Function.process_params (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:410:3)<br> &nbsp; &nbsp;at next (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:275:10)<br> &nbsp; &nbsp;at Function.handle (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:174:3)<br> &nbsp; &nbsp;at router (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:47:12)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\layer.js:95:5)<br> &nbsp; &nbsp;at trim_prefix (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:317:13)<br> &nbsp; &nbsp;at D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:284:7<br> &nbsp; &nbsp;at Function.process_params (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:335:12)<br> &nbsp; &nbsp;at next (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:275:10)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\layer.js:91:12)<br> &nbsp; &nbsp;at trim_prefix (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:317:13)<br> &nbsp; &nbsp;at D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:284:7<br> &nbsp; &nbsp;at Function.process_params (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:335:12)<br> &nbsp; &nbsp;at next (D:\\Projects\\meanstore\\node_modules\\express\\lib\\router\\index.js:275:10)</pre>\n</body>\n</html>\n","status":500,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/braintree/client_token","headers":{"Accept":"application/json, text/plain, */*","X-XSRF-TOKEN":"t2sFfL5kWBa2Jo4GXP9OqmR2Ox9WJVtbxIH2w="}},"statusText":"Internal Server Error","xhrStatus":"complete"}

i found out later from braintree-angular repository that its not maintained anymore... so please if anyone can suggest me an alternative i can use fast because i wasted too much time thanks.

Awk34 commented 5 years ago

GitHub issues here are for bug reports and feature requests. Help questions like this are better served on a question/answer site like Stack Overflow, or our Gitter.im channel.