@unchainedshop/plugins
Version:
Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec
29 lines • 978 B
JavaScript
import { SaferpayTransactionsCollection } from './db/SaferpayTransactionsCollection.js';
const configureSaferpayTransactionsModule = async ({ db }) => {
const SaferpayTransactions = await SaferpayTransactionsCollection(db);
return {
findTransactionById: async (_id) => {
return SaferpayTransactions.findOne({
_id,
});
},
createTransaction: async (orderPaymentId) => {
const result = await SaferpayTransactions.insertOne({
created: new Date(),
orderPaymentId,
});
return result.insertedId;
},
setToken: async (_id, token) => {
await SaferpayTransactions.updateOne({ _id }, {
$set: { token, updated: new Date() },
});
},
};
};
export default {
saferpayTransactions: {
configure: configureSaferpayTransactionsModule,
},
};
//# sourceMappingURL=module.js.map