MediaWiki:DonationFormSandbox.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 1,078:
*
* Currently only used in monthlyconvert, but this could be useful
*
* @param {string} language
* @param {string} country
Line 1,094:
}
return language + '-' + country;
};
/**
* Should we show Apple Pay?
*
* Note there is a ~500ms delay in Safari when checking, so only call this if needed
*
* @param {string} country
* @return {boolean}
*/
donationForm.shouldShowApplePay = function ( country ) {
// TODO: Add country logic when we get a list from payments
if ( location.search.match('forceApplePay') ) {
return true;
}
if ( window.ApplePaySession ) {
if ( ApplePaySession.canMakePayments() ) {
return true;
}
}
return false;
};
Line 1,142 ⟶ 1,163:
addCardTypesClass( donationForm.country );
// Apple Pay
if ( $('.paymentmethod-applepay').length > 0 ) {
if ( donationForm.shouldShowApplePay( donationForm.country ) ) {
$('.paymentmethod-applepay').show();
}
}
}
|