コード例 #1
0
 public Task <DisputesQueryResponse> Query(DisputesQueryFilter filter,
                                           CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", filter);
     return(ApiClient.Query <DisputesQueryResponse>(DisputesPath, SdkAuthorization(), filter,
                                                    cancellationToken));
 }
コード例 #2
0
 public Task <StatementReportResponse> QueryStatementsReport(QueryFilterDateRange filter,
                                                             CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("filter", filter);
     return(ApiClient.Query <StatementReportResponse>(BuildPath(ReportingPath, StatementsPath),
                                                      SdkAuthorization(), filter, cancellationToken));
 }
コード例 #3
0
 public Task <ReconciliationPaymentReportResponse> SinglePaymentReport(string paymentId,
                                                                       CancellationToken cancellationToken = default)
 {
     CheckoutUtils.ValidateParams("paymentId", paymentId);
     return(ApiClient.Get <ReconciliationPaymentReportResponse>(BuildPath(ReportingPath, PaymentsPath, paymentId),
                                                                SdkAuthorization(), cancellationToken));
 }
コード例 #4
0
 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));
        }
コード例 #9
0
 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));
 }
コード例 #16
0
        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));
 }
コード例 #26
0
 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));
 }