Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-sdk-mercadopago

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-sdk-mercadopago

A hook to facilitate the use of the mercadopago sdk js

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
222
decreased by-36.39%
Maintainers
1
Weekly downloads
 
Created
Source

SDK Mercadopago js for React

A hook to facilitate the use of the mercadopago sdk js

About

I created this package because I couldn't find a way to integrate the mercado pago sdk with React. However, as there is no detailed documentation for the sdk, the methods are typed as 'any'. Over time, I update the types. Please help me to type the project.

Install

npm install --save react-sdk-mercadopago

Usage

// SDK V1
import React from 'react';
import { useMercadopago } from 'react-sdk-mercadopago';

export default function Checkout() {
    const mercadopago = useMercadopago.v1('YOUR_PUBLIC_KEY');

    return (
        // jsx
    )
}
// SDK V2
import React, { useEffect } from 'react';
import { useMercadopago } from 'react-sdk-mercadopago';

export default function Checkout() {
    const mercadopago = useMercadopago.v2('YOUR_PUBLIC_KEY', {
        locale: 'en-US'
    });

    useEffect(() => {
        if (mercadopago) {
            mercadopago.checkout({
                preference: {
                    id: 'YOUR_PREFERENCE_ID'
                },
                render: {
                    container: '.cho-container',
                    label: 'Pay',
                }
            })
        }
    }, [mercadopago])

    return (
        <div>
            <div class="cho-container" />
        </div>
    )
}

Keywords

FAQs

Package last updated on 05 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc