How access Custom Order Data added when purchase made through Custom payment gateway

Matt Mason asked on November 11, 2014 21:05

While taking an order through my CMSPaymentGatewayForm (Custom Payment gateway), I add a few custom data items, and I can't seem to see where I can retrieve the data later through the API. Any ideas?

Here is how I add the data:

 public override string ProcessData()
   {
   ...
                        PaymentGatewayCustomData["ChurchAccount"] = ChurchAccount.Text;
                        PaymentGatewayCustomData["ChurchPin"] = ChurchPIN.Text;
                        PaymentGatewayCustomData["ChurchName"] = reader["ChurchName"];
                        CMS.Ecommerce.PaymentResultItemInfo itemInfo = new CMS.Ecommerce.PaymentResultItemInfo();
                        itemInfo.Name = "Church Account";
                        itemInfo.Text = "Verified";
                        CMS.Ecommerce.OrderInfo orderInfo = new CMS.Ecommerce.OrderInfo();
                        orderInfo.OrderPaymentResult.SetPaymentResultItemInfo(itemInfo);
                        return string.Empty;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

Recent Answers


Yehuda Lando answered on November 11, 2014 22:41

I don't think that the payment custom data is saved to the db. You should set the order custom data instead.

0 votesVote for this answer Mark as a Correct answer

Matt Mason answered on November 11, 2014 22:55

Wow. Really? Ugh.

0 votesVote for this answer Mark as a Correct answer

Josef Dvorak answered on November 28, 2014 09:58

Hi Matt,

The PaymentGatewayCustomData is used only as a temporary storage of data and is discarded after payment request is submitted. Keeping it could cause PCI compliance issues when paying with credit card.

As Yehuda mentioned, you can use the OrderCustomData for any data that you want to keep permanently:

ShoppingCartInfoObj.Order.OrderCustomData
ShoppingCartInfoObj.Order.Update();
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.