/// <param name="amount">
        /// The amount of the payment.
        /// </param>
        /// <param name="idempotencyKey">
        /// A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
        /// </param>
        /// <param name="billingAddress">
        /// The billing address for the payment.
        /// </param>
        /// <param name="vaultId">
        /// The ID returned by Shopify's Card Vault.
        /// </param>
        /// <param name="test">
        /// Executes the payment in test mode if possible. Defaults to `false`.
        /// </param>
        public CreditCardPaymentInput(decimal amount, string idempotencyKey, MailingAddressInput billingAddress, string vaultId, bool?test = null)
        {
            Set(amountFieldKey, amount);

            Set(idempotencyKeyFieldKey, idempotencyKey);

            Set(billingAddressFieldKey, billingAddress);

            Set(vaultIdFieldKey, vaultId);

            if (test != null)
            {
                Set(testFieldKey, test);
            }
        }
        /// <param name="amount">
        /// The amount of the payment.
        /// </param>
        /// <param name="idempotencyKey">
        /// A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one.
        /// </param>
        /// <param name="billingAddress">
        /// The billing address for the payment.
        /// </param>
        /// <param name="type">
        /// The type of payment token.
        /// </param>
        /// <param name="paymentData">
        /// A simple string or JSON containing the required payment data for the tokenized payment.
        /// </param>
        /// <param name="test">
        /// Executes the payment in test mode if possible. Defaults to `false`.
        /// </param>
        /// <param name="identifier">
        /// Public Hash Key used for AndroidPay payments only.
        /// </param>
        public TokenizedPaymentInput(decimal amount, string idempotencyKey, MailingAddressInput billingAddress, string type, string paymentData, bool?test = null, string identifier = null)
        {
            Set(amountFieldKey, amount);

            Set(idempotencyKeyFieldKey, idempotencyKey);

            Set(billingAddressFieldKey, billingAddress);

            Set(typeFieldKey, type);

            Set(paymentDataFieldKey, paymentData);

            if (test != null)
            {
                Set(testFieldKey, test);
            }

            if (identifier != null)
            {
                Set(identifierFieldKey, identifier);
            }
        }
        public void SetShippingAddress(MailingAddressInput mailingAddressInput, CompletionCallback callback)
        {
            MutationQuery query = new MutationQuery();

            DefaultQueries.checkout.ShippingAddressUpdate(query, CurrentCheckout.id(), mailingAddressInput);

            Client.Mutation(query, (Mutation response, ShopifyError error) => {
                if (error != null)
                {
                    callback(error);
                }
                else
                {
                    if (UpdateState(response.checkoutShippingAddressUpdateV2().checkout(), response.checkoutShippingAddressUpdateV2().userErrors()))
                    {
                        PollCheckoutAndUpdate(PollCheckoutAvailableShippingRatesReady, callback);
                    }
                    else
                    {
                        HandleUserError(callback);
                    }
                }
            });
        }
Exemple #4
0
        /// <param name="email">
        /// The email with which the customer wants to checkout.
        /// </param>
        /// <param name="lineItems">
        /// A list of line item objects, each one containing information about an item in the checkout.
        /// </param>
        /// <param name="shippingAddress">
        /// The shipping address to where the line items will be shipped.
        /// </param>
        /// <param name="note">
        /// The text of an optional note that a shop owner can attach to the checkout.
        /// </param>
        /// <param name="customAttributes">
        /// A list of extra information that is added to the checkout.
        /// </param>
        /// <param name="allowPartialAddresses">
        /// Allows setting partial addresses on a Checkout, skipping the full validation of attributes.
        /// The required attributes are city, province, and country.
        /// Full validation of addresses is still done at complete time.
        /// </param>
        /// <param name="presentmentCurrencyCode">
        /// The three-letter currency code of one of the shop's enabled presentment currencies.
        /// Including this field creates a checkout in the specified currency. By default, new
        /// checkouts are created in the shop's primary currency.
        /// </param>
        public CheckoutCreateInput(string email = null, List <CheckoutLineItemInput> lineItems = null, MailingAddressInput shippingAddress = null, string note = null, List <AttributeInput> customAttributes = null, bool?allowPartialAddresses = null, CurrencyCode?presentmentCurrencyCode = null)
        {
            if (email != null)
            {
                Set(emailFieldKey, email);
            }

            if (lineItems != null)
            {
                Set(lineItemsFieldKey, lineItems);
            }

            if (shippingAddress != null)
            {
                Set(shippingAddressFieldKey, shippingAddress);
            }

            if (note != null)
            {
                Set(noteFieldKey, note);
            }

            if (customAttributes != null)
            {
                Set(customAttributesFieldKey, customAttributes);
            }

            if (allowPartialAddresses != null)
            {
                Set(allowPartialAddressesFieldKey, allowPartialAddresses);
            }

            if (presentmentCurrencyCode != null)
            {
                Set(presentmentCurrencyCodeFieldKey, presentmentCurrencyCode);
            }
        }
 public ShippingFields(MailingAddressInput shippingAddress, string shippingIdentifier)
 {
     ShippingIdentifier = shippingIdentifier;
     ShippingAddress    = shippingAddress;
 }