+source +destination in payments
This commit is contained in:
@@ -2,15 +2,16 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/payment/operation.dart';
|
||||
import 'package:pshared/data/dto/payment/payment_quote.dart';
|
||||
import 'package:pshared/data/dto/payment/response_endpoint.dart';
|
||||
|
||||
part 'payment.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PaymentDTO {
|
||||
final String? paymentRef;
|
||||
final String? idempotencyKey;
|
||||
final String? state;
|
||||
final PaymentResponseEndpointDTO? source;
|
||||
final PaymentResponseEndpointDTO? destination;
|
||||
final String? failureCode;
|
||||
final String? failureReason;
|
||||
final List<PaymentOperationDTO> operations;
|
||||
@@ -20,8 +21,9 @@ class PaymentDTO {
|
||||
|
||||
const PaymentDTO({
|
||||
this.paymentRef,
|
||||
this.idempotencyKey,
|
||||
this.state,
|
||||
this.source,
|
||||
this.destination,
|
||||
this.failureCode,
|
||||
this.failureReason,
|
||||
this.operations = const <PaymentOperationDTO>[],
|
||||
|
||||
22
frontend/pshared/lib/data/dto/payment/response_endpoint.dart
Normal file
22
frontend/pshared/lib/data/dto/payment/response_endpoint.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'response_endpoint.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class PaymentResponseEndpointDTO {
|
||||
final String? type;
|
||||
final Map<String, dynamic>? data;
|
||||
final String? paymentMethodRef;
|
||||
final String? payeeRef;
|
||||
|
||||
const PaymentResponseEndpointDTO({
|
||||
this.type,
|
||||
this.data,
|
||||
this.paymentMethodRef,
|
||||
this.payeeRef,
|
||||
});
|
||||
|
||||
factory PaymentResponseEndpointDTO.fromJson(Map<String, dynamic> json) =>
|
||||
_$PaymentResponseEndpointDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$PaymentResponseEndpointDTOToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user