@vendure/payments-plugin 2.2.0-next.5 → 2.2.0-next.6

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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/package/mollie/api-extensions.d.ts +2 -0
  3. package/package/mollie/api-extensions.js +86 -0
  4. package/package/mollie/api-extensions.js.map +1 -0
  5. package/package/mollie/custom-fields.d.ts +7 -0
  6. package/package/mollie/custom-fields.js +12 -0
  7. package/package/mollie/custom-fields.js.map +1 -0
  8. package/package/mollie/extended-mollie-client.d.ts +51 -0
  9. package/package/mollie/extended-mollie-client.js +39 -0
  10. package/package/mollie/extended-mollie-client.js.map +1 -0
  11. package/package/mollie/graphql/generated-shop-types.d.ts +2 -1
  12. package/package/mollie/graphql/generated-shop-types.js.map +1 -1
  13. package/package/mollie/{mollie.resolver.d.ts → mollie.common-resolver.d.ts} +2 -3
  14. package/package/mollie/{mollie.resolver.js → mollie.common-resolver.js} +7 -19
  15. package/package/mollie/mollie.common-resolver.js.map +1 -0
  16. package/package/mollie/mollie.handler.d.ts +1 -1
  17. package/package/mollie/mollie.handler.js +7 -4
  18. package/package/mollie/mollie.handler.js.map +1 -1
  19. package/package/mollie/mollie.helpers.d.ts +2 -1
  20. package/package/mollie/mollie.helpers.js +13 -3
  21. package/package/mollie/mollie.helpers.js.map +1 -1
  22. package/package/mollie/mollie.plugin.d.ts +18 -31
  23. package/package/mollie/mollie.plugin.js +30 -25
  24. package/package/mollie/mollie.plugin.js.map +1 -1
  25. package/package/mollie/mollie.service.d.ts +28 -0
  26. package/package/mollie/mollie.service.js +170 -72
  27. package/package/mollie/mollie.service.js.map +1 -1
  28. package/package/mollie/mollie.shop-resolver.d.ts +8 -0
  29. package/package/mollie/mollie.shop-resolver.js +40 -0
  30. package/package/mollie/mollie.shop-resolver.js.map +1 -0
  31. package/package.json +13 -13
  32. package/package/mollie/mollie-shop-schema.d.ts +0 -1
  33. package/package/mollie/mollie-shop-schema.js +0 -47
  34. package/package/mollie/mollie-shop-schema.js.map +0 -1
  35. package/package/mollie/mollie.resolver.js.map +0 -1
@@ -9,12 +9,14 @@ var MolliePlugin_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.MolliePlugin = void 0;
11
11
  const core_1 = require("@vendure/core");
12
+ const api_extensions_1 = require("./api-extensions");
12
13
  const constants_1 = require("./constants");
13
- const mollie_shop_schema_1 = require("./mollie-shop-schema");
14
+ const custom_fields_1 = require("./custom-fields");
15
+ const mollie_common_resolver_1 = require("./mollie.common-resolver");
14
16
  const mollie_controller_1 = require("./mollie.controller");
15
17
  const mollie_handler_1 = require("./mollie.handler");
16
- const mollie_resolver_1 = require("./mollie.resolver");
17
18
  const mollie_service_1 = require("./mollie.service");
