Skip to content

Commit b22a00f

Browse files
committed
ACP2E-3354: force "ACCOUNT" rate request type
1 parent a4cf5e6 commit b22a00f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

app/code/Magento/Fedex/Model/Carrier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ protected function _formRateRequest($purpose): array
417417
]
418418
]
419419
],
420-
'rateRequestType' => ['LIST']
420+
'rateRequestType' => ['LIST', 'ACCOUNT']
421421
]
422422
];
423423

app/code/Magento/Fedex/Test/Unit/Model/CarrierTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,17 @@ public function testCollectRatesRateAmountOriginBased(
421421
$rateResponse = $this->getRateResponse($amount, $currencyCode, $rateType);
422422

423423
$this->serializer->method('serialize')
424-
->willReturn('CollectRateString' . $amount);
424+
->willReturn(
425+
json_encode(
426+
[
427+
'accountNumber' => '123456789',
428+
'requestedShipment' =>
429+
['rateRequestTypes' =>
430+
['LIST', 'ACCOUNT']
431+
]
432+
]
433+
) .'CollectRateString' . $amount
434+
);
425435

426436
$rateCurrency = $this->getMockBuilder(Currency::class)
427437
->disableOriginalConstructor()
@@ -454,6 +464,7 @@ public function testCollectRatesRateAmountOriginBased(
454464
->addMethods(['getBaseCurrency'])
455465
->disableOriginalConstructor()
456466
->getMock();
467+
457468
$request->method('getBaseCurrency')
458469
->willReturn($baseCurrency);
459470

@@ -465,6 +476,7 @@ public function testCollectRatesRateAmountOriginBased(
465476
->willReturnOnConsecutiveCalls($accessTokenResponse, $rateResponse);
466477

467478
$allRates1 = $this->carrier->collectRates($request)->getAllRates();
479+
468480
foreach ($allRates1 as $rate) {
469481
$this->assertEquals($expected, $rate->getData('cost'));
470482
}

0 commit comments

Comments
 (0)