A PicPay library for Dart developers based on e-Commerce Public API (1.0).
A simple usage example:
Create your PicPay Token on your PicPay E-Commerce Account.
final String token = '5b008f2367b2-1399-5b008cef';
import 'package:picpay/picpay.dart';
void main() async {
// Create a PicPay Buyer
var buyer = PicPayBuyer(
"Luiz",
"Eduardo",
"123.345.678.99",
"luizeof@gmail.com",
"+551212345678",
);
}
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);
}
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;
}
import 'package:picpay/picpay.dart';
void main() async {
var token = '5b008f2367b2-1399-5b008cef';
var paymentCancel = await PicPayCancelPayment.create(token, "1234");
print(paymentCancel.isRequestSuccess);
}
Please file feature requests and bugs at the issue tracker.