https://github.com/stackingwidgets/picpay-dart
PicPay API for Dart and Flutter
https://github.com/stackingwidgets/picpay-dart
dart dart-library dart-package flutter picpay picpay-gateway
Last synced: 5 months ago
JSON representation
PicPay API for Dart and Flutter
- Host: GitHub
- URL: https://github.com/stackingwidgets/picpay-dart
- Owner: stackingwidgets
- License: gpl-3.0
- Created: 2020-02-03T00:16:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-25T14:36:05.000Z (over 4 years ago)
- Last Synced: 2025-10-22T22:12:56.671Z (9 months ago)
- Topics: dart, dart-library, dart-package, flutter, picpay, picpay-gateway
- Language: Dart
- Homepage: https://pub.dev/packages/picpay
- Size: 52.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PicPay
A [PicPay](https://picpay.com/) library for Dart developers based on [e-Commerce Public API (1.0)](https://ecommerce.picpay.com/doc/).
## Usage
A simple usage example:
### Create your PicPay Token
[Create your PicPay Token](https://lojista.picpay.com/ecommerce-token) on your PicPay E-Commerce Account.
```dart
final String token = '5b008f2367b2-1399-5b008cef';
```
### Create a Buyer
```dart
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",
);
}
```
### Create Payment
```dart
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
```dart
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
```dart
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][tracker].
[tracker]: https://github.com/stackingwidgets/picpay-dart/issues