@lana-commerce/core 12.0.0-alpha.2 → 12.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,16 @@ This project adheres to [Semantic Versioning][semantic versioning].
9
9
  ### Major Changes
10
10
 
11
11
  - Add new helper class PinInput. Refactor SixDigitInput to use it. Note that SixDigitInput's property is now called "onEnteredAllDigits" instead of "onEnteredSixDigits".
12
+ - Remove deprecated stripe payment method integrations:
13
+ - amex express checkout
14
+ - masterpass
15
+ - visa checkout
16
+ - giropay
17
+ - sofort
18
+
19
+ ### Minor Changes
20
+
21
+ - Add "shopPreviewURL" helper function.
12
22
 
13
23
  ### Patch Changes
14
24
 
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "fragment GatewayStripe on GatewayStripe{account_id amex_express_checkout{client_id enabled}auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}masterpass{checkout_id enabled}payment_methods{alipay bancontact giropay eps ideal multibanco p24 sofort wechat}send_authorized_order_notifications visa_checkout{checkout_id enabled}publishable_key}\n";
3
+ exports.default = "fragment GatewayStripe on GatewayStripe{account_id auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}payment_methods{alipay bancontact eps ideal multibanco p24 wechat}send_authorized_order_notifications publishable_key}\n";
package/cjs/shopLinks.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shopSubscriptionURL = exports.shopUnsubscribeURL = exports.shopRemoteURL = exports.shopConnectURL = exports.shopQuestionURL = exports.shopReviewURL = exports.shopNewPasswordURL = exports.shopPasswordResetURL = exports.shopEmailConfirmationURL = exports.shopCheckoutTrackingURL = exports.shopCheckoutOrderURL = exports.shopCheckoutBaseURL = exports.shopBuyURL = void 0;
3
+ exports.shopPreviewURL = exports.shopSubscriptionURL = exports.shopUnsubscribeURL = exports.shopRemoteURL = exports.shopConnectURL = exports.shopQuestionURL = exports.shopReviewURL = exports.shopNewPasswordURL = exports.shopPasswordResetURL = exports.shopEmailConfirmationURL = exports.shopCheckoutTrackingURL = exports.shopCheckoutOrderURL = exports.shopCheckoutBaseURL = exports.shopBuyURL = void 0;
4
4
  const shopDomain_js_1 = require("./shopDomain.js");
