Skip to main content

In the implementation of 

ICCHostedPaymentFormProcessor::GetDataForPaymentForm

this function has the object parameter inputData as default method input to build the payment form

but the address data is coming empty
 

inputData.CustomerData.AddressData

 

Is there anyway or permission required so address data returns with the customer data, customer data has name and email address, but AddressData is coming null

Ok instead of waiting and since the customer email is being received in the in input data I created this function to get the address

 

 public Address GetCustomerAddressByEmail(string customerEmail)
{
if (string.IsNullOrEmpty(customerEmail))
{
return null;
}


var addressCollection = PXSelectJoin<Address,
InnerJoin<Customer, On<Address.addressID, Equal<Customer.defBillAddressID>>,
InnerJoin<Contact, On<Customer.bAccountID, Equal<Contact.bAccountID>>>>,
Where<Contact.eMail, Equal<Required<Contact.eMail>>>>
.Select(new PXGraph(), customerEmail);



if (addressCollection == null || addressCollection.Count == 0)
{
PXTrace.WriteError("No address found with the specified email.");
return null;
}
PXTrace.WriteInformation($"add typo: " + addressCollectionn0].GetType());
var address = addressCollectionn0].GetItem<Address>();

return address;
}

 


Reply