Hierarchy

  • default
    • PaymentMethods

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns PaymentMethods

Methods

  • Returns a list of Payment Methods. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.paymentMethods.list({
    bearer_token: '7381273269536713689562374856'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & Record<string, any>>

    Returns Promise<IPaymentMethodsResult>

  • Returns a single Payment Method by its ID. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.paymentMethods.show({
    bearer_token: '7381273269536713689562374856'
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & {
          id: string;
      }>

    Returns Promise<IPaymentMethodResult>

  • Creates a new Payment Method and returns its attributes. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.paymentMethods.create({
    bearer_token: '7381273269536713689562374856',
    payment_method: {
    name: 'Test Payment Method',
    active: true,
    auto_capture: true,
    description: 'This is a test payment method',
    type: 'Spree::Gateway::Bogus',
    display_on: 'both',
    store_ids: ['2'],
    public_metadata: {},
    private_metadata: {}
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & PaymentMethodParams>

    Returns Promise<IPaymentMethodResult>

  • Update selected Payment Method. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.paymentMethods.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    payment_method: {
    name: 'Test Payment Method',
    active: true,
    auto_capture: true,
    description: 'This is a test payment method',
    type: 'Spree::Gateway::Bogus',
    display_on: 'both',
    store_ids: ['2'],
    public_metadata: {},
    private_metadata: {}
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & PaymentMethodParams & {
          id: string;
      }>

    Returns Promise<IPaymentMethodResult>

  • This endpoint removes the specified Payment Method. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.paymentMethods.remove({
    bearer_token: '7381273269536713689562374856',
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & Record<string, unknown> & {
          id: string;
      }>

    Returns Promise<NoContentResult>

  • Type Parameters

    • ResponseType = JsonApiResponse

    Parameters

    • method: HttpMethod
    • url: string
    • Optional tokens: IToken
    • Optional params: any
    • Optional responseParsing: ResponseParsing

    Returns Promise<ResultResponse<ResponseType>>

  • The HTTP error code returned by Spree is not indicative of its response shape. This function determines the information provided by Spree and uses everything available.

    Parameters

    • error: default

    Returns ErrorType

  • Parameters

    • error: Error

    Returns default

  • Parameters

    • error: default

    Returns default

  • Parameters

    • tokens: IToken

    Returns {
        [headerName: string]: string;
    }

    • [headerName: string]: string

Properties

fetcher: Fetcher

Generated using TypeDoc