Beispiel #1
0
 /// <summary>
 /// Determine whether the user can checkout by paying with their native payment solution
 /// </summary>
 /// <param name="callback">
 /// Closure that is invoked with the result.
 /// True is returned if the user is able to pay with their native payment solution
 /// </param>
 public void CanCheckoutWithNativePay(CanCheckoutWithNativePayCallback callback)
 {
     if (NativeCheckout != null)
     {
         GetShopMetadata((metadata, error) => {
             if (error != null)
             {
                 callback(false);
             }
             else
             {
                 NativeCheckout.CanCheckout(metadata.Value.PaymentSettings, callback);
             }
         });
     }
     else
     {
         callback(false);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Checks if Android Pay can be used as a checkout method on this device.
        /// </summary>
        /// <param name="paymentSettings">
        /// A <see cref="PaymentSettings"/> object used to read store payment options from.
        /// <param name="callback">
        /// A callback object to deliver the response to.
        /// </param>
        public void CanCheckout(PaymentSettings paymentSettings, CanCheckoutWithNativePayCallback callback)
        {
            if (paymentSettings.supportedDigitalWallets().Contains(DigitalWallet.ANDROID_PAY))
            {
                object[] args =
                {
                    SerializedPaymentNetworksFromCardBrands(paymentSettings.acceptedCardBrands())
                };
#if !SHOPIFY_MONO_UNIT_TEST
                AndroidPayCheckoutSession.Call("canCheckoutWithAndroidPay", args);
#endif
                if (PendingCanCheckoutWithNativePayCallback != null)
                {
                    PendingCanCheckoutWithNativePayCallback(false);
                }
                PendingCanCheckoutWithNativePayCallback = callback;
            }
            else
            {
                callback(false);
            }
        }
Beispiel #3
0
 public void CanCheckoutWithNativePay(CanCheckoutWithNativePayCallback callback)
 {
     _controller.Cart.CanCheckoutWithNativePay(callback);
 }
Beispiel #4
0
 public void CanCheckoutWithNativePay(CanCheckoutWithNativePayCallback callback)
 {
     Cart.CanCheckoutWithNativePay(callback);
 }