Using filterss to change Stripe account per-product, will this cause problems?
-
Our organization is selling products for different locations. Thus I need to use hooks to modify the stripe account keys on the fly at checkout, based on the product being bought. Thus far I’m hooking into these 3 filters:
wc_stripe_params – $params[‘key’] contains the publishable key. This is run when the page is loaded.
woocommerce_stripe_request_headers – The “authorization” field here contains the base-64 encoded secret key. This is run when the payment is made.
woocommerce_stripe_request_params – $params[‘stripe’][‘key’] contains the publishable key. This is run when the checkout page is loaded.I’m using these filters to change my publishable and secret keys to those of a different stripe account, and it seems to work fine. However, will this cause unforeseen issues anywhere?
- The topic ‘Using filterss to change Stripe account per-product, will this cause problems?’ is closed to new replies.