NVelocity Variable For Failed Payment Reason

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

NVelocity Variable For Failed Payment Reason

Post by jsmits » Mon Dec 14, 2009 8:19 am

Is there an NVelocity variable for the reason a payment failed?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: NVelocity Variable For Failed Payment Reason

Post by mazhar » Mon Dec 14, 2009 8:34 am

All payments are available with order context in Email notification template. All you need is to check status of each payment. For example

Code: Select all

#foreach($payment in $order.Payments) 
#if($payment.PaymentStatus == "CaptureFailed")
Do your stuff here against payments with capture failed
#end
#end

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: NVelocity Variable For Failed Payment Reason

Post by jsmits » Mon Dec 14, 2009 10:00 am

Hi Mazhar,

I'd like to send an email on Capture Failed stating the reply from the processor (like invalid expiration) as is shown on the pay my order page if the transaction failed. ('The bank said: Invalid expiration date: 1109').

Is this possible to get with nVelocity?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: NVelocity Variable For Failed Payment Reason

Post by mazhar » Tue Dec 15, 2009 6:07 am

EDIT MADE [Invalid Comment]

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: NVelocity Variable For Failed Payment Reason

Post by jsmits » Tue Dec 15, 2009 11:30 am

I think payment capture failed and payment authorization failed are both valid triggers, but your approach would make more sense anyway.

The problem I am now having is that neither $order.PaymentStatus or $payment.PaymentStatus seem to return the proper values. The former returns 'unspecified' and the latter returns 'unprocessed' regardless of whether the payment failed or not....

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: NVelocity Variable For Failed Payment Reason

Post by mazhar » Wed Dec 16, 2009 5:53 am

Sorry I made some mistakes in my last comments about events. You are right capture failed and payment authorization failed are both valid triggers try putting your Email template against them.

DBounlom
Lieutenant (LT)
Lieutenant (LT)
Posts: 62
Joined: Wed Sep 09, 2009 1:26 pm

Re: NVelocity Variable For Failed Payment Reason

Post by DBounlom » Wed Dec 16, 2009 12:50 pm

Jsmits,

If you don't mind, could you post the code you edited here? For instance, what did you end up changing in the email template? Thanks.

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: NVelocity Variable For Failed Payment Reason

Post by jsmits » Thu Dec 17, 2009 6:42 am

DBounlom wrote:If you don't mind, could you post the code you edited here? For instance, what did you end up changing in the email template? Thanks.
I haven't decided yet. I think I am just going to fire off an email on payment capture failed with the order number that will go to a person in order fulfillment in my company so they will know not to process the order until paymnet is received. Ablecommerce is great, but we do not plan on using the order management tools from within the admin section, which is why this is an issue.

Post Reply