Template gateway

Looks like this PR contains the same commit as https://github.com/Shopify/active_merchant/pull/1473