PaymentRequest class

Payment request model containing all necessary payment information

Constructors

PaymentRequest.new({required double amount, required String currency, required String description, required String orderId, String? successUrl, String? cancelUrl, String? customerEmail, String? customerName, String? customerPhone, Map<String, dynamic>? metadata, String? returnUrl})
const
PaymentRequest.fromJson(Map<String, dynamic> json)
Create from JSON
factory

Properties

amount double
Payment amount (in the smallest currency unit, e.g., cents for USD)
final
amountInMajorUnits double
Get amount in major currency units (e.g., dollars instead of cents)
no setter
cancelUrl String?
Callback URL for cancelled payments
final
currency String
Currency code (ISO 4217, e.g., 'USD', 'EUR', 'INR')
final
customerEmail String?
Customer email (optional but recommended)
final
customerName String?
Customer name (optional)
final
customerPhone String?
Customer phone number (optional)
final
description String
Human-readable description of the payment
final
formattedAmount String
Format amount as string with currency symbol
no setter
hashCode int
The hash code for this object.
no setterinherited
metadata Map<String, dynamic>?
Additional metadata for the payment
final
orderId String
Unique order/transaction identifier
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
returnUrl String?
Custom return URL for the payment flow
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
successUrl String?
Callback URL for successful payments
final

Methods

copyWith({double? amount, String? currency, String? description, String? orderId, String? successUrl, String? cancelUrl, String? customerEmail, String? customerName, String? customerPhone, Map<String, dynamic>? metadata, String? returnUrl}) PaymentRequest
Create a copy of this request with updated values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert to JSON for backend communication
toString() String
A string representation of this object.

Operators

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