flutter_payphone 0.1.12

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

flutter_payphone #

Plugin de Flutter para pasarela de pagos Payphone.

Plugin creado por Irwin Ortiz irwing844@gmail.com

Uso #

  1. Obtener el Token para el RUC en https://appdeveloper.payphonetodoesposible.com/
  2. Puedes llamar a los siguientes métodos:
    • Payphone(tokenApiKey).enviarVentaResultadoWidget(context, widget, phoneNumber,amount,amountWithTax,tax,clientTransactionId, referencia); (Esto nos devuelve un dialog con un widget hasta esperar que el cliente aprueba la transaccion en la APP de Payphone)
    • Payphone(tokenApiKey).enviarVentaResultado(phoneNumber,amount,amountWithTax,tax,clientTransactionId, referencia); (Esto es sin widget)
    • Payphone(tokenApiKey).consultarVenta(clientTransactionId); *enviarAnulacionResultadoWidget, enviarAnulacionResultado y consultarAnulacion (lo mismo que la venta)
      (Esto nos devuelve un json con un número de transacción si es que todo salió bien, o un codigo de error)

Nota 1: El clientTransactionId es una referencia cualquiera para identificar la transacción del cliente (debe ser único). Nota 2: Amount, AmountWithTax y Tax se deben multiplicar por 100, es decir, $1 dólar = 100; $1.50 dólares = 150. Nota 3: La referencia es el concepto del cobro.

Apoyame #

Si te sirve este plugin y quieres que sea actualizado constantemente puedes apoyarme donando a mi cuenta de payphone:

https://ppls.me/Tge8Brvr2u8yjBLHKI5A

O lo puedes hacer a mi PayPal: https://www.paypal.me/irwinortiz

[0.1.12] #

  • Se estabiliza y valida el plugin

[0.0.11] #

  • se implementa el método enviarVentaResultadoWidget, enviarVentaResultado, consultarVenta, enviarAnulacionResultado y consultarAnulacion

[0.0.8] #

  • Se estabiliza el plugin

[0.0.7] #

  • Algunas correcciones

[0.0.6] #

  • Algunas correcciones

[0.0.5] #

  • Algunas correcciones

[0.0.4] #

  • Se mejora la respuesta de saleStatus

[0.0.3] #

  • Se implementa saleStatus

[0.0.2] #

  • Se corrigen errores de petición

[0.0.1] #

  • Versión inicial

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_payphone/flutter_payphone.dart';

const API_KEY_PAYPHONE = "TU_CREDENCIAL";

void main() {
  runApp(MaterialApp(
    home: MyApp(),
  ));
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: RaisedButton(
            child: Text(
              'Solicitar Pago',
              style: TextStyle(color: Colors.white),
            ),
            color: Colors.blue,
            onPressed: () async {
              var resultado = await Payphone(API_KEY_PAYPHONE)
                  .enviarVentaResultadoWidget(
                      context,
                      CircularProgressIndicator(),
                      "0991234567",
                      112,
                      100,
                      12,
                      "IDPEDIDO9",
                      "Pack Manos");
              print("RESULTADO EN TEST: " + resultado.toString());
            }),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_payphone: ^0.1.12

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_payphone/flutter_payphone.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • flutter_payphone that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

11 out of 11 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/flutter_payphone.dart. (-0.50 points)

Analysis of lib/flutter_payphone.dart reported 1 hint:

line 195 col 26: The value of the local variable 'resultado' isn't used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
http ^0.12.0+4 0.12.1
progress_dialog ^1.2.2 1.2.4
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
http_parser 3.1.4
meta 1.1.8 1.2.1
path 1.7.0
pedantic 1.9.0 1.9.1
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test