intent reference generation + propagation
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import 'package:pshared/api/requests/payment/base.dart';
|
||||
|
||||
|
||||
class InitiatePaymentsRequest extends PaymentBaseRequest {
|
||||
final String quoteRef;
|
||||
final String? intentRef;
|
||||
final List<String>? intentRefs;
|
||||
|
||||
const InitiatePaymentsRequest({
|
||||
required super.idempotencyKey,
|
||||
super.metadata,
|
||||
required this.quoteRef,
|
||||
this.intentRef,
|
||||
this.intentRefs,
|
||||
});
|
||||
|
||||
factory InitiatePaymentsRequest.fromJson(Map<String, dynamic> json) {
|
||||
@@ -17,6 +20,10 @@ class InitiatePaymentsRequest extends PaymentBaseRequest {
|
||||
(key, value) => MapEntry(key, value as String),
|
||||
),
|
||||
quoteRef: json['quoteRef'] as String,
|
||||
intentRef: json['intentRef'] as String?,
|
||||
intentRefs: (json['intentRefs'] as List<dynamic>?)
|
||||
?.map((value) => value as String)
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,6 +33,8 @@ class InitiatePaymentsRequest extends PaymentBaseRequest {
|
||||
'idempotencyKey': idempotencyKey,
|
||||
'metadata': metadata,
|
||||
'quoteRef': quoteRef,
|
||||
if (intentRef != null) 'intentRef': intentRef,
|
||||
if (intentRefs != null) 'intentRefs': intentRefs,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user