public IResponse Visit(CreateProposedOrderRequest request)
 {
     return(_restWrapper.Post <CreateProposedOrderRequestBody, ProposedOrderResponse>(request.Body,
                                                                                      uri: GetEndpoint(request),
                                                                                      accessTokenHeader: GetHeaderToken(request),
                                                                                      actions: GetCustomResponseHandlers(request)));
 }
示例#2
0
        public ProposedOrderResponse CreateProposedOrder(string accessToken, int locationId, string qrPaymentData,
                                                         int totalOutstandingAmountCents, int spendAmountCents,
                                                         int?taxAmountCents, int exemptionAmountCents, string register,
                                                         string cashier, string identifierFromMerchant,
                                                         string receiptMessageHtml, bool partialAuthorizationAllowed,
                                                         bool discountOnly, IList <Item> items)
        {
            // Adjust spend/tax/exemption amounts in situations where there are multiple payments on a single check.
            var adjustmentsForPartialPayments = ProposedOrderCalculator.CalculateCreateProposedOrderValues(
                totalOutstandingAmountCents, taxAmountCents ?? 0, exemptionAmountCents, spendAmountCents);

            CreateProposedOrderRequest request = new CreateProposedOrderRequest(accessToken, locationId, qrPaymentData,
                                                                                adjustmentsForPartialPayments.SpendAmount,
                                                                                adjustmentsForPartialPayments.TaxAmount,
                                                                                adjustmentsForPartialPayments.ExemptionAmount,
                                                                                register, cashier, identifierFromMerchant,
                                                                                receiptMessageHtml, partialAuthorizationAllowed,
                                                                                discountOnly, items);

            return(_restWrapper.Post <CreateProposedOrderRequestBody, ProposedOrderResponse>(
                       request.Body,
                       uri: BuildUri(request.ApiVersion, "proposed_orders"),
                       accessTokenHeader: FormatAccessTokenString(merchantUserAccessToken: request.AccessToken),
                       actions: null));
        }
        public ProposedOrderResponse CreateProposedOrder(string accessToken, int locationId, string qrPaymentData,
                                                         int totalOutstandingAmountCents, int spendAmountCents,
                                                         int?taxAmountCents, int exemptionAmountCents, string register,
                                                         string cashier, string identifierFromMerchant,
                                                         string receiptMessageHtml, bool partialAuthorizationAllowed,
                                                         IList <Item> items)
        {
            // Adjust spend/tax/exemption amounts in situations where there are multiple payments on a single check.
            var adjustmentsForPartialPayments = ProposedOrderCalculator.CalculateCreateProposedOrderValues(
                totalOutstandingAmountCents, taxAmountCents ?? 0, exemptionAmountCents, spendAmountCents);

            CreateProposedOrderRequest request = new CreateProposedOrderRequest(accessToken, locationId, qrPaymentData,
                                                                                adjustmentsForPartialPayments.SpendAmount,
                                                                                adjustmentsForPartialPayments.TaxAmount,
                                                                                adjustmentsForPartialPayments.ExemptionAmount,
                                                                                register, cashier, identifierFromMerchant,
                                                                                receiptMessageHtml, partialAuthorizationAllowed, items);

            return(request.Accept(_engine) as ProposedOrderResponse);
        }
 public override string Visit(CreateProposedOrderRequest request)
 {
     return(FormatAccessTokenString(merchantUserAccessToken: request.AccessToken));
 }
示例#5
0
 public virtual T Visit(CreateProposedOrderRequest request)
 {
     return(DEFAULT_FUNC(request));
 }
 public string Visit(CreateProposedOrderRequest request)
 {
     return(BuildUri(request.ApiVersion, "proposed_orders"));
 }