javascript – How do you store state.Data and state.isValid in ADYEN Card Component?

So I’ve read the documentation and have followed everything so far. However, in the handleOnChange function, I cannot post the data because it gives the error:

Here’s how I’m currently trying to post the data, I’m open for any suggestions.

function handleOnChange(state, component) {
  if (state.isValid === true) { + '/', { amount: this.amount, content:}).subscribe((res) => {

I’ve tried storing them as variables but it results as undefined. What am I missing here?