namirasoft-payment 1.4.60 → 1.4.62

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.
@@ -16,7 +16,7 @@ const NamirasoftPaymentServerSubscriptionPaid_1 = require("./NamirasoftPaymentSe
16
16
  const NamirasoftPaymentServerValue_1 = require("./NamirasoftPaymentServerValue");
17
17
  class NamirasoftPaymentServer extends namirasoft_account_1.NSABaseServer {
18
18
  constructor(base_url, manager, onError) {
19
- super(base_url, `1.4.60`, manager, onError);
19
+ super(base_url, `1.4.62`, manager, onError);
20
20
  this.healthz = new NamirasoftPaymentServerHealthz_1.NamirasoftPaymentServerHealthz(this);
21
21
  this.value = new NamirasoftPaymentServerValue_1.NamirasoftPaymentServerValue(this);
22
22
  this.invoice = new NamirasoftPaymentServerInvoice_1.NamirasoftPaymentServerInvoice(this);
@@ -18,7 +18,7 @@ class NamirasoftPaymentServerOneTime extends NamirasoftPaymentServerBase_1.Namir
18
18
  }
19
19
  Checkout(invoice_id, body) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
- let path = `/onetime/checkout/${invoice_id}`;
21
+ let path = `/onetime/checkout/invoice/${invoice_id}`;
22
22
  let { data } = yield this.server._post(path, {}, body);
23
23
  return data;
24
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftPaymentServerOneTime.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerOneTime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,+EAA4E;AAE5E,MAAa,8BAA+B,SAAQ,yDAA2B;IAE3E,YAAY,MAA+B;QAEvC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACK,QAAQ,CAAC,UAAkB,EAAE,IAAgG;;YAE/H,IAAI,IAAI,GAAG,qBAAqB,UAAU,EAAE,CAAC;YAC7C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAkB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,wEAaC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftPaymentServerOneTime.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerOneTime.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,+EAA4E;AAE5E,MAAa,8BAA+B,SAAQ,yDAA2B;IAE3E,YAAY,MAA+B;QAEvC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACK,QAAQ,CAAC,UAAkB,EAAE,IAAgG;;YAE/H,IAAI,IAAI,GAAG,6BAA6B,UAAU,EAAE,CAAC;YACrD,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAkB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,wEAaC;AAAA,CAAC"}
@@ -7,10 +7,8 @@ import { SubscriptionFullRow } from "./row/SubscriptionFullRow";
7
7
  import { SubscriptionRow } from "./row/SubscriptionRow";
8
8
  export declare class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase {
9
9
  constructor(server: NamirasoftPaymentServer);
10
- AcceptCancellationOffer(body: {
10
+ AcceptCancellationOffer(id: string, reason_id: string, body: {
11
11
  gateway: GatewayType;
12
- id: string;
13
- reason_id: string;
14
12
  success_url: string;
15
13
  cancel_url: string;
16
14
  }): Promise<{
@@ -20,9 +18,8 @@ export declare class NamirasoftPaymentServerSubscription extends NamirasoftPayme
20
18
  cancellation_reason_id: string;
21
19
  cancellatino_explaination: string;
22
20
  }): Promise<void>;
23
- Checkout(body: {
21
+ Checkout(offer_id: string, body: {
24
22
  gateway: GatewayType;
25
- offer_id: string;
26
23
  success_url: string;
27
24
  cancel_url: string;
28
25
  }): Promise<{
@@ -32,6 +29,8 @@ export declare class NamirasoftPaymentServerSubscription extends NamirasoftPayme
32
29
  rows: SubscriptionRow[];
33
30
  count: number;
34
31
  }>;
35
- GetCancellationOffer(id: string, reason_id: string): Promise<void>;
32
+ GetCancellationOffer(id: string, reason_id: string): Promise<{
33
+ offer_id: string;
34
+ }>;
36
35
  Get(id: string): Promise<SubscriptionFullRow>;
37
36
  }
@@ -23,9 +23,9 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
23
23
  this.GetCancellationOffer = this.GetCancellationOffer.bind(this);
24
24
  this.Get = this.Get.bind(this);
25
25
  }
26
- AcceptCancellationOffer(body) {
26
+ AcceptCancellationOffer(id, reason_id, body) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- let path = `/subscription/checkout`;
28
+ let path = `/subscription/${id}/accept/cancellation/offer/reason/${reason_id}`;
29
29
  let { data } = yield this.server._post(path, {}, body);
30
30
  return data;
31
31
  });
@@ -36,9 +36,9 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
36
36
  yield this.server._post(path, {}, body);
37
37
  });
38
38
  }
39
- Checkout(body) {
39
+ Checkout(offer_id, body) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
- let path = `/subscription/checkout`;
41
+ let path = `/subscription/checkout/offer/${offer_id}`;
42
42
  let { data } = yield this.server._post(path, {}, body);
43
43
  return data;
44
44
  });
@@ -55,7 +55,8 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
55
55
  GetCancellationOffer(id, reason_id) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
57
  let path = `/subscription/${id}/cancellation/offer/reason/${reason_id}`;
58
- yield this.server._get(path, {});
58
+ let { data } = yield this.server._get(path, {});
59
+ return data;
59
60
  });
60
61
  }
61
62
  Get(id) {
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftPaymentServerSubscription.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,qDAA6C;AAG7C,+EAA4E;AAC5E,qDAA2C;AAI3C,MAAa,mCAAoC,SAAQ,yDAA2B;IAEhF,YAAY,MAA+B;QAEvC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACK,uBAAuB,CAAC,IAAsG;;YAEhI,IAAI,IAAI,GAAG,wBAAwB,CAAC;YACpC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAkB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,MAAM,CAAC,EAAU,EAAE,IAA2E;;YAEhG,IAAI,IAAI,GAAG,iBAAiB,EAAE,SAAS,CAAC;YACxC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAO,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAClD,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}
@@ -16,7 +16,7 @@ const NamirasoftPaymentServer_1 = require("../NamirasoftPaymentServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
17
  class SubscriptionAcceptCancellationOfferCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
- super(argv, [], [
19
+ super(argv, ["id", "reason_id"], [
20
20
  {
21
21
  name: "gateway",
22
22
  short: "",
@@ -25,22 +25,6 @@ class SubscriptionAcceptCancellationOfferCommand extends namirasoft_node_cli_1.B
25
25
  args: ["gateway"],
26
26
  defaults: [""]
27
27
  },
28
- {
29
- name: "id",
30
- short: "",
31
- description: "Provides the value of 'id' in body",
32
- optional: false,
33
- args: ["id"],
34
- defaults: [""]
35
- },
36
- {
37
- name: "reason_id",
38
- short: "",
39
- description: "Provides the value of 'reason_id' in body",
40
- optional: false,
41
- args: ["reason_id"],
42
- defaults: [""]
43
- },
44
28
  {
45
29
  name: "success_url",
46
30
  short: "",
@@ -69,10 +53,8 @@ class SubscriptionAcceptCancellationOfferCommand extends namirasoft_node_cli_1.B
69
53
  manager.setValue(token, false);
70
54
  let url = this.app.storage.getItem("ns-payment-server-url");
71
55
  let server = new NamirasoftPaymentServer_1.NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
72
- let ans = yield server.subscription.AcceptCancellationOffer({
56
+ let ans = yield server.subscription.AcceptCancellationOffer(this.arg_values[0], this.arg_values[1], {
73
57
  gateway: this.option_values.gateway,
74
- id: this.option_values.id,
75
- reason_id: this.option_values.reason_id,
76
58
  success_url: this.option_values.success_url,
77
59
  cancel_url: this.option_values.cancel_url
78
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionAcceptCancellationOfferCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionAcceptCancellationOfferCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,0CAA2C,SAAQ,sCAAg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,gCAAc,EAAE,CAAC;YACnC,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAC5D,IAAI,MAAM,GAAG,IAAI,iDAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,uBAAuB,CAAC;gBACxD,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;gBACnC,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE;gBACzB,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS;gBACvC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;aAC5C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAlED,gGAkEC;AAAA,CAAC"}
1
+ {"version":3,"file":"SubscriptionAcceptCancellationOfferCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionAcceptCancellationOfferCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,0CAA2C,SAAQ,sCAAgB;IAE5E,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,CA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AAC,CAAC,CAAC;YAC9F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBAChG,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;gBACnC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;aAC5C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAhDD,gGAgDC;AAAA,CAAC"}
@@ -16,7 +16,7 @@ const NamirasoftPaymentServer_1 = require("../NamirasoftPaymentServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
17
  class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
- super(argv, [], [
19
+ super(argv, ["offer_id"], [
20
20
  {
21
21
  name: "gateway",
22
22
  short: "",
@@ -25,14 +25,6 @@ class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand
25
25
  args: ["gateway"],
26
26
  defaults: [""]
27
27
  },
28
- {
29
- name: "offer_id",
30
- short: "",
31
- description: "Provides the value of 'offer_id' in body",
32
- optional: false,
33
- args: ["offer_id"],
34
- defaults: [""]
35
- },
36
28
  {
37
29
  name: "success_url",
38
30
  short: "",
@@ -61,9 +53,8 @@ class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand
61
53
  manager.setValue(token, false);
62
54
  let url = this.app.storage.getItem("ns-payment-server-url");
63
55
  let server = new NamirasoftPaymentServer_1.NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
64
- let ans = yield server.subscription.Checkout({
56
+ let ans = yield server.subscription.Checkout(this.arg_values[0], {
65
57
  gateway: this.option_values.gateway,
66
- offer_id: this.option_values.offer_id,
67
58
  success_url: this.option_values.success_url,
68
59
  cancel_url: this.option_values.cancel_url
69
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionCheckoutCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCheckoutCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,2BAA4B,SAAQ,sCAAgB;IAE7D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yCAAyC;gBACtD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,SAAS,CAAC;gBACjB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,aAAa,CAAC;gBACrB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,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AAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBAC7D,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;gBACnC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;aAC5C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAhDD,kEAgDC;AAAA,CAAC"}
@@ -11,7 +11,7 @@ export declare class SubscriptionCancellationReasonMetaTable extends NSBaseMetaT
11
11
  type: BaseMetaColumn;
12
12
  name: BaseMetaColumn;
13
13
  order: BaseMetaColumn;
14
- needs_desciption: BaseMetaColumn;
14
+ needs_explaination: BaseMetaColumn;
15
15
  description: BaseMetaColumn;
16
16
  created_at: BaseMetaColumn;
17
17
  updated_at: BaseMetaColumn;
@@ -23,7 +23,7 @@ class SubscriptionCancellationReasonMetaTable extends namirasoft_site_1.NSBaseMe
23
23
  type: new namirasoft_core_1.BaseMetaColumn(this, "type", "Type", "String", true),
24
24
  name: new namirasoft_core_1.BaseMetaColumn(this, "name", "Name", "String", true),
25
25
  order: new namirasoft_core_1.BaseMetaColumn(this, "order", "Order", "Integer", true),
26
- needs_desciption: new namirasoft_core_1.BaseMetaColumn(this, "needs_desciption", "Needs Desciption", "Boolean", true),
26
+ needs_explaination: new namirasoft_core_1.BaseMetaColumn(this, "needs_explaination", "Needs Explaination", "Boolean", true),
27
27
  description: new namirasoft_core_1.BaseMetaColumn(this, "description", "Description", "String", true),
28
28
  created_at: new namirasoft_core_1.BaseMetaColumn(this, "created_at", "Created At", "DateTime", true),
29
29
  updated_at: new namirasoft_core_1.BaseMetaColumn(this, "updated_at", "Updated At", "DateTime", true),
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionCancellationReasonMetaTable.js","sourceRoot":"","sources":["../../src/meta/SubscriptionCancellationReasonMetaTable.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,qDAAiF;AACjF,qDAAsE;AAItE,MAAa,uCAAwC,SAAQ,iCAA2E;IAepI,YAAY,QAAqD;QAE7D,KAAK,CAAC,QAAQ,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,IAAI,0BAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QACjH,IAAI,CAAC,OAAO,GAAG;YACX,EAAE,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC;YACxD,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;YAChF,aAAa,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC;YACzF,QAAQ,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC;YAC3E,IAAI,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9D,IAAI,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9D,KAAK,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC;YAClE,gBAAgB,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAI,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AAS,EAAE,CAAC;YACvC,OAAO,MAAM,MAAM,CAAC,gCAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC,CAAA,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAO,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB,EAAE,EAAE;YAEzH,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YACvC,OAAO,MAAM,MAAM,CAAC,gCAAgC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC1F,CAAC,CAAA,CAAC;IACN,CAAC;CACJ;AA1CD,0FA0CC;AAAA,CAAC"}
@@ -6,7 +6,7 @@ export type SubscriptionCancellationReasonRow = {
6
6
  type: string;
7
7
  name: string;
8
8
  order: number;
9
- needs_desciption: boolean;
9
+ needs_explaination: boolean;
10
10
  description: string;
11
11
  created_at: Date;
12
12
  updated_at: Date;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.60",
11
+ "version": "1.4.62",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@ export class NamirasoftPaymentServer extends NSABaseServer
49
49
  product: NamirasoftPaymentServerProduct;
50
50
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
51
51
  {
52
- super(base_url, `1.4.60`, manager, onError);
52
+ super(base_url, `1.4.62`, manager, onError);
53
53
  this.healthz = new NamirasoftPaymentServerHealthz(this);
54
54
  this.value = new NamirasoftPaymentServerValue(this);
55
55
  this.invoice = new NamirasoftPaymentServerInvoice(this);
@@ -31,7 +31,7 @@ export class NamirasoftPaymentServerOneTime extends NamirasoftPaymentServerBase
31
31
  }
32
32
  async Checkout(invoice_id: string, body: { gateway: GatewayType, amount: (number | null), success_url: string, cancel_url: string }): Promise<{ url: string }>
33
33
  {
34
- let path = `/onetime/checkout/${invoice_id}`;
34
+ let path = `/onetime/checkout/invoice/${invoice_id}`;
35
35
  let { data } = await this.server._post<{ url: string }>(path, {}, body);
36
36
  return data;
37
37
  }
@@ -38,9 +38,9 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
38
38
  this.GetCancellationOffer = this.GetCancellationOffer.bind(this);
39
39
  this.Get = this.Get.bind(this);
40
40
  }
41
- async AcceptCancellationOffer(body: { gateway: GatewayType, id: string, reason_id: string, success_url: string, cancel_url: string }): Promise<{ url: string }>
41
+ async AcceptCancellationOffer(id: string, reason_id: string, body: { gateway: GatewayType, success_url: string, cancel_url: string }): Promise<{ url: string }>
42
42
  {
43
- let path = `/subscription/checkout`;
43
+ let path = `/subscription/${id}/accept/cancellation/offer/reason/${reason_id}`;
44
44
  let { data } = await this.server._post<{ url: string }>(path, {}, body);
45
45
  return data;
46
46
  }
@@ -49,9 +49,9 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
49
49
  let path = `/subscription/${id}/cancel`;
50
50
  await this.server._post<void>(path, {}, body);
51
51
  }
52
- async Checkout(body: { gateway: GatewayType, offer_id: string, success_url: string, cancel_url: string }): Promise<{ url: string }>
52
+ async Checkout(offer_id: string, body: { gateway: GatewayType, success_url: string, cancel_url: string }): Promise<{ url: string }>
53
53
  {
54
- let path = `/subscription/checkout`;
54
+ let path = `/subscription/checkout/offer/${offer_id}`;
55
55
  let { data } = await this.server._post<{ url: string }>(path, {}, body);
56
56
  return data;
57
57
  }
@@ -63,10 +63,11 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
63
63
  let { data } = await this.server._get<{ rows: SubscriptionRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
64
64
  return data;
65
65
  }
66
- async GetCancellationOffer(id: string, reason_id: string): Promise<void>
66
+ async GetCancellationOffer(id: string, reason_id: string): Promise<{ offer_id: string }>
67
67
  {
68
68
  let path = `/subscription/${id}/cancellation/offer/reason/${reason_id}`;
69
- await this.server._get<void>(path, {});
69
+ let { data } = await this.server._get<{ offer_id: string }>(path, {});
70
+ return data;
70
71
  }
71
72
  async Get(id: string): Promise<SubscriptionFullRow>
72
73
  {
@@ -27,7 +27,7 @@ export class SubscriptionAcceptCancellationOfferCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
30
- super(argv, [], [
30
+ super(argv, ["id", "reason_id"], [
31
31
  {
32
32
  name: "gateway",
33
33
  short: "",
@@ -36,22 +36,6 @@ export class SubscriptionAcceptCancellationOfferCommand extends BaseFinalCommand
36
36
  args: ["gateway"],
37
37
  defaults: [""]
38
38
  },
39
- {
40
- name: "id",
41
- short: "",
42
- description: "Provides the value of 'id' in body",
43
- optional: false,
44
- args: ["id"],
45
- defaults: [""]
46
- },
47
- {
48
- name: "reason_id",
49
- short: "",
50
- description: "Provides the value of 'reason_id' in body",
51
- optional: false,
52
- args: ["reason_id"],
53
- defaults: [""]
54
- },
55
39
  {
56
40
  name: "success_url",
57
41
  short: "",
@@ -80,10 +64,8 @@ export class SubscriptionAcceptCancellationOfferCommand extends BaseFinalCommand
80
64
  manager.setValue(token, false);
81
65
  let url = this.app.storage.getItem("ns-payment-server-url");
82
66
  let server = new NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
83
- let ans = await server.subscription.AcceptCancellationOffer({
67
+ let ans = await server.subscription.AcceptCancellationOffer(this.arg_values[0], this.arg_values[1], {
84
68
  gateway: this.option_values.gateway,
85
- id: this.option_values.id,
86
- reason_id: this.option_values.reason_id,
87
69
  success_url: this.option_values.success_url,
88
70
  cancel_url: this.option_values.cancel_url
89
71
  });
@@ -27,7 +27,7 @@ export class SubscriptionCheckoutCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
30
- super(argv, [], [
30
+ super(argv, ["offer_id"], [
31
31
  {
32
32
  name: "gateway",
33
33
  short: "",
@@ -36,14 +36,6 @@ export class SubscriptionCheckoutCommand extends BaseFinalCommand
36
36
  args: ["gateway"],
37
37
  defaults: [""]
38
38
  },
39
- {
40
- name: "offer_id",
41
- short: "",
42
- description: "Provides the value of 'offer_id' in body",
43
- optional: false,
44
- args: ["offer_id"],
45
- defaults: [""]
46
- },
47
39
  {
48
40
  name: "success_url",
49
41
  short: "",
@@ -72,9 +64,8 @@ export class SubscriptionCheckoutCommand extends BaseFinalCommand
72
64
  manager.setValue(token, false);
73
65
  let url = this.app.storage.getItem("ns-payment-server-url");
74
66
  let server = new NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
75
- let ans = await server.subscription.Checkout({
67
+ let ans = await server.subscription.Checkout(this.arg_values[0], {
76
68
  gateway: this.option_values.gateway,
77
- offer_id: this.option_values.offer_id,
78
69
  success_url: this.option_values.success_url,
79
70
  cancel_url: this.option_values.cancel_url
80
71
  });
@@ -33,7 +33,7 @@ export class SubscriptionCancellationReasonMetaTable extends NSBaseMetaTable<Nam
33
33
  type: BaseMetaColumn;
34
34
  name: BaseMetaColumn;
35
35
  order: BaseMetaColumn;
36
- needs_desciption: BaseMetaColumn;
36
+ needs_explaination: BaseMetaColumn;
37
37
  description: BaseMetaColumn;
38
38
  created_at: BaseMetaColumn;
39
39
  updated_at: BaseMetaColumn;
@@ -49,7 +49,7 @@ export class SubscriptionCancellationReasonMetaTable extends NSBaseMetaTable<Nam
49
49
  type: new BaseMetaColumn(this, "type", "Type", "String", true),
50
50
  name: new BaseMetaColumn(this, "name", "Name", "String", true),
51
51
  order: new BaseMetaColumn(this, "order", "Order", "Integer", true),
52
- needs_desciption: new BaseMetaColumn(this, "needs_desciption", "Needs Desciption", "Boolean", true),
52
+ needs_explaination: new BaseMetaColumn(this, "needs_explaination", "Needs Explaination", "Boolean", true),
53
53
  description: new BaseMetaColumn(this, "description", "Description", "String", true),
54
54
  created_at: new BaseMetaColumn(this, "created_at", "Created At", "DateTime", true),
55
55
  updated_at: new BaseMetaColumn(this, "updated_at", "Updated At", "DateTime", true),
@@ -27,7 +27,7 @@ export type SubscriptionCancellationReasonRow =
27
27
  type: string;
28
28
  name: string;
29
29
  order: number;
30
- needs_desciption: boolean;
30
+ needs_explaination: boolean;
31
31
  description: string;
32
32
  created_at: Date;
33
33
  updated_at: Date;