copyWith method

PaymentRequest copyWith({
  1. double? amount,
  2. String? currency,
  3. String? description,
  4. String? orderId,
  5. String? successUrl,
  6. String? cancelUrl,
  7. String? customerEmail,
  8. String? customerName,
  9. String? customerPhone,
  10. Map<String, dynamic>? metadata,
  11. String? returnUrl,
})

Create a copy of this request with updated values

Implementation

PaymentRequest 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,
}) {
  return PaymentRequest(
    amount: amount ?? this.amount,
    currency: currency ?? this.currency,
    description: description ?? this.description,
    orderId: orderId ?? this.orderId,
    successUrl: successUrl ?? this.successUrl,
    cancelUrl: cancelUrl ?? this.cancelUrl,
    customerEmail: customerEmail ?? this.customerEmail,
    customerName: customerName ?? this.customerName,
    customerPhone: customerPhone ?? this.customerPhone,
    metadata: metadata ?? this.metadata,
    returnUrl: returnUrl ?? this.returnUrl,
  );
}