cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize Customer Payment Profile not working

Our checkout process is like this, during payment step, we will just authorise the customer payment profile and later on to some other flow, on completion of service provided to the customer, we will charge the customer payment profile. So firstly we have to authorise the customer payment profile. Surely the payment profile is already created from their account settings section of our website. So the customer will just choose one of their payment profile and will authorise that profile for the order amount. For this purpose I was using the given piece of code :
- - - - - - -
 - - - - -- -
public static ANetApiResponse Run(string customerProfileId,string customerPaymentProfileId,decimal AmountToCharge)
{
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;

// define the merchant information (authentication / transaction id)
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = APICredential.APILoginID,
ItemElementName = ItemChoiceType.transactionKey,
Item = APICredential.TransactionKey
};

//create a customer payment profile
customerProfilePaymentType profileToCharge = new customerProfilePaymentType();
profileToCharge.customerProfileId = customerProfileId;
profileToCharge.paymentProfile = new paymentProfile { paymentProfileId = customerPaymentProfileId };
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authOnlyTransaction.ToString(),
amount = AmountToCharge,
profile = profileToCharge
};

var request = new createTransactionRequest { transactionRequest = transactionRequest };

// instantiate the collector that will call the service
var controller = new createTransactionController(request);
controller.Execute();

// get the response from the service (errors contained if any)
var response = controller.GetApiResponse();

return response;
}
----- -- - - - - - - - -
 - - - - - - - - - - -
 
now as per the expectation and the code, transactionTypeEnum.authOnlyTransaction.ToString() will only authorise the profile whereas when I am looking the transaction entry into the authorize.net account , the status is showing as "Captured/Pending Settlement" whereas it should be Authorized/Pending Capture. 
 
Please help me on this as soon as possible.
sachinmcsd12
Member
1 REPLY 1

 

Hi sachinmcsd12,

 

We are unable to duplicate the error you are seeing on Issue2. We ran a charge of Authorize Only transaction type using createTransactionRequest with a CIM profile and setting the type to Auth Only resulted to an Authorized/Pending Capture transaction.

 

I also sent you an email for the exact code we used to replicate this.

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator