Permalink
Browse files

NCDevCon Sept 2011

slide deck and sample code
  • Loading branch information...
1 parent e5950ef commit d95b7961fc653cac03a012e0b8ebfe73dfedb815 Sidney Maestre committed Apr 26, 2012
Showing with 21,579 additions and 0 deletions.
  1. BIN NCDevCon-Sept2011/X.commerce-NCDevCon.pptx
  2. +42 −0 NCDevCon-Sept2011/ncdevcon/ap-lib/services/CallerService.cfc
  3. +136 −0 NCDevCon-Sept2011/ncdevcon/button-manager/Application.cfc
  4. +48 −0 NCDevCon-Sept2011/ncdevcon/button-manager/ajax.cfm
  5. +77 −0 NCDevCon-Sept2011/ncdevcon/button-manager/buttonmanager.cfc
  6. +68 −0 NCDevCon-Sept2011/ncdevcon/button-manager/index.cfm
  7. +38 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/DirectPayment.cfc
  8. +173 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/ExpressCheckout.cfc
  9. +53 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/RecurringPayment.cfc
  10. +164 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/Transaction.cfc
  11. +118 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/services/CallerService.cfc
  12. +22 −0 NCDevCon-Sept2011/ncdevcon/button-manager/lib/services/DisplayService.cfc
  13. +152 −0 NCDevCon-Sept2011/ncdevcon/checkout01/Application.cfc
  14. +80 −0 NCDevCon-Sept2011/ncdevcon/checkout01/checkout02.cfm
  15. +87 −0 NCDevCon-Sept2011/ncdevcon/checkout01/checkout03.cfm
  16. +75 −0 NCDevCon-Sept2011/ncdevcon/checkout01/checkout04.cfm
  17. +174 −0 NCDevCon-Sept2011/ncdevcon/checkout01/css/sdk.css
  18. BIN NCDevCon-Sept2011/ncdevcon/checkout01/images/horse.jpg
  19. +23 −0 NCDevCon-Sept2011/ncdevcon/checkout01/index.cfm
  20. +139 −0 NCDevCon-Sept2011/ncdevcon/checkout02/Application.cfc
  21. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/ajax-loader.png
  22. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/icon-search-black.png
  23. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/icons-18-black.png
  24. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/icons-18-white.png
  25. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/icons-36-black.png
  26. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/images/icons-36-white.png
  27. +1,643 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/css/jquery.mobile-1.0b2.css
  28. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/images/12-eye.png
  29. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/images/background.jpg
  30. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/images/icon-eye-18.png
  31. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/images/icon-eye-36.png
  32. BIN NCDevCon-Sept2011/ncdevcon/checkout02/assets/images/myWineIcon.png
  33. +18 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/jquery-1.6.2.min.js
  34. +6,259 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/jquery.mobile-1.0b2.js
  35. +1 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/json2.js
  36. +2,381 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.js
  37. +286 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.min.js
  38. +236 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.store.memory.js
  39. +893 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.store.sql.js
  40. +121 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.store.sqlite.js
  41. +216 −0 NCDevCon-Sept2011/ncdevcon/checkout02/assets/js/persistence.store.websql.js
  42. +80 −0 NCDevCon-Sept2011/ncdevcon/checkout02/checkout02.cfm
  43. +106 −0 NCDevCon-Sept2011/ncdevcon/checkout02/checkout03.cfm
  44. +174 −0 NCDevCon-Sept2011/ncdevcon/checkout02/css/sdk.css
  45. BIN NCDevCon-Sept2011/ncdevcon/checkout02/images/horse.jpg
  46. +47 −0 NCDevCon-Sept2011/ncdevcon/checkout02/index.cfm
  47. +134 −0 NCDevCon-Sept2011/ncdevcon/checkout03/Application.cfc
  48. +80 −0 NCDevCon-Sept2011/ncdevcon/checkout03/checkout02.cfm
  49. +87 −0 NCDevCon-Sept2011/ncdevcon/checkout03/checkout03.cfm
  50. +75 −0 NCDevCon-Sept2011/ncdevcon/checkout03/checkout04.cfm
  51. +174 −0 NCDevCon-Sept2011/ncdevcon/checkout03/css/sdk.css
  52. BIN NCDevCon-Sept2011/ncdevcon/checkout03/images/horse.jpg
  53. +23 −0 NCDevCon-Sept2011/ncdevcon/checkout03/index.cfm
  54. +156 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/Application.cfc
  55. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/_notes/dwsync.xml
  56. +20 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/cancel.cfm
  57. +130 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/connect.cfc
  58. +38 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/DirectPayment.cfc
  59. +173 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/ExpressCheckout.cfc
  60. +64 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/ExpressCheckoutOLD.cfc
  61. +49 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/RecurringPayment.cfc
  62. +160 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/Transaction.cfc
  63. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/_notes/dwsync.xml
  64. +114 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/services/CallerService.cfc
  65. +21 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/services/DisplayService.cfc
  66. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/lib/services/_notes/dwsync.xml
  67. +67 −0 NCDevCon-Sept2011/ncdevcon/embedded/coldfusion/success.cfm
  68. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/css/_notes/dwsync.xml
  69. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/css/images/_notes/dwsync.xml
  70. BIN NCDevCon-Sept2011/ncdevcon/embedded/css/images/close.png
  71. BIN NCDevCon-Sept2011/ncdevcon/embedded/css/images/controls.png
  72. +50 −0 NCDevCon-Sept2011/ncdevcon/embedded/css/style.css
  73. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/images/_notes/dwsync.xml
  74. BIN NCDevCon-Sept2011/ncdevcon/embedded/images/angrybirds.png
  75. BIN NCDevCon-Sept2011/ncdevcon/embedded/images/trans.png
  76. +65 −0 NCDevCon-Sept2011/ncdevcon/embedded/index.html
  77. +1 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/_notes/dwsync.xml
  78. +840 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/dg-mod.js
  79. +27 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/game.js
  80. +18 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/jquery-1.6.2.min.js
  81. +161 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/xconnect.js
  82. +240 −0 NCDevCon-Sept2011/ncdevcon/embedded/js/xconnectOLD.js
  83. +28 −0 NCDevCon-Sept2011/ncdevcon/index.html
  84. BIN NCDevCon-Sept2011/ncdevcon/ipn/filecontent.pdf
  85. BIN NCDevCon-Sept2011/ncdevcon/ipn/form.pdf
  86. +37 −0 NCDevCon-Sept2011/ncdevcon/ipn/index.cfm
  87. +62 −0 NCDevCon-Sept2011/ncdevcon/ipn/ipn.cfm
  88. BIN NCDevCon-Sept2011/ncdevcon/ipn/requestdata.pdf
  89. +38 −0 NCDevCon-Sept2011/ncdevcon/lib/DirectPayment.cfc
  90. +173 −0 NCDevCon-Sept2011/ncdevcon/lib/ExpressCheckout.cfc
  91. +53 −0 NCDevCon-Sept2011/ncdevcon/lib/RecurringPayment.cfc
  92. +164 −0 NCDevCon-Sept2011/ncdevcon/lib/Transaction.cfc
  93. +114 −0 NCDevCon-Sept2011/ncdevcon/lib/services/CallerService.cfc
  94. +22 −0 NCDevCon-Sept2011/ncdevcon/lib/services/DisplayService.cfc
  95. +85 −0 NCDevCon-Sept2011/ncdevcon/simplepay/Application.cfc
  96. +20 −0 NCDevCon-Sept2011/ncdevcon/simplepay/index.cfm
  97. +19 −0 NCDevCon-Sept2011/ncdevcon/simplepay/pay.cfm
  98. +152 −0 NCDevCon-Sept2011/ncdevcon/subscription01/Application.cfc
  99. +80 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/AuthorizationReceipt.cfm
  100. +37 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/BillOutStandingAmt.cfm
  101. +57 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoAuthorization.cfm
  102. +76 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoCapture.cfm
  103. +76 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoCaptureReceipt.cfm
  104. +214 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoDirectPayment.cfm
  105. +72 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoDirectPaymentReceipt.cfm
  106. +74 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoExpressCheckoutPayment.cfm
  107. +43 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoReauthorization.cfm
  108. +74 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoReauthorizationReceipt.cfm
  109. +39 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoVoid.cfm
  110. +82 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/DoVoidReceipt.cfm
  111. +16 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/GetBalance.cfm
  112. +74 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/GetBalanceReceipt.cfm
  113. +83 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/GetExpressCheckoutDetails.cfm
  114. +40 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/GetTransactionDetails.cfm
  115. +137 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/MassPay.cfm
  116. +83 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/MassPayReceipt.cfm
  117. +78 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/OutstandingAmtReceipt.cfm
  118. +283 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPcreateProfile.cfm
  119. +33 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPgetProfileDetails.cfm
  120. +42 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPmanageProfile.cfm
  121. +81 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPmanageProfileStatus.cfm
  122. +83 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPprofile.cfm
  123. +73 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RPprofileDetails.cfm
  124. +24 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RecurringPaymentsIndex.cfm
  125. +75 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RefundReceipt.cfm
  126. +68 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/RefundTransaction.cfm
  127. +87 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/ReviewOrder.cfm
  128. +124 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/SetExpressCheckout.cfm
  129. +181 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/ThreeDSecure.cfm
  130. +91 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/ThreeDSecureReceipt.cfm
  131. +100 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/TransactionDetails.cfm
  132. +53 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/TransactionSearch.cfm
  133. +135 −0 NCDevCon-Sept2011/ncdevcon/subscription01/archive/TransactionSearchResults.cfm
  134. +174 −0 NCDevCon-Sept2011/ncdevcon/subscription01/css/sdk.css
  135. +21 −0 NCDevCon-Sept2011/ncdevcon/subscription01/index.cfm
  136. +73 −0 NCDevCon-Sept2011/ncdevcon/subscription01/sub02.cfm
  137. +86 −0 NCDevCon-Sept2011/ncdevcon/subscription01/sub03.cfm
  138. +81 −0 NCDevCon-Sept2011/ncdevcon/subscription01/sub04.cfm
  139. +83 −0 NCDevCon-Sept2011/ncdevcon/subscription01/sub05.cfm
  140. +23 −0 NCDevCon-Sept2011/ncdevcon/subscription01/sub06.cfm
Binary file not shown.
@@ -0,0 +1,42 @@
+<cfscript>
+/*
+CallerService.cfc
+This ColdFusion component reused by all sample page to get credential information and
+it has getNVPResponse method which takes nvpString as parameter and return Nvpresponse
+as CF Struct object. using this object we can display the response values
+*/
+component output="false" {
+
+ serverURL = "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay";
+
+ public any function doHttppost( required struct requestData ) {
+
+ var httpService = new http();
+ httpService.setMethod("post");
+ httpService.setCharset("utf-8");
+ httpService.setUrl(serverURL);
+
+ for (key in requestData)
+ {
+ httpService.addParam(type="formfield",name="#key#",value="#requestData[key]#",encoded="yes");
+ }
+
+ httpService.addParam(type="header",name="X-PAYPAL-SECURITY-USERID",value="sidney_1311957058_biz_api1.x.com",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-SECURITY-PASSWORD",value="1311957099",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-SECURITY-SIGNATURE",value="AsWOI0XsYOW6SY4-RFW6nmQX9L2GAx2Dvzlusmnc2lLkNlYS6cilwiEc",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-DEVICE-IPADDRESS",value="cgi.remote_addr",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-REQUEST-DATA-FORMAT",value="NV",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-RESPONSE-DATA-FORMAT",value="JSON",encoded="yes");
+ httpService.addParam(type="header",name="X-PAYPAL-APPLICATION-ID",value="APP-80W284485P519543T",encoded="yes");
+
+ httpService.addParam(type="body",value="&actionType=PAY&trackingID=12345&cancelUrl=http://www.x.com&currencyCode=USD&receiverList.receiver(0).amount=50.00&receiverList.receiver(0).email=nc1_1316197521_per@x.com&receiverList.receiver(1).amount=99.00&receiverList.receiver(1).email=nc2_1316197650_per@x.com&requestEnvelope.errorLanguage=en_US&returnUrl=http://www.x.com/test/return.cfm",encoded="yes");
+
+ var result = httpService.send().getPrefix();
+
+ return deserializeJSON(result.filecontent);
+
+ }
+
+}
+
+</cfscript>
@@ -0,0 +1,136 @@
+<cfscript>
+/**
+@dateCreated "July 18, 2011"
+@hint "You implement methods in Application.cfc to handle ColdFusion application events and set variables in the CFC to configure application characteristics."
+*/
+
+
+component output="false" {
+
+ /* **************************** APPLICATION VARIABLES **************************** */
+ THIS.name = "NCDevConCheckout01";
+ THIS.applicationTimeout = createTimeSpan(0, 2, 0, 0);
+
+
+ customtagpaths = "#getDirectoryFromPath(ExpandPath('../lib/'))#";
+ THIS.customTagPaths = customtagpaths;
+
+ THIS.serverSideFormValidation = true;
+ THIS.sessionManagement = true;
+ THIS.sessionTimeout = createTimeSpan(0, 0, 30, 0);
+
+ THIS.setClientCookies = true;
+ THIS.setDomainCookies = false;
+
+ THIS.scriptProtect = true;
+ THIS.secureJSON = false;
+ THIS.secureJSONPrefix = "";
+
+
+ THIS.enablerobustexception = true;
+
+
+/* **************************** APPLICATION METHODS **************************** */
+
+ public void function onApplicationEnd(struct ApplicationScope=structNew()) {
+
+ return;
+ }
+
+
+ public boolean function onApplicationStart() {
+
+ return true;
+ }
+
+
+
+ public void function onRequestEnd() {
+
+ return;
+ }
+
+
+ public boolean function onRequestStart(required string TargetPage) {
+
+ request.serverURL = "https://api-3t.sandbox.paypal.com/nvp";
+
+ /* SUBJECT to be uncommented for UNIPAY all the other credentials like API username,
+ password,signature can be commented for UNIPAY
+ To enable Payments for Third Party Email whcih will be passed along with Partner's 3token credentials
+ uncomment both subject and 3 token credentials.
+ */
+
+
+ //request.SUBJECT="sidney@x.com";
+
+ APIuserName = "sidney_1311957058_biz_api1.x.com";
+ APIPassword = "1311957099";
+ APISignature = "AsWOI0XsYOW6SY4-RFW6nmQX9L2GAx2Dvzlusmnc2lLkNlYS6cilwiEc";
+
+
+ //condition to check if it is UNIPAY
+ if (isdefined("SUBJECT") && (isdefined("APIuserName") eq "false" && isdefined("APIPassword") eq "false" && isdefined("APISignature") eq "false") )
+ {
+ request.UNIPAYSUBJECT="#SUBJECT#";
+ request.USER = "";
+ request.PWD = "";
+ request.SIGNATURE = "";
+ }
+
+
+
+ //condition to check if it is Payments for Third Party Email
+ if (isdefined("SUBJECT") && isdefined("APIuserName") && isdefined("APIPassword") && isdefined("APISignature"))
+ {
+ request.UNIPAYSUBJECT="#SUBJECT#";
+ request.USER = "#APIuserName#";
+ request.PWD = "#APIPassword#";
+ request.SIGNATURE = "#APISignature#";
+ }
+
+
+ //condition to check if it is 3 token credentials
+ if (isdefined("SUBJECT") eq "false" && isdefined("APIuserName") && isdefined("APIPassword") && isdefined("APISignature") )
+ {
+ request.UNIPAYSUBJECT="";
+ request.USER = "#APIuserName#";
+ request.PWD = "#APIPassword#";
+ request.SIGNATURE = "#APISignature#";
+ }
+
+
+ request.PayPalURL = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
+ request.version = "78";
+
+ /*
+ By default the API requests doesn't go through proxy. To route the requests through a proxy server
+ set "useProxy" value as "true" and set values for proxyName and proxyPort. Set proxyName with
+ the Host Name or the IP address of the proxy server. proxyPort should be a valid port number.
+ eg:
+ useProxy = "true";
+ proxyName = "127.0.0.1";
+ proxyPort = "8081";
+ */
+
+ request.useProxy = "false";
+ request.proxyName = "";
+ request.proxyPort = "";
+
+ return true;
+ }
+
+
+ public void function onSessionEnd(required struct SessionScope, struct ApplicationScope=structNew()) {
+
+ return;
+ }
+
+
+ public void function onSessionStart() {
+
+ return;
+ }
+
+}
+</cfscript>
@@ -0,0 +1,48 @@
+<html>
+<head>
+ <title>Button Manager</title>
+ <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
+
+ <script>
+ $(document).ready(function() {
+
+
+ $('#createButton').live('click',function(e)
+ {
+
+ $.ajax({
+ url: 'buttonmanager.cfc',
+ data: 'method=BMCreateButton',
+ success: function(data){
+ var obj = $.parseJSON(data);
+ console.log(obj['code']);
+ $('#ppButton').append(obj['code']);
+
+ },
+ error: function(request, textStatus, error){
+
+ }
+ });
+
+ });
+
+ });
+ </script>
+
+
+</head>
+<body>
+
+<a href="#" id="createButton">create button</a>
+<p id="ppButton">
+
+</p>
+
+
+
+<br><br>
+<a href="../index.html">home</a>
+
+
+</body>
+</html>
@@ -0,0 +1,77 @@
+<cfcomponent>
+ <cfscript>
+
+ // create our objects to call methods on
+ caller = createObject("component","lib.services.CallerService");
+ /*
+ serverName = SERVER_NAME;
+ serverPort = CGI.SERVER_PORT;
+ contextPath = GetDirectoryFromPath(#SCRIPT_NAME#);
+ protocol = CGI.SERVER_PROTOCOL;
+ */
+ </cfscript>
+
+ <cffunction name="BMCreateButton" access="remote" returntype="any" returnFormat="JSON">
+
+ <cfscript>
+ var responseStruct="";
+ var returnObj = StructNew();
+
+ try {
+ // create our objects to call methods on
+
+ data = StructNew();
+ data.USER = request.USER;
+ data.PWD = request.PWD;
+ data.SIGNATURE = request.SIGNATURE;
+ data.VERSION = "84";
+
+ data.URLBASE = request.serverURL;
+ data.USEPROXY = false;
+
+ data.METHOD = "BMCreateButton";
+
+ data.BUTTONCODE = "cleartext"; // hosted, encrypted, cleartext
+ data.BUTTONTYPE = "buynow";
+
+ //data.L_BUTTONVAR0 = "business=sidney_1311957058_biz@x.com";
+ data.L_BUTTONVAR1 = "item_name=T-shirt";
+ data.L_BUTTONVAR2 = "amount=20.00";
+ //data.L_BUTTONVAR3 = "no_shipping=1";
+ //data.L_BUTTONVAR4 = "currency_code=USD";
+ //data.L_BUTTONVAR5 = "no_note=1";
+
+ response = caller.doHttppost(data);
+
+ responseStruct = caller.getNVPResponse(#URLDecode(response)#);
+
+ if (responseStruct.Ack is not "Success")
+ {
+ Throw(type="InvalidData",
+ message="Response:#responseStruct.Ack#, ErrorCode: #responseStruct.L_ERRORCODE0#,
+ Message: #responseStruct.L_LONGMESSAGE0#");
+
+ } else {
+ code = responseStruct.websitecode;
+ }
+
+
+ returnObj['success'] = true;
+ returnObj['code'] = code;
+
+ }
+
+ catch(any e)
+ {
+ returnObj['success'] = true;
+ returnObj['error'] = e.message;
+ }
+
+
+ return serializeJSON(returnObj);
+ </cfscript>
+
+ </cffunction>
+
+
+</cfcomponent>
@@ -0,0 +1,68 @@
+<cfoutput>
+<html>
+<head>
+ <title>Subscription process</title>
+ <link href="sdk.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<cfscript>
+code = "";
+responseStruct="";
+ try {
+ // create our objects to call methods on
+ caller = createObject("CallerService");
+
+ data = StructNew();
+ data.USER = request.USER;
+ data.PWD = request.PWD;
+ data.SIGNATURE = request.SIGNATURE;
+ data.VERSION = "78";
+
+ data.SERVERURL = request.serverURL;
+ data.USEPROXY = false;
+
+ data.METHOD = "BMCreateButton";
+
+ data.BUTTONCODE = "hosted";
+ data.BUTTONTYPE = "buynow";
+
+ data.L_BUTTONVAR0 = "business=sidney_1311957058_biz@x.com";
+ data.L_BUTTONVAR1 = "item_name=Virtual Cow";
+ data.L_BUTTONVAR2 = "amount=1.50";
+ data.L_BUTTONVAR3 = "no_shipping=1";
+ data.L_BUTTONVAR4 = "currency_code=USD";
+ data.L_BUTTONVAR5 = "no_note=1";
+
+ response = caller.doHttppost(data);
+
+ responseStruct = caller.getNVPResponse(#URLDecode(response)#);
+
+ if (responseStruct.Ack is not "Success")
+ {
+ Throw(type="InvalidData",message="Response:#responseStruct.Ack#, ErrorCode: #responseStruct.L_ERRORCODE0#, Message: #responseStruct.L_LONGMESSAGE0#");
+
+ } else {
+ code = responseStruct.websitecode;
+ }
+
+ }
+
+ catch(any e)
+ {
+ writeOutput("Error: " & e.message);
+ writeDump(responseStruct);
+ }
+
+</cfscript>
+
+
+#code#
+
+
+
+<br><br>
+<a href="../index.html">home</a>
+
+</body>
+</html>
+</cfoutput>
Oops, something went wrong.

0 comments on commit d95b796

Please sign in to comment.