cancel
Showing results for 
Search instead for 
Did you mean: 

Please help, payment form not billing correctly

Supposed to charge $49 instant then $25/week for 8 weeks.  The recurring is working correctly but not charging the initial $49.  Can anyone offer me advice on how to correct this?  Pretty please?

<?xml version="1.0" encoding="utf-8" ?>

- <ARBCreateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

- <merchantAuthentication>

  <name>3W3Jc3Efy2su</name>

  <transactionKey>7vz3kX8943ATw7rZ</transactionKey>

  </merchantAuthentication>

- <subscription>

  <name>2012 Unique Underwriters Conference of Champions</name>

- <paymentSchedule>

- <interval>

  <length>7</length>

  <unit>days</unit>

  </interval>

  <startDate>2011-10-04</startDate>

  <totalOccurrences>8</totalOccurrences>

  <trialOccurrences>1</trialOccurrences>

  </paymentSchedule>

  <amount>25</amount>

  <trialAmount>49</trialAmount>

- <payment>

- <creditCard>

  <cardNumber>5555555555555555</cardNumber>

  <expirationDate>2013-3</expirationDate>

  </creditCard>

  </payment>

- <order>

  <description>Capture Page Subscription</description>

  </order>

- <customer>

  <email>test1@yahoo.com</email>

  <phoneNumber>555-555-5555</phoneNumber>

  </customer>

- <billTo>

  <firstName>Test</firstName>

  <lastName>test</lastName>

  <address>111 Main St</address>

  <city>City</city>

  <state>FL</state>

  <zip>55555</zip>

  </billTo>

  </subscription>

  </ARBCreateSubscriptionRequest>

Thanks!
Judy
judysver@yahoo.com

judy
Member
5 REPLIES 5

The trial amount just changes the amount charged during a specified trial period. It doesn't make ARB charge the first payment immediately. If you want an immediate charge, you'll have to use AIM for that. Personally, I find it easier to integrate CIM with an automated routine to process charges, rather than have to mess with AIM + ARB + callback page.

TJPride
Expert

Do you have an example of how I can mofify it? I appreciate your help.

Not if you're using XML. I use the PHP API that layers on top, it's much simpler.

At this point I will try anything. I am ok if it it one or other but this form needs to do both instant and recurring with different amounts.  Can you show me an example of how you are doing. I am pretty good at PHP so I should be able to follow.

AIM example, may need slight modifications for your needs:

 

$authorize = new AuthorizeNetAIM(
    $GLOBALS['_authorize_id'], $GLOBALS['_authorize_key']);
$authorize->setSandbox(false);

$fields = array(
    'first_name' => $_POST['first'],
    'last_name' => $_POST['last'],
    'company' => $_POST['company'],
    'address' => $_POST['address'],
    'city' => $_POST['city'],
    'state' => $_POST['state'],
    'zip' => $_POST['zip'],
    'country' => 'US',

    'phone' => $_POST['phone'],
    'email' => $_POST['email'],

    'customer_ip' => $_SERVER['REMOTE_ADDR'],

    'description' => "{$_POST['type']} initial fee for " . count($_POST['zips']) . " zip codes with {$population} total estimated population",
    'amount' => $_POST['initial_payment'],

    'card_num' => $_POST['card_number'],
    'exp_date' => sprintf('%02d%02d', $_POST['card_exp_month'], ($_POST['card_exp_year'] % 1000)),
    'card_code' => $_POST['card_ccv']
);
$authorize->setFields($fields);    
$authorize->setCustomField('payment_type', 'SINGLE');

$result = $authorize->authorizeAndCapture();

if ($result->error || $result->{'response_code'} != 1)
    $errors[] = "Initial charge declined - {$result->response_reason_text}";

 

ARB example, also may require some modification:

 

$authorize = new AuthorizeNetARB(
    $GLOBALS['_authorize_id'], $GLOBALS['_authorize_key']);
$authorize->setSandbox(false);

$subscription = new AuthorizeNet_Subscription;

$subscription->customerId = $idn;

$subscription->billToFirstName = $_POST['first'];
$subscription->billToLastName = $_POST['last'];
$subscription->billToCompany = $_POST['company'];
$subscription->billToAddress = $_POST['address'];
$subscription->billToCity = $_POST['city'];
$subscription->billToState = $_POST['state'];
$subscription->billToZip = $_POST['zip'];
$subscription->billToCountry = 'US';

$subscription->customerPhoneNumber = $_POST['phone'];
$subscription->customerEmail = $_POST['email'];

$subscription->name = "{$_POST['type']} Subscription";
$subscription->orderDescription = 'For ' . count($_POST['zips']) . " zip codes with {$population} total estimated population";
$subscription->amount = $_POST['price'];

$subscription->startDate = $_POST['payment_due'];
$subscription->intervalLength = '1';
$subscription->intervalUnit = 'months';
$subscription->totalOccurrences = '9999';

$subscription->creditCardCardNumber = $_POST['card_number'];
$subscription->creditCardExpirationDate = sprintf('%04d-%02d', $_POST['card_exp_year'], $_POST['card_exp_month']);
$subscription->creditCardCardCode = $_POST['card_ccv'];

$result = $authorize->createSubscription($subscription);

// We want to delay this error until later
if ($result->xml->messages->resultCode != 'Ok')
    $errors[] = "Recurring billing could not be initiated - {$result->xml->messages->message->text}";

else {
    // Do some success thing
}