Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ColdFusion payment processing library makes plumbing e-commerce apps easy. Charging credit cards has never been easier. Inspired by Ruby's ActiveMerchant.

License

Notifications You must be signed in to change notification settings

jack4dev/cfpayment

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFPAYMENT

ColdFusion payment processing library makes plumbing e-commerce apps easy.

Rather than roll your own credit card, ACH or alternative payment gateway with error, currency and money handling, leverage one of our production-tested gateways or extend our base gateway and write only the code necessary to create requests and parse responses for your gateway. Eliminates writing boilerplate code and handling esoteric CFHTTP errors that only seem to happen in production.

Tens of millions of dollars have been processed successfully. Inspired by Ruby's ActiveMerchant.

Install

A "/cfpayment" mapping is required to the cfpayment root folder. Either add it via the Admin or on CF8+, create a per-application mapping in the Application.cfc:

this.mappings["/cfpayment"] = "/path/to/your/cfpayment/folder";

Charge an Account in 6 Lines of Code

// initialize gateway
cfg = { path = "stripe.stripe", TestSecretKey = "tGN0bIwXnHdwOa85VABjPdSn8nWY7G7I" };
svc = createObject("component", "cfpayment.api.core").init(cfg);
gw = svc.getGateway();


// create the account; setters return 'this' to allow method chaining like jquery
account = svc.createCreditCard().setAccount(4242424242424242).setMonth(10).setYear(year(now())+1))
             .setFirstName("John").setLastName("Doe");

// in cents = $50.00, defaults to USD but can take any ISO currency code
money = svc.createMoney(5000); 

// charge the card
response = gw.purchase(money = money, account = account);

// did we succeed?
if (response.getSuccess()) {
  // yay!  look at response.getResult() or response.getParsedResult()
  // verify response.isValidAVS() or response.isValidCVV()
} else {
  // check response.getStatus(), output response.getMessage()
}

About

ColdFusion payment processing library makes plumbing e-commerce apps easy. Charging credit cards has never been easier. Inspired by Ruby's ActiveMerchant.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • ColdFusion 97.5%
  • Java 2.2%
  • HTML 0.3%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.