5
5
  function domain(shop) {
6
6
  return typeof shop === "string" ? shop : (0, shopDomain_js_1.shopDomain)(shop);
@@ -61,3 +61,7 @@ function shopSubscriptionURL(shop, subscriptionID, email) {
61
61
  return `https://${domain(shop)}/subscriptions/${encodeURIComponent(subscriptionID)}/${encodeURIComponent(email)}`;
62
62
  }
63
63
  exports.shopSubscriptionURL = shopSubscriptionURL;
64
+ function shopPreviewURL(shop) {
65
+ return `https://${domain(shop)}/preview`;
66
+ }
67
+ exports.shopPreviewURL = shopPreviewURL;
@@ -1 +1 @@
1
- export default "fragment GatewayStripe on GatewayStripe{account_id amex_express_checkout{client_id enabled}auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}masterpass{checkout_id enabled}payment_methods{alipay bancontact giropay eps ideal multibanco p24 sofort wechat}send_authorized_order_notifications visa_checkout{checkout_id enabled}publishable_key}\n";
1
+ export default "fragment GatewayStripe on GatewayStripe{account_id auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}payment_methods{alipay bancontact eps ideal multibanco p24 wechat}send_authorized_order_notifications publishable_key}\n";
package/esm/shopLinks.js CHANGED
@@ -45,3 +45,6 @@ export function shopUnsubscribeURL(shop, token, email) {
45
45
  export function shopSubscriptionURL(shop, subscriptionID, email) {
46
46
  return `https://${domain(shop)}/subscriptions/${encodeURIComponent(subscriptionID)}/${encodeURIComponent(email)}`;
47
47
  }
48
+ export function shopPreviewURL(shop) {
49
+ return `https://${domain(shop)}/preview`;
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lana-commerce/core",
3
- "version": "12.0.0-alpha.2",
3
+ "version": "12.0.0-alpha.4",
4
4
  "description": "Lana JS Core",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -1,2 +1,2 @@
1
- declare const _default: "fragment GatewayStripe on GatewayStripe{account_id amex_express_checkout{client_id enabled}auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}masterpass{checkout_id enabled}payment_methods{alipay bancontact giropay eps ideal multibanco p24 sofort wechat}send_authorized_order_notifications visa_checkout{checkout_id enabled}publishable_key}\n";
1
+ declare const _default: "fragment GatewayStripe on GatewayStripe{account_id auto_capture card_tokenization cards{amex diners discover jcb mastercard unionpay visa}payment_methods{alipay bancontact eps ideal multibanco p24 wechat}send_authorized_order_notifications publishable_key}\n";
2
2
  export default _default;
@@ -890,10 +890,6 @@ export interface GatewayPaypalFragment {
890
890
  }
891
891
  export interface GatewayStripeFragment {
892
892
  account_id: string;
893
- amex_express_checkout: {
894
- client_id: string;
895
- enabled: boolean;
896
- };
897
893
  auto_capture: boolean;
898
894
  card_tokenization: boolean;
899
895
  cards: {
@@ -905,27 +901,17 @@ export interface GatewayStripeFragment {
905
901
  unionpay: boolean;
906
902
  visa: boolean;
907
903
  };
908
- masterpass: {
909
- checkout_id: string;
910
- enabled: boolean;
911
- };
912
904
  payment_methods: {
913
905
  alipay: boolean;
914
906
  bancontact: boolean;
915
907
  eps: boolean;
916
- giropay: boolean;
917
908
  ideal: boolean;
918
909
  multibanco: boolean;
919
910
  p24: boolean;
920
- sofort: boolean;
921
911
  wechat: boolean;
922
912
  };
923
913
  publishable_key: string;
924
914
  send_authorized_order_notifications: boolean;
925
- visa_checkout: {
926
- checkout_id: string;
927
- enabled: boolean;
928
- };
929
915
  }
930
916
  export interface GatewayTestFragment {
931
917
  auto_capture: boolean;
@@ -2038,16 +2038,12 @@ export interface GatewayPaypalFundingCreate {
2038
2038
  export interface GatewayStripe {
2039
2039
  /** Account id of the connected stripe account */
2040
2040
  account_id: string;
2041
- /** Enable/disable Amex Express Checkout */
2042
- amex_express_checkout: GatewayStripeAmexExpressCheckout;
2043
2041
  /** Automatically capture authorized orders */
2044
2042
  auto_capture: boolean;
2045
2043
  /** Whether it's allowed to tokenize (save) cards for future use or not */
2046
2044
  card_tokenization: boolean;
2047
2045
  /** Enable/disable credit cards per-type */
2048
2046
  cards: GatewayStripeCards;
2049
- /** Enable/disable Masterpass */
2050
- masterpass: GatewayStripeMasterpass;
2051
2047
  /** Use stripe's MOTO options on payment intent transaction */
2052
2048
  moto: boolean;
2053
2049
  /** Enable/disable additional payment methods */
@@ -2056,16 +2052,6 @@ export interface GatewayStripe {
2056
2052
  publishable_key: string;
2057
2053
  /** Send about to expire authorized orders notification (when auto_capture is false) */
2058
2054
  send_authorized_order_notifications: boolean;
2059
- /** Enable/disable Visa Checkout */
2060
- visa_checkout: GatewayStripeVisaCheckout;
2061
- }
2062
- export interface GatewayStripeAmexExpressCheckout {
2063
- client_id: string;
2064
- enabled: boolean;
2065
- }
2066
- export interface GatewayStripeAmexExpressCheckoutCreate {
2067
- client_id: string;
2068
- enabled: boolean;
2069
2055
  }
2070
2056
  export interface GatewayStripeCards {
2071
2057
  amex: boolean;
@@ -2086,8 +2072,6 @@ export interface GatewayStripeCardsCreate {
2086
2072
  visa: boolean;
2087
2073
  }
2088
2074
  export interface GatewayStripeCreate {
2089
- /** Enable/disable Amex Express Checkout */
2090
- amex_express_checkout: GatewayStripeAmexExpressCheckoutCreate;
2091
2075
  /** Automatically capture authorized orders */
2092
2076
  auto_capture: boolean;
2093
2077
  /** Whether it's allowed to tokenize (save) cards for future use or not */
@@ -2095,55 +2079,31 @@ export interface GatewayStripeCreate {
2095
2079
  /** Enable/disable credit cards per-type */
2096
2080
  cards: GatewayStripeCardsCreate;
2097
2081
  code: string;
2098
- /** Enable/disable Masterpass */
2099
- masterpass: GatewayStripeMasterpassCreate;
2100
2082
  /** Use stripe's MOTO options on payment intent transaction */
2101
2083
  moto: boolean;
2102
2084
  /** Enable/disable additional payment methods */
2103
2085
  payment_methods: GatewayStripePaymentMethodsCreate;
2104
2086
  /** Send about to expire authorized orders notification (when auto_capture is false) */
2105
2087
  send_authorized_order_notifications: boolean;
2106
- /** Enable/disable Visa Checkout */
2107
- visa_checkout: GatewayStripeVisaCheckoutCreate;
2108
- }
2109
- export interface GatewayStripeMasterpass {
2110
- checkout_id: string;
2111
- enabled: boolean;
2112
- }
2113
- export interface GatewayStripeMasterpassCreate {
2114
- checkout_id: string;
2115
- enabled: boolean;
2116
2088
  }
2117
2089
  export interface GatewayStripePaymentMethods {
2118
2090
  alipay: boolean;
2119
2091
  bancontact: boolean;
2120
2092
  eps: boolean;
2121
- giropay: boolean;
2122
2093
  ideal: boolean;
2123
2094
  multibanco: boolean;
2124
2095
  p24: boolean;
2125
- sofort: boolean;
2126
2096
  wechat: boolean;
2127
2097
  }
2128
2098
  export interface GatewayStripePaymentMethodsCreate {
2129
2099
  alipay: boolean;
2130
2100
  bancontact: boolean;
2131
2101
  eps: boolean;
2132
- giropay: boolean;
2133
2102
  ideal: boolean;
2134
2103
  multibanco: boolean;
2135
2104
  p24: boolean;
2136
- sofort: boolean;
2137
2105
  wechat: boolean;
2138
2106
  }
2139
- export interface GatewayStripeVisaCheckout {
2140
- checkout_id: string;
2141
- enabled: boolean;
2142
- }
2143
- export interface GatewayStripeVisaCheckoutCreate {
2144
- checkout_id: string;
2145
- enabled: boolean;
2146
- }
2147
2107
  export interface GatewayTest {
2148
2108
  /** Automatically capture authorized orders */
2149
2109
  auto_capture: boolean;
@@ -4094,12 +4054,6 @@ export interface OrderPayment {
4094
4054
  payment_method?: string | null;
4095
4055
  /** Use it to perform gateway payment (when gateway type is "paypal") */
4096
4056
  paypal?: OrderPaymentPaypal | null;
4097
- /** Use it to perform gateway payment (when gateway type is "stripe") */
4098
- source?: string | null;
4099
- /** Use it to perform gateway payment (when gateway type is "stripe", for saved cards) */
4100
- stripe?: OrderPaymentStripe | null;
4101
- /** Use it to perform gateway payment (when gateway type is "stripe") */
4102
- token?: string | null;
4103
4057
  }
4104
4058
  export interface OrderPaymentCreditCard {
4105
4059
  /** Expiration month */
@@ -4123,12 +4077,6 @@ export interface OrderPaymentPaypal {
4123
4077
  /** Patch the order with final price before authorizing */
4124
4078
  patch: boolean;
4125
4079
  }
4126
- export interface OrderPaymentStripe {
4127
- /** Stripe customer id to apply charge to */
4128
- customer_id: string;
4129
- /** Stripe payment source id to apply charge to */
4130
- source_id: string;
4131
- }
4132
4080
  export interface OrderRefund {
4133
4081
  /** Amount of money to refund to customer's balance */
4134
4082
  customer_balance?: number | null;
@@ -475,16 +475,12 @@ export interface GatewayPaypalFunding {
475
475
  export interface GatewayStripe {
476
476
  /** Account id of the connected stripe account */
477
477
  account_id: string;
478
- /** Enable/disable Amex Express Checkout */
479
- amex_express_checkout: GatewayStripeAmexExpressCheckout;
480
478
  /** Automatically capture authorized orders */
481
479
  auto_capture: boolean;
482
480
  /** Whether it's allowed to tokenize (save) cards for future use or not */
483
481
  card_tokenization: boolean;
484
482
  /** Enable/disable credit cards per-type */
485
483
  cards: GatewayStripeCards;
486
- /** Enable/disable Masterpass */
487
- masterpass: GatewayStripeMasterpass;
488
484
  /** Use stripe's MOTO options on payment intent transaction */
489
485
  moto: boolean;
490
486
  /** Enable/disable additional payment methods */
@@ -493,12 +489,6 @@ export interface GatewayStripe {
493
489
  publishable_key: string;
494
490
  /** Send about to expire authorized orders notification (when auto_capture is false) */
495
491
  send_authorized_order_notifications: boolean;
496
- /** Enable/disable Visa Checkout */
497
- visa_checkout: GatewayStripeVisaCheckout;
498
- }
499
- export interface GatewayStripeAmexExpressCheckout {
500
- client_id: string;
501
- enabled: boolean;
502
492
  }
503
493
  export interface GatewayStripeCards {
504
494
  amex: boolean;
@@ -509,25 +499,15 @@ export interface GatewayStripeCards {
509
499
  unionpay: boolean;
510
500
  visa: boolean;
511
501
  }
512
- export interface GatewayStripeMasterpass {
513
- checkout_id: string;
514
- enabled: boolean;
515
- }
516
502
  export interface GatewayStripePaymentMethods {
517
503
  alipay: boolean;
518
504
  bancontact: boolean;
519
505
  eps: boolean;
520
- giropay: boolean;
521
506
  ideal: boolean;
522
507
  multibanco: boolean;
523
508
  p24: boolean;
524
- sofort: boolean;
525
509
  wechat: boolean;
526
510
  }
527
- export interface GatewayStripeVisaCheckout {
528
- checkout_id: string;
529
- enabled: boolean;
530
- }
531
511
  export interface GatewayTest {
532
512
  /** Automatically capture authorized orders */
533
513
  auto_capture: boolean;
@@ -933,12 +913,6 @@ export interface OrderPayment {
933
913
  payment_method?: string | null;
934
914
  /** Use it to perform gateway payment (when gateway type is "paypal") */
935
915
  paypal?: OrderPaymentPaypal | null;
936
- /** Use it to perform gateway payment (when gateway type is "stripe") */
937
- source?: string | null;
938
- /** Use it to perform gateway payment (when gateway type is "stripe", for saved cards) */
939
- stripe?: OrderPaymentStripe | null;
940
- /** Use it to perform gateway payment (when gateway type is "stripe") */
941
- token?: string | null;
942
916
  }
943
917
  export interface OrderPaymentCreditCard {
944
918
  /** Expiration month */
@@ -962,12 +936,6 @@ export interface OrderPaymentPaypal {
962
936
  /** Patch the order with final price before authorizing */
963
937
  patch: boolean;
964
938
  }
965
- export interface OrderPaymentStripe {
966
- /** Stripe customer id to apply charge to */
967
- customer_id: string;
968
- /** Stripe payment source id to apply charge to */
969
- source_id: string;
970
- }
971
939
  export type OrderSourceName = "admin" | "subscription" | "web";
972
940
  export type OrderState = "authorize_payment" | "capture_payment" | "cart" | "imported" | "manual_payment" | "reserved";
973
941
  export interface PaymentDetail {
@@ -12,3 +12,4 @@ export declare function shopConnectURL(shop: ShopLike | string): string;
12
12
  export declare function shopRemoteURL(shop: ShopLike | string): string;
13
13
  export declare function shopUnsubscribeURL(shop: ShopLike | string, token: string, email: string): string;
14
14
  export declare function shopSubscriptionURL(shop: ShopLike | string, subscriptionID: string, email: string): string;
15
+ export declare function shopPreviewURL(shop: ShopLike | string): string;