forked from pmcelhaney/payflowpro-api-for-coldfusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.txt
More file actions
50 lines (39 loc) · 1.78 KB
/
readme.txt
File metadata and controls
50 lines (39 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PayFlowPro Components for ColdFusion
Simple interface to process credit card transactions via Verisign PayFlowPro. It wraps around the HTTP interface using CFHTTP.
<!--- Change "TEST" to "LIVE" in live code --->
<cfset gateway = createObject("component", "HTTPPayFlowProGateway").init("TEST")>
<cfset transaction = gateway.createTransaction()>
<cfset transaction.setVendor(vendor)>
<cfset transaction.setUsernameAndPassword(username,password )>
<cfset transaction.setCardNumber(card_number)>
<cfset transaction.setExpirationMonthAndYear(expiration_month, expiration_year)>
<cfset transaction.setAmount(amount_to_charge)>
<cfset transaction.run()>
<cfoutput>
Approved? #transaction.approved()#<br>
Result Code: #transaction.resultCode()#<br>
Response Message: #transaction.responseMessage()#<br>
Auth code: #transaction.authCode()#<br>
PNREF: #transaction.pnRef()#
</cfoutput>
Another execution possibilities:
Charge Using Reference Transaction:
<cfset transaction = gateway.createTransaction()>
<cfset transaction.setVendor(vendor)>
<cfset transaction.setUsernameAndPassword(username,password)>
<cfset transaction.setReferenceTransaction(pnref)>
<cfset transaction.setAmount(amount_to_charge)>
<cfset transaction.run()>
Credit Using Reference Transaction:
<cfset transaction = gateway.createTransaction()>
<cfset transaction.setVendor(vendor)>
<cfset transaction.setUsernameAndPassword(username,password)>
<cfset transaction.setReferenceTransaction(pnref)>
<cfset transaction.setAmount(amount_to_credit)>
<cfset transaction.credit()>
Void Transaction Using Reference Transaction:
<cfset transaction = gateway.createTransaction()>
<cfset transaction.setVendor(vendor)>
<cfset transaction.setUsernameAndPassword(username,password)>
<cfset transaction.setReferenceTransaction(pnref)>
<cfset transaction.void()>