authorize_card

authorize_card Puts a hold on a card for an amount without taking the money, to be taken later with capture_card or let go with release_card: a deposit, an escrow, a reservation. Needs a Stripe payment resource (the project's E-Commerce Server role); with PayPal it returns an error string.

Runs on: the server only. The statement that calls it runs on the server, and its result is a server-side value: the server keeps it, the device never writes it, and it is copied to the device only when a device statement reads it.

Format:

authorize_card(cardinfo, total, description)

Parameters:

Parameter Type Description
cardinfo object The values of a credit card form (_cardvalues_)
total number The amount to hold, in the resource's currency (dollars and cents)
description string What the hold is for, as the card holder's statement shows it

Returned Value:

Type Description
string "OK" and the server variable transaction_record_id names the transaction record (its authorization id is the hold), or an error message

Examples

 result = authorize_card(_cardvalues_, deposit, "Deposit for the rental")