documentation

This documenation covers the ColdFusion cfPaymill (v0.3.6) wrapper component for the Paymill v2.0 API service.

installation

Download the v0.3.6 tagged version from the GitHub repository. Extract the file cfPaymill.cfc from the downloaded zip and place it in a location that is accessible to ColdFusion. That could be either in the webroot or a mapped directory specified in the ColdFusion Administrator or Application.cfc using the this.mappings setting.


init()

I instaniate and return a cfPaymill object.

Example

cfPaymill = createObject("component", "cfPaymill").init(privateKey="8a4d1230504c19caf55d02f150730afa", publicKey="148466278085160bc9d8ee20b29d279f", apiEndpoint="https://api.paymill.com/v2/")

Arguments

Argument Description
privateKey (required, string) I am the private key of the account as provided by Paymill. This must be either the test key or the live key.
publicKey (optional, string="") I am the public key of the account as provided by Paymill. This must be either the test key or the live key.
apiEndpoint (optional, string="https://api.paymill.com/v2/") I am the the URL of the Paymill REST API service.

addClient()

I create a Paymill Client object and return the result as a structure.

Example

client = cfPaymill.addClient(email="jack@nicholson.com", description="Jack Nicholson")

Arguments

Argument Description
email (optional, string="") I am the Client email address.
description (optional, string="") I am a description of the Client. I could be the client's name or I could be a reference to the database primary key for the client record.

Response

getClient()

I get a Paymill Client object and return the result as a structure.

Example

client = cfPaymill.getClient(id="client_c2c4472b91660675567a")

Arguments

Argument Description
id (required, string) I am the ID of an existing Client.

Response

getClients()

I get all the Paymill Client objects and return the result as a structure.

Example

clients = cfPaymill.getClients(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)

Arguments

Argument Description
count (optional, numeric=20) I am the number of records returned.
offset (optional, numeric=0) I am the offset of the first record returned.
orderFilter (optional, string="") I am a Paymill order field or filter value that follows the Paymill documentation . For example, order="amount_asc" and/or description="Joan Crawford" etc.

Response

updateClient()

I update a Paymill Client object and return the result as a structure.

Example

client = cfPaymill.updateClient(id="client_c2c4472b91660675567a", email="jack@nicholson.com", description="Jack Nicholson")

Arguments

Argument Description
id (required, string) I am the ID of an existing Client.
email (optional, string="") I am the Client email address.
description (optional, string="") I am a description of the Client. I could be the client's name or I could be a reference to the database primary key for the client.

Response

deleteClient()

I delete an existing Paymill Client object and return the result as a structure.

Example

client = cfPaymill.deleteClient(id="client_c2c4472b91660675567a")

Arguments

Argument Description
id (required, string) I am the ID of an existing Client.

Response

addOffer()

I create a Paymill Offer object and return the result as a structure.

Example

offer = cfPaymill.addOffer(amount="42.71", currency="GBP", interval="21 DAY", name="Life Insurance")

Arguments

Argument Description
amount (required, decimal) I am the Offer amount.
currency (required, string) I am the ISO 4217 currency code to be used for the Offer.
interval (required, string) I am the interval between charges on the Client's account. An interval is expressed by a integer following by a period of either DAY, WEEK, MONTH or YEAR. For example "3 WEEK".
name (required, string) I am the name of the Offer.

Response

getOffer()

I get a Paymill Offer object and return the result as a structure.

Example

offer = cfPaymill.getOffer(id="offer_6551988075034162d14c")

Arguments

Argument Description
id (required, string) I am the ID of an existing Offer.

Response

getOffers()

I get all the Paymill Offer objects and return the result as a structure.

Example

offers = cfPaymill.getOffers(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)

Arguments

Argument Description
count (optional, numeric=20) I am the number of records returned.
offset (optional, numeric=0) I am the offset of the first record returned.
orderFilter (optional, string="") I am a Paymill order field or filter value that follows the Paymill documentation . For example, order="amount_asc" and/or name="Magazine Subscription" etc.

Response

updateOffer()

I update a Paymill Offer object and return the result as a structure.

Example

offer = cfPaymill.updateOffer(id="offer_bbb34ecffc5b07f4baf2", name="Magazine Subscription")

Arguments

Argument Description
id (required, string) I am the ID of an existing Offer.
name (required, string="") I am the name of the Offer.

Response

deleteOffer()

I delete an existing Paymill Offer object and return the result as a structure.

Example

offer = cfPaymill.deleteOffer(id="offer_b36e949b8851b8f0e199")

Arguments

Argument Description
id (required, string) I am the ID of an existing Offer.

Response

addPayment()

I create a Paymill Payment object and return the result as a structure.

Example

payment = cfPaymill.addPayment(token="098f6bcd4621d373cade4e832627b4f6", client="client_c2c4472b91660675567a")

Arguments

Argument Description
token (required, string) I am the Paymill credit card token returned from the Paymill Bridge.
client (optional, string="") I am the Client ID returned when a new Client is created. If supplied, the selected Client is associated with the Payment.

Response

getPayment()

I get a Paymill Payment object and return the result as a structure.

Example

payment = cfPaymill.getPayment(id="pay_cd824ab3101ca82bbafe2b10cfbe")

Arguments

Argument Description
id (required, string) I am the ID of an existing Payment.

Response

getPayments()

I get all the Paymill Payment objects and return the result as a structure.

Example

payments = cfPaymill.getPayments(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)

Arguments

Argument Description
count (optional, numeric=20) I am the number of records returned.
offset (optional, numeric=0) I am the offset of the first record returned.
orderFilter (optional, string="") I am a Paymill order field or filter value that follows the Paymill documentation . For example, order="expire_year_asc" and/or card_type="Visa" etc.

Response

addTransaction()

I create a Paymill Transaction object and return the result as a structure.

Example

transaction = cfPaymill.addTransaction(amount="10.24", currency="GBP", token="098f6bcd4621d373cade4e832627b4f6", client="client_c2c4472b91660675567a", description="Purchase of film memorabilia")

Arguments

Argument Description
amount (required, decimal) I am the amount of the Transaction expressed in the base currency units. Cents for Euro and Dollar transactions. Pence for British Pounds.
currency (required, string) I am the ISO 4217 currency code to be used for the Transaction.
token (optional, string="") I am the Paymill credit card token returned from the Paymill Bridge. If supplied, a Payment and/or Preauthorization must not be provided.
payment (optional, string="") I am the Payment ID returned when a new Payment is created. If supplied, a Token and/or Preauthorization must not be provided.
preauthorization (optional, string="") I am the Preauthorization ID returned when a new Preauthorization is created. If supplied, a Token and/or Payment must not be provided.
client (optional, string="") I am the Client ID returned when a new Client is created. If a Token or Preauthorization is supplied, the Client value is ignored. If a Client is supplied a new Payment must also be supplied.
description (optional, string="")

Response

getTransaction()

I get a Paymill Transaction object and return the result as a structure.

Example

transaction = cfPaymill.getTransaction(id="tran_2e1b80b967ad323e9e3deb6cbe63")

Arguments

Argument Description
id (required, string) I am the ID of an existing Transaction.

Response

getTransactions()

I get all the Paymill Transaction objects and return the result as a structure.

Example

transactions = cfPaymill.getTransactions(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)

Arguments

Argument Description
count (optional, numeric=20) I am the number of records returned.
offset (optional, numeric=0) I am the offset of the first record returned.
orderFilter (optional, string="") I am a Paymill order field or filter value that follows the Paymill documentation . For example, order="amount_asc" and/or currency="gbp" etc.

Response