1- using Checkout . Accounts . Payout . Request ;
1+ using Checkout . Accounts . Entities . Request ;
2+ using Checkout . Accounts . Entities . Response ;
3+ using Checkout . Accounts . Payout . Request ;
24using Checkout . Accounts . Payout . Response ;
35using Checkout . Common ;
46using Checkout . Files ;
@@ -12,6 +14,8 @@ public class AccountsClient : FilesClient, IAccountsClient
1214 {
1315 private const string AccountsPath = "accounts" ;
1416 private const string EntitiesPath = "entities" ;
17+ private const string MembersPath = "members" ;
18+ private const string FilesPath = "files" ;
1519 private const string InstrumentPath = "instruments" ;
1620 private const string PayoutSchedulePath = "payout-schedules" ;
1721 private const string PaymentInstrumentsPath = "payment-instruments" ;
@@ -24,37 +28,46 @@ public AccountsClient(
2428 {
2529 }
2630
27- public async Task < IdResponse > SubmitFile ( AccountsFileRequest accountsFileRequest ,
31+ public async Task < OnboardEntityResponse > CreateEntity (
32+ OnboardEntityRequest entityRequest ,
2833 CancellationToken cancellationToken = default )
2934 {
30- CheckoutUtils . ValidateParams ( "accountsFileRequest" , accountsFileRequest ,
31- "accountsFileRequest.purpose" , accountsFileRequest . Purpose ) ;
32- return await SubmitFileToFilesApi ( accountsFileRequest . File , accountsFileRequest . Purpose . Value ,
35+ CheckoutUtils . ValidateParams ( "entityRequest" , entityRequest ) ;
36+ return await ApiClient . Post < OnboardEntityResponse > (
37+ BuildPath ( AccountsPath , EntitiesPath ) ,
38+ SdkAuthorization ( ) ,
39+ entityRequest ,
3340 cancellationToken ) ;
3441 }
3542
36- public async Task < OnboardEntityResponse > CreateEntity ( OnboardEntityRequest entityRequest ,
43+ public async Task < OnboardSubEntityDetailsResponse > GetSubEntityMembers (
44+ string entityId ,
3745 CancellationToken cancellationToken = default )
3846 {
39- CheckoutUtils . ValidateParams ( "entityRequest " , entityRequest ) ;
40- return await ApiClient . Post < OnboardEntityResponse > (
41- BuildPath ( AccountsPath , EntitiesPath ) ,
47+ CheckoutUtils . ValidateParams ( "entityId " , entityId ) ;
48+ return await ApiClient . Get < OnboardSubEntityDetailsResponse > (
49+ BuildPath ( AccountsPath , EntitiesPath , entityId , MembersPath ) ,
4250 SdkAuthorization ( ) ,
43- entityRequest ,
4451 cancellationToken ) ;
4552 }
4653
47- public async Task < PaymentInstrumentDetailsResponse > RetrievePaymentInstrumentDetails ( string entityId ,
48- string paymentInstrumentId , CancellationToken cancellationToken = default )
54+ public async Task < OnboardSubEntityResponse > ReinviteSubEntityMember (
55+ string entityId ,
56+ string userId ,
57+ OnboardSubEntityRequest subEntityRequest ,
58+ CancellationToken cancellationToken = default )
4959 {
50- CheckoutUtils . ValidateParams ( "entityId" , entityId , "paymentInstrumentId" , paymentInstrumentId ) ;
51- return await ApiClient . Get < PaymentInstrumentDetailsResponse > (
52- BuildPath ( AccountsPath , EntitiesPath , entityId , PaymentInstrumentsPath , paymentInstrumentId ) ,
60+ CheckoutUtils . ValidateParams ( "entityId" , entityId , "userId" , userId ,
61+ "subEntityRequest" , subEntityRequest ) ;
62+ return await ApiClient . Put < OnboardSubEntityResponse > (
63+ BuildPath ( AccountsPath , EntitiesPath , entityId , MembersPath , userId ) ,
5364 SdkAuthorization ( ) ,
65+ subEntityRequest ,
5466 cancellationToken ) ;
5567 }
5668
57- public async Task < OnboardEntityDetailsResponse > GetEntity ( string entityId ,
69+ public async Task < OnboardEntityDetailsResponse > GetEntity (
70+ string entityId ,
5871 CancellationToken cancellationToken = default )
5972 {
6073 CheckoutUtils . ValidateParams ( "entityId" , entityId ) ;
@@ -64,31 +77,34 @@ public async Task<OnboardEntityDetailsResponse> GetEntity(string entityId,
6477 cancellationToken ) ;
6578 }
6679
67- public async Task < OnboardEntityResponse > UpdateEntity ( string entityId , OnboardEntityRequest entityRequest ,
80+ public async Task < OnboardEntityResponse > UpdateEntity (
81+ string entityId ,
82+ OnboardEntityRequest entityRequest ,
6883 CancellationToken cancellationToken = default )
6984 {
70- CheckoutUtils . ValidateParams ( "entityRequest " , entityRequest , "entityId " , entityId ) ;
85+ CheckoutUtils . ValidateParams ( "entityId " , entityId , "entityRequest " , entityRequest ) ;
7186 return await ApiClient . Put < OnboardEntityResponse > (
7287 BuildPath ( AccountsPath , EntitiesPath , entityId ) ,
7388 SdkAuthorization ( ) ,
7489 entityRequest ,
7590 cancellationToken ) ;
7691 }
7792
78- public async Task < EmptyResponse > CreatePaymentInstrument ( string entityId ,
93+ public async Task < EmptyResponse > CreatePaymentInstrument (
94+ string entityId ,
7995 AccountsPaymentInstrument accountsPaymentInstrument ,
8096 CancellationToken cancellationToken = default )
8197 {
82- CheckoutUtils . ValidateParams ( "accountsPaymentInstrument" , accountsPaymentInstrument , "entityId" ,
83- entityId ) ;
98+ CheckoutUtils . ValidateParams ( "entityId" , entityId , "accountsPaymentInstrument" , accountsPaymentInstrument ) ;
8499 return await ApiClient . Post < EmptyResponse > (
85100 BuildPath ( AccountsPath , EntitiesPath , entityId , InstrumentPath ) ,
86101 SdkAuthorization ( ) ,
87102 accountsPaymentInstrument ,
88103 cancellationToken ) ;
89104 }
90105
91- public async Task < IdResponse > CreatePaymentInstrument ( string entityId ,
106+ public async Task < IdResponse > CreatePaymentInstrument (
107+ string entityId ,
92108 PaymentInstrumentRequest paymentInstrumentRequest ,
93109 CancellationToken cancellationToken = default )
94110 {
@@ -100,21 +116,35 @@ public async Task<IdResponse> CreatePaymentInstrument(string entityId,
100116 cancellationToken ) ;
101117 }
102118
103- public async Task < IdResponse > UpdatePaymentInstrument ( string entityId ,
119+ public async Task < PaymentInstrumentDetailsResponse > RetrievePaymentInstrumentDetails (
120+ string entityId ,
121+ string paymentInstrumentId ,
122+ CancellationToken cancellationToken = default )
123+ {
124+ CheckoutUtils . ValidateParams ( "entityId" , entityId , "paymentInstrumentId" , paymentInstrumentId ) ;
125+ return await ApiClient . Get < PaymentInstrumentDetailsResponse > (
126+ BuildPath ( AccountsPath , EntitiesPath , entityId , PaymentInstrumentsPath , paymentInstrumentId ) ,
127+ SdkAuthorization ( ) ,
128+ cancellationToken ) ;
129+ }
130+
131+ public async Task < IdResponse > UpdatePaymentInstrument (
132+ string entityId ,
104133 string instrumentId ,
105134 UpdatePaymentInstrumentRequest updatePaymentInstrumentRequest ,
106135 CancellationToken cancellationToken = default )
107136 {
108- CheckoutUtils . ValidateParams ( "entityId" , entityId , "updatePaymentInstrumentRequest" ,
109- updatePaymentInstrumentRequest ) ;
137+ CheckoutUtils . ValidateParams ( "entityId" , entityId , "instrumentId" , instrumentId ,
138+ "updatePaymentInstrumentRequest" , updatePaymentInstrumentRequest ) ;
110139 return await ApiClient . Patch < IdResponse > (
111140 BuildPath ( AccountsPath , EntitiesPath , entityId , PaymentInstrumentsPath , instrumentId ) ,
112141 SdkAuthorization ( ) ,
113142 updatePaymentInstrumentRequest ,
114143 cancellationToken ) ;
115144 }
116145
117- public async Task < PaymentInstrumentQueryResponse > QueryPaymentInstruments ( string entityId ,
146+ public async Task < PaymentInstrumentQueryResponse > QueryPaymentInstruments (
147+ string entityId ,
118148 PaymentInstrumentsQuery query = null ,
119149 CancellationToken cancellationToken = default )
120150 {
@@ -126,7 +156,8 @@ public async Task<PaymentInstrumentQueryResponse> QueryPaymentInstruments(string
126156 cancellationToken ) ;
127157 }
128158
129- public async Task < GetScheduleResponse > RetrievePayoutSchedule ( string entityId ,
159+ public async Task < GetScheduleResponse > RetrievePayoutSchedule (
160+ string entityId ,
130161 CancellationToken cancellationToken = default )
131162 {
132163 CheckoutUtils . ValidateParams ( "entityId" , entityId ) ;
@@ -136,7 +167,9 @@ public async Task<GetScheduleResponse> RetrievePayoutSchedule(string entityId,
136167 cancellationToken ) ;
137168 }
138169
139- public async Task < EmptyResponse > UpdatePayoutSchedule ( string entityId , Currency currency ,
170+ public async Task < EmptyResponse > UpdatePayoutSchedule (
171+ string entityId ,
172+ Currency currency ,
140173 UpdateScheduleRequest updateScheduleRequest ,
141174 CancellationToken cancellationToken = default )
142175 {
@@ -148,5 +181,40 @@ public async Task<EmptyResponse> UpdatePayoutSchedule(string entityId, Currency
148181 new Dictionary < Currency , UpdateScheduleRequest > ( ) { { currency , updateScheduleRequest } } ,
149182 cancellationToken ) ;
150183 }
184+
185+ public async Task < IdResponse > SubmitFile (
186+ AccountsFileRequest accountsFileRequest ,
187+ CancellationToken cancellationToken = default )
188+ {
189+ CheckoutUtils . ValidateParams ( "accountsFileRequest" , accountsFileRequest ,
190+ "accountsFileRequest.purpose" , accountsFileRequest . Purpose ) ;
191+ return await SubmitFileToFilesApi ( accountsFileRequest . File , accountsFileRequest . Purpose . Value ,
192+ cancellationToken ) ;
193+ }
194+
195+ public async Task < UploadFileResponse > UploadFile (
196+ string entityId ,
197+ AccountsFileRequest accountsFileRequest ,
198+ CancellationToken cancellationToken = default )
199+ {
200+ CheckoutUtils . ValidateParams ( "accountsFileRequest" , accountsFileRequest ) ;
201+ return await ApiClient . Post < UploadFileResponse > (
202+ BuildPath ( AccountsPath , entityId , FilesPath ) ,
203+ SdkAuthorization ( ) ,
204+ accountsFileRequest ,
205+ cancellationToken ) ;
206+ }
207+
208+ public async Task < FileDetailsResponse > RetrieveFile (
209+ string entityId ,
210+ string fileId ,
211+ CancellationToken cancellationToken = default )
212+ {
213+ CheckoutUtils . ValidateParams ( "entityId" , entityId , "fileId" , fileId ) ;
214+ return await ApiClient . Get < FileDetailsResponse > (
215+ BuildPath ( AccountsPath , entityId , FilesPath , fileId ) ,
216+ SdkAuthorization ( ) ,
217+ cancellationToken ) ;
218+ }
151219 }
152220}
0 commit comments