'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ' START: PROCESS IPN '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ Dim Status, Result Status=objHttp.status Result=objHttp.ResponseText
'// Check notification validation if (Status <> 200 ) then '// Now we see if the payment is pending, verified, or denied elseif (objHttp.responseText="VERIFIED") then pcv_OrderID=(int(pcv_OrderID)-scpre) session("GWCustomerID")=pcf_RestoreCustomer(pcv_OrderID) if ucase(pcv_PaymentStatus)="COMPLETED" then session("GWAuthCode")=pcv_PaymentStatus session("GWTransId")=pcv_gwTransID session("GWOrderId")=pcv_OrderID pcf_AuthorizeCustomer session("GWSessionID"), session("GWOrderId") response.Redirect("gwReturn.asp?s=true&gw=PayPal&GWA uthCode="&session("GWAuthCode")&"&GWOrderId="&am p;session("GWOrderId")&"&GWSessionID="&session(" GWSessionID")&"&GWTransId="&session("GWTransId") &"&GWCustomerID="&session("GWCustomerID")&"" ) response.end else if ucase(pcv_PaymentStatus)="PENDING" then '// SAVE PENDING REASON TO DB session("GWAuthCode")=pcv_PaymentStatus session("GWTransId")=pcv_PendingReason session("GWOrderId")=pcv_OrderID '// FLAG AS PENDING session("GWTransType")="P" pcf_AuthorizeCustomer session("GWSessionID"), session("GWOrderId") response.Redirect("gwReturn.asp?s=true&gw=PayPal&GWA uthCode="&session("GWAuthCode")&"&GWOrderId="&am p;session("GWOrderId")&"&GWSessionID="&session(" GWSessionID")&"&GWTransId="&session("GWTransId") &"&GWCustomerID="&session("GWCustomerID")&"" ) response.end end if end if elseif (objHttp.responseText="INVALID" OR objHttp.responseText="FAILED") then '// If we get an Invalid response from PayPal, then the payment is messed up and we notify the customer if ucase(pcv_PaymentStatus)="COMPLETED" then session("GWAuthCode")=pcv_PaymentStatus session("GWTransId")="" session("GWOrderId")=pcv_OrderID pcf_AuthorizeCustomer session("GWSessionID"), session("GWOrderId") response.Redirect("gwReturn.asp?s=true&gw=PayPal&GWA uthCode="&session("GWAuthCode")&"&GWOrderId="&am p;session("GWOrderId")&"&GWSessionID="&session(" GWSessionID")&"&GWTransId="&session("GWTransId") &"&GWCustomerID="&session("GWCustomerID")&"" ) response.end else response.redirect "msg.asp?message=73" end if else '// error end if set objHttp=nothing '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ' END: PROCESS IPN '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
|