npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ranty/ranty-sdk

v2.13.0

Published

Ranty sdk

Downloads

1,076

Readme

Naranja

@ranty/ranty-sdk

Librería frontend basada en Web Components para el Payfac SDK. Su principal objetivo es proporcionar diversas soluciones enfocadas en el procesamiento de pagos:

Instalación

NPM

@ranty/ranty-sdk

npm install @ranty/ranty-sdk

Importación

import '@ranty/ranty-sdk'

CDN

@ranty/ranty-sdk

<script type="module">
  import rantyrantySdk from 'https://cdn.jsdelivr.net/npm/@ranty/ranty-sdk@latest/+esm'
</script>

Utilización

Atributos obligatorios

  • publicKey: Llave pública proporcionada por Naranja X
  • paymentRequestId: ID de la intención de pago (uuid-v4)

Atributos opcionales

  • env:

    • production (no requerido)
    • staging (homologación)
  • settings: permite mostrar u ocultar componentes. Si no se pasa el atributo settings en el tag de payfac, se muestra todo por default.

    • show_title: muestra u oculta el título.
    • show_subtitle: muestra u oculta el subtítulo.
    • show_order_detail: muestra u oculta el detalle de la compra.
    • enable_auto_redirect: activa ó desactiva la redirección automática a la tienda.
customerProperties: {
  show_title: false,
  show_subtitle: false,
  show_order_detail: false,
  enable_auto_redirect: false
}

Recomendación de uso

Para tener una mejor experiencia se recomienda embeber el tag de <payfac-sdk></payfac-sdk> en un tag de contencion div, iframe..., con los siguientes estilos height: 94vh; background: #F4F4F4;

Pagos Tradicionales:

Producción

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    settings="settings"
  ></payfac-sdk>
</div>

Homologación

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    settings="settings"
    env="staging"
  ></payfac-sdk>
</div>

Pagos Tokenizados:

Click To Pay

Atributos:

  • dpaid: identificador del merchant (uuid-v4)
  • dpaname: nombre del merchant
  • mode: click_to_pay
  • env:
    • production (no requerido)
    • staging (homologación)

Producción

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    dpaId="uuid-v4"
    dpaName="string"
    mode="click_to_pay"
  ></payfac-sdk>
</div>

Homologación

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    mode="click_to_pay"
    env="staging"
  ></payfac-sdk>
</div>

Secure Card On File

Atributos:

  • mode: card_on_file
  • env:
    • production (no requerido)
    • staging (homologación)

Producción

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    mode="card_on_file"
  ></payfac-sdk>
</div>

Homologación

<div style="height: 94vh;background: #F4F4F4;">
  <payfac-sdk
    paymentRequestId="uuid-v4"
    publicKey="publicKey-merchant"
    env="staging"
  ></payfac-sdk>
</div>

Manejo de eventos

Se dispara un evento cuando:

  • Falla al generar el token
  • Falla get payment request
  • Falla installment plan
  • Falla directPayment
  • Pago rechazado
  • Pago aprobado
<script>
  window.addEventListener('message', (event) => {
    if(event.data && event.data.type) {
      console.log('Mensaje recibido del SDK:', event.data);
    }
  });
</script>

Tabla de eventos

| TIPO | DETALLE | | ---------------------- | ----------------------------- | | AUTH_ERROR | Authentication failed. | | AUTH_PAYMENT_REQUEST | Payment request failed. | | LOAD_DATA_ERROR | Load data failed. | | PROMOTIONS_ERROR | Promotions failed. | | PAYMENT_REQUEST_ERROR | Payment request failed. | | INSTALLMENT_PLAN_ERROR | Installment plant failed. | | WEB_SOCKET_ERROR | Web socket connection failed. | | DIRECT_PAYMENT_ERROR | Direct payment failed. | | FAILURE_PROCESSED | Failure detail | | SUCCESS_PROCESSED | none | | BLOCKED | Blocked detail | | INVOICE_ERROR | Open invoice failed. |