cancel
Showing results for 
Search instead for 
Did you mean: 

Create Profile Using Charge a Credit card API

Hi,

i was trying to create customer profile (along with customer payment profile) on invoking "Charge a Credit Card" API.

CustomerProfilePaymentType customerProfilePaymentType = new CustomerProfilePaymentType();
    		
    		Boolean isCreateProfile = true;
    		
    		customerProfilePaymentType.setCreateProfile(isCreateProfile);
    		// Create the payment transaction request
    		TransactionRequestType txnRequest = new TransactionRequestType();
    		txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());
    		txnRequest.setPayment(paymentType);
    		txnRequest.setAmount(new BigDecimal(amount).setScale(2, RoundingMode.CEILING));
    		
    		txnRequest.setProfile(customerProfilePaymentType);

my payment was successfull, but failed to create a profile. am getting an error "One or more fields must contain a value".

I want to know how to set those fields in java code.

kindly help me in this.


Thanks,

Suresh Babu R

sureshrb3
Contributor
1 REPLY 1

Hi ,

 

For charge credit card transaction please refer to the charge credit card in the sample code.

You need to set up the customer (CustomerDataType) field in the transactionRequest for creating a customer profile (otherwise you'll get a 'customer info is missing' error).  Also make sure your paymentType has all the required fields.

 

basusap
Authorize.Net Developer Authorize.Net Developer
Authorize.Net Developer