Skip to content

Commit 22de350

Browse files
[ACL-245] Add support for scheme selection override fields (#238)
1 parent 89fa3a5 commit 22de350

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

src/TrueLayer/Payments/Model/SchemeSelection.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ public record InstantOnly : IDiscriminated
2525
/// Unless explicitly set, will default to false.
2626
/// </summary>
2727
public bool AllowRemitterFee { get; init; } = false;
28+
29+
/// <summary>
30+
/// An array of provider ids. If the user selects one of the providers specified in this list,
31+
/// the payment always goes through an instant scheme. This ignores any settings you specify for allow_remitter_fee.
32+
/// </summary>
33+
public string[]? InstantOverrideProviderIds { get; init; }
34+
35+
/// <summary>
36+
/// An array of provider ids. If the user selects one of the providers specified in this list,
37+
/// the payment always goes through a non instant scheme. This ignores any settings you specify for allow_remitter_fee.
38+
/// </summary>
39+
public string[]? NonInstantOverrideProviderIds { get; init; }
2840
}
2941

3042
/// <summary>
@@ -45,6 +57,18 @@ public record InstantPreferred : IDiscriminated
4557
/// Unless explicitly set, will default to false.
4658
/// </summary>
4759
public bool AllowRemitterFee { get; init; } = false;
60+
61+
/// <summary>
62+
/// An array of provider ids. If the user selects one of the providers specified in this list,
63+
/// the payment always goes through an instant scheme. This ignores any settings you specify for allow_remitter_fee.
64+
/// </summary>
65+
public string[]? InstantOverrideProviderIds { get; init; }
66+
67+
/// <summary>
68+
/// An array of provider ids. If the user selects one of the providers specified in this list,
69+
/// the payment always goes through a non instant scheme. This ignores any settings you specify for allow_remitter_fee.
70+
/// </summary>
71+
public string[]? NonInstantOverrideProviderIds { get; init; }
4872
}
4973

5074
/// <summary>

test/TrueLayer.AcceptanceTests/PaymentTests.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,12 @@ public static IEnumerable<object[]> ExternalAccountPaymentRequests()
534534
CreateTestPaymentRequest(new Provider.UserSelected
535535
{
536536
Filter = providerFilterMockGbRedirect,
537-
SchemeSelection = new SchemeSelection.InstantOnly { AllowRemitterFee = false },
537+
SchemeSelection = new SchemeSelection.InstantOnly
538+
{
539+
AllowRemitterFee = false,
540+
InstantOverrideProviderIds = ["mock-payments-gb-redirect"],
541+
NonInstantOverrideProviderIds = ["mock-payments-de-redirect"]
542+
},
538543
},
539544
sortCodeAccountNumber)
540545
];
@@ -543,7 +548,12 @@ public static IEnumerable<object[]> ExternalAccountPaymentRequests()
543548
CreateTestPaymentRequest(new Provider.UserSelected
544549
{
545550
Filter = providerFilterMockGbRedirect,
546-
SchemeSelection = new SchemeSelection.InstantPreferred { AllowRemitterFee = true },
551+
SchemeSelection = new SchemeSelection.InstantPreferred
552+
{
553+
AllowRemitterFee = true,
554+
InstantOverrideProviderIds = ["mock-payments-de-embedded"],
555+
NonInstantOverrideProviderIds = ["mock-payments-de-redirect"]
556+
},
547557
},
548558
sortCodeAccountNumber)
549559
];

0 commit comments

Comments
 (0)