PaypalService class interface
A payment service class that integrates with PayPal using flutter_paypal_payment
.
Implements the PaymentService interface, allowing you to initiate a PayPal checkout via a WebView. This class supports both sandbox and production modes.
Typically used with a SetupPaypalPayment
configuration to customize the payment
details, such as client credentials, transaction data, and callback handlers.
Example:
PaypalService().pay(setupPayment: SetupPaypalPayment(...));
This class is meant to be a plug-and-play solution for handling payments with PayPal.
Exceptions and user messages are already handled internally using snackbars and default fallback behavior.
Usage is simple and requires no additional error handling from the caller.
- Implemented types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pay<
T> ({required T setupPayment}) → Future< void> -
Initiates a PayPal payment checkout flow.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → PaypalService
-
no setter