A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API (https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
I will say yes and no. Getting the data, collections in this case, from VFP to post there may be difficult. you are posting in an httppost situation.
From a PHP pov there are objects being created. new
AnetAPI\TransactionRequestType(); you should be able to do that easily. You then stuff it. Still easy. It is the defining the catching object to receive the response. That is where I think you are going to find the difficulty.
// Create a TransactionRequestType object and add the previous objects to it $transactionRequestType = new AnetAPI\TransactionRequestType(); $transactionRequestType->setTransactionType("authCaptureTransaction"); $transactionRequestType->setAmount($amount); $transactionRequestType->setOrder($order); $transactionRequestType->setPayment($paymentOne); $transactionRequestType->setBillTo($customerAddress); $transactionRequestType->setCustomer($customerData);
$transactionRequestType->addToTransactionSettings($duplicateWindowSetting); $transactionRequestType->addToUserFields($merchantDefinedField1); $transactionRequestType->addToUserFields($merchantDefinedField2);
// Assemble the complete transaction request $request = new AnetAPI\CreateTransactionRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId($refId); $request->setTransactionRequest($transactionRequestType);
// Create the controller and get the response $controller = new AnetController\CreateTransactionController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if ($response != null) { // Check to see if the API request was successfully received and acted upon if ($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) { // Since the API request was successful, l
On Thu, Oct 26, 2017 at 2:42 PM, Vince Teachout teachv@taconic.net wrote:
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API ( https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
[excessive quoting removed by server]
We have used Rick Strahl's West-Wind Web Tools for years to do HTTP POST using HTTP and HTTPS, both to web sites and web services. We call an in-house written C# Windows authentication utility from VFP. A little work but very do-able from VFP.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Thursday, October 26, 2017 3:33 PM To: profoxtech@leafe.com Subject: Re: VFP, Authorize.net
I will say yes and no. Getting the data, collections in this case, from VFP to post there may be difficult. you are posting in an httppost situation.
From a PHP pov there are objects being created. new
AnetAPI\TransactionRequestType(); you should be able to do that easily. You then stuff it. Still easy. It is the defining the catching object to receive the response. That is where I think you are going to find the difficulty.
// Create a TransactionRequestType object and add the previous objects to it $transactionRequestType = new AnetAPI\TransactionRequestType(); $transactionRequestType->setTransactionType("authCaptureTransaction"); $transactionRequestType->setAmount($amount); $transactionRequestType->setOrder($order); $transactionRequestType->setPayment($paymentOne); $transactionRequestType->setBillTo($customerAddress); $transactionRequestType->setCustomer($customerData);
$transactionRequestType->addToTransactionSettings($duplicateWindowSetting); $transactionRequestType->addToUserFields($merchantDefinedField1); $transactionRequestType->addToUserFields($merchantDefinedField2);
// Assemble the complete transaction request $request = new AnetAPI\CreateTransactionRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId($refId); $request->setTransactionRequest($transactionRequestType);
// Create the controller and get the response $controller = new AnetController\CreateTransactionController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if ($response != null) { // Check to see if the API request was successfully received and acted upon if ($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) { // Since the API request was successful, l
On Thu, Oct 26, 2017 at 2:42 PM, Vince Teachout teachv@taconic.net wrote:
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API ( https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
[excessive quoting removed by server]
The rule is simple. VFP can do anything !!!
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Mike McCann Sent: Friday, 27 October 2017 7:59 AM To: profoxtech@leafe.com Subject: RE: VFP, Authorize.net
We have used Rick Strahl's West-Wind Web Tools for years to do HTTP POST using HTTP and HTTPS, both to web sites and web services. We call an in-house written C# Windows authentication utility from VFP. A little work but very do-able from VFP.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Stephen Russell Sent: Thursday, October 26, 2017 3:33 PM To: profoxtech@leafe.com Subject: Re: VFP, Authorize.net
I will say yes and no. Getting the data, collections in this case, from VFP to post there may be difficult. you are posting in an httppost situation.
From a PHP pov there are objects being created. new
AnetAPI\TransactionRequestType(); you should be able to do that easily. You then stuff it. Still easy. It is the defining the catching object to receive the response. That is where I think you are going to find the difficulty.
// Create a TransactionRequestType object and add the previous objects to it $transactionRequestType = new AnetAPI\TransactionRequestType(); $transactionRequestType->setTransactionType("authCaptureTransaction"); $transactionRequestType->setAmount($amount); $transactionRequestType->setOrder($order); $transactionRequestType->setPayment($paymentOne); $transactionRequestType->setBillTo($customerAddress); $transactionRequestType->setCustomer($customerData);
$transactionRequestType->addToTransactionSettings($duplicateWindowSetting); $transactionRequestType->addToUserFields($merchantDefinedField1); $transactionRequestType->addToUserFields($merchantDefinedField2);
// Assemble the complete transaction request $request = new AnetAPI\CreateTransactionRequest(); $request->setMerchantAuthentication($merchantAuthentication); $request->setRefId($refId); $request->setTransactionRequest($transactionRequestType);
// Create the controller and get the response $controller = new AnetController\CreateTransactionController($request); $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX);
if ($response != null) { // Check to see if the API request was successfully received and acted upon if ($response->getMessages()->getResultCode() == \SampleCode\Constants::RESPONSE_OK) { // Since the API request was successful, l
On Thu, Oct 26, 2017 at 2:42 PM, Vince Teachout teachv@taconic.net wrote:
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API ( https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
[excessive quoting removed by server]
Seems to me like it is ultimately XML or JSON posted and JSON back. If that is what it is then it is easy enough to handle. If I am missing something then it could be a different story.
Personally I'd skip all that C# stuff and look at the examples they give in the "TRY IT" tabs. But then again my web experience is fairly limited.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Vince Teachout Sent: Friday, 27 October 2017 6:43 AM To: profoxtech@leafe.com Subject: VFP, Authorize.net
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API (https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
[excessive quoting removed by server]
On 2017-10-26 15:42, Vince Teachout wrote:
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API (https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
I've got my former colleague Thierry Labarre writing some C# code for me to consume an API from a vendor online. From that, I consume it in VFP using Rick Strahl's wwDotNetBridge and it works great. Let me know if you need his contact info. He's definitely available as he's looking for side work while looking for a regular gig.
Hi Vince,
Based on the API doc (https://developer.authorize.net/api/reference/) you can do all transactions from VFP using West-Wind Internet Client tools.
All transactions go to the same end point (https://apitest.authorize.net/xml/v1/request.api for testing), which makes it fairly easier.
All you need is:
* build a structure of nested VFP empty objects like documentations explains * turn these objects into JSON using wwJSON* or VFPX's nfJSON * send the request with the JSON as POST data * get the JSON response * turn the JSON response into a structure of VFP empty objects using wwJSON* or VFPX's nfJSON * recurse on these objects using aMembers() and extract data like documentations explains
The test page issues an 'option' request before the regular 'post' request, not sure why.
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 26/10/2017 à 21:42, Vince Teachout a écrit :
A friend of mine sent the following question, and I don't know the answer. Does anyone know off the top of their head?
"I have a VFP question if you do not mind. I have a client with an old custom app in VFP 7 and 9. They process credit cards using Authorize.net. Authorize.net is pushing everyone to a new API and I am tasked with migrating the client’s apps so they can use this new API (https://developer.authorize.net/api/reference/index.html). Currently they use HTTP Posts to send in the CC info.
Anyway, my question is this. Authorize offers a development kit and example code using C#. Therefore it should be .Net compliant and wouldn’t that mean I could use the same in a VFP application?"
[excessive quoting removed by server]
Thank you all so much! I've forwarded the answers to the person who asked, and I'm sure they'll be able to use them. Thank you!