Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error: undefined is not an object (CheckoutMercadoPagoModule.startCheckout) #15

Open
githubmss opened this issue Jun 12, 2018 · 3 comments

Comments

@githubmss
Copy link

I am getting above mentioned error after installing the plugin to my project, this is how my app.js file looks like :

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View,
  TouchableOpacity
} from 'react-native';
import { startCheckout } from 'react-native-checkout-mercadopago';

// const Mercadopago = NativeModules.CheckoutMercadoPagoModule;

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity style={styles.button} onPress={() => this.callMercado()}>
          <Text>Press</Text>
        </TouchableOpacity>
      </View>
    );
  }
  callMercado() {
    let payment = startCheckout('TEST-ad365c37-8012-4014-84f5-6c895b3f8e0a', '176234066-fc6d5d5e-2671-4073-ab49-362a98b720b5').then(success => { console.log("success") }, error => { console.log("error")})
    //  Mercadopago.startCheckout('TEST-ad365c37-8012-4014-84f5-6c895b3f8e0a', '176234066-fc6d5d5e-2671-4073-ab49-362a98b720b5').then(success => { console.log("success") }, error => { console.log("error")});
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  button: {
    borderWidth: 1,
    borderColor: 'rgba(0,0,0,0.2)',
    alignItems: 'center',
    justifyContent: 'center',
    width: 100,
    height: 100,
    backgroundColor: '#fff',
    borderRadius: 100,
  },
});

Please let know how can I resolve this error. I need to integrate this into my project it's my client requirement
Regards

@scarmuega
Copy link
Collaborator

@githubmss can you share the stack trace of the error?

@sawpti
Copy link

sawpti commented Oct 22, 2018

Tengo el mismo problema

@Seba34
Copy link

Seba34 commented Dec 18, 2018

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants