busha_commerce_flutter 0.0.2 busha_commerce_flutter: ^0.0.2 copied to clipboard
Accept bitcoin and other cryptocurrencies from anywhere in the world.
Busha Commerce SDK #
Accept bitcoin and other cryptocurrencies from anywhere in the world.
Features #
Getting started (Installing) #
In the pubspec.yaml
of your flutter project, add the following dependency:
dependencies:
...
busha_commerce_flutter: <latest_version>
In your library add the following import:
import 'package:busha_commerce_flutter/busha_commerce_flutter.dart';
After adding, initialize the sdk as shown below in your widget or in any better way you see fit.
For the sdk to work, you must have a product_url, business token and customer details(email and name only).
class _SetupViewState extends State<SetupView> {
late BushaCommerce bushaCommerce;
@override
void initState() {
bushaCommerce = BushaCommerce(
context: context,
url: 'checkout_url',
businessToken: 'live_key',
paymentType: PaymentType.checkout,
customerEmail: 'customer@gmail.com',
customerName: 'customer');
super.initState();
}
}
Usage #
After installation and setup is done properly, you can start using the sdk
bushaCommerce.startPayment(
onCompleted: (data){ /// Returns any charge action data after a payment attempt.
....
},
onClose: (data) { /// Returns closed action message before any charge takes place.
...
}
);
Additional information #
The url to be used to can only be gotten from the business and information is automatically gotten from it from the sdk to be used to continue the payment activities.
📝 Contributing, Issues and 🐛 Bug Reports #
This sdk project is open to contribution and open requests to fix bugs and make it better.