зеркало из https://github.com/mozilla/fxa.git
fix(tax): wrong Request IP Address Sent to StripeE
Because: * we don't want to use 127.0.0.1 to try to look up tax locations in stripe This commit: * uses the forwarded IP address from the client Closes #
This commit is contained in:
Родитель
2cae770329
Коммит
cf5fde2edb
|
@ -423,7 +423,7 @@ export class StripeHandler {
|
|||
>;
|
||||
|
||||
const country = request.app.geo.location?.country || 'US';
|
||||
const ipAddress = request.info.remoteAddress;
|
||||
const ipAddress = request.app.clientAddress;
|
||||
const automaticTax = this.automaticTax;
|
||||
|
||||
const previewInvoice = await this.stripeHelper.previewInvoice({
|
||||
|
@ -485,7 +485,7 @@ export class StripeHandler {
|
|||
string
|
||||
>;
|
||||
const country = request.app.geo.location?.country || 'US';
|
||||
const ipAddress = request.info.remoteAddress;
|
||||
const ipAddress = request.app.clientAddress;
|
||||
const automaticTax = this.automaticTax;
|
||||
|
||||
const couponDetails = this.stripeHelper.retrieveCouponDetails({
|
||||
|
|
|
@ -661,9 +661,6 @@ describe('DirectStripeRoutes', () => {
|
|||
priceId: 'priceId',
|
||||
};
|
||||
VALID_REQUEST.app.geo = {};
|
||||
VALID_REQUEST.info = {
|
||||
remoteAddress: '1.1.1.1',
|
||||
};
|
||||
const actual = await directStripeRoutesInstance.previewInvoice(
|
||||
VALID_REQUEST
|
||||
);
|
||||
|
@ -677,7 +674,7 @@ describe('DirectStripeRoutes', () => {
|
|||
{
|
||||
automaticTax: false,
|
||||
country: 'US',
|
||||
ipAddress: '1.1.1.1',
|
||||
ipAddress: '127.0.0.1',
|
||||
promotionCode: 'promotionCode',
|
||||
priceId: 'priceId',
|
||||
}
|
||||
|
@ -818,10 +815,6 @@ describe('DirectStripeRoutes', () => {
|
|||
priceId: 'priceId',
|
||||
};
|
||||
VALID_REQUEST.app.geo = {};
|
||||
VALID_REQUEST.info = {
|
||||
remoteAddress: '1.1.1.1',
|
||||
};
|
||||
|
||||
const actual = await directStripeRoutesInstance.retrieveCouponDetails(
|
||||
VALID_REQUEST
|
||||
);
|
||||
|
@ -831,7 +824,7 @@ describe('DirectStripeRoutes', () => {
|
|||
{
|
||||
automaticTax: false,
|
||||
country: 'US',
|
||||
ipAddress: '1.1.1.1',
|
||||
ipAddress: '127.0.0.1',
|
||||
promotionCode: 'promotionCode',
|
||||
priceId: 'priceId',
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче