PaymentService class
Main service class for unified payment processing
Constructors
- PaymentService.new()
-
Factory constructor for easier access
factory
Properties
- config → PaymentConfig?
-
Get current configuration
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialized → bool
-
Check if service is initialized
no setter
- providerType → PaymentProvider?
-
Get current provider type
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createPaymentUrl(
PaymentRequest request) → Future< PaymentUrlResponse> - Create a payment URL without launching WebView Useful for custom implementations
-
getProviderUrlPatterns(
) → Map< String, List< String> > - Get provider-specific URL patterns
-
init(
PaymentConfig config) → Future< void> - Initialize the payment service with configuration
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parsePaymentResponse(
Map< String, dynamic> response) → PaymentResponse - Handle payment response from external sources Useful when payment is completed outside the WebView
-
pay(
{required BuildContext context, required PaymentRequest request, PaymentSuccessCallback? onSuccess, PaymentFailureCallback? onFailure, Duration? timeout}) → Future< void> - Make a payment
-
reset(
) → void - Reset the service (useful for testing)
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyPayment(
String transactionId) → Future< PaymentResponse> - Verify a payment manually
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PaymentService
-
Singleton instance
no setter