Aliasgher Nooruddin
Aliasgher Nooruddin

Reputation: 563

Moonpay SDK form not initializing as expected

I am trying to integrate MoonPay in my application. I am unable to initialize the Moonpay form on my Vue application. I think I am doing something wrong here.

createCardDetailsForm(formCallback: (formState: any) => any): any; This is according to their documentatation

      console.log("asd");
      console.log(formCallback);
      formCallback.createField("#cc-number", {
        name: "number",
        value: "4000 0231 0466 2535",
        placeholder: "4242 4242 4242 4242",
        type: "card-number",
        validations: ["validCardNumber"]
      });
      this.form.createField("#cc-expiration", {
        name: "expiryDate",
        value: "12/2020",
        placeholder: "MM / YY",
        type: "card-expiration-date",
        validations: ["validCardExpirationDate"]
      });
      this.form.createField("#cc-cvc", {
        name: "cvc",
        value: "123",
        placeholder: "123",
        type: "card-security-code",
        validations: ["validCardSecurityCode"]
      });
      this.createMoonPayForm();
    });

I am initializing this way in Moonpay. I am using console to see if anything popups but nothing prints even asd is not

Upvotes: 1

Views: 274

Answers (1)

dasdasdasda
dasdasdasda

Reputation: 26

you should call the form on mounted function. Mounted will allow form to render after templete is initialized

Upvotes: 1

Related Questions