@osovitny/anatoly 3.20.37 → 3.20.38
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/fesm2022/osovitny-anatoly.mjs +27 -21
- package/fesm2022/osovitny-anatoly.mjs.map +1 -1
- package/index.d.ts +9 -6
- package/package.json +1 -1
|
@@ -5343,13 +5343,13 @@ class PaymentsApiService extends ApiServiceBase {
|
|
|
5343
5343
|
createBraintreeToken() {
|
|
5344
5344
|
return this.get('createBraintreeToken');
|
|
5345
5345
|
}
|
|
5346
|
-
addPayment(paymentMethod, paidFor,
|
|
5346
|
+
addPayment(paymentMethod, planId, paidFor,
|
|
5347
5347
|
//Amount
|
|
5348
5348
|
subtotal, promoCode, total, currency,
|
|
5349
5349
|
//Payment method details (PayPal/Stripe/Braintree)
|
|
5350
5350
|
pmId, pmStatus, pmDetails, success, error) {
|
|
5351
5351
|
return this.post('addPayment', {
|
|
5352
|
-
paymentMethod, paidFor,
|
|
5352
|
+
paymentMethod, planId, paidFor,
|
|
5353
5353
|
//Amount
|
|
5354
5354
|
subtotal, promoCode, total, currency,
|
|
5355
5355
|
//Payment method details (PayPal/Stripe/Braintree)
|
|
@@ -5492,13 +5492,13 @@ class BillingService {
|
|
|
5492
5492
|
createBraintreeToken() {
|
|
5493
5493
|
return this.apiPayments.createBraintreeToken();
|
|
5494
5494
|
}
|
|
5495
|
-
addPayment(paymentMethod, paidFor, subtotal, promoCode, total, currency, pmId, pmStatus, pmDetails) {
|
|
5495
|
+
addPayment(paymentMethod, planId, paidFor, subtotal, promoCode, total, currency, pmId, pmStatus, pmDetails) {
|
|
5496
5496
|
this.zone.run(() => {
|
|
5497
5497
|
let paidForAsString = JSON.stringify(paidFor);
|
|
5498
5498
|
if (total == 0) {
|
|
5499
5499
|
paymentMethod = PaymentMethod.None;
|
|
5500
5500
|
}
|
|
5501
|
-
this.apiPayments.addPayment(paymentMethod, paidForAsString,
|
|
5501
|
+
this.apiPayments.addPayment(paymentMethod, planId, paidForAsString,
|
|
5502
5502
|
//Amount
|
|
5503
5503
|
subtotal, promoCode, total, currency,
|
|
5504
5504
|
//Payment method details (PayPal/Stripe/Braintree)
|
|
@@ -5647,7 +5647,7 @@ class BraintreeDialog extends DialogBase {
|
|
|
5647
5647
|
let promoCode = this.ps.promoCode;
|
|
5648
5648
|
let total = this.ps.getTotal();
|
|
5649
5649
|
let currency = this.ps.currency;
|
|
5650
|
-
this.bs.addPayment(paymentMethod, this.paidFor, subtotal, promoCode, total, currency, payload.nonce, 'COMPLETED', this.deviceData);
|
|
5650
|
+
this.bs.addPayment(paymentMethod, this.planId, this.paidFor, subtotal, promoCode, total, currency, payload.nonce, 'COMPLETED', this.deviceData);
|
|
5651
5651
|
}
|
|
5652
5652
|
closeDialog() {
|
|
5653
5653
|
super.close();
|
|
@@ -5677,7 +5677,7 @@ class BraintreeDialog extends DialogBase {
|
|
|
5677
5677
|
return this.isOpen && this.ps.getTotal() > 0;
|
|
5678
5678
|
}
|
|
5679
5679
|
static { this.ɵfac = function BraintreeDialog_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BraintreeDialog)(i0.ɵɵdirectiveInject(BillingService), i0.ɵɵdirectiveInject(PaymentsService), i0.ɵɵdirectiveInject(NotificationService)); }; }
|
|
5680
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BraintreeDialog, selectors: [["anatoly-billing-braintree-dialog"]], inputs: { paidFor: "paidFor", title: "title", description: "description", image: "image" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "send-message__kendo-dialog"], [3, "close", "width", "height", "themeColor"], [1, "kendo-dialog-content"], ["id", "braintree-container"], ["layout", "end"], ["type", "button", 1, "btn", "btn-sm", "btn-success", 3, "click"], ["type", "button", 1, "btn", "btn-sm", "btn-danger", 3, "click"]], template: function BraintreeDialog_Template(rf, ctx) { if (rf & 1) {
|
|
5680
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BraintreeDialog, selectors: [["anatoly-billing-braintree-dialog"]], inputs: { planId: "planId", paidFor: "paidFor", title: "title", description: "description", image: "image" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "send-message__kendo-dialog"], [3, "close", "width", "height", "themeColor"], [1, "kendo-dialog-content"], ["id", "braintree-container"], ["layout", "end"], ["type", "button", 1, "btn", "btn-sm", "btn-success", 3, "click"], ["type", "button", 1, "btn", "btn-sm", "btn-danger", 3, "click"]], template: function BraintreeDialog_Template(rf, ctx) { if (rf & 1) {
|
|
5681
5681
|
i0.ɵɵconditionalCreate(0, BraintreeDialog_Conditional_0_Template, 11, 3, "div", 0);
|
|
5682
5682
|
} if (rf & 2) {
|
|
5683
5683
|
i0.ɵɵconditional(ctx.visible ? 0 : -1);
|
|
@@ -5686,7 +5686,9 @@ class BraintreeDialog extends DialogBase {
|
|
|
5686
5686
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BraintreeDialog, [{
|
|
5687
5687
|
type: Component,
|
|
5688
5688
|
args: [{ selector: 'anatoly-billing-braintree-dialog', standalone: false, template: "@if (visible) {\r\n <div class='send-message__kendo-dialog'>\r\n <kendo-dialog [width]='480' [height]='560' [themeColor]='themeColor' (close)='onClose()'>\r\n <kendo-dialog-titlebar>Pay with Credit Card</kendo-dialog-titlebar>\r\n <div class='kendo-dialog-content'>\r\n <div id=\"braintree-container\"></div>\r\n </div>\r\n <kendo-dialog-actions layout='end'>\r\n <button class='btn btn-sm btn-success' type='button' (click)='onPay()'>Pay</button>\r\n <button class='btn btn-sm btn-danger' type='button' (click)='onClose()'>Cancel</button>\r\n </kendo-dialog-actions>\r\n </kendo-dialog>\r\n </div>\r\n}\r\n" }]
|
|
5689
|
-
}], () => [{ type: BillingService }, { type: PaymentsService }, { type: NotificationService }], {
|
|
5689
|
+
}], () => [{ type: BillingService }, { type: PaymentsService }, { type: NotificationService }], { planId: [{
|
|
5690
|
+
type: Input
|
|
5691
|
+
}], paidFor: [{
|
|
5690
5692
|
type: Input
|
|
5691
5693
|
}], title: [{
|
|
5692
5694
|
type: Input
|
|
@@ -6222,7 +6224,7 @@ class PaypalButtonComponent extends ComponentBase {
|
|
|
6222
6224
|
let promoCode = that.ps.promoCode;
|
|
6223
6225
|
let total = that.ps.getTotal();
|
|
6224
6226
|
let currency = that.ps.currency;
|
|
6225
|
-
that.bs.addPayment(paymentMethod, that.paidFor, subtotal, promoCode, total, currency, paymentId, status, details);
|
|
6227
|
+
that.bs.addPayment(paymentMethod, that.planId, that.paidFor, subtotal, promoCode, total, currency, paymentId, status, details);
|
|
6226
6228
|
}
|
|
6227
6229
|
catch {
|
|
6228
6230
|
that.bs.paymentFailed(PaymentStage.External);
|
|
@@ -6241,7 +6243,7 @@ class PaypalButtonComponent extends ComponentBase {
|
|
|
6241
6243
|
return this.ps.selectedPaymentMethod == PaymentMethod.PayPal && this.ps.getTotal() > 0;
|
|
6242
6244
|
}
|
|
6243
6245
|
static { this.ɵfac = function PaypalButtonComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PaypalButtonComponent)(i0.ɵɵdirectiveInject(BillingService), i0.ɵɵdirectiveInject(PaymentsService)); }; }
|
|
6244
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PaypalButtonComponent, selectors: [["anatoly-billing-paypal-button"]], inputs: {
|
|
6246
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PaypalButtonComponent, selectors: [["anatoly-billing-paypal-button"]], inputs: { planId: "planId", paidFor: "paidFor", paidForTitle: "paidForTitle" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "config"]], template: function PaypalButtonComponent_Template(rf, ctx) { if (rf & 1) {
|
|
6245
6247
|
i0.ɵɵconditionalCreate(0, PaypalButtonComponent_Conditional_0_Template, 1, 1, "anatoly-billing-paypal-container", 0);
|
|
6246
6248
|
} if (rf & 2) {
|
|
6247
6249
|
i0.ɵɵconditional(ctx.visible ? 0 : -1);
|
|
@@ -6250,10 +6252,12 @@ class PaypalButtonComponent extends ComponentBase {
|
|
|
6250
6252
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaypalButtonComponent, [{
|
|
6251
6253
|
type: Component,
|
|
6252
6254
|
args: [{ selector: 'anatoly-billing-paypal-button', standalone: false, template: "@if (visible) {\r\n <anatoly-billing-paypal-container [config]='payPalConfig' />\r\n}\r\n" }]
|
|
6253
|
-
}], () => [{ type: BillingService }, { type: PaymentsService }], {
|
|
6255
|
+
}], () => [{ type: BillingService }, { type: PaymentsService }], { planId: [{
|
|
6254
6256
|
type: Input
|
|
6255
6257
|
}], paidFor: [{
|
|
6256
6258
|
type: Input
|
|
6259
|
+
}], paidForTitle: [{
|
|
6260
|
+
type: Input
|
|
6257
6261
|
}] }); })();
|
|
6258
6262
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalButtonComponent, { className: "PaypalButtonComponent", filePath: "lib/billing/components/pm/paypal/paypal-button.component.ts", lineNumber: 44 }); })();
|
|
6259
6263
|
|
|
@@ -6430,9 +6434,9 @@ class StripeDialog extends DialogBase {
|
|
|
6430
6434
|
this.stripe = await loadStripe(stripePk);
|
|
6431
6435
|
this.stripeCheckout = await this.stripe.initEmbeddedCheckout({
|
|
6432
6436
|
fetchClientSecret: async () => {
|
|
6433
|
-
const amount =
|
|
6434
|
-
const currency =
|
|
6435
|
-
const response = await firstValueFrom(that.bs.createStripeSession(amount, currency,
|
|
6437
|
+
const amount = that.ps.getTotal();
|
|
6438
|
+
const currency = that.ps.currency;
|
|
6439
|
+
const response = await firstValueFrom(that.bs.createStripeSession(amount, currency, that.title, that.description, that.image));
|
|
6436
6440
|
if (response) {
|
|
6437
6441
|
that.sessionId = response.sessionId;
|
|
6438
6442
|
return response?.sessionSecret ? response.sessionSecret : '';
|
|
@@ -6441,12 +6445,12 @@ class StripeDialog extends DialogBase {
|
|
|
6441
6445
|
},
|
|
6442
6446
|
onComplete: () => {
|
|
6443
6447
|
//ps
|
|
6444
|
-
let paymentMethod =
|
|
6445
|
-
let subtotal =
|
|
6446
|
-
let promoCode =
|
|
6447
|
-
let total =
|
|
6448
|
-
let currency =
|
|
6449
|
-
|
|
6448
|
+
let paymentMethod = that.ps.selectedPaymentMethod;
|
|
6449
|
+
let subtotal = that.ps.subtotal;
|
|
6450
|
+
let promoCode = that.ps.promoCode;
|
|
6451
|
+
let total = that.ps.getTotal();
|
|
6452
|
+
let currency = that.ps.currency;
|
|
6453
|
+
that.bs.addPayment(paymentMethod, that.planId, that.paidFor, subtotal, promoCode, total, currency, that.sessionId, 'COMPLETED', '');
|
|
6450
6454
|
that.onClose();
|
|
6451
6455
|
}
|
|
6452
6456
|
});
|
|
@@ -6465,7 +6469,7 @@ class StripeDialog extends DialogBase {
|
|
|
6465
6469
|
return this.isOpen && this.ps.getTotal() > 0;
|
|
6466
6470
|
}
|
|
6467
6471
|
static { this.ɵfac = function StripeDialog_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || StripeDialog)(i0.ɵɵdirectiveInject(BillingService), i0.ɵɵdirectiveInject(PaymentsService)); }; }
|
|
6468
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: StripeDialog, selectors: [["anatoly-billing-stripe-dialog"]], inputs: { paidFor: "paidFor", title: "title", description: "description", image: "image" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "send-message__kendo-dialog"], [3, "close", "width", "height", "themeColor"], [1, "kendo-dialog-content"], ["id", "stripeCheckout"]], template: function StripeDialog_Template(rf, ctx) { if (rf & 1) {
|
|
6472
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: StripeDialog, selectors: [["anatoly-billing-stripe-dialog"]], inputs: { planId: "planId", paidFor: "paidFor", title: "title", description: "description", image: "image" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "send-message__kendo-dialog"], [3, "close", "width", "height", "themeColor"], [1, "kendo-dialog-content"], ["id", "stripeCheckout"]], template: function StripeDialog_Template(rf, ctx) { if (rf & 1) {
|
|
6469
6473
|
i0.ɵɵconditionalCreate(0, StripeDialog_Conditional_0_Template, 6, 3, "div", 0);
|
|
6470
6474
|
} if (rf & 2) {
|
|
6471
6475
|
i0.ɵɵconditional(ctx.visible ? 0 : -1);
|
|
@@ -6474,7 +6478,9 @@ class StripeDialog extends DialogBase {
|
|
|
6474
6478
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StripeDialog, [{
|
|
6475
6479
|
type: Component,
|
|
6476
6480
|
args: [{ selector: 'anatoly-billing-stripe-dialog', standalone: false, template: "@if (visible) {\r\n <div class='send-message__kendo-dialog'>\r\n <kendo-dialog [width]='1080' [height]='800' [themeColor]='themeColor' (close)='onClose()'>\r\n <kendo-dialog-titlebar>Pay with Stripe</kendo-dialog-titlebar> \r\n <div class='kendo-dialog-content'>\r\n <div id=\"stripeCheckout\"></div>\r\n </div>\r\n </kendo-dialog>\r\n </div>\r\n}\r\n" }]
|
|
6477
|
-
}], () => [{ type: BillingService }, { type: PaymentsService }], {
|
|
6481
|
+
}], () => [{ type: BillingService }, { type: PaymentsService }], { planId: [{
|
|
6482
|
+
type: Input
|
|
6483
|
+
}], paidFor: [{
|
|
6478
6484
|
type: Input
|
|
6479
6485
|
}], title: [{
|
|
6480
6486
|
type: Input
|