Braintree-web: Create official Angular example implementation based on Angular CLI

Created on 4 Dec 2017  路  6Comments  路  Source: braintree/braintree-web

The implementation of braintree-web to an Angular app is not easy.

There are several issues, e.g.:

  • how to import the library
  • how to integrate with webpack
  • how to avoid using jquery with hosted fields (like it is used in the material design example) etc.

It would be extremely helpful if there was an official example application.
The ever-growing Angular community would be grateful!

Most helpful comment

A year later, I really think braintree team should reevaluate Typescript solution.

All 6 comments

We have plans to provide full examples for various frontend frameworks. I'll update here when it's ready.

One additional request - it would be very helpful if you could provide typescript interfaces for all response methods. Even better, if you could provide a swagger document (version 2) since there are several code generators, e.g. https://github.com/jnwltr/swagger-angular-generator.

As Braintree does not use typescript, we don't have a good reason to devote developer time to creating the definitions. There's a 3rd party one someone started at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/braintree-web, which you are free to PR and update.

We're not going to have an official example at this time, but you can take a look at the very simple example I put together here https://github.com/crookedneighbor/Angular-4-Routing-Example

It's forked from https://github.com/rutvikrpatel/Angular-4-Routing-Example

Here's the specific commit where I added braintree-web: https://github.com/crookedneighbor/Angular-4-Routing-Example/commit/ab52d6d7aa46d7298ab99044012a21b7acc0a1d8

Wish you'd reconsider making this official. :-)

We don't have a good reason to devote developer time to creating the definitions.

Yes you do !

Never underestimate the cost of all the developer support requests that would be avoided if people had proper definition files that failed compilation when they made a stupid mistake. I can only imagine how much time you must waste debugging people's clumsy code!

I'm using the existing definitions now, but they're missing a lot of recent changes like vault manager, authorization field for hosted fields creation and the newer PayPal API.

Typescript is only going to become more and more popular.

A year later, I really think braintree team should reevaluate Typescript solution.

Was this page helpful?
0 / 5 - 0 ratings