Skip to content

Commit e0d42d3

Browse files
committed
Use npm for Adyen/adyen-web
1 parent 4b78cce commit e0d42d3

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

js/dist/checkout-drop-in.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array(), 'version' => 'a82e7c6c447f5f0921e1');
1+
<?php return array('dependencies' => array(), 'version' => '7484a0414b1b91cf7b60');

js/dist/checkout-drop-in.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/src/checkout-drop-in.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/* global AdyenCheckout, pronamicPayAdyenCheckout */
1+
/* global pronamicPayAdyenCheckout */
2+
3+
import { AdyenCheckout, Dropin } from '@adyen/adyen-web/auto'
24

35
/**
46
* Adyen checkout error definition.
@@ -51,8 +53,6 @@
5153
},
5254
};
5355

54-
const { AdyenCheckout, Dropin } = window.AdyenWeb;
55-
5656
const checkout = await AdyenCheckout( configuration );
5757

5858
const dropin = new Dropin(

src/Gateway.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,12 @@ public function payment_redirect( Payment $payment ) {
298298
// Endpoint.
299299
$endpoint = new Endpoint( $this->config->environment, $this->config->api_live_url_prefix );
300300

301-
// Register scripts.
302-
$url_script = $endpoint->get_web_url( self::SDK_VERSION, 'adyen.js' );
303-
304-
\wp_register_script(
305-
'pronamic-pay-adyen-checkout',
306-
$url_script,
307-
[],
308-
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- Version is part of URL.
309-
null,
310-
false
311-
);
312-
313301
$asset = include __DIR__ . '/../js/dist/checkout-drop-in.asset.php';
314302

315303
\wp_register_script(
316304
'pronamic-pay-adyen-checkout-drop-in',
317305
\plugins_url( '../js/dist/checkout-drop-in.js', __FILE__ ),
318-
[ 'pronamic-pay-adyen-checkout' ],
306+
[],
319307
$asset['version'],
320308
true
321309
);
@@ -361,7 +349,7 @@ public function payment_redirect( Payment $payment ) {
361349
$configuration = \apply_filters( 'pronamic_pay_adyen_checkout_configuration', $configuration );
362350

363351
\wp_localize_script(
364-
'pronamic-pay-adyen-checkout',
352+
'pronamic-pay-adyen-checkout-drop-in',
365353
'pronamicPayAdyenCheckout',
366354
[
367355
'configuration' => $configuration,

0 commit comments

Comments
 (0)