cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

DPM Quick Start Guide fails

The quick start guide is a bit thin on details, but after spending a few hours on it, I've still not gotten it to work.

 

<?php
  $url = "http://YOUR_DOMAIN.com/direct_post.php";
  $api_login_id = 'YOUR_API_LOGIN_ID';
  $transaction_key = 'YOUR_TRANSACTION_KEY';
  $md5_setting = 'YOUR_API_LOGIN_ID'; // Your MD5 Setting
  $amount = "5.99";

  AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, 
$md5_setting);
?>

 

Here's what's missing/unclear from the guide:

1) Where do you put the downloaded PHP SDK (after unzipping). I can't see that it matters as there are no external references in the sample code above.

2) For the MD5 setting, I inserted my Login_ID, but it's unclear what is supposed to go here. Where do you get the MD5 version?

3) For the 8 line sample code what filename should be used?  (I tried "test.php" and "direct_post.php" which both didn't  work).

4) Where is the direct_post.php referenced in the first line?  It's not in the SDK.

5) How can this code possibly work. The class "AuthorizeNetDPM" is not included. I've tried an include statement to the AuthorizeNetDPM.php file, but that didn't help matters. I even copied the contents from the AuthorizeNetDPM.php file below the 5 lines - again it always fails.

 

Fatal error: Class 'AuthorizeNetDPM' not found in [removed url]direct_post.php on line 8

 

It would be great if there was a simple zip that had the exact files needed so you didn't have to guess what is needed or how it should be constructed. 

 

There was a great post on how to make it all work (http://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Handling-Online-Payment... except the new PHP SDK completely breaks the old methods making the blog entry confusing and somewhat worthless (and another few hours down the rathole). It really shouldn't be this hard!

 

frankvg3
Member
1 ACCEPTED SOLUTION

Accepted Solutions

It is necessary to include the library in your implementation. The quickstart guide covers how to do this through the use of composer, but you can also do it manually. There are a few examples in the readme for the SDK on github, but the most basic is through the use of a require line such as:

require 'path/to/anet_php_sdk/autoload.php';

 

View solution in original post

Trevor
Administrator Administrator
Administrator
1 REPLY 1

It is necessary to include the library in your implementation. The quickstart guide covers how to do this through the use of composer, but you can also do it manually. There are a few examples in the readme for the SDK on github, but the most basic is through the use of a require line such as:

require 'path/to/anet_php_sdk/autoload.php';

 

Trevor
Administrator Administrator
Administrator