$payment->setParameter("x_zip", $a['zipcode']); $payment->setParameter("x_ship_to_first_name", $a['card_name_first']); $payment->setParameter("x_ship_to_last_name", $a['card_name_last']); $payment->setParameter("x_ship_to_address", $a['address']); $payment->setParameter("x_ship_to_city", $a['city']); $payment->setParameter("x_ship_to_state", $a['state']); $payment->setParameter("x_ship_to_zip", $a['zipcode']); $payment->setParameter("x_description", 'Occasions Initial Authorization'); //$payment->setParameter("x_test_request", TRUE); $payment->process(); if ($payment->isApproved()) { // Get info from Authnet to store in the database $authorization_code = $payment->getAuthCode(); $avs_result = $payment->getAVSResponse(); // not saved at this time $cvv_result = $payment->getCVVResponse(); // not saved at this time $transaction_id = $payment->getTransactionID(); // Do stuff with this. //$err[] = "Amount: $auth_total"; //$err[] = "Invoice #: $invoice"; //$err[] = "Auth Code: $approval_code"; //$err[] = "AVS Result: $avs_result"; //$err[] = "CVV Result: $cvv_result"; //$err[] = "Transaction ID: $transaction_id"; // TODO: in case of errors, email the above info to the admin // ******************************************************************* // NOW WE CAN SET UP THE RECURRING BILLING SUBSCRIPTION // ******************************************************************* $arb = new AuthnetARB(); // Set recurring billing variables