19
+ const mollie_shop_resolver_1 = require("./mollie.shop-resolver");
18
20
  /**
19
21
  * @description
20
22
  * Plugin to enable payments through the [Mollie platform](https://docs.mollie.com/).
@@ -40,34 +42,25 @@ const mollie_service_1 = require("./mollie.service");
40
42
  * // ...
41
43
  *
42
44
  * plugins: [
43
- * MolliePlugin.init({ vendureHost: 'https://yourhost.io/', useDynamicRedirectUrl: true }),
45
+ * MolliePlugin.init({ vendureHost: 'https://yourhost.io/' }),
44
46
  * ]
45
47
  * ```
46
- * 2. Create a new PaymentMethod in the Admin UI, and select "Mollie payments" as the handler.
47
- * 3. Set your Mollie apiKey in the `API Key` field.
48
+ * 2. Run a database migration to add the `mollieOrderId` custom field to the order entity.
49
+ * 3. Create a new PaymentMethod in the Admin UI, and select "Mollie payments" as the handler.
50
+ * 4. Set your Mollie apiKey in the `API Key` field.
51
+ * 5. Set the `Fallback redirectUrl` to the url that the customer should be redirected to after completing the payment.
52
+ * You can override this url by passing the `redirectUrl` as an argument to the `createMolliePaymentIntent` mutation.
48
53
  *
49
- * ## Specifying the redirectUrl
50
- *
51
- * Currently, there are two ways to specify the `redirectUrl` to which the customer is redirected after completing the payment:
52
- * 1. Configure the `redirectUrl` in the PaymentMethod.
53
- * 2. Pass the `redirectUrl` as an argument to the `createPaymentIntent` mutation.
54
- *
55
- * Which method is used depends on the value of the `useDynamicRedirectUrl` option while initializing the plugin.
56
- * By default, this option is set to `false` for backwards compatibility. In a future version, this option will be deprecated.
57
- * Upon deprecation, the `redirectUrl` will always be passed as an argument to the `createPaymentIntent` mutation.
58
- *
59
- * TODO toevoegen van /code weggehaald..!
60
54
  * ## Storefront usage
61
55
  *
62
56
  * In your storefront you add a payment to an order using the `createMolliePaymentIntent` mutation. In this example, our Mollie
63
57
  * PaymentMethod was given the code "mollie-payment-method". The `redirectUrl``is the url that is used to redirect the end-user
64
- * back to your storefront after completing the payment. When using the first method specified in `Specifying the redirectUrl`,
65
- * the order code is appened to the `redirectUrl`. For the second method, the order code is not appended to the specified `redirectUrl`.
58
+ * back to your storefront after completing the payment.
66
59
  *
67
60
  * ```GraphQL
68
61
  * mutation CreateMolliePaymentIntent {
69
62
  * createMolliePaymentIntent(input: {
70
- * redirectUrl: "https://storefront/order"
63
+ * redirectUrl: "https://storefront/order/1234XYZ"
71
64
  * paymentMethodCode: "mollie-payment-method"
72
65
  * molliePaymentMethodCode: "ideal"
73
66
  * }) {
@@ -111,10 +104,10 @@ const mollie_service_1 = require("./mollie.service");
111
104
  * }
112
105
  * }
113
106
  * ```
114
- * You can pass `MolliePaymentMethod.code` to the `createMolliePaymentIntent` mutation to skip the method selection.
107
+ * You can pass `creditcard` for example, to the `createMolliePaymentIntent` mutation to skip the method selection.
115
108
  *
116
109
  * After completing payment on the Mollie platform,
117
- * the user is redirected to the configured redirect url + orderCode: `https://storefront/order/CH234X5`
110
+ * the user is redirected to the given redirect url, e.g. `https://storefront/order/CH234X5`
118
111
  *
119
112
  * ## Pay later methods
120
113
  * Mollie supports pay-later methods like 'Klarna Pay Later'. For pay-later methods, the status of an order is
@@ -124,6 +117,14 @@ const mollie_service_1 = require("./mollie.service");
124
117
  * If you don't want this behaviour (Authorized first), you can set 'autoCapture=true' on the payment method. This option will immediately
125
118
  * capture the payment after a customer authorizes the payment.
126
119
  *
120
+ * ## ArrangingAdditionalPayment state
121
+ *
122
+ * In some rare cases, a customer can add items to the active order, while a Mollie payment is still open,
123
+ * for example by opening your storefront in another browser tab.
124
+ * This could result in an order being in `ArrangingAdditionalPayment` status after the customer finished payment.
125
+ * You should check if there is still an active order with status `ArrangingAdditionalPayment` on your order confirmation page,
126
+ * and if so, allow your customer to pay for the additional items by creating another Mollie payment.
127
+ *
127
128
  * @docsCategory core plugins/PaymentsPlugin
128
129
  * @docsPage MolliePlugin
129
130
  * @docsWeight 0
@@ -133,7 +134,6 @@ let MolliePlugin = exports.MolliePlugin = MolliePlugin_1 = class MolliePlugin {
133
134
  * @description
134
135
  * Initialize the mollie payment plugin
135
136
  * @param vendureHost is needed to pass to mollie for callback
136
- * @param useDynamicRedirectUrl to indicate if the redirectUrl can be passed via the `createPaymentIntent` mutation, versus being configured in the Payment Method.
137
137
  */
138
138
  static init(options) {
139
139
  this.options = options;
@@ -147,13 +147,18 @@ exports.MolliePlugin = MolliePlugin = MolliePlugin_1 = __decorate([
147
147
  providers: [mollie_service_1.MollieService, { provide: constants_1.PLUGIN_INIT_OPTIONS, useFactory: () => MolliePlugin_1.options }],
148
148
  configuration: (config) => {
149
149
  config.paymentOptions.paymentMethodHandlers.push(mollie_handler_1.molliePaymentHandler);
150
+ config.customFields.Order.push(...custom_fields_1.orderCustomFields);
150
151
  return config;
151
152
  },
152
153
  shopApiExtensions: {
153
- schema: mollie_shop_schema_1.shopSchema,
154
- resolvers: [mollie_resolver_1.MollieResolver],
154
+ schema: api_extensions_1.shopApiExtensions,
155
+ resolvers: [mollie_common_resolver_1.MollieCommonResolver, mollie_shop_resolver_1.MollieShopResolver],
156
+ },
157
+ adminApiExtensions: {
158
+ schema: api_extensions_1.adminApiExtensions,
159
+ resolvers: [mollie_common_resolver_1.MollieCommonResolver],
155
160
  },
156
- compatibility: '^2.0.0',
161
+ compatibility: '^2.2.0',
157
162
  })
158
163
  ], MolliePlugin);
159
164
  //# sourceMappingURL=mollie.plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mollie.plugin.js","sourceRoot":"","sources":["../../src/mollie/mollie.plugin.ts"],"names":[],"mappings":";;;;;;;;;;AACA,wCAOuB;AAEvB,2CAAkD;AAClD,6DAAkD;AAClD,2DAAuD;AACvD,qDAAwD;AACxD,uDAAmD;AACnD,qDAAiD;AA0EjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AAeI,IAAM,YAAY,2CAAlB,MAAM,YAAY;IAGrB;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,OAA4B;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,cAAY,CAAC;IACxB,CAAC;CACJ,CAAA;uBAbY,YAAY;IAdxB,IAAA,oBAAa,EAAC;QACX,OAAO,EAAE,CAAC,yBAAkB,CAAC;QAC7B,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,EAAE,EAAE,OAAO,EAAE,+BAAmB,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,cAAY,CAAC,OAAO,EAAE,CAAC;QACpG,aAAa,EAAE,CAAC,MAA4B,EAAE,EAAE;YAC5C,MAAM,CAAC,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,qCAAoB,CAAC,CAAC;YACvE,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,iBAAiB,EAAE;YACf,MAAM,EAAE,+BAAU;YAClB,SAAS,EAAE,CAAC,gCAAc,CAAC;SAC9B;QACD,aAAa,EAAE,QAAQ;KAC1B,CAAC;GACW,YAAY,CAaxB"}
1
+ {"version":3,"file":"mollie.plugin.js","sourceRoot":"","sources":["../../src/mollie/mollie.plugin.ts"],"names":[],"mappings":";;;;;;;;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order as MollieOrder } from '@mollie/api-client';
2
+ import { CreateParameters } from '@mollie/api-client/dist/types/src/binders/orders/parameters';
2
3
  import { ModuleRef } from '@nestjs/core';
3
4
  import { ActiveOrderService, EntityHydrator, Order, OrderService, PaymentMethodService, ProductVariant, ProductVariantService, RequestContext } from '@vendure/core';
5
+ import { ExtendedMollieClient } from './extended-mollie-client';
4
6
  import { MolliePaymentIntentInput, MolliePaymentIntentResult, MolliePaymentMethod } from './graphql/generated-shop-types';
5
7
  import { MolliePluginOptions } from './mollie.plugin';
6
8
  interface OrderStatusInput {
@@ -15,6 +17,7 @@ export declare class MollieService {
15
17
  private entityHydrator;
16
18
  private variantService;
17
19
  private moduleRef;
20
+ private readonly injector;
18
21
  constructor(paymentMethodService: PaymentMethodService, options: MolliePluginOptions, activeOrderService: ActiveOrderService, orderService: OrderService, entityHydrator: EntityHydrator, variantService: ProductVariantService, moduleRef: ModuleRef);
19
22
  /**
20
23
  * Creates a redirectUrl to Mollie for the given paymentMethod and current activeOrder
@@ -34,6 +37,31 @@ export declare class MollieService {
34
37
  settleExistingPayment(ctx: RequestContext, order: Order, mollieOrderId: string): Promise<void>;
35
38
  getEnabledPaymentMethods(ctx: RequestContext, paymentMethodCode: string): Promise<MolliePaymentMethod[]>;
36
39
  getVariantsWithInsufficientStock(ctx: RequestContext, order: Order): Promise<ProductVariant[]>;
40
+ /**
41
+ * Update an existing Mollie order based on the given Vendure order.
42
+ */
43
+ updateMollieOrder(mollieClient: ExtendedMollieClient, newMollieOrderInput: CreateParameters, mollieOrderId: string): Promise<MollieOrder>;
44
+ /**
45
+ * Update the Mollie Order data itself, excluding the order lines.
46
+ * So, addresses, redirect url etc
47
+ */
48
+ private updateMollieOrderData;
49
+ /**
50
+ * Compare existing order lines with the new input,
51
+ * and update, add or cancel the order lines accordingly.
52
+ *
53
+ * We compare and update order lines based on their index, because there is no unique identifier
54
+ */
55
+ private updateMollieOrderLines;
56
+ /**
57
+ * Dry run a transition to a given state.
58
+ * As long as we don't call 'finalize', the transition never completes.
59
+ */
60
+ private canTransitionTo;
37
61
  private getPaymentMethod;
62
+ /**
63
+ * Get order by id, or active order if no orderId is given
64
+ */
65
+ private getOrder;
38
66
  }
39
67
  export {};
@@ -1,33 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
7
  };
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
31
8
  var __metadata = (this && this.__metadata) || function (k, v) {
32
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
33
10
  };
@@ -36,13 +13,16 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
36
13
  };
37
14
  Object.defineProperty(exports, "__esModule", { value: true });
38
15
  exports.MollieService = void 0;
39
- const api_client_1 = __importStar(require("@mollie/api-client"));
16
+ const api_client_1 = require("@mollie/api-client");
40
17
  const common_1 = require("@nestjs/common");
41
18
  const core_1 = require("@nestjs/core");
42
19
  const core_2 = require("@vendure/core");
20
+ const core_3 = require("@vendure/core/");
43
21
  const order_utils_1 = require("@vendure/core/dist/service/helpers/utils/order-utils");
44
22
  const constants_1 = require("./constants");
23
+ const extended_mollie_client_1 = require("./extended-mollie-client");
45
24
  const generated_shop_types_1 = require("./graphql/generated-shop-types");
25
+ const mollie_handler_1 = require("./mollie.handler");
46
26
  const mollie_helpers_1 = require("./mollie.helpers");
47
27
  class PaymentIntentError {
48
28
  constructor(message) {
@@ -65,6 +45,7 @@ let MollieService = exports.MollieService = class MollieService {
65
45
  this.entityHydrator = entityHydrator;
66
46
  this.variantService = variantService;
67
47
  this.moduleRef = moduleRef;
48
+ this.injector = new core_2.Injector(this.moduleRef);
68
49
  }
69
50
  /**
70
51
  * Creates a redirectUrl to Mollie for the given paymentMethod and current activeOrder
@@ -72,17 +53,16 @@ let MollieService = exports.MollieService = class MollieService {
72
53
  async createPaymentIntent(ctx, input) {
73
54
  var _a, _b, _c, _d;
74
55
  const { paymentMethodCode, molliePaymentMethodCode } = input;
75
- let redirectUrl;
76
56
  const allowedMethods = Object.values(api_client_1.PaymentMethod);
77
57
  if (molliePaymentMethodCode && !allowedMethods.includes(molliePaymentMethodCode)) {
78
58
  return new InvalidInputError(`molliePaymentMethodCode has to be one of "${allowedMethods.join(',')}"`);
79
59
  }
80
60
  const [order, paymentMethod] = await Promise.all([
81
- this.activeOrderService.getActiveOrder(ctx, undefined),
61
+ this.getOrder(ctx, input.orderId),
82
62
  this.getPaymentMethod(ctx, paymentMethodCode),
83
63
  ]);
84
- if (!order) {
85
- return new PaymentIntentError('No active order found for session');
64
+ if (order instanceof PaymentIntentError) {
65
+ return order;
86
66
  }
87
67
  await this.entityHydrator.hydrate(ctx, order, {
88
68
  relations: [
@@ -93,56 +73,47 @@ let MollieService = exports.MollieService = class MollieService {
93
73
  'payments',
94
74
  ],
95
75
  });
96
- if (!((_a = order.lines) === null || _a === void 0 ? void 0 : _a.length)) {
97
- return new PaymentIntentError('Cannot create payment intent for empty order');
98
- }
99
- if (!order.customer) {
100
- return new PaymentIntentError('Cannot create payment intent for order without customer');
76
+ if (order.state !== 'ArrangingPayment' && order.state !== 'ArrangingAdditionalPayment') {
77
+ // Pre-check if order is transitionable to ArrangingPayment, because that will happen after Mollie payment
78
+ try {
79
+ await this.canTransitionTo(ctx, order.id, 'ArrangingPayment');
80
+ }
81
+ catch (e) {
82
+ if (e.message) {
83
+ return new PaymentIntentError(e.message);
84
+ }
85
+ throw e;
86
+ }
101
87
  }
102
- if (!order.customer.firstName.length) {
88
+ if (!((_a = order.customer) === null || _a === void 0 ? void 0 : _a.firstName.length)) {
103
89
  return new PaymentIntentError('Cannot create payment intent for order with customer that has no firstName set');
104
90
  }
105
- if (!order.customer.lastName.length) {
91
+ if (!((_b = order.customer) === null || _b === void 0 ? void 0 : _b.lastName.length)) {
106
92
  return new PaymentIntentError('Cannot create payment intent for order with customer that has no lastName set');
107
93
  }
108
- if (!order.customer.emailAddress.length) {
109
- return new PaymentIntentError('Cannot create payment intent for order with customer that has no emailAddress set');
110
- }
111
- if (!((_b = order.shippingLines) === null || _b === void 0 ? void 0 : _b.length)) {
112
- return new PaymentIntentError('Cannot create payment intent for order without shippingMethod');
113
- }
114
94
  if (!paymentMethod) {
115
- return new PaymentIntentError(`No paymentMethod found with code ${paymentMethodCode}`);
116
- }
117
- if (this.options.useDynamicRedirectUrl === true) {
118
- if (!input.redirectUrl) {
119
- return new InvalidInputError('Cannot create payment intent without redirectUrl specified');
120
- }
121
- redirectUrl = input.redirectUrl;
95
+ return new PaymentIntentError(`No paymentMethod found with code ${String(paymentMethodCode)}`);
122
96
  }
123
- else {
124
- const paymentMethodRedirectUrl = (_c = paymentMethod.handler.args.find(arg => arg.name === 'redirectUrl')) === null || _c === void 0 ? void 0 : _c.value;
125
- if (!paymentMethodRedirectUrl) {
126
- return new PaymentIntentError('Cannot create payment intent without redirectUrl specified in paymentMethod');
97
+ let redirectUrl = input.redirectUrl;
98
+ if (!redirectUrl) {
99
+ // Use fallback redirect if no redirectUrl is given
100
+ let fallbackRedirect = (_c = paymentMethod.handler.args.find(arg => arg.name === 'redirectUrl')) === null || _c === void 0 ? void 0 : _c.value;
101
+ if (!fallbackRedirect) {
102
+ return new PaymentIntentError('No redirect URl was given and no fallback redirect is configured');
127
103
  }
128
- redirectUrl = paymentMethodRedirectUrl;
129
- }
130
- const variantsWithInsufficientSaleableStock = await this.getVariantsWithInsufficientStock(ctx, order);
131
- if (variantsWithInsufficientSaleableStock.length) {
132
- return new PaymentIntentError(`The following variants are out of stock: ${variantsWithInsufficientSaleableStock
133
- .map(v => v.name)
134
- .join(', ')}`);
104
+ redirectUrl = fallbackRedirect;
105
+ // remove appending slash if present
106
+ fallbackRedirect = fallbackRedirect.endsWith('/')
107
+ ? fallbackRedirect.slice(0, -1)
108
+ : fallbackRedirect;
109
+ redirectUrl = `${fallbackRedirect}/${order.code}`;
135
110
  }
136
111
  const apiKey = (_d = paymentMethod.handler.args.find(arg => arg.name === 'apiKey')) === null || _d === void 0 ? void 0 : _d.value;
137
112
  if (!apiKey) {
138
113
  core_2.Logger.warn(`CreatePaymentIntent failed, because no apiKey is configured for ${paymentMethod.code}`, constants_1.loggerCtx);
139
114
  return new PaymentIntentError(`Paymentmethod ${paymentMethod.code} has no apiKey configured`);
140
115
  }
141
- const mollieClient = (0, api_client_1.default)({ apiKey });
142
- redirectUrl =
143
- redirectUrl.endsWith('/') && this.options.useDynamicRedirectUrl !== true
144
- ? redirectUrl.slice(0, -1)
145
- : redirectUrl; // remove appending slash
116
+ const mollieClient = (0, extended_mollie_client_1.createExtendedMollieClient)({ apiKey });
146
117
  const vendureHost = this.options.vendureHost.endsWith('/')
147
118
  ? this.options.vendureHost.slice(0, -1)
148
119
  : this.options.vendureHost; // remove appending slash
@@ -157,16 +128,38 @@ let MollieService = exports.MollieService = class MollieService {
157
128
  const orderInput = {
158
129
  orderNumber: order.code,
159
130
  amount: (0, mollie_helpers_1.toAmount)(amountToPay, order.currencyCode),
160
- redirectUrl: this.options.useDynamicRedirectUrl === true ? redirectUrl : `${redirectUrl}/${order.code}`,
131
+ redirectUrl,
161
132
  webhookUrl: `${vendureHost}/payments/mollie/${ctx.channel.token}/${paymentMethod.id}`,
162
133
  billingAddress,
163
134
  locale: (0, mollie_helpers_1.getLocale)(billingAddress.country, ctx.languageCode),
164
135
  lines: (0, mollie_helpers_1.toMollieOrderLines)(order, alreadyPaid),
136
+ metadata: {
137
+ languageCode: ctx.languageCode,
138
+ },
165
139
  };
166
140
  if (molliePaymentMethodCode) {
167
141
  orderInput.method = molliePaymentMethodCode;
168
142
  }
143
+ const existingMollieOrderId = order.customFields.mollieOrderId;
144
+ if (existingMollieOrderId) {
145
+ // Update order and return its checkoutUrl
146
+ const updateMollieOrder = await this.updateMollieOrder(mollieClient, orderInput, existingMollieOrderId).catch(e => {
147
+ core_2.Logger.error(`Failed to update Mollie order '${existingMollieOrderId}' for '${order.code}': ${e.message}`, constants_1.loggerCtx);
148
+ });
149
+ const checkoutUrl = updateMollieOrder === null || updateMollieOrder === void 0 ? void 0 : updateMollieOrder.getCheckoutUrl();
150
+ if (checkoutUrl) {
151
+ core_2.Logger.info(`Updated Mollie order '${updateMollieOrder === null || updateMollieOrder === void 0 ? void 0 : updateMollieOrder.id}' for order '${order.code}'`, constants_1.loggerCtx);
152
+ return {
153
+ url: checkoutUrl,
154
+ };
155
+ }
156
+ }
157
+ // Otherwise create a new Mollie order
169
158
  const mollieOrder = await mollieClient.orders.create(orderInput);
159
+ // Save async, because this shouldn't impact intent creation
160
+ this.orderService.updateCustomFields(ctx, order.id, { mollieOrderId: mollieOrder.id }).catch(e => {
161
+ core_2.Logger.error(`Failed to save Mollie order ID: ${e.message}`, constants_1.loggerCtx);
162
+ });
170
163
  core_2.Logger.info(`Created Mollie order ${mollieOrder.id} for order ${order.code}`, constants_1.loggerCtx);
171
164
  const url = mollieOrder.getCheckoutUrl();
172
165
  if (!url) {
@@ -180,7 +173,7 @@ let MollieService = exports.MollieService = class MollieService {
180
173
  * Update Vendure payments and order status based on the incoming Mollie order
181
174
  */
182
175
  async handleMollieStatusUpdate(ctx, { paymentMethodId, orderId }) {
183
- var _a, _b;
176
+ var _a, _b, _c;
184
177
  core_2.Logger.info(`Received status update for channel ${ctx.channel.token} for Mollie order ${orderId}`, constants_1.loggerCtx);
185
178
  const paymentMethod = await this.paymentMethodService.findOne(ctx, paymentMethodId);
186
179
  if (!paymentMethod) {
@@ -192,8 +185,18 @@ let MollieService = exports.MollieService = class MollieService {
192
185
  if (!apiKey) {
193
186
  throw Error(`No apiKey found for payment ${paymentMethod.id} for channel ${ctx.channel.token}`);
194
187
  }
195
- const client = (0, api_client_1.default)({ apiKey });
188
+ const client = (0, extended_mollie_client_1.createExtendedMollieClient)({ apiKey });
196
189
  const mollieOrder = await client.orders.get(orderId);
190
+ if ((_c = mollieOrder.metadata) === null || _c === void 0 ? void 0 : _c.languageCode) {
191
+ // Recreate ctx with the original languageCode
192
+ ctx = new core_2.RequestContext({
193
+ apiType: 'admin',
194
+ isAuthorized: true,
195
+ authorizedAsOwnerOnly: false,
196
+ channel: ctx.channel,
197
+ languageCode: mollieOrder.metadata.languageCode,
198
+ });
199
+ }
197
200
  core_2.Logger.info(`Processing status '${mollieOrder.status}' for order ${mollieOrder.orderNumber} for channel ${ctx.channel.token} for Mollie order ${orderId}`, constants_1.loggerCtx);
198
201
  let order = await this.orderService.findOneByCode(ctx, mollieOrder.orderNumber, ['payments']);
199
202
  if (!order) {
@@ -244,7 +247,7 @@ let MollieService = exports.MollieService = class MollieService {
244
247
  * Add payment to order. Can be settled or authorized depending on the payment method.
245
248
  */
246
249
  async addPayment(ctx, order, mollieOrder, paymentMethodCode, status) {
247
- if (order.state !== 'ArrangingPayment') {
250
+ if (order.state !== 'ArrangingPayment' && order.state !== 'ArrangingAdditionalPayment') {
248
251
  const transitionToStateResult = await this.orderService.transitionToState(ctx, order.id, 'ArrangingPayment');
249
252
  if (transitionToStateResult instanceof core_2.OrderStateTransitionError) {
250
253
  throw Error(`Error transitioning order ${order.code} from ${transitionToStateResult.fromState} ` +
@@ -291,9 +294,9 @@ let MollieService = exports.MollieService = class MollieService {
291
294
  if (!apiKey) {
292
295
  throw Error(`No apiKey configured for payment method ${paymentMethodCode}`);
293
296
  }
294
- const client = (0, api_client_1.default)({ apiKey });
297
+ const client = (0, extended_mollie_client_1.createExtendedMollieClient)({ apiKey });
295
298
  const activeOrder = await this.activeOrderService.getActiveOrder(ctx, undefined);
296
- const additionalParams = await ((_c = (_b = this.options).enabledPaymentMethodsParams) === null || _c === void 0 ? void 0 : _c.call(_b, new core_2.Injector(this.moduleRef), ctx, activeOrder !== null && activeOrder !== void 0 ? activeOrder : null));
299
+ const additionalParams = await ((_c = (_b = this.options).enabledPaymentMethodsParams) === null || _c === void 0 ? void 0 : _c.call(_b, this.injector, ctx, activeOrder !== null && activeOrder !== void 0 ? activeOrder : null));
297
300
  // We use the orders API, so list available methods for that API usage
298
301
  const methods = await client.methods.list(Object.assign(Object.assign({}, additionalParams), { resource: 'orders' }));
299
302
  return methods.map(m => (Object.assign(Object.assign({}, m), { code: m.id })));
@@ -308,9 +311,104 @@ let MollieService = exports.MollieService = class MollieService {
308
311
  }
309
312
  return variantsWithInsufficientSaleableStock;
310
313
  }
314
+ /**
315
+ * Update an existing Mollie order based on the given Vendure order.
316
+ */
317
+ async updateMollieOrder(mollieClient, newMollieOrderInput, mollieOrderId) {
318
+ const existingMollieOrder = await mollieClient.orders.get(mollieOrderId);
319
+ const [order] = await Promise.all([
320
+ this.updateMollieOrderData(mollieClient, existingMollieOrder, newMollieOrderInput),
321
+ this.updateMollieOrderLines(mollieClient, existingMollieOrder, newMollieOrderInput.lines),
322
+ ]);
323
+ return order;
324
+ }
325
+ /**
326
+ * Update the Mollie Order data itself, excluding the order lines.
327
+ * So, addresses, redirect url etc
328
+ */
329
+ async updateMollieOrderData(mollieClient, existingMollieOrder, newMollieOrderInput) {
330
+ return await mollieClient.orders.update(existingMollieOrder.id, {
331
+ billingAddress: newMollieOrderInput.billingAddress,
332
+ shippingAddress: newMollieOrderInput.shippingAddress,
333
+ redirectUrl: newMollieOrderInput.redirectUrl,
334
+ });
335
+ }
336
+ /**
337
+ * Compare existing order lines with the new input,
338
+ * and update, add or cancel the order lines accordingly.
339
+ *
340
+ * We compare and update order lines based on their index, because there is no unique identifier
341
+ */
342
+ async updateMollieOrderLines(mollieClient, existingMollieOrder, newMollieOrderLines) {
343
+ const manageOrderLinesInput = {
344
+ operations: []
345
+ };
346
+ // Update or add new order lines
347
+ newMollieOrderLines.forEach((newLine, index) => {
348
+ const existingLine = existingMollieOrder.lines[index];
349
+ if (existingLine && !(0, mollie_helpers_1.areOrderLinesEqual)(existingLine, newLine)) {
350
+ // Update if exists but not equal
351
+ manageOrderLinesInput.operations.push({
352
+ operation: 'update',
353
+ data: Object.assign(Object.assign({}, newLine), { id: existingLine.id })
354
+ });
355
+ }
356
+ else {
357
+ // Add new line if it doesn't exist
358
+ manageOrderLinesInput.operations.push({
359
+ operation: 'add',
360
+ data: newLine
361
+ });
362
+ }
363
+ });
364
+ // Cancel any order lines that are in the existing Mollie order, but not in the new input
365
+ existingMollieOrder.lines.forEach((existingLine, index) => {
366
+ const newLine = newMollieOrderLines[index];
367
+ if (!newLine) {
368
+ manageOrderLinesInput.operations.push({
369
+ operation: 'cancel',
370
+ data: { id: existingLine.id }
371
+ });
372
+ }
373
+ });
374
+ return await mollieClient.manageOrderLines(existingMollieOrder.id, manageOrderLinesInput);
375
+ }
376
+ /**
377
+ * Dry run a transition to a given state.
378
+ * As long as we don't call 'finalize', the transition never completes.
379
+ */
380
+ async canTransitionTo(ctx, orderId, state) {
381
+ // Fetch new order object, because `transition()` mutates the order object
382
+ const orderCopy = await (0, core_2.assertFound)(this.orderService.findOne(ctx, orderId));
383
+ const orderStateMachine = this.injector.get(core_3.OrderStateMachine);
384
+ await orderStateMachine.transition(ctx, orderCopy, state);
385
+ }
311
386
  async getPaymentMethod(ctx, paymentMethodCode) {
312
- const paymentMethods = await this.paymentMethodService.findAll(ctx);
313
- return paymentMethods.items.find(pm => pm.code === paymentMethodCode);
387
+ if (paymentMethodCode) {
388
+ const { items } = await this.paymentMethodService.findAll(ctx, {
389
+ filter: {
390
+ code: { eq: paymentMethodCode },
391
+ },
392
+ });
393
+ return items.find(pm => pm.code === paymentMethodCode);
394
+ }
395
+ else {
396
+ const { items } = await this.paymentMethodService.findAll(ctx);
397
+ return items.find(pm => pm.handler.code === mollie_handler_1.molliePaymentHandler.code);
398
+ }
399
+ }
400
+ /**
401
+ * Get order by id, or active order if no orderId is given
402
+ */
403
+ async getOrder(ctx, orderId) {
404
+ if (orderId) {
405
+ return await (0, core_2.assertFound)(this.orderService.findOne(ctx, orderId));
406
+ }
407
+ const order = await this.activeOrderService.getActiveOrder(ctx, undefined);
408
+ if (!order) {
409
+ return new PaymentIntentError('No active order found for session');
410
+ }
411
+ return order;
314
412
  }
315
413
  };
316
414
  exports.MollieService = MollieService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"mollie.service.js","sourceRoot":"","sources":["../../src/mollie/mollie.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAK4B;AAE5B,2CAAoD;AACpD,uCAAyC;AACzC,wCAeuB;AACvB,sFAA8F;AAE9F,2CAA6D;AAC7D,yEAOwC;AACxC,qDAA2G;AAQ3G,MAAM,kBAAkB;IAGpB,YAAmB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;QAFlC,cAAS,GAAG,gCAAS,CAAC,yBAAyB,CAAC;IAEX,CAAC;CACzC;AAED,MAA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AI,KAAK,iBAAiB,CAAC,CAAC;SAC1D;aAAM;YACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,qCAAoB,CAAC,IAAI,CAAC,CAAC;SAC1E;IACL,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,QAAQ,CAAC,GAAmB,EAAE,OAAmB;QAC3D,IAAI,OAAO,EAAE;YACT,OAAO,MAAM,IAAA,kBAAW,EAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;SACrE;QACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,IAAI,kBAAkB,CAAC,mCAAmC,CAAC,CAAC;SACtE;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAA;wBAldY,aAAa;IADzB,IAAA,mBAAU,GAAE;IAMJ,WAAA,IAAA,eAAM,EAAC,+BAAmB,CAAC,CAAA;qCADE,2BAAoB,UAEtB,yBAAkB;QACxB,mBAAY;QACV,qBAAc;QACd,4BAAqB;QAC1B,gBAAS;GAVvB,aAAa,CAkdzB"}
@@ -0,0 +1,8 @@
1
+ import { RequestContext } from '@vendure/core';
2
+ import { MolliePaymentMethod, MolliePaymentMethodsInput } from './graphql/generated-shop-types';
3
+ import { MollieService } from './mollie.service';
4
+ export declare class MollieShopResolver {
5
+ private mollieService;
6
+ constructor(mollieService: MollieService);
7
+ molliePaymentMethods(ctx: RequestContext, { paymentMethodCode }: MolliePaymentMethodsInput): Promise<MolliePaymentMethod[]>;
8
+ }