UNPKG

bitpay-sdk

Version:

Complete version of the NodeJS library for the new cryptographically secure BitPay API

95 lines (94 loc) 4.05 kB
import { RefundInterface } from '../Model/Invoice/Refund'; import { TokenContainer } from '../TokenContainer'; import { GuidGenerator } from '../util/GuidGenerator'; import { BitPayClient } from './BitPayClient'; export declare class RefundClient { private bitPayClient; private tokenContainer; private guidGenerator; constructor(bitPayClient: BitPayClient, tokenContainer: TokenContainer, guidGenerator: GuidGenerator); /** * Create a refund for a BitPay invoice. * * @param refund RefundInterface * @returns Refund An updated Refund Object * @throws RefundCreationException */ create(refund: RefundInterface): Promise<RefundInterface>; /** * Retrieve a previously made refund request on a BitPay invoice. * * @param refundId The BitPay refund ID. * @returns Refund BitPay Refund object with the associated Refund object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ get(refundId: string): Promise<RefundInterface>; /** * Retrieve a previously made refund request on a BitPay invoice by Guid. * * @param guid The BitPay GUID. * @returns Refund BitPay Refund object with the associated Refund object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ getByGuid(guid: string): Promise<RefundInterface>; /** * Retrieve a previously made refund request on a BitPay invoice by guid. * * @param invoiceId The BitPay refund Guid. * @returns Refund BitPay Refund object with the associated Refund object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ getRefunds(invoiceId: string): Promise<RefundInterface[]>; /** * Send a refund notification. * * @param refundId A BitPay refund ID. * @param refundToken The resource token for the refundId. * This token can be retrieved from the Bitpay's refund object. * @returns boolean An updated Refund Object * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ sendRefundNotification(refundId: string, refundToken: string): Promise<boolean>; /** * Update the status of a BitPay invoice. * * @param refundId BitPay refund ID. * @param status The new status for the refund to be updated. * @returns Refund A BitPay generated Refund object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ update(refundId: string, status: string): Promise<RefundInterface>; /** * Update the status of a BitPay invoice. * * @param guid BitPay refund Guid. * @param status The new status for the refund to be updated. * @returns Refund A BitPay generated Refund object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ updateByGuid(guid: string, status: string): Promise<RefundInterface>; /** * Cancel a previously submitted refund request on a BitPay invoice. * * @param refundId The refund Id for the refund to be canceled. * @returns Cancelled refund Object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ cancel(refundId: string): Promise<RefundInterface>; /** * Cancel a previously submitted refund request on a BitPay invoice * * @param guid The refund Guid for the refund to be canceled. * @returns Cancelled refund Object. * @throws BitPayApiException BitPayApiException class * @throws BitPayGenericException BitPayGenericException class */ cancelByGuid(guid: string): Promise<RefundInterface>; }