forked from dkyadav/CF_PP
/
GetBalanceReceipt.cfm
72 lines (61 loc) · 2.21 KB
/
GetBalanceReceipt.cfm
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!--
*************************************************
DoCaptureReceipt.cfm
This page takes necessary parameter from doCapture.cfm page
and pssing into doHttppost function which takes request value
as Struct Object it will call cfhttp tag to perform DoCapture.This
page will show the response value coming from the Server. If
any error occurs, the page will redirect to APIError.cfm to
show exact error details
*************************************************
-->
<head>
<title>PayPal CF SDK - DoCapture API</title>
<link href="sdk.css" rel="stylesheet" type="text/css" />
</head>
<body>
<cfset StructClear(Session)>
<CFOBJECT COMPONENT="CallerService" NAME="caller">
<CFTRY>
<CFSET requestData = StructNew()>
<CFSET requestData.METHOD = "GetBalance">
<CFSET requestData.USER = "#USERNAME#">
<CFSET requestData.PWD = "#PASSWORD#">
<CFSET requestData.SIGNATURE = "#SIGNATURE#">
<CFSET requestData.SUBJECT = "#UNIPAYSUBJECT#">
<CFSET requestData.VERSION = "#version#">
<!---
Calling doHttppost for API call
--->
<cfinvoke component="CallerService" method="doHttppost" returnvariable="response">
<cfinvokeargument name="requestData" value=#requestData#>
<cfinvokeargument name="serverURL" value=#serverURL#>
<cfinvokeargument name="proxyName" value=#proxyName#>
<cfinvokeargument name="proxyPort" value=#proxyPort#>
<cfinvokeargument name="useProxy" value=#useProxy#>
</cfinvoke>
<CFSET responseStruct = caller.getNVPResponse(#URLDecode(response)#)>
<CFSET messages = ArrayNew(1)>
<CFSET Session.resStruct ="#responseStruct#">
<CFIF responseStruct.Ack is "Success">
<br>
<center>
<font size=2 color=black face=Verdana><b>GetBalance Response</b></font>
<br>
<table class="api"><cfoutput>#displayText(responseStruct)#</cfoutput></table>
</center>
</CFIF>
<CFIF responseStruct.Ack is "Failure">
<CFLOCATION URL="APIError.cfm?error=fromServer">
</CFIF>
<CFCATCH>
<CFSET responseStruct = StructNew() >
<CFSET responseStruct.errorType = "#cfcatch.type#">
<CFSET responseStruct.errorMessage = "#cfcatch.message#">
<CFSET Session.resStruct = "#responseStruct#">
<CFLOCATION URL="APIError.cfm?error=fromClient">
</CFCATCH>
</CFTRY>
<a class="home" id="CallsLink" href="index.html">Home</a>
</body>
</html>