@quintype/components 3.8.9-stripe-up-downgrade.0 → 3.8.9-stripe-up-downgrade.2

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/dist/cjs/index.js CHANGED
@@ -5820,6 +5820,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5820
5820
  _yield$awaitHelper12,
5821
5821
  error,
5822
5822
  switchPaymentOptions,
5823
+ payload,
5823
5824
  _args12 = arguments;
5824
5825
 
5825
5826
  return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
@@ -5844,23 +5845,20 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5844
5845
  }, options));
5845
5846
  intent = get__default["default"](options, ['intent'], 'default');
5846
5847
  switchType = get__default["default"](options, ['switchType']);
5847
- console.log("------- initStripePayment PROPS--------->", _this.props, {
5848
- intent: intent,
5849
- switchType: switchType
5850
- });
5851
5848
 
5852
- if (!(intent === "switch")) {
5853
- _context12.next = 19;
5849
+ if (!(intent === 'switch')) {
5850
+ _context12.next = 21;
5854
5851
  break;
5855
5852
  }
5856
5853
 
5857
- _context12.next = 13;
5854
+ _context12.next = 12;
5858
5855
  return awaitHelper(global.AccessType.getPaymentOptions(null, null, "switch"));
5859
5856
 
5860
- case 13:
5857
+ case 12:
5861
5858
  _yield$awaitHelper12 = _context12.sent;
5862
5859
  error = _yield$awaitHelper12.error;
5863
5860
  switchPaymentOptions = _yield$awaitHelper12.data;
5861
+ console.log("------- initStripePayment 111--------->", options === null || options === void 0 ? void 0 : options.successUrl, options === null || options === void 0 ? void 0 : options.cancelUrl, JSON.stringify(paymentObject));
5864
5862
 
5865
5863
  if (!error) {
5866
5864
  _context12.next = 18;
@@ -5870,18 +5868,26 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
5870
5868
  throw new Error("payment options fetch failed");
5871
5869
 
5872
5870
  case 18:
5873
- return _context12.abrupt("return", switchPaymentOptions.stripe.proceed(_objectSpread(_objectSpread({}, paymentObject), {}, {
5871
+ payload = _objectSpread(_objectSpread({}, paymentObject), {}, {
5874
5872
  switch_type: switchType,
5875
5873
  subscription_plan_id: options === null || options === void 0 ? void 0 : (_options$selectedPlan = options.selectedPlan) === null || _options$selectedPlan === void 0 ? void 0 : _options$selectedPlan.id,
5876
- subscriptionId: options === null || options === void 0 ? void 0 : (_options$selectedPlan2 = options.selectedPlan) === null || _options$selectedPlan2 === void 0 ? void 0 : _options$selectedPlan2.subscriptionId
5877
- })));
5874
+ subscriptionId: options === null || options === void 0 ? void 0 : (_options$selectedPlan2 = options.selectedPlan) === null || _options$selectedPlan2 === void 0 ? void 0 : _options$selectedPlan2.subscriptionId,
5875
+ urls: {
5876
+ success_url: options === null || options === void 0 ? void 0 : options.successUrl,
5877
+ cancel_url: options === null || options === void 0 ? void 0 : options.cancelUrl
5878
+ }
5879
+ });
5880
+ console.log("PAYLOAD----------", {
5881
+ payload: payload
5882
+ });
5883
+ return _context12.abrupt("return", switchPaymentOptions.stripe.proceed(payload));
5878
5884
 
5879
- case 19:
5885
+ case 21:
5880
5886
  return _context12.abrupt("return", paymentOptions.stripe ? paymentOptions.stripe.proceed(paymentObject) : Promise.reject({
5881
5887
  message: 'Payment option is loading...'
5882
5888
  }));
5883
5889
 
5884
- case 20:
5890
+ case 22:
5885
5891
  case "end":
5886
5892
  return _context12.stop();
5887
5893
  }
@@ -746,6 +746,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
746
746
  _yield$awaitHelper12,
747
747
  error,
748
748
  switchPaymentOptions,
749
+ payload,
749
750
  _args12 = arguments;
750
751
 
751
752
  return _regeneratorRuntime.wrap(function _callee12$(_context12) {
@@ -770,23 +771,20 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
770
771
  }, options));
771
772
  intent = get(options, ['intent'], 'default');
772
773
  switchType = get(options, ['switchType']);
773
- console.log("------- initStripePayment PROPS--------->", _this.props, {
774
- intent: intent,
775
- switchType: switchType
776
- });
777
774
 
778
- if (!(intent === "switch")) {
779
- _context12.next = 19;
775
+ if (!(intent === 'switch')) {
776
+ _context12.next = 21;
780
777
  break;
781
778
  }
782
779
 
783
- _context12.next = 13;
780
+ _context12.next = 12;
784
781
  return awaitHelper(global.AccessType.getPaymentOptions(null, null, "switch"));
785
782
 
786
- case 13:
783
+ case 12:
787
784
  _yield$awaitHelper12 = _context12.sent;
788
785
  error = _yield$awaitHelper12.error;
789
786
  switchPaymentOptions = _yield$awaitHelper12.data;
787
+ console.log("------- initStripePayment 111--------->", options === null || options === void 0 ? void 0 : options.successUrl, options === null || options === void 0 ? void 0 : options.cancelUrl, JSON.stringify(paymentObject));
790
788
 
791
789
  if (!error) {
792
790
  _context12.next = 18;
@@ -796,18 +794,26 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
796
794
  throw new Error("payment options fetch failed");
797
795
 
798
796
  case 18:
799
- return _context12.abrupt("return", switchPaymentOptions.stripe.proceed(_objectSpread(_objectSpread({}, paymentObject), {}, {
797
+ payload = _objectSpread(_objectSpread({}, paymentObject), {}, {
800
798
  switch_type: switchType,
801
799
  subscription_plan_id: options === null || options === void 0 ? void 0 : (_options$selectedPlan = options.selectedPlan) === null || _options$selectedPlan === void 0 ? void 0 : _options$selectedPlan.id,
802
- subscriptionId: options === null || options === void 0 ? void 0 : (_options$selectedPlan2 = options.selectedPlan) === null || _options$selectedPlan2 === void 0 ? void 0 : _options$selectedPlan2.subscriptionId
803
- })));
800
+ subscriptionId: options === null || options === void 0 ? void 0 : (_options$selectedPlan2 = options.selectedPlan) === null || _options$selectedPlan2 === void 0 ? void 0 : _options$selectedPlan2.subscriptionId,
801
+ urls: {
802
+ success_url: options === null || options === void 0 ? void 0 : options.successUrl,
803
+ cancel_url: options === null || options === void 0 ? void 0 : options.cancelUrl
804
+ }
805
+ });
806
+ console.log("PAYLOAD----------", {
807
+ payload: payload
808
+ });
809
+ return _context12.abrupt("return", switchPaymentOptions.stripe.proceed(payload));
804
810
 
805
- case 19:
811
+ case 21:
806
812
  return _context12.abrupt("return", paymentOptions.stripe ? paymentOptions.stripe.proceed(paymentObject) : Promise.reject({
807
813
  message: 'Payment option is loading...'
808
814
  }));
809
815
 
810
- case 20:
816
+ case 22:
811
817
  case "end":
812
818
  return _context12.stop();
813
819
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/components",
3
- "version": "3.8.9-stripe-up-downgrade.0",
3
+ "version": "3.8.9-stripe-up-downgrade.2",
4
4
  "description": "Components to help build Quintype Node.js apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",