Kaynağa Gözat

fix(core): Eligible payment methods must be enabled (#3406)

Marc Schipperheyn 9 ay önce
ebeveyn
işleme
45852ea2c4

+ 1 - 1
README.md

@@ -91,7 +91,7 @@ The first step is to populate the dev server with some test data:
 ```bash
 ```bash
 cd packages/dev-server
 cd packages/dev-server
 
 
-[DB=mysql|postres|sqlite] npm run populate
+[DB=mysql|postgres|sqlite] npm run populate
 ```
 ```
 
 
 If you do not specify the `DB` variable, it will default to "mysql". If you specifically want to develop against Postgres,
 If you do not specify the `DB` variable, it will default to "mysql". If you specifically want to develop against Postgres,

+ 1 - 0
packages/core/src/service/services/payment-method.service.ts

@@ -307,6 +307,7 @@ export class PaymentMethodService {
             .leftJoin('method.channels', 'channel')
             .leftJoin('method.channels', 'channel')
             .where('method.code = :code', { code: method })
             .where('method.code = :code', { code: method })
             .andWhere('channel.id = :channelId', { channelId: ctx.channelId })
             .andWhere('channel.id = :channelId', { channelId: ctx.channelId })
+            .andWhere('method.enabled IS true')
             .getOne();
             .getOne();
         if (!paymentMethod) {
         if (!paymentMethod) {
             throw new UserInputError('error.payment-method-not-found', { method });
             throw new UserInputError('error.payment-method-not-found', { method });