hi guys,
 
i am getting an odd problem happening. we are using an external COM
object/hosted payments page (PXACCESS) for processing credit cards.
 
all works fine, except when the com object returns data to the site - it
seems to hit my response/confirmation page twice eg. duplicate records are
entered in the db, and duplicate emails sent to the member.
 
my code is below - if anyone can see what may be going wrong...
 
<cfparam name="URL.result" default="">
 
<cfif len(URL.result)>
 
 <cftry>
 
  <cfobject class="PxAccess.PxAccessCtrl" action="CREATE" name="pxAccess"
type="COM">
  <cfscript>
   pxAccess.Response = URL.result;
   pxAccess.UserId = application.settings.dps_username;
   pxAccess.DoProcessResponse();
   listing_id = trim(pxAccess.TxnData1);
   listing_rate_id = trim(pxAccess.TxnData2);
  </cfscript>
  
  <cfinvoke component="#application.listing#" method="authorise_payment">
   <cfinvokeargument name="listing_id" value="#listing_id#">
   <cfinvokeargument name="merchantReference"
value="#pxAccess.merchantReference#">
   <cfinvokeargument name="success" value="#pxAccess.success#">
   <cfinvokeargument name="authCode" value="#pxAccess.authCode#">
   <cfinvokeargument name="responseText" value="#pxAccess.responseText#">
   <cfinvokeargument name="DPSTxnRef" value="#pxAccess.DPSTxnRef#">
   <cfinvokeargument name="cardholdername"
value="#pxAccess.cardholdername#">
   <cfinvokeargument name="amountSettlement"
value="#pxAccess.amountSettlement#">
   <cfinvokeargument name="currencySettlement"
value="#pxAccess.currencySettlement#">
  </cfinvoke>
  
  <cfif pxAccess.success NEQ 0>
  
   <cfinvoke component="#application.listing#" method="renew_listing">
    <cfinvokeargument name="listing_id" value="#listing_id#">
    <cfinvokeargument name="listing_rate_id" value="#listing_rate_id#">
   </cfinvoke>
  
   <!--- email user --->
   <cfscript>
    getListing = application.listing.get(listing_id=listing_id);
    getUser =
application.user.get_user_from_id(profile_id=getListing.profile_id);
   </cfscript>
   <cfinclude template="_email/email_renewal_confirmation_to_user.cfm">
  
  </cfif>
  
  <cfcatch type="any">
   <cfoutput>
   <div>#cfcatch.message#</div>
   <div>#cfcatch.Detail#</div>
   </cfoutput>
  </cfcatch>
  
 </cftry>

 <cflocation
url="mylistings.cfm?action=confirm_renewal&listing_id=#listing_id#&responseT
ext=#pxAccess.responseText#&success=#pxAccess.success#" addtoken="no">
 
<cfelse>
 An error has occurred. <a
href="<cfoutput>#application.settings.rootURL#</cfoutput>">Click here</a> to
return to the homepage.
</cfif>



Kind Regards

Mike Little
[ Designer ]

  <http://www.nzsolutions.co.nz/images/email/nzsolutions.gif> 

NZSolutions Ltd
Innovative Internet + Print Design



Phone    +64 9 522 4924 
Mobile   +64 21 966 562 
Fax      +64 9 522 4926 

CAUTION: This e-mail message and accompanying data may contain information
that is confidential. If you are not the intended recipient you are notified
that any use, dissemination, distribution or copying of this message or data
is prohibited. All content is to be treated as confidential unless otherwise
specified, and is not to be forwarded to third parties without the prior
permission of the author. To do so may breach the New Zealand Privacy Act
1993. If you have received this e-mail message in error please delete it and
notify me. Thank you.   



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276283
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to