Git Product home page Git Product logo

picpay-dart's Introduction

PicPay

A PicPay library for Dart developers based on e-Commerce Public API (1.0).

Usage

A simple usage example:

Create your PicPay Token

Create your PicPay Token on your PicPay E-Commerce Account.

  final String token = '5b008f2367b2-1399-5b008cef';

Create a Buyer

import 'package:picpay/picpay.dart';

void main() async {

  // Create a PicPay Buyer
  var buyer = PicPayBuyer(
    "Luiz",
    "Eduardo",
    "123.345.678.99",
    "[email protected]",
    "+551212345678",
  );

}

Create Payment

import 'package:picpay/picpay.dart';

void main() async {

  var token = '5b008f2367b2-1399-5b008cef';

  // Create a Payment
  var payment = await PicPayPayment.create(
    token,
    "9999999",
    'https://retorno.seusite.com.br',
    10,
    buyer,
  );

  // Buyer Payment URL
  print(payment.paymentUrl);

  // Buyer Payment QRCode Content
  print(payment.qrcodeContent);

  // Buyer Payment QRCode Image encoded with Base64
  print(payment.qrcodeImage);

}

Check Payment Status

import 'package:picpay/picpay.dart';

void main() async {

  var token = '5b008f2367b2-1399-5b008cef';

  var paymentStatus = await PicPayPaymentStatus.create(token, "1234");

  // Return Payment Status Text
  print(paymentStatus.status);

  // You can also check status using:

  paymentStatus.isCreated;

  paymentStatus.isExpired;

  paymentStatus.isAnalysis;

  paymentStatus.isPaid;

  paymentStatus.isCompleted;

  paymentStatus.isRefunded;

  paymentStatus.isChargeback;

}

Cancel Payment

import 'package:picpay/picpay.dart';

void main() async {

  var token = '5b008f2367b2-1399-5b008cef';

  var paymentCancel = await PicPayCancelPayment.create(token, "1234");

  print(paymentCancel.isRequestSuccess);

}

Features and bugs

Please file feature requests and bugs at the issue tracker.

picpay-dart's People

Contributors

luizeof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

brasizza

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.