@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
21 lines (18 loc) • 580 B
text/typescript
import {
FetchDatatransFn,
AuthorizeAuthenticatedRequestPayload,
AuthorizeAuthenticatedResponse,
} from './types.js';
export default async function authorizeAuthenticated({
transactionId,
...payload
}: AuthorizeAuthenticatedRequestPayload): Promise<AuthorizeAuthenticatedResponse> {
const reqBody = {
...payload,
autoSettle: false,
};
const { fetchDatatrans }: { fetchDatatrans: FetchDatatransFn } = this;
const result = await fetchDatatrans(`/v1/transactions/${transactionId}/authorize`, reqBody);
const json = await result.json();
return json;
}