Home Reference Source
public class | source

CreditCard

Extends:

Base → CreditCard

Method Summary

Public Methods
public

all(customerID: string): Promise

CreditCard all method.

public

capture(chargeID: string, amount: number): Promise

CreditCard capture method.

public

chargeByID(cardID: string, amount: number, description: string, currency: string): Promise

CreditCard chargeByID method.

public

chargeByToken(token: string, amount: number, description: string, currency: string): Promise

CreditCard chargeByToken method.

public

create(card: object, customerID: string): Promise

CreditCard create method.

public

createFromToken(token: object, customerID: string): Promise

CreditCard createFromToken method.

public

get(cardID: object, customerID: string): Promise

CreditCard get method.

public

getRefund(chargeID: string, refundID: string): Promise

CreditCard getRefund method.

public

receipt(chargeID: string): Promise

CreditCard receipt method.

public

refund(chargeID: string, amount: number, reason: string): Promise

CreditCard refund method.

public

remove(cardID: object, customerID: string): Promise

CreditCard remove method.

Inherited Summary

From class Base
public
public
public

realmID: *

public

version: *

public

all()

public

create(info: *)

public

createFromToken(info: *)

public

formatUrl(path: *): string

public

get(id: *)

public

remove(id: *)

public

request(method: *, path: *, params: {}): *

public

update(id: *, info: *)

Public Methods

public all(customerID: string): Promise source

CreditCard all method.

Retrieve all credit cards through the Intuit Quickbooks payment API

Required Options:

  • customerID identifier for the customer

Examples:

CreditCard().all('customer-id');

Override:

Base#all

Params:

NameTypeAttributeDescription
customerID string

Return:

Promise

promise containing network response object

public capture(chargeID: string, amount: number): Promise source

CreditCard capture method.

Capture an existing charge through the Intuit Quickbooks payment API

Required Options:

  • chargeID identifier of the charge
  • amount amount to capture

Examples:

CreditCard().capture('some-id');

Params:

NameTypeAttributeDescription
chargeID string
amount number

Return:

Promise

promise containing network response object

public chargeByID(cardID: string, amount: number, description: string, currency: string): Promise source

CreditCard chargeByID method.

Charge a credit card through the Intuit Quickbooks payment API

Required Options:

  • cardID identifier of the card
  • amount the amount to charge the card
  • description description for the charge
  • currency the amount to charge will be in (default USD)

Examples:

CreditCard().chargeByID('some-id', 10.55);

Params:

NameTypeAttributeDescription
cardID string
amount number
description string
currency string

Return:

Promise

promise containing network response object

public chargeByToken(token: string, amount: number, description: string, currency: string): Promise source

CreditCard chargeByToken method.

Charge a credit card through the Intuit Quickbooks payment API

Required Options:

  • token tokenized version of the card
  • amount the amount to charge the card
  • currency the amount to charge will be in (default USD)
  • description description for the charge

Examples:

CreditCard().chargeByToken('some-token', 10.55);

Params:

NameTypeAttributeDescription
token string
amount number
description string
currency string

Return:

Promise

promise containing network response object

public create(card: object, customerID: string): Promise source

CreditCard create method.

Create a credit card object through the Intuit Quickbooks payment API

Required Options:

  • card
    • number number on the card
    • expMonth expiration month on the card
    • expYear expiration year on the card
    • name name on the card
    • address
      • streetAddress street address of billing address
      • city city of billing address
      • region region of billing address
      • country country of billing address
      • postalCode postalCode of billing address
  • customerID identifier for the customer

Examples:

CreditCard().create({
  "number": "4408041234567893",
  "expMonth": "12",
  "expYear": "2026",
  "name": "Test User",
  "address": {
    "streetAddress": "1245 Hana Rd",
    "city": "Richmond",
    "region": "VA",
    "country": "US",
    "postalCode": "44112"
  }
}, 'customer-id');

Override:

Base#create

Params:

NameTypeAttributeDescription
card object
customerID string

Return:

Promise

promise containing network response object

public createFromToken(token: object, customerID: string): Promise source

CreditCard createFromToken method.

Create a credit card object through the Intuit Quickbooks payment API

Required Options:

  • token tokenized version of the card
  • customerID identifier for the customer

Examples:

CreditCard().createFromToken('some-token', 'customer-id');

Override:

Base#createFromToken

Params:

NameTypeAttributeDescription
token object
customerID string

Return:

Promise

promise containing network response object

public get(cardID: object, customerID: string): Promise source

CreditCard get method.

Retrieve a credit card through the Intuit Quickbooks payment API

Required Options:

  • cardID identifier of the card
  • customerID identifier for the customer

Examples:

CreditCard().get('identifier', 'customer-id');

Override:

Base#get

Params:

NameTypeAttributeDescription
cardID object
customerID string

Return:

Promise

promise containing network response object

public getRefund(chargeID: string, refundID: string): Promise source

CreditCard getRefund method.

Get information about a refund through the Intuit Quickbooks payment API

Required Options:

  • chargeID identifier of the charge
  • refundID identifier of the refund

Examples:

CreditCard().getRefund('some-id');

Params:

NameTypeAttributeDescription
chargeID string
refundID string

Return:

Promise

promise containing network response object

public receipt(chargeID: string): Promise source

CreditCard receipt method.

Retrieve a charge through the Intuit Quickbooks payment API

Required Options:

  • chargeID identifier of the charge

Examples:

CreditCard().receipt('some-id');

Params:

NameTypeAttributeDescription
chargeID string

Return:

Promise

promise containing network response object

public refund(chargeID: string, amount: number, reason: string): Promise source

CreditCard refund method.

Process a refund for a charge through the Intuit Quickbooks payment API

Required Options:

  • chargeID identifier of the charge
  • amount amount to capture
  • reason reason for the refund

Examples:

CreditCard().refund('some-id', 5.00, 'the reason');

Params:

NameTypeAttributeDescription
chargeID string
amount number
reason string

Return:

Promise

promise containing network response object

public remove(cardID: object, customerID: string): Promise source

CreditCard remove method.

Remove a credit card through the Intuit Quickbooks payment API

Required Options:

  • cardID identifier of the card
  • customerID identifier for the customer

Examples:

CreditCard().remove('identifier', 'customer-id');

Override:

Base#remove

Params:

NameTypeAttributeDescription
cardID object
customerID string

Return:

Promise

promise containing network response object