> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verifying AVS and CVN for One-Time Transactions

To verify security codes for real-time billing, set the name–value pair for the `PaymentMethod` object. See [Verifying AVS and CVN for Recurring Billing](Verifying_AVS_and_CVN_fo#) for details.

The `authCapture()` method authorizes a transaction and marks it for capture by a Subscribe back-end batch process. `auth()` also authorizes a transaction and returns the authorization results, including the results from address and security-code verifications, but does not mark the transaction for automatic capture. To capture the transaction using `auth()`, you must call `capture()` before the authorization period expires. (The authorization period varies by payment processor, but is typically three days for real-time transactions, and seven days for recurring transactions.)

If you have shippable merchandise or want an additional risk review process before deciding whether to capture a transaction, make two separate SOAP calls. (When calling `authCapture()` to immediately mark a transaction for capture, the `capture` operation might occur before you have a chance to call `cancel()`.)

Payment processors recommend authorizing a transaction when the order is placed, and capturing it only after you have shipped the merchandise. To do this, make a live `auth()` call when a customer places an order. After the product is authorized or shipped, use a `capture()` call in batch mode to process an array of transactions at the end of a day, or more frequently, depending on the volume of your transactions.

The `authCapture()` call may save time if your one-time transactions are for relatively small amounts and do not require physical shipments. However, Vindicia recommends that you screen transactions for fraud risk with the `score` call before calling `authCapture`.

To verify address and security codes, retrieve AVS and CVN code responses, then examine the `TransactionStatus` object in the `Transaction`. Look at the most recent entry in the `statusLog` array of the `Transaction` object, located in the first position in the array.

If you specify a `minChargebackProbability` of less than 100 when calling `auth()`, Subscribe evaluates the risk score for the transaction, and includes the results in the return parameters `score` and `scoreCodes` (codes and corresponding messages that explain the score). If the score evaluates higher than `minChargebackProbability`, no authorization with the payment processor is performed, saving you the cost of authorizing a transaction with the payment processor if it is determined to be potentially fraudulent.

**Note:** To ignore the fraud score, set `minChargebackProbability` to 100.

## Verify for real-time billing

```

$tx = new Transaction();
$tx->setAmount('9.90');
$tx->setCurrency('USD');
 
$tx->setMerchantTransactionId('txid-123456');
 
$paymentMethod = new PaymentMethod();
$paymentMethod->setBillingAddress($address);
$paymentMethod->setType('CreditCard');
 
$card = new CreditCard();
$card->setAccount('4444222211113333');
$card->setExpirationDate('xxxxxx'); // Use YYYYMM format for date
$paymentMethod->setCreditCard($card);
 
$nv = new NameValuePair();
$nv->setName("CVN");
$nv->setValue("123"); // card security code provided by customer
 
// set the card security code inside the payment method 
$paymentMethod->setNameValues(array($nv));
$tx->setSourcePaymentMethod($paymentMethod);
 
// set other transaction attributes here
$sendEmailNotification=false;
$minChargebackProbability = 100; // not doing risk screening
 
$response = $tx->auth($minChargebackProbability, $sendEmailNotification);
 
if($response['returnCode']==200) {
 
   if($tx->statusLog[0]->status=='Authorized') {
      print "Card approved.       
      Checking address and security code responses \n";
      $txnStatus = $tx->statusLog[0]; 
      // latest transaction status
 
      if ($txnStatus->vinAVS == "FullMatch" 
      || $txnStatus->vinAVS == "PartialMatch") 
      {
      print " Address verified \n";
      }
   else {
      $avs = $txnStatus->creditCardStatus->avsCode;
 
      // work with the AVS response code here. If there is a
      // certain value of the AVS code which is not acceptable,
      // then cancel the transaction
 
   if ($avs == "xyz") {
      $soapCallerTxn = new Transaction();
      $soapCallerTxn->cancel(array($tx));
      exit();
   }
   } 
   // AVS is OK, now check the response to security code
   // verification 
 
   $cvn = $txnStatus->creditCardStatus->cvnCode;
 
   // work with the AVS response code here. If a certain
   // value of the CVN response code is not acceptable, then 
   // cancel the transaction
 
   if ($cvn == "abc") {
      $soapCallerTxn = new Transaction();
      $soapCallerTxn->cancel(array($tx));
      exit();
   }
   else if($tx->statusLog[0]->status=='Cancelled') {
      // The transaction did not go through 
      print "Declined. Reason code received from 
      payment processor: ";
      print $tx->statusLog[0]->status->creditCardStatus->
      authCode . "\n";
   }
}

```

## Capture multiple authorized Transactions in a batch

```

$tx_soap = new Transaction();
 
$txn1 = new Transaction();
 
$txn1->setMerchantTransactionId('id1'); 
   // this is a previously authed transaction
 
$txn2 = new Transaction();
 
$txn2->setMerchantTransactionId('id2');   
   // this is a previously authed transaction
 
$response = $tx_soap->capture(array($txn1, $txn2));
 
if($response['returnCode']==200) {
   // capture success
}
```

**Parent topic:**[Using Credit Cards for One-Time Transactions](../topics/Using_Credit_Cards_for_O)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.