Adyen - IONIC 4 - iOS - PullRequest
       43

Adyen - IONIC 4 - iOS

0 голосов
/ 25 сентября 2019

У меня проблемы с загрузкой adyen падение в в iOS, я использую ionic Framework в версии 4, я не знаю, как решить эту проблему, я пытался импортировать в архив на "angular.json«SDK Adyen, но это не решило.Мой код прекрасно работает на Android, но не iOS.

Импорт в index.html SDK adyen

<script src="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.2.0/adyen.js"></script>

<link rel="stylesheet" href="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/3.2.0/adyen.css"/>

Мой код Машинопись:

  //top of my class 
  declare var AdyenCheckout;



  ngOnInit() { 
    var styleObject = {
      base: {
        color: "black",
        fontSize: "16px",
        fontSmoothing: "antialiased",
        fontFamily: "Helvetica",
        background: "white"
      },
      error: {
        color: "red"
      },
      placeholder: {
        color: "red"
      },
      validated: {
        color: "red"
      }
    };

    function handleOnChange(state, component) {
      state.isValid; // True or false. Specifies if all the information that the shopper provided is valid.
      state.data; // Provides the data that you need to pass in the `/payments` call.
      component; // Provides the active component instance that called this event.
    }

    function handleOnAdditionalDetails(state, component) {
      state.data; // Provides the data that you need to pass in the `/payments/details` call.
      component; // Provides the active component instance that called this event.
    }
    function paymentMethodsResponse() {}

    const configuration = {
      locale: "pt_BR",
      environment: "test",
      showPayButton: false,
      originKey:
        "pub.v2.8015687578673775.aHR0cDovL2xvY2FsaG9zdA.TwcAlxzkaTzBqMiKYqlyAgUcw5JvkkZFf3NFUJYpQME",
      paymentMethodsResponse: {
        groups: [
          { name: "Credit Card", types: ["mc", "visa", "amex", "diners"] }
        ],
        paymentMethods: [
          {
            brands: ["mc", "visa", "amex", "diners"],
            details: [
              { key: "encryptedCardNumber", type: "cardToken" },
              { key: "encryptedSecurityCode", type: "cardToken" },
              { key: "encryptedExpiryMonth", type: "cardToken" },
              { key: "encryptedExpiryYear", type: "cardToken" },
              {
                key: "holderName",
                optional: true,
                type: "text",
                holderName: "M. Ricardo"
              }
            ],
            name: "Credit Card",
            type: "scheme"
          }
        ]
      }
    };

    window.setTimeout(() => {
      const checkout = new AdyenCheckout(configuration);

      const dropin = checkout
        .create("dropin", {
          paymentMethodsConfiguration: {
            card: {
              hasHolderName: true,
              holderNameRequired: true,
              enableStoreDetails: true
            }
          },
          onSubmit: (state, dropin) => {
            console.log('finish order');
          }
        })
        .mount("#dropin");

      this.dropin = dropin;
    }, 100);
  } 

Ошибка:

const checkout = new AdyenCheckout(configuration);

console.log(checkout); =====> this return error "JSON.stringify()ing argument: TypeError: JSON.stringify cannot serialize cyclic structures."

...