Problem with postProcessPaymentRequest

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
So i need to update my plugin for paying (PayPal Edit)
In old plugin code was
            data.Add("ch_full_name", HttpUtility.UrlEncode(postProcessPaymentRequest.Order.FirstName) + " " + postProcessPaymentRequest.Order.BillingAddress.LastName);
            data.Add("ch_address", postProcessPaymentRequest.Order.BillingAddressId.ToString());
            data.Add("ch_city", postProcessPaymentRequest.Order.BillingAddress.City);
            data.Add("ch_country", postProcessPaymentRequest.Order.BillingAddress.Country.Name);
            data.Add("ch_zip", postProcessPaymentRequest.Order.BillingAddress.ZipPostalCode);
            data.Add("ch_phone", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber);
            data.Add("ch_email", postProcessPaymentRequest.Order.BillingAddress.Email);


But now, in 4.30 Version i got these errors
Error  CS1061  'Order' does not contain a definition for 'BillingAddress' and no accessible extension method 'BillingAddress' accepting a first argument of type 'Order' could be found (are you missing a using directive or an assembly reference?)


How can i get these informations now ?
3 years ago
musoviich wrote:
So i need to update my plugin for paying (PayPal Edit)
In old plugin code was
            data.Add("ch_full_name", HttpUtility.UrlEncode(postProcessPaymentRequest.Order.FirstName) + " " + postProcessPaymentRequest.Order.BillingAddress.LastName);
            data.Add("ch_address", postProcessPaymentRequest.Order.BillingAddressId.ToString());
            data.Add("ch_city", postProcessPaymentRequest.Order.BillingAddress.City);
            data.Add("ch_country", postProcessPaymentRequest.Order.BillingAddress.Country.Name);
            data.Add("ch_zip", postProcessPaymentRequest.Order.BillingAddress.ZipPostalCode);
            data.Add("ch_phone", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber);
            data.Add("ch_email", postProcessPaymentRequest.Order.BillingAddress.Email);


But now, in 4.30 Version i got these errors
Error  CS1061  'Order' does not contain a definition for 'BillingAddress' and no accessible extension method 'BillingAddress' accepting a first argument of type 'Order' could be found (are you missing a using directive or an assembly reference?)


Hello
You have to get Address by postProcessPaymentRequest.Order.BillingAddressId, Because BillingAddress class property removed in 4.30.
3 years ago
Yes, but how can i get it ?

I need all stuff...
3 years ago
I get it with

var orderAddress = _addressService.GetAddressById(postProcessPaymentRequest.Order.BillingAddressId);



data.Add("ch_full_name", HttpUtility.UrlEncode(orderAddress.FirstName) + " " + orderAddress.LastName);
            data.Add("ch_address", orderAddress.Address1);
            data.Add("ch_city", orderAddress.City);
            data.Add("ch_country", orderAddress.County);
            data.Add("ch_zip", orderAddress.ZipPostalCode);
            data.Add("ch_phone", orderAddress.PhoneNumber);
            data.Add("ch_email", orderAddress.Email);


If someone needs :)
3 years ago
Entity Framework definitely was a better solution. There was great flexibility in LINQ queries. In my opinion from nopcommerce 4.30 version stepped back!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.