paynow_bloc library

Paynow As a Bloc aims to

  • Simplify Paynow Integration with Flutter/Dart Applications
  • Gracefully handle payment requests and logic
  • Save you time , focus on the making the perfect UI

Classes

CartCubit
A cubit to manage the Cart Is streamable for state changes
CartRepository
CartState
A snapshot of the cart current state
PaynowBloc
Bloc for creating and managing Paynow payment requests
PaynowBuilder
Widget using the PaynowBloc to gracefully handle the payment workflow. It handles all the logic behind the scenes You are only required to plug in your UI. Each Builder provides ready to use information about your cart.
PaynowBuilderState
PaynowConfig
Paynow Configuration
PaynowFailedState
Triggered when payment completes unsuccessfully
PaynowInitialState
Initial State of PaynowBloc
PaynowLoadingState
Triggered when processing payment
PaynowPaymentInfo
Containing Payment Information required during transaction
PaynowPaymentResult
A response returned by core containing summary of the payment Is safe to use to validate payments
PaynowPendingState
Triggered when waiting for user to complete payment
PaynowState
PaynowState for PaynowBloc
PaynowSuccessState
Triggered when user has successfully paid

Enums

PaynowPaymentMethod
Options for Payment method

Functions

startPaynowPayment<E>(BuildContext context, {required PaynowConfig paynowConfig, required CartRepository cartRepository, required PaynowPaymentInfo paynowPaymentInfo, required Widget onInitial(BuildContext context, PaynowInitialState initialState, List<PaynowCartItem> cart), required Widget onPending(BuildContext context, PaynowPendingState pendingState, List<PaynowCartItem> cart), required Widget onLoading(BuildContext context, PaynowLoadingState loadingState, List<PaynowCartItem> cart), required Widget onSuccess(BuildContext context, PaynowSuccessState successState, List<PaynowCartItem> cart), required Widget onFailed(BuildContext context, PaynowFailedState failedState, List<PaynowCartItem> cart), required Widget checkoutButtonBuilder(BuildContext context, PaynowBloc paynowBloc, CartRepository cartRepository), bool? forceWebView, bool? forceSafariVC}) Future<PaynowPaymentResult>
A simplfied function to start the payment from UI layer