Rithum B2B patterns and distribution API
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Trust guaranteed non-null fields:
// DO: Trust the data model guarantees
order.setTotalPrice(PriceUtils.centsToDollars(transactableBag.getTotal()));
// DON'T: Add unnecessary null checks
if (Objects.nonNull(transactableBag.getTotal())) {
order.setTotalPrice(PriceUtils.centsToDollars(transactableBag.getTotal()));
}
// CORRECT
OfferData.Shipping.Price price = new OfferData.Shipping.Price();
// WRONG
OfferData.Shipping.Method.Price price = new OfferData.Shipping.Method.Price();
// CORRECT
config.setRithumConfig(rithumConfig);
// WRONG
config.setRithum(rithumConfig);
// CORRECT - merchantId is Integer
assertEquals(Integer.valueOf(12345), result.getMerchantId());
// WRONG
assertEquals(Long.valueOf(12345L), result.getMerchantId());
@Test
public void testOrderSyncWithFallbackShipping() {
try (MockedStatic<RithumMerchantConfig> mockedRithumConfig = Mockito.mockStatic(RithumMerchantConfig.class)) {
mockedRithumConfig.when(() -> RithumMerchantConfig.shouldUseFallbackShippingMethods(config)).thenReturn(true);
List<OfferData.Shipping> result = rithumOrderSyncService.getShippingEstimates(request);
assertNotNull(result);
assertTrue(CollectionUtils.isNotEmpty(result));
}
}
private DecryptedMerchantCredentials createDecryptedMerchantCredentials() {
DecryptedMerchantCredentials dmc = new DecryptedMerchantCredentials();
dmc.setMerchantId(12345); // Use Integer, not Long
dmc.setPlatform(Merchant.Platform.RITHUM);
return dmc;
}