BkashApi class

The BkashApi class provides an interface to interact with various APIs related to bKash payment integration.

This class encapsulates the functionality to create tokens, create agreements, and execute payments with or without agreements. It uses the provided BkashCredentials to authenticate API requests.

Constructors

BkashApi({required BkashCredentials bkashCredentials, required bool logResponse})
Creates a new instance of the BkashApi with the provided bkashCredentials.

Properties

hashCode int
The hash code for this object.
no setterinherited
logResponse bool
This is for printing api response from Bkash
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createAgreement({required String idToken, required String payerReference}) Future<Either<BkashFailure, CreateAgreementResponseModel>>
Creates a new agreement for the provided payerReference.
createToken() Future<Either<BkashFailure, TokenResponseModel>>
Creates a new token for authorizing payment operations.
executeCreateAgreement({required String paymentId, required String idToken}) Future<Either<BkashFailure, ExecuteAgreementResponse>>
Executes the agreement creation with the provided paymentId and idToken.
executePayWithAgreement({required String paymentId, required String idToken}) Future<Either<BkashFailure, PayWithAgreementExecuteResponseModel>>
Executes the payment with an existing agreement using the provided paymentId and idToken.
executePayWithoutAgreement({required String paymentId, required String idToken}) Future<Either<BkashFailure, PayWithoutAgreementExecuteResponseModel>>
Executes the payment without an existing agreement using the provided paymentId and idToken.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payWithAgreement({required String idToken, required String amount, required String agreementId, required String merchantInvoiceNumber}) Future<Either<BkashFailure, PayWithAgreementResponseModel>>
Pays with an existing agreement using the provided idToken, amount, agreementId, and merchantInvoiceNumber.
payWithoutAgreement({required String idToken, required String amount, required String payerReference, required String merchantInvoiceNumber}) Future<Either<BkashFailure, PayWithoutAgreementResponse>>
Pays without an existing agreement using the provided idToken, amount, payerReference, and merchantInvoiceNumber.
refreshToken({required String refreshToken}) Future<Either<BkashFailure, TokenResponseModel>>
Refreshes the token using the provided refreshToken.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited