Пример #1
0
 public Task <DisputesQueryResponse> Query(DisputesQueryFilter filter,
                                           CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", filter);
     return(ApiClient.Query <DisputesQueryResponse>(DisputesPath, SdkAuthorization(), filter,
                                                    cancellationToken));
 }
 public Task <StatementReportResponse> QueryStatementsReport(QueryFilterDateRange filter,
                                                             CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", filter);
     return(ApiClient.Query <StatementReportResponse>(BuildPath(ReportingPath, StatementsPath),
                                                      SdkAuthorization(), filter, cancellationToken));
 }
 public Task <ReconciliationPaymentReportResponse> SinglePaymentReport(string paymentId,
                                                                       CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("paymentId", paymentId);
     return(ApiClient.Get <ReconciliationPaymentReportResponse>(BuildPath(ReportingPath, PaymentsPath, paymentId),
                                                                SdkAuthorization(), cancellationToken));
 }
 public Task <ReconciliationPaymentReportResponse> QueryPaymentsReport(ReconciliationQueryPaymentsFilter filter,
                                                                       CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", filter);
     return(ApiClient.Query <ReconciliationPaymentReportResponse>(BuildPath(ReportingPath, PaymentsPath),
                                                                  SdkAuthorization(), filter, cancellationToken));
 }
Пример #5
0
 public Task <DisputeDetailsResponse> GetDisputeDetails(string disputeId,
                                                        CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("disputeId", disputeId);
     return(ApiClient.Get <DisputeDetailsResponse>(BuildPath(DisputesPath, disputeId), SdkAuthorization(),
                                                   cancellationToken));
 }
Пример #6
0
 public Task <ReflowResponse> ReflowBySubjectAndWorkflow(string subjectId, string workflowId)
 {
     CheckoutUtils.ValidateParams("subjectId", subjectId, WorkflowId, workflowId);
     return(ApiClient.Post <ReflowResponse>(
                BuildPath(WorkflowsPath, EventsPath, SubjectPath, subjectId, WorkflowPath, workflowId, ReflowPath),
                SdkAuthorization()));
 }
Пример #7
0
 public Task <EmptyResponse> RetryWebhook(string eventId, string webhookId,
                                          CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("eventId", eventId, "webhookId", webhookId);
     return(ApiClient.Post <EmptyResponse>(BuildPath(EventsPath, eventId, WebhooksPath, webhookId, RetryPath),
                                           SdkAuthorization(), null, cancellationToken, null));
 }
Пример #8
0
        private static ISender Create(JToken jToken)
        {
            CheckoutUtils.ValidateParams("jToken", jToken);
            var sourceType = GetSourceType(jToken);

            return(CreateResponse(sourceType));
        }
 public Task <HostedPaymentResponse> CreateHostedPaymentsPageSession(HostedPaymentRequest hostedPaymentRequest,
                                                                     CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("hostedPaymentRequest", hostedPaymentRequest);
     return(ApiClient.Post <HostedPaymentResponse>(HostedPaymentsPath, SdkAuthorization(), hostedPaymentRequest,
                                                   cancellationToken));
 }
Пример #10
0
 private async Task <GetSessionResponse> GetSessionDetails(string sessionId, SdkAuthorization sdkAuthorization,
                                                           CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams(SessionIdPath, sessionId, "sdkAuthorization", sdkAuthorization);
     return(await ApiClient.Get <GetSessionResponse>(BuildPath(SessionsPath, sessionId), sdkAuthorization,
                                                     cancellationToken));
 }
Пример #11
0
        public static IServiceCollection AddCheckoutSdk(
            IServiceCollection serviceCollection,
            IConfiguration configuration,
            ILoggerFactory loggerFactory         = null,
            IHttpClientFactory httpClientFactory = null)
        {
            CheckoutUtils.ValidateParams("serviceCollection", serviceCollection, "configuration", configuration);
            var checkoutOptions = configuration.GetCheckoutOptions();

            if (checkoutOptions == null)
            {
                throw new CheckoutArgumentException("Checkout options was not initialized correctly");
            }

            switch (checkoutOptions.PlatformType)
            {
            case PlatformType.Previous:
                return(AddSingletonPreviousSdk(serviceCollection, checkoutOptions, loggerFactory,
                                               httpClientFactory));

            case PlatformType.Default:
                return(AddSingletonDefaultSdk(serviceCollection, checkoutOptions, loggerFactory, httpClientFactory));

            case PlatformType.DefaultOAuth:
                return(AddSingletonDefaultOAuthSdk(serviceCollection, checkoutOptions, loggerFactory,
                                                   httpClientFactory));

            default:
                throw new CheckoutArgumentException($"Unsupported PlatformType:{checkoutOptions.PlatformType}");
            }
        }
Пример #12
0
 public Task <WebhookResponse> RegisterWebhook(WebhookRequest webhookRequest, string idempotencyKey = null,
                                               CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("webhookRequest", webhookRequest);
     return(ApiClient.Post <WebhookResponse>(WebhooksPath, SdkAuthorization(), webhookRequest, cancellationToken,
                                             idempotencyKey));
 }
Пример #13
0
 public Task <EventsPageResponse> RetrieveEvents(RetrieveEventsRequest eventsRequest,
                                                 CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("eventsRequest", eventsRequest);
     return(ApiClient.Query <EventsPageResponse>(EventsPath, SdkAuthorization(), eventsRequest,
                                                 cancellationToken));
 }
Пример #14
0
 public Task <RetrieveInstrumentResponse> Get(string instrumentId, CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("instrumentId", instrumentId);
     return(ApiClient.Get <RetrieveInstrumentResponse>(BuildPath(InstrumentsPath, instrumentId),
                                                       SdkAuthorization(),
                                                       cancellationToken));
 }
Пример #15
0
 public Task <EmptyResponse> Update(string customerId, CustomerRequest customerRequest,
                                    CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("customerId", customerId, "customerRequest", customerRequest);
     return(ApiClient.Patch <EmptyResponse>(BuildPath(Customers, customerId), SdkAuthorization(), customerRequest,
                                            cancellationToken));
 }
        private static GetInstrumentResponse Create(JToken jToken)
        {
            CheckoutUtils.ValidateParams("jToken", jToken);
            var sourceType = GetSourceType(jToken);

            return(Create(sourceType));
        }
Пример #17
0
 public Task <PaymentLinkResponse> Create(PaymentLinkRequest paymentLinkRequest,
                                          CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("paymentLinkRequest", paymentLinkRequest);
     return(ApiClient.Post <PaymentLinkResponse>(PaymentLinksPath, SdkAuthorization(), paymentLinkRequest,
                                                 cancellationToken, null));
 }
        private static IPaymentResponseDestination Create(JToken jToken)
        {
            CheckoutUtils.ValidateParams("jToken", jToken);
            var sourceType = GetSourceType(jToken);

            return(CreateRequest(sourceType));
        }
Пример #19
0
        private static WorkflowActionResponse Create(JToken jToken)
        {
            CheckoutUtils.ValidateParams("jToken", jToken);
            var sourceType = GetSourceType(jToken);

            return(Create(sourceType));
        }
Пример #20
0
 public Task <UpdateWorkflowResponse> UpdateWorkflow(string workflowId,
                                                     UpdateWorkflowRequest updateWorkflowRequest)
 {
     CheckoutUtils.ValidateParams(WorkflowId, workflowId, "updateWorkflowRequest", updateWorkflowRequest);
     return(ApiClient.Patch <UpdateWorkflowResponse>(BuildPath(WorkflowsPath, workflowId), SdkAuthorization(),
                                                     updateWorkflowRequest));
 }
Пример #21
0
 public Task <CreditSession> GetCreditSession(string sessionId, CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("sessionId", sessionId);
     return(ApiClient.Get <CreditSession>(BuildPath(GetBaseUrl(), CreditSessionsPath, sessionId),
                                          SdkAuthorization(),
                                          cancellationToken));
 }
Пример #22
0
 public Task <TokenResponse> Request(
     WalletTokenRequest walletTokenRequest,
     CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("walletTokenRequest", walletTokenRequest);
     return(ApiClient.Post <TokenResponse>(Tokens, SdkAuthorization(), walletTokenRequest, cancellationToken));
 }
Пример #23
0
 public async Task <GetSessionResponse> UpdateSession(string sessionSecret, string sessionId,
                                                      ChannelData channelData, CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("sessionSecret", sessionSecret, "sessionId", sessionId, "channelData",
                                  channelData);
     return(await UpdateSession(sessionId, channelData, SessionSecretAuthorization(sessionSecret),
                                cancellationToken));
 }
Пример #24
0
        public Task <IdResponse> SubmitFile(string pathToFile, string purpose,
                                            CancellationToken cancellationToken = default)
        {
            CheckoutUtils.ValidateParams("pathToFile", pathToFile, "purpose", purpose);
            var dataContent = CreateMultipartRequest(pathToFile, purpose, "file");

            return(ApiClient.Post <IdResponse>(Files, SdkAuthorization(), dataContent, cancellationToken));
        }
Пример #25
0
 public Task <EventNotificationResponse> RetrieveEventNotification(string eventId, string notificationId,
                                                                   CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("eventId", eventId, "notificationId", notificationId);
     return(ApiClient.Get <EventNotificationResponse>(
                BuildPath(EventsPath, eventId, "notifications", notificationId),
                SdkAuthorization(), cancellationToken));
 }
 public Task <HostedPaymentDetailsResponse> GetHostedPaymentsPageDetails(string hostedPaymentId,
                                                                         CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("hostedPaymentId", hostedPaymentId);
     return(ApiClient.Get <HostedPaymentDetailsResponse>(BuildPath(HostedPaymentsPath, hostedPaymentId),
                                                         SdkAuthorization(),
                                                         cancellationToken));
 }
Пример #27
0
 public Task <EmptyResponse> UpdateWorkflowCondition(string workflowId, string conditionId,
                                                     WorkflowConditionRequest workflowConditionRequest)
 {
     CheckoutUtils.ValidateParams(WorkflowId, workflowId, "conditionId", conditionId,
                                  "workflowConditionRequest", workflowConditionRequest);
     return(ApiClient.Put <EmptyResponse>(BuildPath(WorkflowsPath, workflowId, ConditionsPath, conditionId),
                                          SdkAuthorization(), workflowConditionRequest));
 }
Пример #28
0
 public Task <WebhookResponse> PatchWebhook(string webhookId, WebhookRequest webhookRequest,
                                            CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("webhookId", webhookId, "webhookRequest", webhookRequest);
     return(ApiClient.Patch <WebhookResponse>(BuildPath(WebhooksPath, webhookId), SdkAuthorization(),
                                              webhookRequest,
                                              cancellationToken));
 }
Пример #29
0
 public Task <EmptyResponse> PutEvidence(string disputeId, DisputeEvidenceRequest disputeEvidenceRequest,
                                         CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("disputeId", disputeId, "disputeEvidenceRequest", disputeEvidenceRequest);
     return(ApiClient.Put <EmptyResponse>(BuildPath(DisputesPath, disputeId, EvidencePath), SdkAuthorization(),
                                          disputeEvidenceRequest,
                                          cancellationToken));
 }
Пример #30
0
 public async Task <IdResponse> SubmitFile(AccountsFileRequest accountsFileRequest,
                                           CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("accountsFileRequest", accountsFileRequest,
                                  "accountsFileRequest.purpose", accountsFileRequest.Purpose);
     return(await SubmitFileToFilesApi(accountsFileRequest.File, accountsFileRequest.Purpose.Value,
                                       cancellationToken));
 }