mangopay v0.1.0 MangoPay.PreAuthorization

Functions for MangoPay pre authorization.

Link to this section Summary

Functions

List all preauthorizations for a credit card

List all preauthorizations for a credit card

List all preauthorizations for a user

List all preauthorizations for a user

Cancel a preauthorization

Cancel a preauthorization

Create a preauthorization

Create a preauthorization

Get a preauthorization

Get a preauthorization

Get path called

Get path called

Link to this section Functions

Link to this function all_by_card(id, query \\ %{})

List all preauthorizations for a credit card.

Examples

{:ok, preauthorizations} = MangoPay.PreAuthorization.all_by_card("card_id")
Link to this function all_by_card!(id, query \\ %{})

List all preauthorizations for a credit card.

Examples

preauthorizations = MangoPay.PreAuthorization.all_by_card!("card_id")
Link to this function all_by_user(id, query \\ %{})

List all preauthorizations for a user.

Examples

user_id                  = Id of a user object
query                    = %{
  "Page": 1,
  "Per_Page": 25,
  "Sort": "CreationDate:DESC",
  "ResultCode": "000000,009199",
  "Status": "CREATED",
  "PaymentStatus": "WAITING"
}
{:ok, preauthorizations} = MangoPay.PreAuthorization.all_by_user(user_id, query)
Link to this function all_by_user!(id, query \\ %{})

List all preauthorizations for a user.

Examples

user_id           = Id of a user
query             = %{
  "Page": 1,
  "Per_Page": 25,
  "Sort": "CreationDate:DESC",
  "ResultCode": "000000,009199",
  "Status": "CREATED",
  "PaymentStatus": "WAITING"
}
preauthorizations = MangoPay.PreAuthorization.all_by_user!(user_id, query)
Link to this function cancel(id, params)

Cancel a preauthorization.

Examples

params                  = %{
  "Tag": "custom meta",
  "PaymentStatus": "CANCELED"
}
{:ok, preauthorization} = MangoPay.PreAuthorization.cancel("preauthorization_id", params)
Link to this function cancel!(id, params)

Cancel a preauthorization.

Examples

params                  = %{
  "Tag": "custom meta",
  "PaymentStatus": "CANCELED"
}
preauthorization = MangoPay.PreAuthorization.cancel!("preauthorization_id", params)

Create a preauthorization.

Examples

params         = %{
  "Tag": "custom meta",
  "AuthorId": "8494514",
  "DebitedFunds": %{
    "Currency": "EUR",
    "Amount": 12
  },
  "Billing": %{
    "Address": %{
      "AddressLine1": "1 Mangopay Street",
      "AddressLine2": "The Loop",
      "City": "Paris",
      "Region": "Ile de France",
      "PostalCode": "75001",
      "Country": "FR"
    }
  },
  "SecureMode": "DEFAULT",
  "CardId": "14213157",
  "SecureModeReturnURL": "http://www.my-site.com/returnURL"
}
{:ok, preauthorization} = MangoPay.PreAuthorization.create(params)
Link to this function create!(params)

Create a preauthorization.

Examples

params         = %{
  "Tag": "custom meta",
  "AuthorId": "8494514",
  "DebitedFunds": %{
    "Currency": "EUR",
    "Amount": 12
  },
  "Billing": %{
    "Address": %{
      "AddressLine1": "1 Mangopay Street",
      "AddressLine2": "The Loop",
      "City": "Paris",
      "Region": "Ile de France",
      "PostalCode": "75001",
      "Country": "FR"
    }
  },
  "SecureMode": "DEFAULT",
  "CardId": "14213157",
  "SecureModeReturnURL": "http://www.my-site.com/returnURL"
}
preauthorization = MangoPay.PreAuthorization.create!(params)

Get a preauthorization.

Examples

{:ok, preauthorization} = MangoPay.PreAuthorization.get(id)

Get a preauthorization.

Examples

preauthorization = MangoPay.PreAuthorization.get!(id)

Get path called.

Examples

"/users" = MangoPay.User.path()

Get path called.

Examples

"/users/id" = MangoPay.User.path(id)