copyWith method

PaymentIntent copyWith({
  1. String? id,
  2. int? amount,
  3. String? currency,
  4. PaymentIntentStatus? status,
  5. String? clientSecret,
  6. String? phoneNumber,
  7. String? description,
  8. Map<String, dynamic>? metadata,
  9. DateTime? createdAt,
  10. DateTime? updatedAt,
  11. String? errorMessage,
  12. String? providerReference,
})

Creates a copy of this PaymentIntent with the given fields replaced.

Implementation

PaymentIntent copyWith({
  String? id,
  int? amount,
  String? currency,
  PaymentIntentStatus? status,
  String? clientSecret,
  String? phoneNumber,
  String? description,
  Map<String, dynamic>? metadata,
  DateTime? createdAt,
  DateTime? updatedAt,
  String? errorMessage,
  String? providerReference,
}) {
  return PaymentIntent(
    id: id ?? this.id,
    amount: amount ?? this.amount,
    currency: currency ?? this.currency,
    status: status ?? this.status,
    clientSecret: clientSecret ?? this.clientSecret,
    phoneNumber: phoneNumber ?? this.phoneNumber,
    description: description ?? this.description,
    metadata: metadata ?? this.metadata,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
    errorMessage: errorMessage ?? this.errorMessage,
    providerReference: providerReference ?? this.providerReference,
  );
}