Code Monkey home page Code Monkey logo

Comments (9)

srikanthonl avatar srikanthonl commented on May 29, 2024

Was your server side createPurchaseURL method invoked when buy is clicked? I see same method, -snip- is being called for token generation and purchasing. If the server side method is invoked when buy is clicked, did you try console logging the response in onPaymentStatus($event)?

from ngx-braintree.

lukechatton avatar lukechatton commented on May 29, 2024

They are different endpoints.

Here is the server side createPurchase endpoint I was testing with. The client never called this though.

app.post('/credits/braintree/createpurchase/150', this.validate.user, (req, res) => {
            let nonceFromClient = req.body.payment_method_nonce;
            let credits = 150;
            this.createBraintreeSale("1.00", nonceFromClient, (err, result) => {
                if (result) {
                    res.json({})
                } else {
                    res.status(500).json({});
                }
            })
        })

onPaymentStatus() never gets called. This is what I have in my shop.component.ts

onPaymentStatus(response) {
        console.log(response);
}

from ngx-braintree.

lukechatton avatar lukechatton commented on May 29, 2024

Could angular be blocking dropin.min.js from being downloaded? Do I have to configure something to allow that?

from ngx-braintree.

srikanthonl avatar srikanthonl commented on May 29, 2024

I don’t think angular is blocking because if that’s the case the drop in UI should not be rendered at all but you have it rendered. I’ll look into this and will try to reproduce in what cases the createpurchaseURL is not called AND doesn’t give any error. Please provide more information, if any. Like your component.ts code if possible.

from ngx-braintree.

srikanthonl avatar srikanthonl commented on May 29, 2024

Hi Luke,
As you said that the buy button was displayed, did you get the dropin UI rendered as well? The buy button gets displayed as soon as the clientToken is received from your server and the dropin ui gets rendered within moments after the buy button gets displayed, although sometimes this will take few seconds (depending upon how quickly braintree server responds). If you have the buy button displayed but dropin ui is not rendered, then one of the reason could be a network issue.

Or is it that you have the dropin UI rendered but nothing happens when you enter the card details and click buy?

Can you pls confirm which one of the above is the behavior?

from ngx-braintree.

lukechatton avatar lukechatton commented on May 29, 2024

The drop in UI is never displayed. Only the buy button.

from ngx-braintree.

srikanthonl avatar srikanthonl commented on May 29, 2024

OK. It appears that there is a network/incorrect braintree configuration issue although not sure at this moment if this is an ngx-braintree error or an error in your network. However, a new version of ngx-braintree is published just now (2.2.1) which now throws any error encountered while creating the dropin UI which helps in identifying the root cause. Please update ngx-braintree to the latest version which will now throw the error in console. As I'm unable to reproduce this issue at my end, it will be helpful if you let me know your findings after you have updated the version and tested it.

from ngx-braintree.

lukechatton avatar lukechatton commented on May 29, 2024

Turned out to be a bug with Angular not parsing a text response from Node.js correctly. Submitted a fix over at #29

from ngx-braintree.

srikanthonl avatar srikanthonl commented on May 29, 2024

@lukechatton thanks for the fix. Also updated the readme and npm package reflecting this change.

from ngx-braintree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.