Ejemplo n.º 1
0
def set_not_processable_payments_with_bank_information_to_retry(
        batch_date: datetime) -> None:
    payments_to_retry = payment_queries.find_not_processable_with_bank_information(
    )
    for payment in payments_to_retry:
        booking = payment.booking
        if booking.venue.bic and booking.venue.iban:
            payment.bic = booking.venue.bic
            payment.iban = booking.venue.iban
        elif booking.offerer.bic and booking.offerer.iban:
            payment.bic = booking.offerer.bic
            payment.iban = booking.offerer.iban
        payment.batchDate = batch_date
        payment.transactionLabel = make_transaction_label(datetime.utcnow())
        payment.setStatus(TransactionStatus.RETRY)
    repository.save(*payments_to_retry)
Ejemplo n.º 2
0
    def test_in_second_half_of_a_month(self, date):
        # when
        message = make_transaction_label(date)

        # then
        assert message == "pass Culture Pro - remboursement 2nde quinzaine 07-2018"