@vendure/payments-plugin 1.6.2 → 1.6.3
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/package/stripe/raw-body.middleware.js.map +1 -1
- package/package/stripe/stripe.controller.d.ts +5 -5
- package/package/stripe/stripe.controller.js +9 -11
- package/package/stripe/stripe.controller.js.map +1 -1
- package/package/stripe/stripe.service.d.ts +2 -1
- package/package/stripe/stripe.service.js +21 -1
- package/package/stripe/stripe.service.js.map +1 -1
- package/package/stripe/types.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw-body.middleware.js","sourceRoot":"","sources":["../../src/stripe/raw-body.middleware.ts"],"names":[],"mappings":";;;AAAA,6CAAmC;AAKnC;;;GAGG;AACU,QAAA,iBAAiB,GAAG,kBAAI,CAAC;IAClC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"raw-body.middleware.js","sourceRoot":"","sources":["../../src/stripe/raw-body.middleware.ts"],"names":[],"mappings":";;;AAAA,6CAAmC;AAKnC;;;GAGG;AACU,QAAA,iBAAiB,GAAG,kBAAI,CAAC;IAClC,MAAM,CAAC,GAAuB,EAAE,CAAiB,EAAE,GAAW;QAC1D,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACtB,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderService, RequestContextService, TransactionalConnection } from '@vendure/core';
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
import { StripeService } from './stripe.service';
|
|
4
|
-
import {
|
|
4
|
+
import { RequestWithRawBody } from './types';
|
|
5
5
|
export declare class StripeController {
|
|
6
6
|
private connection;
|
|
7
|
-
private channelService;
|
|
8
7
|
private orderService;
|
|
9
8
|
private stripeService;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
private requestContextService;
|
|
10
|
+
constructor(connection: TransactionalConnection, orderService: OrderService, stripeService: StripeService, requestContextService: RequestContextService);
|
|
11
|
+
webhook(signature: string | undefined, request: RequestWithRawBody, response: Response): Promise<void>;
|
|
12
12
|
private createContext;
|
|
13
13
|
private getPaymentMethod;
|
|
14
14
|
}
|
|
@@ -23,11 +23,11 @@ const missingHeaderErrorMessage = 'Missing stripe-signature header';
|
|
|
23
23
|
const signatureErrorMessage = 'Error verifying Stripe webhook signature';
|
|
24
24
|
const noPaymentIntentErrorMessage = 'No payment intent in the event payload';
|
|
25
25
|
let StripeController = class StripeController {
|
|
26
|
-
constructor(connection,
|
|
26
|
+
constructor(connection, orderService, stripeService, requestContextService) {
|
|
27
27
|
this.connection = connection;
|
|
28
|
-
this.channelService = channelService;
|
|
29
28
|
this.orderService = orderService;
|
|
30
29
|
this.stripeService = stripeService;
|
|
30
|
+
this.requestContextService = requestContextService;
|
|
31
31
|
}
|
|
32
32
|
async webhook(signature, request, response) {
|
|
33
33
|
var _a;
|
|
@@ -63,7 +63,7 @@ let StripeController = class StripeController {
|
|
|
63
63
|
core_1.Logger.info(`Received ${event.type} status update for order ${orderCode}`, constants_1.loggerCtx);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const ctx = await this.createContext(channelToken);
|
|
66
|
+
const ctx = await this.createContext(channelToken, request);
|
|
67
67
|
const order = await this.orderService.findOneByCode(ctx, orderCode);
|
|
68
68
|
if (!order) {
|
|
69
69
|
throw Error(`Unable to find order ${orderCode}, unable to settle payment ${paymentIntent.id}!`);
|
|
@@ -89,13 +89,11 @@ let StripeController = class StripeController {
|
|
|
89
89
|
core_1.Logger.info(`Stripe payment intent id ${paymentIntent.id} added to order ${orderCode}`, constants_1.loggerCtx);
|
|
90
90
|
response.status(common_1.HttpStatus.OK).send('Ok');
|
|
91
91
|
}
|
|
92
|
-
async createContext(channelToken) {
|
|
93
|
-
|
|
94
|
-
return new core_1.RequestContext({
|
|
92
|
+
async createContext(channelToken, req) {
|
|
93
|
+
return this.requestContextService.create({
|
|
95
94
|
apiType: 'admin',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
channel,
|
|
95
|
+
channelOrToken: channelToken,
|
|
96
|
+
req,
|
|
99
97
|
languageCode: core_1.LanguageCode.en,
|
|
100
98
|
});
|
|
101
99
|
}
|
|
@@ -119,9 +117,9 @@ __decorate([
|
|
|
119
117
|
StripeController = __decorate([
|
|
120
118
|
common_1.Controller('payments'),
|
|
121
119
|
__metadata("design:paramtypes", [core_1.TransactionalConnection,
|
|
122
|
-
core_1.ChannelService,
|
|
123
120
|
core_1.OrderService,
|
|
124
|
-
stripe_service_1.StripeService
|
|
121
|
+
stripe_service_1.StripeService,
|
|
122
|
+
core_1.RequestContextService])
|
|
125
123
|
], StripeController);
|
|
126
124
|
exports.StripeController = StripeController;
|
|
127
125
|
//# sourceMappingURL=stripe.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.controller.js","sourceRoot":"","sources":["../../src/stripe/stripe.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiF;AACjF,wCAUuB;AACvB,iHAA0G;
|
|
1
|
+
{"version":3,"file":"stripe.controller.js","sourceRoot":"","sources":["../../src/stripe/stripe.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiF;AACjF,wCAUuB;AACvB,iHAA0G;AAI1G,2CAAwC;AACxC,qDAA8D;AAC9D,qDAAiD;AAGjD,MAAM,yBAAyB,GAAG,iCAAiC,CAAC;AACpE,MAAM,qBAAqB,GAAG,0CAA0C,CAAC;AACzE,MAAM,2BAA2B,GAAG,wCAAwC,CAAC;AAG7E,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IACzB,YACY,UAAmC,EACnC,YAA0B,EAC1B,aAA4B,EAC5B,qBAA4C;QAH5C,eA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AAA;;;;+CAiFT;AA7FQ,gBAAgB;IAD5B,mBAAU,CAAC,UAAU,CAAC;qCAGK,8BAAuB;QACrB,mBAAY;QACX,8BAAa;QACL,4BAAqB;GAL/C,gBAAgB,CAmH5B;AAnHY,4CAAgB"}
|
|
@@ -5,7 +5,7 @@ import { StripePluginOptions } from './types';
|
|
|
5
5
|
export declare class StripeService {
|
|
6
6
|
private connection;
|
|
7
7
|
private options;
|
|
8
|
-
|
|
8
|
+
protected stripe: Stripe;
|
|
9
9
|
constructor(connection: TransactionalConnection, options: StripePluginOptions);
|
|
10
10
|
createPaymentIntent(ctx: RequestContext, order: Order): Promise<string | undefined>;
|
|
11
11
|
createRefund(paymentIntentId: string, amount: number): Promise<Stripe.Refund | Stripe.StripeError>;
|
|
@@ -16,4 +16,5 @@ export declare class StripeService {
|
|
|
16
16
|
* Otherwise, creates a new Customer record in Stripe and returns the generated id.
|
|
17
17
|
*/
|
|
18
18
|
private getStripeCustomerId;
|
|
19
|
+
private currencyHasFractionPart;
|
|
19
20
|
}
|
|
@@ -33,8 +33,19 @@ let StripeService = class StripeService {
|
|
|
33
33
|
if (this.options.storeCustomersInStripe && ctx.activeUserId) {
|
|
34
34
|
customerId = await this.getStripeCustomerId(ctx, order);
|
|
35
35
|
}
|
|
36
|
+
// From the [Stripe docs](https://stripe.com/docs/currencies#zero-decimal):
|
|
37
|
+
// > All API requests expect amounts to be provided in a currency’s smallest unit.
|
|
38
|
+
// > For example, to charge 10 USD, provide an amount value of 1000 (that is, 1000 cents).
|
|
39
|
+
// > For zero-decimal currencies, still provide amounts as an integer but without multiplying by 100.
|
|
40
|
+
// > For example, to charge ¥500, provide an amount value of 500.
|
|
41
|
+
//
|
|
42
|
+
// Therefore, for a fractionless currency like JPY, we need to divide the amount by 100 (since Vendure always
|
|
43
|
+
// stores money amounts multiplied by 100). See https://github.com/vendure-ecommerce/vendure/issues/1630
|
|
44
|
+
const amountInMinorUnits = this.currencyHasFractionPart(order.currencyCode)
|
|
45
|
+
? order.totalWithTax
|
|
46
|
+
: Math.round(order.totalWithTax / 100);
|
|
36
47
|
const { client_secret } = await this.stripe.paymentIntents.create({
|
|
37
|
-
amount:
|
|
48
|
+
amount: amountInMinorUnits,
|
|
38
49
|
currency: order.currencyCode.toLowerCase(),
|
|
39
50
|
customer: customerId,
|
|
40
51
|
automatic_payment_methods: {
|
|
@@ -104,6 +115,15 @@ let StripeService = class StripeService {
|
|
|
104
115
|
await this.connection.getRepository(ctx, core_1.Customer).save(customer, { reload: false });
|
|
105
116
|
return stripeCustomerId;
|
|
106
117
|
}
|
|
118
|
+
currencyHasFractionPart(currencyCode) {
|
|
119
|
+
const parts = new Intl.NumberFormat(undefined, {
|
|
120
|
+
style: 'currency',
|
|
121
|
+
currency: currencyCode,
|
|
122
|
+
currencyDisplay: 'symbol',
|
|
123
|
+
}).formatToParts(123.45);
|
|
124
|
+
const hasFractionPart = !!parts.find(p => p.type === 'fraction');
|
|
125
|
+
return hasFractionPart;
|
|
126
|
+
}
|
|
107
127
|
};
|
|
108
128
|
StripeService = __decorate([
|
|
109
129
|
common_1.Injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.service.js","sourceRoot":"","sources":["../../src/stripe/stripe.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"stripe.service.js","sourceRoot":"","sources":["../../src/stripe/stripe.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,wCAOuB;AACvB,oDAA4B;AAE5B,2CAA+D;AAI/D,IAAa,aAAa,GAA1B,MAAa,aAAa;IAGtB,YACY,UAAmC,EACJ,OAA4B;QAD3D,eAAU,GAAV,UAAU,CAAyB;QACJ,YAAO,GAAP,OAAO,CAAqB;QAEnE,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC1C,UAAU,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-1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import '@vendure/core/dist/entity/custom-entity-fields';
|
|
3
|
-
import {
|
|
3
|
+
import { Request } from 'express';
|
|
4
4
|
declare module '@vendure/core/dist/entity/custom-entity-fields' {
|
|
5
5
|
interface CustomCustomerFields {
|
|
6
6
|
stripeCustomerId?: string;
|
|
@@ -35,6 +35,6 @@ export interface StripePluginOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
storeCustomersInStripe?: boolean;
|
|
37
37
|
}
|
|
38
|
-
export interface
|
|
38
|
+
export interface RequestWithRawBody extends Request {
|
|
39
39
|
rawBody: Buffer;
|
|
40
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/payments-plugin",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "package/index.js",
|
|
6
6
|
"types": "package/index.d.ts",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@mollie/api-client": "^3.6.0",
|
|
30
30
|
"@types/braintree": "^2.22.15",
|
|
31
|
-
"@vendure/common": "^1.6.
|
|
32
|
-
"@vendure/core": "^1.6.
|
|
33
|
-
"@vendure/testing": "^1.6.
|
|
31
|
+
"@vendure/common": "^1.6.3",
|
|
32
|
+
"@vendure/core": "^1.6.3",
|
|
33
|
+
"@vendure/testing": "^1.6.3",
|
|
34
34
|
"braintree": "^3.0.0",
|
|
35
35
|
"nock": "^13.1.4",
|
|
36
36
|
"rimraf": "^3.0.2",
|
|
37
37
|
"stripe": "^8.197.0",
|
|
38
38
|
"typescript": "4.3.5"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "809925dbdc1017943c5b8cba7633f1e232f4968d"
|
|
41
41
|
}
|