Reply
Contributor
Posts: 13
Registered: ‎07-11-2018
Accepted Solution

Accept js in Angular 2

Hello,

 

Im new on the Usage of the Accept js library.

 

Im trying to integrate with my Angular 2 project. 

 

Im trying to call the dispatch data funtion:

 

 

Accept.dispatchData(secureData, this.responseHandler);

 responseHandler(response: any) {
        if (response.messages.resultCode === "Error") {
            var i = 0;
            while (i < response.messages.message.length) {
                //paymentError(response.messages.message[i].text);
                console.log(response.messages.message[i].text);
                i = i + 1;
            }
        } else {
            //paymentNewUser(response.opaqueData, infoData);
        }
    }

But I get this error:

 

 

ERROR TypeError: a[c].match is not a function
at h (AcceptCore.js:1)
at b (AcceptCore.js:1)
at Object.function.a.dispatchData.a.dispatchData (AcceptCore.js:1)
at t.sendPaymentDataToAnet (payment-modal.component.ts:92)
at Object.eval [as handleEvent] (t.html:92)
at _ (core.js:13254)
at li (core.js:14739)
at Object.Zr [as handleEvent] (core.js:14326)
at he (core.js:9703)
at core.js:10317

 

Can any one help me with this? Can be the responseHandler function that is causing that issue?

 

 

Thanks!

 

 

 

 


Accepted Solutions
Highlighted
Solution
Accepted by topic author mtarantooms01
‎07-19-2018 09:07 AM
Contributor
Posts: 13
Registered: ‎07-11-2018

Re: Accept js in Angular 2

Now is working I figure out. The problem was that I was sending the cardData with month and year as number instead of string.

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author mtarantooms01
‎07-19-2018 09:07 AM
Contributor
Posts: 13
Registered: ‎07-11-2018

Re: Accept js in Angular 2

Now is working I figure out. The problem was that I was sending the cardData with month and year as number instead of string.

Member
Posts: 4
Registered: ‎07-13-2018

Re: Accept js in Angular 2

How you inject accept.js file in your angular 2. I am facing problem to inject accept.js

 

Member
Posts: 4
Registered: ‎07-13-2018

Re: Accept js in Angular 2

How you inject accept.js library in your angular 2. i am facing problem to inject this liberary

Member
Posts: 4
Registered: ‎07-13-2018

Re: Accept js in Angular 2

How you inject accept.js library in your angular 2. I am facing problem to inject accept.js library in my angular 5 .

Member
Posts: 4
Registered: ‎07-13-2018

Re: Accept js in Angular 2

    How you inject accept.js library in your angular 2. I am facing problem to inject accept.js library in my angular 5 .

Contributor
Posts: 13
Registered: ‎07-11-2018

Re: Accept js in Angular 2

Hi Just imported on the index. 

 

 <script src="https://jstest.authorize.net/v1/Accept.js" charset="utf-8"></script>

 

And the declare the global vaiable on the component. 

 


declare var Accept: any;

 

@Component({
selector: 'payment',
 ...
})
export class PaymentComponent implements OnInit {

 

....