Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

hash() retorna null apenas no android  #21

Description

@uniusdev

Problema MoipCreditCard.
Ao implementar o MoipCreditCard, segui a documentação e ocorreu tudo bem na versão do app para iOS, porém no android ela só me retorna null.
Teoricamente deveria funcionar nas duas plataformas, se tivesse alguma coisa errada no código, estaria dando erro no iOS também, porém no iOS funciona perfeitamente.
Ambiente
react-native versão 0.57.1
yarn versão 1.7.0
Emuladores:
Genymotion Version 3.0.0 | Revision 2018 | © Copyright Genymobile
Simulator Version 10.1 (SimulatorApp-877 CoreSimulator-581.2)

Testes nos Emuladores :
iOS iPhone XR
Google Nexus 7 Andorid API 25

Testes nos Smartphones :
Motorola E4
iPhone 5

Bibliotecas
import { RSA } from 'react-native-rsa-native';
import { MoipCreditCard } from 'moip-sdk-js';

Funções

`
_moipC() {

const pubKey = -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoBttaXwRoI1Fbcond5mS 7QOb7X2lykY5hvvDeLJelvFhpeLnS4YDwkrnziM3W00UNH1yiSDU+3JhfHu5G387 O6uN9rIHXvL+TRzkVfa5iIjG+ap2N0/toPzy5ekpgxBicjtyPHEgoU6dRzdszEF4 ItimGk5ACx/lMOvctncS5j3uWBaTPwyn0hshmtDwClf6dEZgQvm/dNaIkxHKV+9j Mn3ZfK/liT8A3xwaVvRzzuxf09xJTXrAd9v5VQbeWGxwFcW05oJulSFjmJA9Hcmb DYHJT+sG2mlZDEruCGAzCVubJwGY1aRlcs9AQc1jIm/l8JwH7le2kpk3QoX+gz0w WwIDAQAB -----END PUBLIC KEY-----;

return MoipCreditCard
  .setEncrypter(RSA, 'react-native')
  .setPubKey(pubKey)
  .setCreditCard({
    number: '5555666677778884',
    cvc: '123',
    expirationMonth: '12',
    expirationYear: '22'
  })
  .hash()
  .then((hash) => {
    alert('teste 1' + JSON.stringify(hash));
    return Promise.resolve(hash);
  })
  .catch((err) => {
    alert('teste 2' + JSON.stringify(err));
    return Promise.reject(err);
  });

}

`
Foto da tela
Captura de Tela 2019-03-15 às 10 52 56

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions