Skip to content
LogoLogo

Method.from

Create a payment method from a definition

Creates a payment method.

Usage

import { ,  } from 'mppx'
 
const  = .({
  : 'charge',
  : 'tempo',
  : {
    : {
      : .({
        : .(),
        : .('transaction'),
      }),
    },
    : .({
      : .(),
      : .(),
      : .(),
    }),
  },
})

Return type

type ReturnType = method

The method object passed in (identity function for type inference).

Parameters

intent

  • Type: string

Intent name (for example, "charge", "session").

method

name

  • Type: string

Payment method name (for example, "tempo", "stripe").

schema

Credential.payload

  • Type: z.ZodMiniType

Zod schema for the Credential payload.

request
  • Type: z.ZodMiniType

Zod schema for the request parameters.