@quintype/components 3.1.4 → 3.1.5-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 +36 -1
- package/dist/es/components/access-type.js +36 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -5238,6 +5238,28 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5238
5238
|
return new Promise(adyenExecutor);
|
|
5239
5239
|
});
|
|
5240
5240
|
|
|
5241
|
+
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initPaytrailPayment", function () {
|
|
5242
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5243
|
+
|
|
5244
|
+
if (!options.selectedPlan) {
|
|
5245
|
+
console.warn("Paytrail needs a plan");
|
|
5246
|
+
return false;
|
|
5247
|
+
}
|
|
5248
|
+
|
|
5249
|
+
var paymentOptions = _this.props.paymentOptions;
|
|
5250
|
+
var paymentType = get__default["default"](options.selectedPlan, ["recurring"]) ? "paytrail_recurring" : "paytrail";
|
|
5251
|
+
|
|
5252
|
+
var paymentObject = _this.makePaymentObject(_objectSpread({
|
|
5253
|
+
paymentType: paymentType
|
|
5254
|
+
}, options));
|
|
5255
|
+
|
|
5256
|
+
return paymentOptions.paytrail ? paymentOptions.paytrail.proceed(paymentObject).then(function (response) {
|
|
5257
|
+
return response.proceed(paymentObject);
|
|
5258
|
+
}) : Promise.reject({
|
|
5259
|
+
message: "Payment option is loading..."
|
|
5260
|
+
});
|
|
5261
|
+
});
|
|
5262
|
+
|
|
5241
5263
|
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "pingBackMeteredStory", /*#__PURE__*/function () {
|
|
5242
5264
|
var _ref12 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(asset, accessData) {
|
|
5243
5265
|
return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
|
|
@@ -5515,6 +5537,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
5515
5537
|
initPaypalPayment: this.initPaypalPayment,
|
|
5516
5538
|
initOmisePayment: this.initOmisePayment,
|
|
5517
5539
|
initAdyenPayment: this.initAdyenPayment,
|
|
5540
|
+
initPaytrailPayment: this.initPaytrailPayment,
|
|
5518
5541
|
checkAccess: this.checkAccess,
|
|
5519
5542
|
getSubscriptionForUser: this.getSubscriptionForUser,
|
|
5520
5543
|
accessUpdated: this.props.accessUpdated,
|
|
@@ -5597,6 +5620,7 @@ var mapDispatchToProps$1 = function mapDispatchToProps(dispatch) {
|
|
|
5597
5620
|
* initPaypalPayment| options(object), options={argType: "options",selectedPlan: selectedPlanObj,planType: planType,couponCode: "", recipientSubscriber: {}, returnUrl: "",cancelUrl:""} | Initialize the PayPal payment
|
|
5598
5621
|
* initOmisePayment| selectedPlan(object), planType(string) | Initialize the Omise payment
|
|
5599
5622
|
* initAdyenPayment| selectedPlan(object), planType(string), AdyenModal(React Component), locale(string) | Initialize Adyen Payment
|
|
5623
|
+
* initPaytrailPayment| selectedPlan(object), ptions={selectedPlan: selectedPlanObj,planType: planType,couponCode: "", recipientSubscriber: {}, returnUrl: "",cancelUrl:""} | Initialize the Paytrail payment
|
|
5600
5624
|
* getAssetPlans| storyId(string) | Get Asset Subscription Plans
|
|
5601
5625
|
* getSubscriberMetadata| Get the Subscriber Metadata
|
|
5602
5626
|
* setSubscriberMetadata| subscriberMetadata(object), subscriberMetadata={"address": {
|
|
@@ -5653,7 +5677,7 @@ var mapDispatchToProps$1 = function mapDispatchToProps(dispatch) {
|
|
|
5653
5677
|
* stagingHost="https://staging.accesstype.com"
|
|
5654
5678
|
* accessTypeBkIntegrationId={accessTypeBkIntegrationId}
|
|
5655
5679
|
* >
|
|
5656
|
-
* {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, getSubscriptionForUser, getSubscriberMetadata, setSubscriberMetadata }) => (
|
|
5680
|
+
* {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, initPaytrailPayment, getSubscriptionForUser, getSubscriberMetadata, setSubscriberMetadata }) => (
|
|
5657
5681
|
* <div>
|
|
5658
5682
|
* <PaymentCheckoutLayout
|
|
5659
5683
|
* accessIsLoading={accessIsLoading}
|
|
@@ -5663,6 +5687,7 @@ var mapDispatchToProps$1 = function mapDispatchToProps(dispatch) {
|
|
|
5663
5687
|
* initRazorPayPayment={initRazorPayPayment}
|
|
5664
5688
|
* initStripePayment={initStripePayment}
|
|
5665
5689
|
* initPaypalPayment={initPaypalPayment}
|
|
5690
|
+
* initPaytrailPayment={initPaytrailPayment}
|
|
5666
5691
|
* getSubscriptionForUser={getSubscriptionForUser}
|
|
5667
5692
|
* getgetSubscriberMetadata={getgetSubscriberMetadata}
|
|
5668
5693
|
* setSubscriberMetadata={setSubscriberMetadata}
|
|
@@ -5702,6 +5727,16 @@ var mapDispatchToProps$1 = function mapDispatchToProps(dispatch) {
|
|
|
5702
5727
|
* return props.initPaypalPayment(options);
|
|
5703
5728
|
* }
|
|
5704
5729
|
*
|
|
5730
|
+
* if (paymentGateway === "paytrail") {
|
|
5731
|
+
* const options = {
|
|
5732
|
+
* selectedPlan: plan,
|
|
5733
|
+
* planType: "standard",
|
|
5734
|
+
* returnUrl: `${document.location.origin}/paytrail-success.html`,
|
|
5735
|
+
* cancelUrl: `${document.location.origin}/paytrail-cancel.html`
|
|
5736
|
+
* };
|
|
5737
|
+
* return props.initPaytrailPayment(options);
|
|
5738
|
+
* }
|
|
5739
|
+
*
|
|
5705
5740
|
* if (paymentGateway === "omise") {
|
|
5706
5741
|
* return props.initOmisePayment(plan, "standard");
|
|
5707
5742
|
* }
|
|
@@ -668,6 +668,28 @@ 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"]) ? "paytrail_recurring" : "paytrail";
|
|
681
|
+
|
|
682
|
+
var paymentObject = _this.makePaymentObject(_objectSpread({
|
|
683
|
+
paymentType: paymentType
|
|
684
|
+
}, options));
|
|
685
|
+
|
|
686
|
+
return paymentOptions.paytrail ? paymentOptions.paytrail.proceed(paymentObject).then(function (response) {
|
|
687
|
+
return response.proceed(paymentObject);
|
|
688
|
+
}) : Promise.reject({
|
|
689
|
+
message: "Payment option is loading..."
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
|
|
671
693
|
_defineProperty(_assertThisInitialized(_this), "pingBackMeteredStory", /*#__PURE__*/function () {
|
|
672
694
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(asset, accessData) {
|
|
673
695
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
@@ -945,6 +967,7 @@ var AccessTypeBase = /*#__PURE__*/function (_React$Component) {
|
|
|
945
967
|
initPaypalPayment: this.initPaypalPayment,
|
|
946
968
|
initOmisePayment: this.initOmisePayment,
|
|
947
969
|
initAdyenPayment: this.initAdyenPayment,
|
|
970
|
+
initPaytrailPayment: this.initPaytrailPayment,
|
|
948
971
|
checkAccess: this.checkAccess,
|
|
949
972
|
getSubscriptionForUser: this.getSubscriptionForUser,
|
|
950
973
|
accessUpdated: this.props.accessUpdated,
|
|
@@ -1027,6 +1050,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
1027
1050
|
* initPaypalPayment| options(object), options={argType: "options",selectedPlan: selectedPlanObj,planType: planType,couponCode: "", recipientSubscriber: {}, returnUrl: "",cancelUrl:""} | Initialize the PayPal payment
|
|
1028
1051
|
* initOmisePayment| selectedPlan(object), planType(string) | Initialize the Omise payment
|
|
1029
1052
|
* initAdyenPayment| selectedPlan(object), planType(string), AdyenModal(React Component), locale(string) | Initialize Adyen Payment
|
|
1053
|
+
* initPaytrailPayment| selectedPlan(object), ptions={selectedPlan: selectedPlanObj,planType: planType,couponCode: "", recipientSubscriber: {}, returnUrl: "",cancelUrl:""} | Initialize the Paytrail payment
|
|
1030
1054
|
* getAssetPlans| storyId(string) | Get Asset Subscription Plans
|
|
1031
1055
|
* getSubscriberMetadata| Get the Subscriber Metadata
|
|
1032
1056
|
* setSubscriberMetadata| subscriberMetadata(object), subscriberMetadata={"address": {
|
|
@@ -1083,7 +1107,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
1083
1107
|
* stagingHost="https://staging.accesstype.com"
|
|
1084
1108
|
* accessTypeBkIntegrationId={accessTypeBkIntegrationId}
|
|
1085
1109
|
* >
|
|
1086
|
-
* {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, getSubscriptionForUser, getSubscriberMetadata, setSubscriberMetadata }) => (
|
|
1110
|
+
* {({ initAccessType, checkAccess, accessUpdated, accessIsLoading, validateCoupon, initRazorPayPayment, initStripePayment, initPaypalPayment, initPaytrailPayment, getSubscriptionForUser, getSubscriberMetadata, setSubscriberMetadata }) => (
|
|
1087
1111
|
* <div>
|
|
1088
1112
|
* <PaymentCheckoutLayout
|
|
1089
1113
|
* accessIsLoading={accessIsLoading}
|
|
@@ -1093,6 +1117,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
1093
1117
|
* initRazorPayPayment={initRazorPayPayment}
|
|
1094
1118
|
* initStripePayment={initStripePayment}
|
|
1095
1119
|
* initPaypalPayment={initPaypalPayment}
|
|
1120
|
+
* initPaytrailPayment={initPaytrailPayment}
|
|
1096
1121
|
* getSubscriptionForUser={getSubscriptionForUser}
|
|
1097
1122
|
* getgetSubscriberMetadata={getgetSubscriberMetadata}
|
|
1098
1123
|
* setSubscriberMetadata={setSubscriberMetadata}
|
|
@@ -1132,6 +1157,16 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch) {
|
|
|
1132
1157
|
* return props.initPaypalPayment(options);
|
|
1133
1158
|
* }
|
|
1134
1159
|
*
|
|
1160
|
+
* if (paymentGateway === "paytrail") {
|
|
1161
|
+
* const options = {
|
|
1162
|
+
* selectedPlan: plan,
|
|
1163
|
+
* planType: "standard",
|
|
1164
|
+
* returnUrl: `${document.location.origin}/paytrail-success.html`,
|
|
1165
|
+
* cancelUrl: `${document.location.origin}/paytrail-cancel.html`
|
|
1166
|
+
* };
|
|
1167
|
+
* return props.initPaytrailPayment(options);
|
|
1168
|
+
* }
|
|
1169
|
+
*
|
|
1135
1170
|
* if (paymentGateway === "omise") {
|
|
1136
1171
|
* return props.initOmisePayment(plan, "standard");
|
|
1137
1172
|
* }
|