@linode/api-v4
Version:
JavaScript wrapper around the Linode APIv4
94 lines • 3.25 kB
TypeScript
import { Filter, Params, ResourcePage } from '../types';
import { ClientToken, Payment, PaymentMethod, PaymentResponse, SaveCreditCardData, MakePaymentData, PaymentMethodPayload } from './types';
/**
* getPayments
*
* Retrieve a paginated list of the most recent payments made
* on your account.
*
*/
export declare const getPayments: (params?: Params, filter?: Filter) => Promise<ResourcePage<Payment>>;
/**
* makePayment
*
* Make a payment using the currently active credit card on your
* account, a nonce, or by another payment method on your account
* (by providing its id).
*
* @param data { object }
* @param data.usd { string } the dollar amount of the payment
* @param data.cvv { string } the 3-digit code on the back of the
* @param data.nonce { string } the payment nonce to make a one time payment
* @param data.payment_method_id { number } the payment nonce to make a one time payment
*
*/
export declare const makePayment: (data: MakePaymentData) => Promise<PaymentResponse>;
/**
* saveCreditCard
*
* Add or update credit card information to your account. Only one
* card is allowed per account, so this method will overwrite any
* existing information.
* @deprecated Use POST /account/payment-methods
*/
export declare const saveCreditCard: (data: SaveCreditCardData) => Promise<{}>;
/**
* getPaymentMethods
*
* Gets a paginatated list of all the payment methods avalible
* on a user's account
*
*/
export declare const getPaymentMethods: (params?: Params) => Promise<ResourcePage<PaymentMethod>>;
/**
* getPaymentMethod
*
* Gets information about a specific payment method on
* your account.
*
* @param id {number} the id of the payment method
*
*/
export declare const getPaymentMethod: (id: number) => Promise<PaymentMethod>;
/**
* getClientToken
*
* Gets a unique token that is used to interact with the
* Braintree front-end SDK
*
*/
export declare const getClientToken: () => Promise<ClientToken>;
/**
* addPaymentMethod
*
* Adds a new payment method to a user's account via a nonce.
*
* @param data { object }
* @param data.type { string } 'credit_card' or 'payment_method_nonce'
* @param data.is_default { boolean } whether or not this payment method should be considered the default
* @param data.data { object } this will be data containing a nonce or credit card info
* @param data.data.nonce { string } the nonce for the payment method to be added
* @param data.data.card_number { string } a credit card number
* @param data.data.expiry_year { number } credit card's expiry year
* @param data.data.expiry_month { number } credit card's expiry month
* @param data.data.cvv { string } credit card's cvv
*
*/
export declare const addPaymentMethod: (data: PaymentMethodPayload) => Promise<{}>;
/**
* makeDefaultPaymentMethod
*
* Action endpoint to change your default payment method
*
* @param id {number} id of the payment method
*/
export declare const makeDefaultPaymentMethod: (id: number) => Promise<{}>;
/**
* deletePaymentMethod
*
* Delete the specifed payment method.
*
* @param id {number} The id of the payment method to delete.
*/
export declare const deletePaymentMethod: (id: number) => Promise<{}>;
//# sourceMappingURL=payments.d.ts.map