Skip to content

Commit

Permalink
Add BNPL disclaimer to In3 and Klarna.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Nov 28, 2023
1 parent ba05c39 commit 58b8309
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ public static function get_gateways() {
'id' => 'pronamic_pay_in3',
'payment_method' => PaymentMethods::IN3,
'icon' => PaymentMethods::get_icon_url( PaymentMethods::IN3, $icon_size ),
'form_fields' => [
'description' => [
'default' => self::get_bnpl_disclaimer( \__( 'In3', 'pronamic_ideal' ) ),
],
],
],
[
'id' => 'pronamic_pay_kbc',
Expand All @@ -401,6 +406,11 @@ public static function get_gateways() {
'id' => 'pronamic_pay_klarna_pay_later',
'payment_method' => PaymentMethods::KLARNA_PAY_LATER,
'icon' => PaymentMethods::get_icon_url( PaymentMethods::KLARNA_PAY_LATER, $icon_size ),
'form_fields' => [
'description' => [
'default' => self::get_bnpl_disclaimer( \__( 'Klarna', 'pronamic_ideal' ) ),
],
],
],
[
'id' => 'pronamic_pay_klarna_pay_now',
Expand Down Expand Up @@ -452,10 +462,7 @@ public static function get_gateways() {
'icon' => PaymentMethods::get_icon_url( PaymentMethods::RIVERTY, $icon_size ),
'form_fields' => [
'description' => [
'default' => \__(
'You must be at least 18+ to use this service. If you pay on time, you will avoid additional costs and ensure that you can use Riverty’s services again in the future. By continuing, you accept the Terms and Conditions and confirm that you have read the Privacy Statement and Cookie Statement.',
'pronamic_ideal'
),
'default' => self::get_bnpl_disclaimer( \__( 'Riverty', 'pronamic_ideal' ) ),
],
],
'method_description' => \__(
Expand Down Expand Up @@ -505,6 +512,24 @@ public static function get_gateways() {
];
}

/**
* Get Buy Now, Pay Later disclaimer.
*
* @link https://github.com/pronamic/pronamic-pay/issues/70
* @param string $provider Provider.
* @return string
*/
private static function get_bnpl_disclaimer( $provider ) {
return \sprintf(
/* translators: %s: provider */
\__(
'You must be at least 18+ to use this service. If you pay on time, you will avoid additional costs and ensure that you can use %s services again in the future. By continuing, you accept the Terms and Conditions and confirm that you have read the Privacy Statement and Cookie Statement.',
'pronamic_ideal'
),
\esc_html( $provider )
);
}

/**
* WooCommerce thank you.
*
Expand Down

0 comments on commit 58b8309

Please sign in to comment.