Hi.
I am pretty new to Authorise.net and by what I can see from the docs it's a great platform.
I have a one question.
How to allow user to pay other user when he wants to buy his product online?
I guess each user should have a merchant account on Authorise.net?
If yes, what would be the easiest way to create that account? Any HTML form to copy to our website?
And when they create account, I guess we should store their info somewhere in our system, associate them with particular user and use it for later payments. How we specify payment destination?
I did not find a part of the doc that addresses this question, so any help is appreciated.
Thanks in advance
11-15-2022 09:37 PM
11-16-2022 10:08 AM
On your Android phone, go to your payment methods in Google Play. Tap Add a payment method. Choose the payment method you want to add. Follow the on-screen instructions.
12-07-2022 10:58 PM
I've stepped through the code multipel times. Returning null is difficult to debug. I'll reinstall Fiddler and see if I can get more, but as I said I used the code basically as is. I only changed it to take inputs from a form.
As it's public code:
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = id,
ItemElementName = ItemChoiceType.transactionKey,
Item = key,
};
var creditCard = new creditCardType
{
cardNumber = cardNum,
expirationDate = expire,
cardCode = ccv
};
var billingAddress = new customerAddressType
{
firstName = firstName,
lastName = lastName,
address = address,
city = city,
zip = zip,
state = state
};
//standard api call to retrieve response
var paymentType = new paymentType { Item = creditCard };
// Add line Items
var lineItems = new lineItemType[1];
lineItems[0] = new lineItemType { itemId = "1", name = "Membership", quantity = 1, unitPrice = new Decimal(20.00) };
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card
amount = charge,
payment = paymentType,
billTo = billingAddress,
lineItems = lineItems
};
var request = new createTransactionRequest { transactionRequest = transactionRequest };
// instantiate the controller 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();
// validate response
if (response != null && response.messages.resultCode == messageTypeEnum.Ok)
{
returnModel.Code = response.transactionResponse.responseCode;
returnModel.Authorization = response.transactionResponse.authCode;
returnModel.AvsResponse = response.transactionResponse.avsResultCode;
returnModel.Reason = response.transactionResponse.messages[0].description;
returnModel.Transaction = response.transactionResponse.messages[0].code;
returnModel.TransactionId = response.transactionResponse.transId;
var user = await AddZineUserAsync(await UserManager.FindByNameAsync(User.Identity.Name));
}
else
{
returnModel = new CardModel
{
Reason = response != null ? response.transactionResponse.errors[0].errorCode : "-1",
Transaction = response != null ? response.transactionResponse.errors[0].errorText : "The error was not correctly returned. Please try again. Your card was not charged.",
};
}
12-15-2022 11:19 PM - last edited on 12-16-2022 07:05 AM by Kh-SabW