Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: On-Line Web Payment Process

$
0
0
Re: On-Line Web Payment Process
FoxInCloud
Re: On-Line Web Payment Process
Jun. 4, 2013
05:58 pm
3SU12JCNCShow this entire thread in new window
Gratar Image based on email address
From:Tuvia Vinitsky
To:Pete Sass

It seems like you might be confusing a few different things.

Authorize.net is not a credit card processor, they are a "gateway". A gateway takes the cc transaction you provide (in this case over the Internet and sends it to the actual cc processor for approval. It then reports back.

There are only a handful of actual cc processors, but there are many gateways. Some work thru http calls like authorize.net, and some, like PC-Charge, are actual software you install and communicate with via ActiveX on a server and then workstations can IP their requests.

There are no custom classed from authroize.net for VFP. None are needed. Authrize.net is the gold standard in gatewys, and I would suggest you not switch unless you have a good reason.

Here is some typical code to call authorize.net. You will need the clients api and trans key, which they can get from the authorize.net website. Assume the tc* vars are from a form or the like and oVM is an application level object that contains info for this clients cc setup.

oCC = CREATEOBJECT('creditcards')WITH oCC .x_login = oVM.gcAuthNetAPIlogin .x_tran_key = oVM.gcAuthNetTranKey .x_test_request = IIF(UPPER(oVM.gcAuthNetTestMode) <> "NO", "true", "false") .Ccardholder = tcMember .Ccredtype =tcCardType && MC, visa, etc .Ccredno = tcCardNumber .Cseccode = tcCVV2 .Cexpmon = RIGHT(tcExpireDate,2) .Cexpyear = LEFT(tcExpireDate, 2) .Caddr1 = tcAddress .Caddr2 = '' .Cstate = '' .x_card_num = tcCardNumber .x_exp_date = RIGHT(tcExpireDate,2) + "/" + LEFT(tcExpireDate, 2) .x_card_code = tcCVV2 .x_currency_code = "USD" .x_method = "CC"&& or ECHECK .x_version = "3.1" .x_delim_data = "true" .x_delim_char ="|" .x_relay_response = "false" .x_address = tcAddress .x_city = '' .x_state = '' .x_zip = tcZip .x_cust_id = tcAccount .x_description = tcComment .x_type = ICASE(tnRequestType=1, 'AUTH_CAPTURE', tnRequestType=2, 'VOID', tnRequestType=3, 'CREDIT', tnRequestType=4, 'CAPTURE_ONLY', tnRequestType=5, 'AUTH_ONLY','AUTH_CAPTURE')IF tnRequestType = 3 && already have approval .x_trans_id = tcForceCodeENDIFIF tnRequestType = 4 && already have approval .x_auth_code = tcForceCodeENDIF* auth.net credit type means credit a previous auth.net transaction* To issue an actual random credit, their account has to be enabled for that specially, and* we use the same type CREDIT but with a blank trans_id.* need a 6th is using prior auth, to put thru the actual charge with type PRIOR_AUTH_CAPTURE, and x_trans_id the authnet idENDWITH oCC.PROCESS(tnAmount) * parse response, the class adds the html status response field statusnum and statustestIF NOT ('200' $ STR(oCC.StatusNum)) OR NOT ('OK' $ oCC.Statustext)RELEASE oCCRETURN'NError communicating with authorize.net'ENDIFIFLEN(oCC.responsetext) < 1RELEASE oCCRETURN'NError with authorize.net'ENDIF* the class parses all the possible reasons from the authnet chart and creates a response we need lcAnswer1 = oCC.vmanagerreplyRELEASE oCCRETURN lcAnswer1********************************************************* **********************************************************defineclass CreditCards as Custom x_login = "" x_tran_key = "" x_version = "" x_test_request ="" x_delim_data = "" x_delim_char ="" x_relay_response ="" x_first_name = "" x_last_name = "" x_company = "" x_address = "" x_city = "" x_state ="" x_zip = "" x_country = "" x_phone = "" x_fax = "" x_cust_id ="" x_customer_ip = "" x_customer_tax_id = "" x_email = "" x_email_customer = "" x_merchant_email = "" x_invoice_num = "" x_description = "" x_ship_to_first_name = "" x_ship_to_last_name = "" x_ship_to_company = "" x_ship_to_address = "" x_ship_to_city = "" x_ship_to_state = "" x_ship_to_zip = "" x_ship_to_country = "" x_amount = "" x_currency_code = "" x_method = "" x_type = "" x_recurring_billing = "" x_bank_aba_code = "" x_bank_acct_num = "" x_bank_acct_type = "" x_bank_name = "" x_bank_acct_name = "" x_echeck_type = "" x_card_num = "" x_exp_date = "" x_card_code = "" x_trans_id = "" x_auth_code = "" x_authentication_indicator = "" x_cardholder_authentication_value = "" x_customer_organization_type = "" x_drivers_license_num = "" x_drivers_license_state = "" x_drivers_license_dob = "" x_po_num = "" x_tax = "" x_tax_exempt ="" x_duty ="" x_freight ="" vmanagerreply = '' BillString="" Ccardholder ="" Ccredtype =""* Ccredno ="" Ccredno = "" Cseccode ="" Cexpmon ="" Cexpyear ="" Caddr1 ="" Caddr2 ="" Cstate ="" vPostData = "" StatusNum = "" StatusText="" Responsetext = ""************************************************************** strStatus="" strRetval=""procedureinit* There seems to be 3 ways to have test charges vs live charges.* 1. use test api and tran code* 2. call the test url* 3. have the var test_charge set to true (we do if Demo param in.ini is true)returnprocedure setPostDatawiththis .vPostData = "x_login=" + .x_login + "&x_tran_key=" + .x_tran_key + "&x_version=" + .x_version + "&x_method=" + .x_method + "&x_test_request=" + .x_test_request + ;"&x_delim_data=" + .x_delim_data + "&x_delim_char=" + .x_delim_char + "&x_relay_response=" + .x_relay_response + "&x_first_name=" + .x_first_name + "&x_last_name=" + ; .x_last_name + "&x_company=" + .x_company + "&x_address=" + .x_address + "&x_city=" + .x_city + "&x_state=" + .x_state + "&x_zip=" + .x_zip + "&x_country=" + ; .x_country + "&x_phone=" + .x_phone + "&x_fax=" + .x_fax + "&x_cust_id=" + .x_cust_id + "&x_customer_ip=" + .x_customer_ip + "&x_customer_tax_id=" + ; .x_customer_tax_id + "&x_email=" + .x_email + "&x_email_customer=" + .x_email_customer + "&x_merchant_email=" + .x_merchant_email + "&x_invoice_num=" + ; .x_invoice_num + "&x_description=" + .x_description + "&x_ship_to_first_name=" + .x_ship_to_first_name + "&x_ship_to_last_name=" + .x_ship_to_last_name + "&x_ship_to_company=" + ; .x_ship_to_company + "&x_ship_to_address=" + .x_ship_to_address + "&x_ship_to_city=" + .x_ship_to_city + "&x_ship_to_state=" + .x_ship_to_state + "&x_ship_to_zip=" + ; .x_ship_to_zip + "&x_ship_to_country=" + .x_ship_to_country + "&x_amount=" + .x_amount + "&x_currency_code=" + .x_currency_code + "&x_method=" + .x_method + "&x_type=" + ; .x_type + "&x_recurring_billing=" + .x_recurring_billing + "&x_bank_aba_code=" + .x_bank_aba_code + "&x_bank_acct_num=" + .x_bank_acct_num + "&x_bank_acct_type=" + ; .x_bank_acct_type + "&x_bank_name=" + .x_bank_name + "&x_bank_acct_name=" + .x_bank_acct_name + "&x_echeck_type=" + .x_echeck_type + "&x_card_num=" + .x_card_num + "&x_exp_date=" + ; .x_exp_date + "&x_card_code=" + .x_card_code + "&x_trans_id=" + .x_trans_id + "&x_auth_code=" + .x_auth_code + "&x_authentication_indicator=" + .x_authentication_indicator + "&x_cardholder_authentication_value=" + ; .x_cardholder_authentication_value + "&x_customer_organization_type=" + .x_customer_organization_type + "&x_drivers_license_num=" + .x_drivers_license_num + "&x_drivers_license_state=" + ; .x_drivers_license_state + "&x_drivers_license_dob=" + .x_drivers_license_dob + "&x_po_num=" + .x_po_num + "&x_tax=" + .x_tax + "&x_tax_exempt=" + .x_tax_exempt + "&x_freight=" + .x_freight + "&x_duty=" + .x_duty + "&billstring=" + ; .billstring + "&ccardholder=" + .ccardholder + "&ccredtype =" + .ccredtype + "&ccredno=" + .ccredno + "&cseccode=" + .cseccode + "&cexpmon=" + .cexpmon + "&cexpyear =" + ; .cexpyear + "&caddr1 =" + .caddr1 + "&caddr2 =" + .caddr2 + "&cstate =" + .cstateendwithendprocprocedure processlparameter tamountthis.x_amount = ALLTRIM(STR(tamount,20,2))this.setPostData oXml = CreateObject("Microsoft.XMLHTTP")* oxml.open( "POST", "https://test.authorize.net/gateway/transact.dll", .f.)* Uncomment the line ABOVE for test accounts OR the line BELOW for LIVE accounts oxml.open( "POST", "https://secure.authorize.net/gateway/transact.dll", .f.) && false sets to synchronous, returns only after call completes oxml.send(this.vPostData)this.StatusNum = oXml.Statusthis.Statustext = oXML.Statustextthis.Responsetext = oXml.Responsetextrelease oXML* We got an OK that we html connected ok, parse response* if we ever did use the cim, we could get things like last 4 etc from various fields her ln1 = AT("|", occ.responsetext, 1) ln2 = AT("|", occ.responsetext, 2) ln3 = AT("|", occ.responsetext, 3) ln4 = AT("|", occ.responsetext, 4) ln5 = AT("|", occ.responsetext, 5) ln6 = AT("|", occ.responsetext, 6) ln7 = AT("|", occ.responsetext, 7) ln8 = AT("|", occ.responsetext, 8) ln9 = AT("|", occ.responsetext, 9) ln10 = AT("|", occ.responsetext, 10) ln11 = AT("|", occ.responsetext, 11) ln12 = AT("|", occ.responsetext, 12) ln13 = AT("|", occ.responsetext, 13) ln14 = AT("|", occ.responsetext, 14) ln15 = AT("|", occ.responsetext, 15) ln16 = AT("|", occ.responsetext, 16) ln17 = AT("|", occ.responsetext, 17) ln18 = AT("|", occ.responsetext, 18) ln38 = AT("|", occ.responsetext, 38) ln39 = AT("|", occ.responsetext, 39) lcCode = LEFT(occ.responsetext,1) lcInternalWeDonotCareAbount = SUBSTR(occ.responsetext, ln1 + 1, ln2 - ln1 -1 ) lcReasonDetail = SUBSTR(occ.responsetext, ln2+1, ln3 - ln2 - 1) lcReasonText = SUBSTR(occ.responsetext, ln3+1, ln4 - ln3 - 1) lcAuthCode = SUBSTR(occ.responsetext, ln4 + 1, ln5 - ln4 - 1) lcAVResponse = SUBSTR(occ.responsetext, ln5 + 1, ln6 - ln5 - 1) lcAuthNetTransID = SUBSTR(occ.responsetext, ln6 + 1, ln7 - ln6 - 1) lcAVSAgain = SUBSTR(occ.responsetext, ln38 + 1, ln39 - ln38 - 1)DOcaseCASEVAL(lcCode) = 1this.vmanagerreply = "Y" + lcAuthCode + "|" + lcAuthNetTransID CASEVAL(lcCode) = 2this.vmanagerreply = "NThe transaction was declined. Reason: " + lcReasontextCASEVAL(lcCode) = 3this.vmanagerreply = "NError processing transaction. Reason: " + lcReasontextCASEVAL(lcCode) = 4this.vmanagerreply = "NTransaction under review. Reason: " + lcReasontextOTHERWISEthis.vmanagerreply = "NUnknown response."ENDCASEendprocenddefine

Shamelss promotion: I am giving a session on credit cards and ACH in VFP at this year's Southwest Fox.


Hi,

I am currently porting a Tech in the field mobile Visual FoxPro project that now runs as a traditional VFP executable on service tech's laptops into FIC.

Part of this tech mobile app provides for service techs in the field to process credit card payments from customers on-site upon completion of the service work.

The current VFP desktop application is using custom classes from a credit card processing company called Authorize.net based out of the US.
These custom classes come back with numerous "unsupported" errors running the FAA and now into well in excess of 20 hours plus attempting to get these to work, I am at a point of ditching these custom classes completely from Authorize.net and starting off new.

Does anyone know of what 3rd party credit card payment provider can be used with a FIC app?

Primarily to handle payments in the US and Canada!

Looking for some payment class or code routines that would work under FIC to process the credit card payment and return a confirmation and authorization number back and process the customers payment?

Any assistance pointing me in the right direction and some solid code examples is what I think I need to complete this port! I mention heavy on any code examples if at all possible and someone is willing to share!

Pete,
(Iceman from the Great White North) - Canada



Viewing all articles
Browse latest Browse all 10393

Trending Articles