Skip to content

A Flutter package for integrating Binance Pay API into your mobile applications, enabling users to make payments with ease.

License

Notifications You must be signed in to change notification settings

MarsadMaqsood/binance_pay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version

⭐ Installing

dependencies:
    binance_pay: ^0.0.3

⚡ Import

import 'package:binance_pay/binance_pay.dart';

📙 How To Use

BinancePay pay = BinancePay(
    apiKey: apiKey,
    apiSecretKey: apiSecret,
);

Create an order

Returns OrderResponse

String merchantTradeNo = generateMerchantTradeNo();

//Create an order
OrderResponse response = await pay.createOrder(
    body: RequestBody(
        merchantTradeNo: merchantTradeNo,
        orderAmount: '1.01',
        currency: 'BUSD',
        goodsType: '01',
        goodsCategory: '1000',
        referenceGoodsId: '1234567',
        goodsName: 'Cup Cake',
        goodsDetail: 'A Yummy cup cake.',
    ),
);

Query the order

Returns QueryResponse

//Query the order
QueryResponse queryResponse = await pay.queryOrder(
    merchantTradeNo: merchantTradeNo,
    prepayId: response.data!.prepayId,
);

Close the order

Returns CloseResponse

//Close the order
CloseResponse closeResponse = await pay.closeOrder(
    merchantTradeNo: merchantTradeNo,
);



About

A Flutter package for integrating Binance Pay API into your mobile applications, enabling users to make payments with ease.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published