-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send WorldPay emails to contact_email for AD renewals (#278)
* Send WorldPay emails to contact_email for AD renewals https://eaflood.atlassian.net/browse/WC-489 Users sometimes go through the assisted digital route to renew because they cannot access their account. When a user goes through WorldPay for payment, we send the account email through to WorldPay, which it then uses to send confirmation of the payment. If the user is AD because they can't access the account, this makes the confirmation meaningless. So if a renewal is done via assisted digital, we should be passing the contact email to WorldPay, and not the account email. * Add spec for AD renewals in WorldpayXmlService The XML should use a different email address when the renewal is AD, so we need a new fixture and a new spec. * WorldpayXmlService now takes a current_user when initialising Improve the specs to handle this. * Get different contact emails for digital and AD We do this by checking if the current user's email matches the renewal account email. If they do, then the user who owns the registration is doing the renewal and it must be digital. If they don't, then another user is doing the renewal on their behalf and it must be assisted digital.
- Loading branch information
1 parent
0f1f11b
commit 4297b34
Showing
5 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1/EN" "http://dtd.worldpay.com/paymentService_v1.dtd"> | ||
<paymentService version="1.4" merchantCode="MERCHANTCODE"> | ||
<submit> | ||
<order orderCode="1234567890"> | ||
<description>Your Waste Carrier Registration CBDU9999</description> | ||
<amount currencyCode="GBP" value="10000" exponent="2"/> | ||
<orderContent>Waste Carrier Registration renewal: CBDU9999 for Acme Waste</orderContent> | ||
<paymentMethodMask> | ||
<include code="VISA-SSL"/> | ||
<include code="MAESTRO-SSL"/> | ||
<include code="ECMC-SSL"/> | ||
</paymentMethodMask> | ||
<shopper> | ||
<shopperEmailAddress>contact-foo@example.com</shopperEmailAddress> | ||
</shopper> | ||
<billingAddress> | ||
<address> | ||
<firstName>Jane</firstName> | ||
<lastName>Doe</lastName> | ||
<address1>42 Foo Gardens</address1> | ||
<address2/> | ||
<postalCode>FA1 1KE</postalCode> | ||
<city>Baz City</city> | ||
<countryCode>SK</countryCode> | ||
</address> | ||
</billingAddress> | ||
</order> | ||
</submit> | ||
</paymentService> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters