WordPress.org

Ready to get started?Download WordPress

Forums

wp-donate
[resolved] How to provide Authorize.net with a description? (2 posts)

  1. phillymactech
    Member
    Posted 4 months ago #

    Hi!

    I think I've figured out most of the customization I've needed for this plugin, and it's working great!

    One thing I'd like to do is to add a description field to the info sent to Authorize.net so that the account types who see that stuff know that it's a donation coming through, and not some other type of purchase that they need to interact with.

    Do you know how I might add a description field to the transaction info that's sent to Authorize.net?

    Thanks very much!

    https://wordpress.org/plugins/wp-donate/

  2. phillymactech
    Member
    Posted 4 months ago #

    Hi, I figured this out.

    I simply added an additional field to the $transaction array for the transaction description.

    In the following file:
    plugins/wp-donate/includes/donate-function.php

    add the following line to the bottom of the $transaction array:

    'description' => 'My Donation Description',

    Changing the description accordingly. The array declaration should then look like this:

    $transaction->setFields(
    				array(
    				'amount' => $REQUEST['amount'],
    				'card_num' => $REQUEST['x_card_num'],
    				'exp_date' => $REQUEST['exp_month'].'/'.$REQUEST['exp_year'],
    				'first_name' => $REQUEST['first_name'],
    				'last_name' => $REQUEST['last_name'],
    				'address' => $REQUEST['address'],
    				'city' => $REQUEST['city'],
    				'state' => $REQUEST['state'],
    				'country' => $REQUEST['country'],
    				'zip' => $REQUEST['zip'],
    				'email' => $REQUEST['email'],
    				'description' => 'My Donation Description',
    				)
    			);

    Now your authorize.net report will have the description listed alongside the other info. Really useful if you use Authorize.net for several types of purchases on a single website and want to keep them separate.

    Hope this helps!

Reply

You must log in to post.

About this Plugin

About this Topic