@Test public void testFulfillmentContingenciesPendingPayments() { CustomerTransactionVO ct = TestingHelper.generateCustomerTransactionVOFromFiles( "contingencies/CT-FulfillmentContingencies-Pending.xml"); WTransaction[] wtransactions = WTransactionCTConverterTestingHelper.convert(ct, 2); int i = 0; // Type-U Sender Side assertEquals(true, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.PENDING.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.PAYPAL_BAL.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() < 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() < 0); assertEquals(true, wtransactions[i].isFlag1Set(WTransactionConstants.Flag1.HELD_FOR_RECEIVING)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_RECIPIENT)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_SHIPPING)); assertEquals( true, wtransactions[i].isFlag4Set(WTransactionConstants.Flag4.INITIALLY_HELD_FOR_PARENT_ACCEPT)); i++; // Type-U Recipient Side assertEquals(false, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(false, wtransactions[i].getId().equals(wtransactions[i - 1].getId())); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.PENDING.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.UNAFFECTED.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() > 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() > 0); assertEquals(true, wtransactions[i].isFlag1Set(WTransactionConstants.Flag1.HELD_FOR_RECEIVING)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_RECIPIENT)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_SHIPPING)); assertEquals( true, wtransactions[i].isFlag4Set(WTransactionConstants.Flag4.INITIALLY_HELD_FOR_PARENT_ACCEPT)); }
@Test public void testPaymentCompletionByReleasingHeldForRecipient() { CustomerTransactionVO ct = TestingHelper.generateCustomerTransactionVOFromFiles( "contingencies/CT-PaymentCompletion-HeldForRecipient.xml"); WTransaction[] wtransactions = WTransactionCTConverterTestingHelper.convert(ct, 4); int i = 0; // Type-U Sender Side assertEquals(true, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.SUCCESS.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.LEDGER_BAL.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() < 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() < 0); assertEquals( false, wtransactions[i].isFlag1Set(WTransactionConstants.Flag1.HELD_FOR_RECIPIENT)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_RECIPIENT)); i++; // Type-U Recipient Side assertEquals(false, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(false, wtransactions[i].getId().equals(wtransactions[i - 1].getId())); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.SUCCESS.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.PAYPAL_LEDGER_BAL.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() > 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() > 0); assertEquals( false, wtransactions[i].isFlag1Set(WTransactionConstants.Flag1.HELD_FOR_RECIPIENT)); assertEquals( true, wtransactions[i].isFlag2Set(WTransactionConstants.Flag2.INITIALLY_HELD_FOR_RECIPIENT)); }
@Test public void testPaymentCompletionByReleasingCompliancePending() { CustomerTransactionVO ct = TestingHelper.generateCustomerTransactionVOFromFiles( "contingencies/CT-PaymentCompletion-CompliancePending.xml"); WTransaction[] wtransactions = WTransactionCTConverterTestingHelper.convert(ct, 3); int i = 0; // Type-U Sender Side assertEquals(true, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.SUCCESS.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.LEDGER_BAL.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() < 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() < 0); assertEquals( false, wtransactions[i].isFlag5Set(WTransactionConstants.Flag5.HAS_COMPLIANCE_HOLD)); assertEquals( true, wtransactions[i].isFlag5Set(WTransactionConstants.Flag5.HAD_COMPLIANCE_HOLD)); i++; // Type-U Recipient Side assertEquals(false, wtransactions[i].isBuyerSide()); assertEquals(1, wtransactions[i].getId().compareTo(BigInteger.ZERO)); assertEquals(false, wtransactions[i].getId().equals(wtransactions[i - 1].getId())); assertEquals(null, wtransactions[i].getParentId()); assertEquals( WTransactionConstants.Type.USERUSER.getValue(), wtransactions[i].getType().charValue()); assertEquals(null, wtransactions[i].getReason()); assertEquals( WTransactionConstants.Status.SUCCESS.getValue(), wtransactions[i].getStatus().charValue()); assertEquals( WTransactionConstants.Transition.PAYPAL_LEDGER_BAL.getValue(), wtransactions[i].getTransition().charValue()); assertEquals(true, wtransactions[i].getAmount().getAmount() > 0); assertEquals(true, wtransactions[i].getUsdAmount().getAmount() > 0); assertEquals( false, wtransactions[i].isFlag5Set(WTransactionConstants.Flag5.HAS_COMPLIANCE_HOLD)); assertEquals( true, wtransactions[i].isFlag5Set(WTransactionConstants.Flag5.HAD_COMPLIANCE_HOLD)); }