def test_createPayzenEvent_newPayment(self):
     date = DateTime()
     transaction = self.createPaymentTransaction()
     payzen_event = transaction.PaymentTransaction_createPayzenEvent()
     self.assertEquals(payzen_event.getPortalType(), "Payzen Event")
     self.assertEquals(payzen_event.getSource(), "portal_secure_payments/slapos_payzen_test")
     self.assertEquals(payzen_event.getDestination(), transaction.getRelativeUrl())
 def test_addPayzenTicket_payzen_payment(self):
     transaction = self.createPaymentTransaction()
     transaction.edit(payment_mode="payzen")
     ticket = transaction.PaymentTransaction_addPayzenTicket()
     self.assertEquals(ticket.getPortalType(), "Support Request")
     self.assertEquals(ticket.getSimulationState(), "validated")
     self.assertEquals(ticket.getSourceProject(), transaction.getRelativeUrl())
     self.assertEquals(ticket.getTitle(), "Payzen Transaction to check")
 def test_sendManualPayzenPaymentUrl_payzen_payment(self):
     person1 = self.portal.person_module.newContent(portal_type="Person")
     person2 = self.portal.person_module.newContent(portal_type="Person")
     transaction = self.createPaymentTransaction()
     transaction.edit(destination_section_value=person1, source_section_value=person2, payment_mode="payzen")
     before_date = DateTime()
     event = transaction.PaymentTransaction_sendManualPayzenPaymentUrl()
     after_date = DateTime()
     ticket = transaction.PaymentTransaction_addPayzenTicket()
     self.assertEquals(event.getPortalType(), "Site Message")
     self.assertTrue(event.getStartDate() >= before_date)
     self.assertTrue(event.getStopDate() <= after_date)
     self.assertEquals(event.getDestination(), transaction.getDestinationSection())
     self.assertEquals(event.getSourceSection(), transaction.getSource())
     self.assertEquals(
         event.getTextContent(),
         'Please pay your payment by clicking <a href="'
         + transaction.getRelativeUrl()
         + '/PaymentTransaction_redirectToManualPayzenPayment">here</a>.',
     )
     self.assertEquals(event.getSimulationState(), "started")
     self.assertEquals(event.getFollowUp(), ticket.getRelativeUrl())