@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
192 lines • 6.75 kB
TypeScript
import { HTTPClient } from '../../core/client';
import { BaseServiceClient } from '../../core/base-client';
import { type TransactionSetupParams, type AccountQueryParams, type BillingUpdateParams, type CardInfoParams, type SurchargeParams, type ValidateParams, type ElementPaymentParams } from './schemas';
/**
* Client for the Payments API service
*
* Provides access to payment processing operations through Element Express integration,
* including transaction setup, account management, and billing operations.
*
* @example
* ```typescript
* const api = new AugurAPI({ bearerToken: 'token', siteId: 'site' });
*
* // Create transaction setup
* const setup = await api.payments.unified.transactionSetup({ customerId: '123' });
*
* // Query account information
* const account = await api.payments.unified.accountQuery({
* customerId: '123',
* transactionSetupId: setup.data.transactionSetupId
* });
* ```
*/
export declare class PaymentsClient extends BaseServiceClient {
constructor(http: HTTPClient, baseUrl?: string);
/**
* Unified payment operations through Element Express
*/
unified: {
/**
* Creates a new payment transaction session with customer and account information
*/
transactionSetup: (params: TransactionSetupParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: {
uiEndpoint: string;
transactionSetupId: string;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Retrieves payment account information using a transaction setup ID
*/
accountQuery: (params: AccountQueryParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: false | {
PaymentAccountID: string;
PaymentBrand: string;
ExpirationMonth: string;
ExpirationYear: string;
ExpressResponseCode: string;
ExpressResponseMessage: string;
ExpressTransactionDate: string;
ExpressTransactionTime: string;
ExpressTransactionTimezone: string;
PaymentAccountType: string;
PaymentAccountReferenceNumber: string;
PASSUpdaterBatchStatus: string;
PASSUpdaterStatus: string;
TransactionSetupID: string;
TruncatedCardNumber: string;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Updates billing information for an existing transaction
*/
billingUpdate: (params: BillingUpdateParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: boolean;
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Retrieves formatted card information for a transaction
*/
cardInfo: (params: CardInfoParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: Record<string, never> | {
cardNumber: string;
transactionSetupId: string;
expMonth: string;
expYear: string;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Calculates payment processing surcharges based on location and payment details
*/
surcharge: (params: SurchargeParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: Record<string, never> | {
message: string;
success: boolean;
expressResponseCode: string;
surchargeAllowed: boolean;
surchargePercent: string;
surchargeDescription: string;
lumpSumTotalSurchargeAmount: string;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Validates an existing transaction setup
*/
validate: (params: ValidateParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: boolean;
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Legacy Element Express payment processing
*
* @deprecated This endpoint appears to be a legacy Element Express integration
* and may be deprecated in favor of the unified endpoints.
*/
element: {
/**
* Process payment through legacy Element Express integration
*/
payment: (params: ElementPaymentParams) => Promise<{
params: Record<string, unknown> | unknown[];
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
data?: unknown;
}>;
};
/**
* Comprehensive health check that validates site configuration and triggers seeding jobs
*/
getHealthCheck: () => Promise<{
params: Record<string, unknown> | unknown[];
data: {
siteHash: string;
siteId: string;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
/**
* Simple availability check endpoint
*/
getPing: () => Promise<{
params: Record<string, unknown> | unknown[];
data: "pong";
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
}
//# sourceMappingURL=client.d.ts.map