-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing correct customer data to Sage Pay #29
Comments
If the billing and shipping address are the same, then you could pass the same address in twice - no need to create separate models if they are identical. I haven't looked at the code to remind me, but I'm sure if you set just the billing or shipping address, then the other one will automatically be set to be the same. The emails are set on the addresses, since SagePay will accept both a shipping email and a billing email. Was it just the email that was the problem, or am I missing something else? |
Thanks. I thought I'd tried unsuccessfully to pass the email address as you explained - I will try again. With the addresses, I get that they can be the same but in this instance I need to store two different sets of contact details as the customer is sometimes a child and the card-payer is often a parent. The records need to show that distinction. |
I just took your example code as production code, so my bad for assuming :-) Best of luck. I'm going to come back to finishing off this module properly before the end of the year - there are a number of lose ends and not enough tests. If you find any holes in the functionality or any improvements that you think may help, then feel free to raise them as issues and it will go on the list. Would be nice (before the end of the year too) to write a connection for Omnipay, so this package can be used as an Omnipay driver, as well as standalone. |
I'm an OOP novice but I will try and work out what is going on - or not. Would I be correct in assuming that in your current production use, you are always using the same address for billing and delivery, and are not passing the email address? |
Hmm, I might be wrong there. Try I'll need to go through the SagePay documentation again. It changes quite a log between point releases (several times a year) from protocol V3. The customer details, the shipping details and the billing details can all refer to completely different people. (posted by @judgej) |
Brilliant, thanks - that works a treat for all the fields :) I didn't realise one could set a field so simply...
|
Ideally you whould be able to do SagePay takes all the fields in one big, flat, list. The classes such as the Address and Customer are just there for convenience, as a way of grouping fields together in your code and abstracting them slightly from the fields that SagePay names, and adding some validation and a way to transform some of the fields (e.g. a basket is turned into XML or CSV data). But if you want to use the raw SagePay fields, then set them all manually as you have done above, and it should work fine. |
Thanks. What you're doing is great, but for now, with my current project, the simple approach works well :) |
Cool. I'll close this ticket. Please re-open if still not working, or raise another ticket if there are further issues. |
HI. Thanks ever so much for publishing this project, which looks like it's going to save me a stack of work :)
I'm having a problem loading the correct customer details and am wondering what I'm doing wrong. My code is as follows:
Both the local storage db and SagePay's systems record both the billing and delivery addresses with the data entered above for 'billing', and the email address is not recorded at all. If you have time, please could you explain what I'm doing wrong?
The text was updated successfully, but these errors were encountered: