boletia/conekta-go — pull request #1 by nubleer (2014-09-25 18:30:59+00:00)
Title: Added support for doing card pre authorizations

Conekta supports charge pre authorizations to validate a card before doing any actual charge. I've added the "Capture" parameter to the Charge struct. If you want to preauthorize a charge, just send a Capture=false value. The transaction will appear in the Conekta https logs with a status of "pre_authorized". The bank will hold the amount of the charge for a max period of 24 hrs and then the amount will be returned to the bank account.

The advantage of doing this, is that Conekta does not take a fee because no actual money transaction is made.

This method is undocumented in the Conekta API and was provided over the phone by its support team. To use it, you should add an extra parameter in your Charge struct:

```go
client := conekta.NewClient()
capture := false
charge := conekta.Charge{
Description: "Some description",
Amount: 45000,
Capture: &capture
Cash: PaymentOxxo{"type":"oxxo"},
}

charge, err = client.Charges.Create(charge)
```