@labdigital/commercetools-mock 2.13.0 → 2.14.0
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/dist/index.cjs +47 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +47 -37
- package/dist/index.js.map +1 -1
- package/package.json +31 -31
- package/src/repositories/cart.ts +2 -2
- package/src/repositories/order.ts +1 -1
- package/src/repositories/payment.ts +92 -47
- package/src/repositories/product.ts +5 -5
- package/src/repositories/review.ts +2 -2
- package/src/repositories/shopping-list.ts +1 -1
- package/src/services/customer.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3939,32 +3939,6 @@ var PaymentRepository = class extends AbstractResourceRepository {
|
|
|
3939
3939
|
// Documented as default
|
|
3940
3940
|
});
|
|
3941
3941
|
actions = {
|
|
3942
|
-
setCustomField: (context, resource, { name, value }) => {
|
|
3943
|
-
if (!resource.custom) {
|
|
3944
|
-
throw new Error("Resource has no custom field");
|
|
3945
|
-
}
|
|
3946
|
-
resource.custom.fields[name] = value;
|
|
3947
|
-
},
|
|
3948
|
-
setCustomType: (context, resource, { type, fields }) => {
|
|
3949
|
-
if (!type) {
|
|
3950
|
-
resource.custom = void 0;
|
|
3951
|
-
} else {
|
|
3952
|
-
const resolvedType = this._storage.getByResourceIdentifier(
|
|
3953
|
-
context.projectKey,
|
|
3954
|
-
type
|
|
3955
|
-
);
|
|
3956
|
-
if (!resolvedType) {
|
|
3957
|
-
throw new Error(`Type ${type} not found`);
|
|
3958
|
-
}
|
|
3959
|
-
resource.custom = {
|
|
3960
|
-
type: {
|
|
3961
|
-
typeId: "type",
|
|
3962
|
-
id: resolvedType.id
|
|
3963
|
-
},
|
|
3964
|
-
fields: fields ?? {}
|
|
3965
|
-
};
|
|
3966
|
-
}
|
|
3967
|
-
},
|
|
3968
3942
|
addTransaction: (context, resource, { transaction }) => {
|
|
3969
3943
|
resource.transactions = [
|
|
3970
3944
|
...resource.transactions,
|
|
@@ -3994,24 +3968,60 @@ var PaymentRepository = class extends AbstractResourceRepository {
|
|
|
3994
3968
|
id: stateObj.id,
|
|
3995
3969
|
obj: stateObj
|
|
3996
3970
|
};
|
|
3971
|
+
},
|
|
3972
|
+
setCustomField: (context, resource, { name, value }) => {
|
|
3973
|
+
if (!resource.custom) {
|
|
3974
|
+
throw new Error("Resource has no custom field");
|
|
3975
|
+
}
|
|
3976
|
+
resource.custom.fields[name] = value;
|
|
3977
|
+
},
|
|
3978
|
+
setCustomType: (context, resource, { type, fields }) => {
|
|
3979
|
+
if (!type) {
|
|
3980
|
+
resource.custom = void 0;
|
|
3981
|
+
} else {
|
|
3982
|
+
const resolvedType = this._storage.getByResourceIdentifier(
|
|
3983
|
+
context.projectKey,
|
|
3984
|
+
type
|
|
3985
|
+
);
|
|
3986
|
+
if (!resolvedType) {
|
|
3987
|
+
throw new Error(`Type ${type} not found`);
|
|
3988
|
+
}
|
|
3989
|
+
resource.custom = {
|
|
3990
|
+
type: {
|
|
3991
|
+
typeId: "type",
|
|
3992
|
+
id: resolvedType.id
|
|
3993
|
+
},
|
|
3994
|
+
fields: fields ?? {}
|
|
3995
|
+
};
|
|
3996
|
+
}
|
|
3997
|
+
},
|
|
3998
|
+
setKey: (_context, resource, { key }) => {
|
|
3999
|
+
resource.key = key;
|
|
4000
|
+
},
|
|
4001
|
+
setStatusInterfaceCode: (_context, resource, { interfaceCode }) => {
|
|
4002
|
+
resource.paymentStatus.interfaceCode = interfaceCode;
|
|
4003
|
+
},
|
|
4004
|
+
setStatusInterfaceText: (_context, resource, { interfaceText }) => {
|
|
4005
|
+
resource.paymentStatus.interfaceText = interfaceText;
|
|
4006
|
+
},
|
|
4007
|
+
setMethodInfoName: (_context, resource, { name }) => {
|
|
4008
|
+
resource.paymentMethodInfo.name = name;
|
|
4009
|
+
},
|
|
4010
|
+
setMethodInfoMethod: (_context, resource, { method }) => {
|
|
4011
|
+
resource.paymentMethodInfo.method = method;
|
|
4012
|
+
},
|
|
4013
|
+
setMethodInfoInterface: (_context, resource, args) => {
|
|
4014
|
+
resource.paymentMethodInfo.paymentInterface = args.interface;
|
|
4015
|
+
},
|
|
4016
|
+
setInterfaceId: (_context, resource, { interfaceId }) => {
|
|
4017
|
+
resource.interfaceId = interfaceId;
|
|
3997
4018
|
}
|
|
3998
4019
|
// addInterfaceInteraction: () => {},
|
|
3999
4020
|
// changeAmountPlanned: () => {},
|
|
4000
4021
|
// changeTransactionInteractionId: () => {},
|
|
4001
4022
|
// changeTransactionTimestamp: () => {},
|
|
4002
|
-
// setAmountPaid: () => {},
|
|
4003
|
-
// setAmountRefunded: () => {},
|
|
4004
4023
|
// setAnonymousId: () => {},
|
|
4005
|
-
// setAuthorization: () => {},
|
|
4006
4024
|
// setCustomer: () => {},
|
|
4007
|
-
// setExternalId: () => {},
|
|
4008
|
-
// setInterfaceId: () => {},
|
|
4009
|
-
// setKey: () => {},
|
|
4010
|
-
// setMethodInfoInterface: () => {},
|
|
4011
|
-
// setMethodInfoMethod: () => {},
|
|
4012
|
-
// setMethodInfoName: () => {},
|
|
4013
|
-
// setStatusInterfaceCode: () => {},
|
|
4014
|
-
// setStatusInterfaceText: () => {},
|
|
4015
4025
|
};
|
|
4016
4026
|
};
|
|
4017
4027
|
|