Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
It appears to me that the shopper's pay-my-order page does not correctly process ARB subscriptions when a stored card profile is used for payment.
If you pay for a subscription order with a stored card profile during regular checkout, the subscription.GatewayPaymentProfileId value gets assigned like it should.
However if you pay for an existing subscription order from the pay-my-order page using the same stored card profile, that portion of the credit-card-payment-form code does not include assigning the stored card profile to the subscription.
The result is the recurring order system treats the subscription as a regular recurring order and no AuthNet ARB is registered. Even though it was paid using the AuthNet stored card profile.
Walk the public ActionResult _CreditCardPaymentForm(CreditCardPaymentModel model) method in CheckoutController.cs assuming: model.IsCompleteButtonSubmit = false order != null
All it does is (eventually) call PayOrder() and bail out. No further effort to accommodate a stored card profile is actually made.
|
1 user thanked Joe Payne2 for this useful post.
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Hi Joy,
I am able to confirm the issue and reported to fix for the next version. Thank you!
|
1 user thanked nadeem for this useful post.
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Here are the code fix in case you are interested to integrate: Open /Website/Controllers/CheckoutController.cs file and find the PayOrder action Locate the following code Code:if (payment.PaymentMethod != null)
{
hasGateway = (payment.PaymentMethod.PaymentGateway != null);
}
else if (payment.PaymentProfile != null)
{
int gatewayId = gatewayRepo.GetPaymentGatewayIdByClassId(payment.PaymentProfile.GatewayIdentifier);
PaymentGateway gateway = gatewayRepo.Load(gatewayId);
hasGateway = (gateway != null);
}
if (hasGateway)
{
// PRESERVE ACCOUNT DATA FOR PROCESSING
string accountData = payment.AccountData;
payment.AccountData = string.Empty;
and replace with Code:GatewayPaymentProfile profile = null;
if (payment.PaymentMethod != null)
{
hasGateway = (payment.PaymentMethod.PaymentGateway != null);
}
else if (payment.PaymentProfile != null)
{
int gatewayId = gatewayRepo.GetPaymentGatewayIdByClassId(payment.PaymentProfile.GatewayIdentifier);
PaymentGateway gateway = gatewayRepo.Load(gatewayId);
hasGateway = (gateway != null);
}
if (hasGateway)
{
// PRESERVE ACCOUNT DATA FOR PROCESSING
string accountData = payment.AccountData;
payment.AccountData = string.Empty;
if (payment.PaymentProfile != null)
{
IList<Subscription> subscriptions = AbleContext.Resolve<ISubscriptionRepository>().LoadForOrder(order.Id);
foreach (Subscription subscription in subscriptions)
{
if (subscription.PaymentFrequency.HasValue && subscription.PaymentFrequencyUnit.HasValue)
{
subscription.PaymentProfile = payment.PaymentProfile;
subscription.PaymentProcessingType = PaymentProcessingType.ArbProfileManaged;
AbleContext.Resolve<ISubscriptionRepository>().Save(subscription);
}
}
}
Hope this helps! Edited by user Tuesday, February 21, 2023 11:13:12 AM(UTC)
| Reason: Not specified
|
1 user thanked nadeem for this useful post.
|
|
|
Rank: Advanced Member
Groups: HelpDesk, Developers Joined: 11/9/2018(UTC) Posts: 564
Thanks: 122 times Was thanked: 26 time(s) in 25 post(s)
|
Thank you Nadeem, I will review and apply to my install. You might also want to look at card profile storage. Here's a walkthrough that I don't see handled: * Create an order in admin with no payments for an account that has an existing stored card profile * Pull up order in pay-my-order page Credit card UI correctly renders stored card profile as a choice. However there is also the option for shopper to add a new card. If you choose add a new card, then enter card details and check the save-card checkbox....I don't see the code that actually stores the new card profile. Should be seeing something like this I believe: Code:
if (profile == null && model.CardType > 0)
{
AccountDataDictionary cardDetails = new AccountDataDictionary();
cardDetails["AccountName"] = model.CardName.Trim();
cardDetails["AccountNumber"] = cardNumber.Trim();
cardDetails["ExpirationMonth"] = model.ExpirationMonth.ToString();
cardDetails["ExpirationYear"] = model.ExpirationYear.ToString();
cardDetails["SecurityCode"] = securityCode.Trim();
profile = CreateProfile(model, cardDetails);
}
|
1 user thanked Joe Payne2 for this useful post.
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
We will look into this when while fixing the bug. Thanks for the more details.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close