Preauthorization - max-power/paymill-ruby GitHub Wiki

If you’d like to reserve some money from the client’s creditcard but you’d also like to execute the transaction itself a bit later, then use preauthorizations.

Create new Preauthorization with ...

Use either a token or an existing payment to authorize the given amount

… Token

with_token = {
  token: "098f6bcd4621d373cade4e832627b4f6",
  amount: 4200,
  currency: "EUR"
}
Paymill::Preauthorization.create(with_token)

… Payment

with_payment = {
  payment: "pay_d43cf0ee969d9847512b",
  amount: 4200,
  currency: "EUR"
}
Paymill::Preauthorization.create(with_payment)

Preauthorization Details

Returns data of a specific preauthorization.

Paymill::Preauthorization.find('preauth_31eb90495837447f76b7')

List Preauthorizations

This function returns a JSON object with a list of preauthorizations.

Paymill::Preauthorization.all
Paymill::Preauthorization.where(created_at: '>1353269532').limit(10).all