Skip to content

Preparing and Updating a Charge

Tom Kay edited this page Oct 13, 2021 · 4 revisions

Before being able to authorize payment, a charge must be prepared.

Prepare a Charge

ChargeHive.prepareCharge(merchantReference, chargeConfigurationObject)

Merchant Reference is required and should be unique for each separate amount you wish to charge.

Charge Configuration Object reference is below.

Update a Charge

ChargeHive.updateCharge(chargeConfigurationObject)

Eg. 1 USD = 100 cents

ChargeHive.updateCharge({amount: 100, currency: 'USD'});

Eg. 0.0000014 BTC = 140 satoshi

ChargeHive.updateCharge({amount: 140, currency: 'BTC'});

Charge Configuration Object

Field Default Description
amount 0 Amount should be set in the smallest denominator of the specified monetary unit.
currency ISO currency code
references {} Additional references to associate with this charge
labels
language
environment