Hi @HelenaB, Please go to this link and check Step no. 4
Nick here from Shopify. Great question!
I spoke to the Shopify theme support team directly about this for you. They mentioned that the Afterpay code is manually added to a theme so you would likely need to re-add the code to the new theme and any other theme you would make your primary theme going forward. Do you remember how you added the code for Afterpay the first time?
@m_waqas link might be the solution you are looking for also.
All the best, Nick
Just to confirm, you were using Afterpay then changed themes and it is no longer there/working for you? If this is the case, do you remember how you added Afterpay to your theme the first time? Let me know!