This documenation covers the ColdFusion cfPaymill (v0.3.6) wrapper component for the Paymill v2.0 API service.
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.
I instaniate and return a cfPaymill object.
cfPaymill = createObject("component", "cfPaymill").init(privateKey="8a4d1230504c19caf55d02f150730afa", publicKey="148466278085160bc9d8ee20b29d279f", apiEndpoint="https://api.paymill.com/v2/")
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. |
I create a Paymill Client object and return the result as a structure.
client = cfPaymill.addClient(email="jack@nicholson.com", description="Jack Nicholson")
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. |
I get a Paymill Client object and return the result as a structure.
client = cfPaymill.getClient(id="client_c2c4472b91660675567a")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Client. |
I get all the Paymill Client objects and return the result as a structure.
clients = cfPaymill.getClients(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)
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. |
I update a Paymill Client object and return the result as a structure.
client = cfPaymill.updateClient(id="client_c2c4472b91660675567a", email="jack@nicholson.com", description="Jack Nicholson")
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. |
I delete an existing Paymill Client object and return the result as a structure.
client = cfPaymill.deleteClient(id="client_c2c4472b91660675567a")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Client. |
I create a Paymill Offer object and return the result as a structure.
offer = cfPaymill.addOffer(amount="42.71", currency="GBP", interval="21 DAY", name="Life Insurance")
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. |
I get a Paymill Offer object and return the result as a structure.
offer = cfPaymill.getOffer(id="offer_6551988075034162d14c")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Offer. |
I get all the Paymill Offer objects and return the result as a structure.
offers = cfPaymill.getOffers(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)
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. |
I update a Paymill Offer object and return the result as a structure.
offer = cfPaymill.updateOffer(id="offer_bbb34ecffc5b07f4baf2", name="Magazine Subscription")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Offer. |
name (required, string="") | I am the name of the Offer. |
I delete an existing Paymill Offer object and return the result as a structure.
offer = cfPaymill.deleteOffer(id="offer_b36e949b8851b8f0e199")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Offer. |
I create a Paymill Payment object and return the result as a structure.
payment = cfPaymill.addPayment(token="098f6bcd4621d373cade4e832627b4f6", client="client_c2c4472b91660675567a")
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. |
I get a Paymill Payment object and return the result as a structure.
payment = cfPaymill.getPayment(id="pay_cd824ab3101ca82bbafe2b10cfbe")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Payment. |
I get all the Paymill Payment objects and return the result as a structure.
payments = cfPaymill.getPayments(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)
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. |
I create a Paymill Transaction object and return the result as a structure.
transaction = cfPaymill.addTransaction(amount="10.24", currency="GBP", token="098f6bcd4621d373cade4e832627b4f6", client="client_c2c4472b91660675567a", description="Purchase of film memorabilia")
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="") |
I get a Paymill Transaction object and return the result as a structure.
transaction = cfPaymill.getTransaction(id="tran_2e1b80b967ad323e9e3deb6cbe63")
Argument | Description |
---|---|
id (required, string) | I am the ID of an existing Transaction. |
I get all the Paymill Transaction objects and return the result as a structure.
transactions = cfPaymill.getTransactions(count=5, offset=20, orderFilter1="value1", orderFilter2="value2", orderFilter3="value3", etc.)
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. |