The AbstractWorldpayOrderService class has a method cloneAndSetBillingAddressFromCart to clone an Address which will be assigned to a PaymentInfo. However, using the clone method of the ModelService doesn't guarantee that the duplicate flag on the cloned Address is set to true. If this flag isn't set correctly it will cause problems, for example when importing Addresses using the Data Hub.
By using the cloneAddressForOwner method of the AddressService instead, we guarantee that the clone is properly created and the relevant attributes (duplicate, original) are all set.
The
AbstractWorldpayOrderService
class has a methodcloneAndSetBillingAddressFromCart
to clone an Address which will be assigned to a PaymentInfo. However, using theclone
method of theModelService
doesn't guarantee that theduplicate
flag on the cloned Address is set totrue
. If this flag isn't set correctly it will cause problems, for example when importing Addresses using the Data Hub. By using thecloneAddressForOwner
method of theAddressService
instead, we guarantee that the clone is properly created and the relevant attributes (duplicate
,original
) are all set.