@ranty/ranty-sdk 2.0.15-beta.4 → 2.0.15-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ import '@ranty/ranty-sdk'
48
48
  - production (no requerido)
49
49
  - staging (homologación)
50
50
 
51
- ## Reecomendación de uso
51
+ ## Recomendación de uso
52
52
 
53
53
  Para tener una mejor experiencia se recomienda embeber el tag de `<payfac-sdk></payfac-sdk>` en un tag de contencion `div, iframe...`, con los sigueintes estilos `height: 94vh; background: #F4F4F4;`
54
54
 
@@ -145,8 +145,45 @@ Para tener una mejor experiencia se recomienda embeber el tag de `<payfac-sdk></
145
145
  <payfac-sdk
146
146
  paymentRequestId="uuid-v4"
147
147
  publicKey="publicKey-merchant"
148
- userId="string"
149
148
  env="staging"
150
149
  ></payfac-sdk>
151
150
  </div>
152
151
  ```
152
+
153
+ ### Manejo de eventos
154
+
155
+ Se dispara un eventos cuando:
156
+
157
+ - Falla al generar el token
158
+ - Falla get payment request
159
+ - Falla installment plan
160
+ - Falla directPayment
161
+ - Pago rechazado
162
+ - Pago aprobado
163
+
164
+ ```html
165
+ <script>
166
+ window.addEventListener('message', (event) => {
167
+ if(event.data && event.data.type) {
168
+ console.log('Mensaje recibido del SDK:', event.data);
169
+ }
170
+ });
171
+ </script>
172
+ ```
173
+
174
+ ### Tabla de eventos
175
+
176
+ | TIPO | DETALLE |
177
+ |------------------------|-------------------------------|
178
+ | AUTH_ERROR | Authentication failed. |
179
+ | AUTH_PAYMENT_REQUEST | Payment request failed. |
180
+ | LOAD_DATA_ERROR | Load data failed. |
181
+ | PROMOTIONS_ERROR | Promotions failed. |
182
+ | PAYMENT_REQUEST_ERROR | Payment request failed. |
183
+ | INSTALLMENT_PLAN_ERROR | Installment plant failed. |
184
+ | WEB_SOCKET_ERROR | Web socket connection failed. |
185
+ | DIRECT_PAYMENT_ERROR | Direct payment failed. |
186
+ | FAILURE_PROCESSED | Failure detail |
187
+ | SUCCESS_PROCESSED | none |
188
+ | BLOCKED | Bloked detail |
189
+ | INVOICE_ERROR | Open invoice failed. |