Account created on 17 June 2018, almost 7 years ago
#

Merge Requests

Recent comments

🇨🇦Canada a.griff

I just did a quick diff check of
https://cdn1.affirm.com/js/v2/affirm.js and https://cdn1.affirm.ca/js/v2/affirm.js and while most of the code is the same, there are country specific differences in the two that I'm guessing lead to problems if you don't include the right one for the country you are trying to use.

Example, this section of the code
{function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cart={},this.buildTarget="prod-live",this.hash="master",this.pageType="",this.resource_urls={checkout_button_route:"apps/checkout-button/",new_order:"checkout/",product_flows_checkout_route:"products/checkout",new_future_checkout:"checkout/?as_future=1",orders_backend_route:"apps/orders/",prequal_backend_route:"apps/prequal/",prequal_frontend_learn_more_route:"#/prequalifications/learn-more",send_future_checkout:"send_future_checkout",third_party_cookie_check:"cookie_sent",breeze_route:"apps/breeze/",toast_route:"apps/toast/"},this.target="prod-live",this.tracking_blacklist={0:"E0QK6BONBI305A0Y"},this.apiTokens={tracking_blacklist:{0:"E0QK6BONBI305A0Y"},statsig_client_side_id:"client-gcVqW85xa36vHQOyW5ZNVdgIA4eDCVLkHmizTJxFRI9",statsig_client_environment_param:{environment:{tier:"production"}},rollbar:"dcce876e5122437d8373240f0b7c0778",branch:"key_live_eak0b1ysFeymTfKqPf8GfmjhyFpG45mQ"},this.api_url="https://api-cf.affirm.com/api/v2/",this.api_version="v2",this.cdn_root="https://cdn1.affirm.com",this.cdn_assets_root="https://cdn-assets.affirm.com",this.assets_root="https://cdn1.affirm.com/products/affirmjs/master/dist/",this.country_code="US",this.frontend_url="https://www.affirm.com",this.minified_url="https://cdn1.affirm.com/js/v2/affirm.js",this.payments_url_base="https://calculator.affirm.com",this.promos_url_prefix="https://cdn1.affirm.com/platform/public/promos/",this.tracking_endpoint="tracker.affirm.com",this.elastic_cloud_apm_endpoint="https://8f72b01b2e7a49d68c403ae5e6b1a428.apm.us-east-1.aws.cloud.es.io",this.extend=this.extend.bind(this)}return

becomes

{function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cart={},this.buildTarget="prod-live",this.hash="master",this.pageType="",this.resource_urls={checkout_button_route:"apps/checkout-button/",new_order:"checkout/",product_flows_checkout_route:"products/checkout",new_future_checkout:"checkout/?as_future=1",orders_backend_route:"apps/orders/",prequal_backend_route:"apps/prequal/",prequal_frontend_learn_more_route:"#/prequalifications/learn-more",send_future_checkout:"send_future_checkout",third_party_cookie_check:"cookie_sent",breeze_route:"apps/breeze/",toast_route:"apps/toast/"},this.target="prod-live",this.tracking_blacklist={0:"E0QK6BONBI305A0Y"},this.apiTokens={tracking_blacklist:{0:"E0QK6BONBI305A0Y"},statsig_client_side_id:"client-gcVqW85xa36vHQOyW5ZNVdgIA4eDCVLkHmizTJxFRI9",statsig_client_environment_param:{environment:{tier:"production"}},rollbar:"dcce876e5122437d8373240f0b7c0778",branch:"key_live_eak0b1ysFeymTfKqPf8GfmjhyFpG45mQ"},this.api_url="https://api-cf.affirm.com/api/v2/",this.api_version="v2",this.cdn_root="https://cdn1.affirm.com",this.cdn_assets_root="https://cdn-assets.affirm.com",this.assets_root="https://cdn1.affirm.com/products/affirmjs/master/dist/",this.country_code="CA",this.frontend_url="https://www.affirm.com",this.minified_url="https://cdn1.affirm.com/js/v2/affirm.js",this.payments_url_base="https://calculator.affirm.com",this.promos_url_prefix="https://cdn1.affirm.com/platform/public/promos/",this.tracking_endpoint="tracker.affirm.com",this.elastic_cloud_apm_endpoint="https://8f72b01b2e7a49d68c403ae5e6b1a428.apm.us-east-1.aws.cloud.es.io",this.extend=this.extend.bind(this)}return

See this.country_code="US" changes to this.country_code="CA"

🇨🇦Canada a.griff

I no longer work for the company where we had to make these changes, so I don't have any of the communication related to this and can no longer test if it still works. But I can confirm that, unless they have made changes since, this is a requirement.

If the company is on Affirm Canada, you need the .ca domain. This makes it especially annoying when your company has a US and Canadian account since they treat these as completely different accounts with different companies.

I found Affirms documentation and support pretty bad in many areas. A lot of trial and error needed. But this single switch of using a .ca domain was the difference between things not working vs working for our Canadian account.

🇨🇦Canada a.griff

Have created a fork with a potential fix for this issue. The approach checks if config.CountryCode === 'CAN' and sets the correct URL based off of that.

🇨🇦Canada a.griff

I believe it is related to this problem, specifically you can see this comment which may be helpful.
https://www.drupal.org/project/advagg/issues/3270337#comment-14989874 📌 Remove JSqueeze as it is abandoned Active

I was experiencing this issue after moving to Drupal 10. I changed from jsqueeze -> jshrink and this solved my problems.

Production build 0.71.5 2024