zarinpal 1.0.1 copy "zarinpal: ^1.0.1" to clipboard
zarinpal: ^1.0.1 copied to clipboard

outdated

Zarinpal Package for dar & flutter, support android and ios

Zarinpal Package for dar & flutter, support android and ios

Usage #

A simple usage example:

import 'package:zarinpal/zarinpal.dart';

main() {
  
// Initialize payment request 
 PaymentRequest _paymentRequest = PaymentRequest()
  ..setIsSandBox(true)
    ..setMerchantID("Zarinpal MerchantID")
    ..setAmount("integar Amount")
    ..setCallbackURL("Verfication Url callbacl") //The callback can be an android scheme or a website URL, you and can pass any data with The callback for both scheme and  URL
    ..setDescription("Payment Description");

// For scheme you can use uni_links dart Package 


String _paymentUrl = null;


// Call Start payment
ZarinPal().startPayment(_paymentRequest, (int status, String paymentGatewayUri){
     if(status == 100)
         _paymentUrl  = paymentGatewayUri;  // launch URL in browser
});


// Vefrication Payment
// if you set the scheme in your application, You can get the Status and Authority from scheme callback
// if your callback is a website URL like htt://mydomain.com you don't need verificationPayment function

ZarinPal().verificationPayment("Status", "Authority Call back", _paymentRequest, (isPaymentSuccess,refID, paymentRequest){
     if(isPaymentSuccess){
       // Payment Is Success
     }else{
       // Error Print Status
     }
   });



}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

39
likes
0
pub points
81%
popularity

Publisher

verified publisherflutterfarsi.ir

Zarinpal Package for dar & flutter, support android and ios

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dio, flutter, sprintf

More

Packages that depend on zarinpal