datatrans / secure-fields-sample

Visually pleasing credit card forms with Datatrans Payment Gateway and PCI Proxy.
https://datatrans.github.io/secure-fields-sample/
MIT License
7 stars 7 forks source link

Added Angular 14 Example #24

Closed joebeeplanet closed 2 years ago

pstadler commented 2 years ago

Thanks for contributing joebee!

@n3ssi3 and I reviewed it. This is our feedback:

joebeeplanet commented 2 years ago

@pstadler thanks I have updated it now with those comments.

The only one I didnt implement was removing the .vscode folder, in Angular it best to keep this folder in source control because it holds all the configuration for VS Code to run and debug the code.

FYI - Once we complete the implementation on our usecase I will update this example again.

pstadler commented 2 years ago

Thanks @joebeeplanet

I checked a popular angular project[1] in order to come back with "look, no .vscode folder here", because this cannot be best practice. Little did I know...

[1] https://github.com/angular/components

Could you maybe update .gitignore to not exclude .vscode? (similar to angular/components)

joebeeplanet commented 2 years ago

@pstadler I have created this angular project using the 'ng new' command from Angular CLI, this command creates all necessary files including the .vscode folder and the .gitignore, I have not had to make any changes to the files that are generated by the Angular CLI New Command https://angular.io/cli/new, but if you want I can update them?

pstadler commented 2 years ago

but if you want I can update them?

It's fine I guess, just leave it as is.

The widget looks great! Tests print some pretty nasty errors to the terminal and web console:

Screenshot 2022-07-22 at 09 35 29

Whenever the component unmounts you should call secureFields.destroy() - maybe this is related to some of the errors I'm encountering.

dmengelt commented 2 years ago

@joebeeplanet I noticed one small issue when trying to use "backspace" on the expiry field:

2022-07-22 10 01 15

dmengelt commented 2 years ago

@joebeeplanet great. the expiry handling works now after your change. 👍

joebeeplanet commented 2 years ago

@dmengelt thanks for the feedback.

@pstadler I am still trying to work out how to remove those errors on the log console during the tests. Like you I'm assuming its something to do with the call to secureFields.destroy() but when I add this the tests are failing. Will continue looking into it today.

joebeeplanet commented 2 years ago

Hi @pstadler & @dmengelt I have resolved those test errors now. I will add some more to it once we have completed our implementation for our usecase but for now I think this could help any others that are trying to use this in Angular.

pstadler commented 2 years ago

Looks great! Thank you @joebeeplanet 🍻