Hi,
I need to send a specific custom field I created with "Configuration > Settings > Customer settings". This field is a simple text field, and I need my Payment Plugin to send this to the Payment Gateway.
Custom Field Name: Prepaid Meter Number
This is what I have in my Plugin to send field data to the Payment Gateway:
------------------------------------------------------------------------------------------>>>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
var storeLocation = _webHelper.GetStoreLocation();
var post = new RemotePost
{
FormName = "SagePay",
Method = "POST",
Url = string.Format("{0}/eng/process?", _sagePayPaymentSettings.UseSandbox ? "https://paynow.sagepay.co.za/site/paynow.aspx" : "https://paynow.sagepay.co.za/site/paynow.aspx")
};
post.Add("m1", _sagePayPaymentSettings.SagePayServiceKey);
post.Add("m2", _sagePayPaymentSettings.SagePaySoftwareVendorKey);
post.Add("p2", postProcessPaymentRequest.Order.Id.ToString());
post.Add("p3", string.Format("Order: #{0}", postProcessPaymentRequest.Order.Id));
post.Add("p4", postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture));
post.Add("Budget", _sagePayPaymentSettings.SagePayShowBudget);
if (postProcessPaymentRequest.Order.BillingAddress != null)
{
post.Add("m4", postProcessPaymentRequest.Order.BillingAddress.LastName + ", " + postProcessPaymentRequest.Order.BillingAddress.FirstName);
post.Add("m5", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber;
post.Add("m6", postProcessPaymentRequest.Order.Customer.;
post.Add("m9", postProcessPaymentRequest.Order.BillingAddress.Email);
}
post.Post();
}
------------------------------------------------------------------------------------------>>>
The "post.Add("m6", postProcessPaymentRequest.Order.Customer.;" line is where I need to reference the custom field I created in the Customers Form.
Is this possible? I can't seems to pick up the CustomerAttribute property. Am going about this the wrong way?
Any help or guidance will be appreciated.
Thanks.