Closed simonworkhouse closed 3 years ago
Is Shipping Address Line 1
Required? If so I don't see any issue with this approach. If it's not then we may need to implement a flag of some kind.
According to the documentation at https://zip-online.api-docs.io/v1/api-specification/create-a-checkout all fields in the shipping address are required. Would you prefer the check be updated to ensure that a value has been supplied for all fields? Or just continue to check for ShippingAddressLine1
and allow Zip to respond with an error if fields do not contain the expected values?
Maybe just check how other libraries such as PayPal, Stripe handle this. But I'm open for the Line1 solution, just might seem messy if someone does use Line2.
@alexw23 I have changed this so that is uses a parameter instead of checking for the first line of the shipping address. That would appear to be the "standard" way that other Omnipay packages would tend to handle this.
Just to confirm getHasShippingAddress()
is returning false/null by default correct?
Yes, it is returning null
by default.
This pull request adds support for handling a shipping address in a RestAuthorizeRequest, but I am not certain if the way that it determines if a shipping address has been supplied is entirely suitable.
What would be the preferred way to determine whether or not to include the shipping address? Currently I have just implemented the following: