@quintype/components 3.0.2 → 3.0.3-paytrail.0
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 +24 -0
- package/dist/es/components/access-type.js +24 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -5142,6 +5142,29 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5142
5142
|
return new Promise(adyenExecutor);
|
|
5143
5143
|
});
|
|
5144
5144
|
|
|
5145
|
+
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initPaytrailPayment", function () {
|
|
5146
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5147
|
+
|
|
5148
|
+
if (!options.selectedPlan) {
|
|
5149
|
+
console.warn("Paytrail needs a plan");
|
|
5150
|
+
return false;
|
|
5151
|
+
}
|
|
5152
|
+
|
|
5153
|
+
var paymentOptions = _this.props.paymentOptions;
|
|
5154
|
+
var paymentType = get__default["default"](options.selectedPlan, ["recurring"]) ? "paypal_recurring" : "paypal";
|
|
5155
|
+
|
|
5156
|
+
var paymentObject = _this.makePaymentObject(_objectSpread({
|
|
5157
|
+
paymentType: paymentType
|
|
5158
|
+
}, options));
|
|
5159
|
+
|
|
5160
|
+
console.log("paymentObject------------", paymentObject);
|
|
5161
|
+
return paymentOptions.paytrail ? paymentOptions.paytrail.proceed(paymentObject).then(function (response) {
|
|
5162
|
+
return response.proceed(paymentObject);
|
|
5163
|
+
}) : Promise.reject({
|
|
5164
|
+
message: "Payment option is loading..."
|
|
5165
|
+
});
|
|
5166
|
+
});
|
|
5167
|
+
|
|
5145
5168
|
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "pingBackMeteredStory", /*#__PURE__*/function () {
|
|
5146
5169
|
var _ref12 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(asset, accessData) {
|
|
5147
5170
|
return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
|
|
@@ -5419,6 +5442,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5419
5442
|
initPaypalPayment: this.initPaypalPayment,
|
|
5420
5443
|
initOmisePayment: this.initOmisePayment,
|
|
5421
5444
|
initAdyenPayment: this.initAdyenPayment,
|
|
5445
|
+
initPaytrailPayment: this.initPaytrailPayment,
|
|
5422
5446
|
checkAccess: this.checkAccess,
|
|
5423
5447
|
getSubscriptionForUser: this.getSubscriptionForUser,
|
|
5424
5448
|
accessUpdated: this.props.accessUpdated,
|
|
@@ -668,6 +668,29 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
668
668
|
return new Promise(adyenExecutor);
|
|
669
669
|
});
|
|
670
670
|
|
|
671
|
+
_defineProperty(_assertThisInitialized(_this), "initPaytrailPayment", function () {
|
|
672
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
673
|
+
|
|
674
|
+
if (!options.selectedPlan) {
|
|
675
|
+
console.warn("Paytrail needs a plan");
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
var paymentOptions = _this.props.paymentOptions;
|
|
680
|
+
var paymentType = get(options.selectedPlan, ["recurring"]) ? "paypal_recurring" : "paypal";
|
|
681
|
+
|
|
682
|
+
var paymentObject = _this.makePaymentObject(_objectSpread({
|
|
683
|
+
paymentType: paymentType
|
|
684
|
+
}, options));
|
|
685
|
+
|
|
686
|
+
console.log("paymentObject------------", paymentObject);
|
|
687
|
+
return paymentOptions.paytrail ? paymentOptions.paytrail.proceed(paymentObject).then(function (response) {
|
|
688
|
+
return response.proceed(paymentObject);
|
|
689
|
+
}) : Promise.reject({
|
|
690
|
+
message: "Payment option is loading..."
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
|
|
671
694
|
_defineProperty(_assertThisInitialized(_this), "pingBackMeteredStory", /*#__PURE__*/function () {
|
|
672
695
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(asset, accessData) {
|
|
673
696
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
@@ -945,6 +968,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
945
968
|
initPaypalPayment: this.initPaypalPayment,
|
|
946
969
|
initOmisePayment: this.initOmisePayment,
|
|
947
970
|
initAdyenPayment: this.initAdyenPayment,
|
|
971
|
+
initPaytrailPayment: this.initPaytrailPayment,
|
|
948
972
|
checkAccess: this.checkAccess,
|
|
949
973
|
getSubscriptionForUser: this.getSubscriptionForUser,
|
|
950
974
|
accessUpdated: this.props.accessUpdated,
|