Class: PaymentService

Defined in: src/service/payment/hapi.coffee

Overview

The default PaymentService, as used by a PurchaseService.

Instance Method Summary

Constructor Details

- (void) constructor(client)

Create a new PaymentService with a HAPILib restClient.

Parameters:

  • client (Object) A HAPILib restClient

Throws:

  • (Error) — If not passed a client with a post method

Instance Method Details

- (void) purchase(userId, goodId, callback)

Purchase a good for a user.

Parameters:

  • userId (String/Integer) Id of the user to purchase the good for
  • goodId (String/Integer) Id of the good to purchase
  • callback (Function) A function to run on completion, accepting arguments error, response