+source +destination in payments

This commit is contained in:
Stephan D
2026-03-10 19:15:20 +01:00
parent 9c2b3bf8bd
commit e5b4de5d48
16 changed files with 716 additions and 56 deletions

View File

@@ -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>[],

View 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);
}