WooCommerce PayPal Payments - Version 1.6.3

Version Description

  • Fix - Payments fail when using custom order numbers #354
  • Fix - Do not display saved payments on PayPal buttons if vault option is disabled #358
  • Fix - Double "Place Order" button #362
  • Fix - Coupon causes TAX_TOTAL_MISMATCH #372
  • Fix - Funding sources Mercado Pago and BLIK can't be disabled #383
  • Fix - Customer details not available in order and name gets replaced by xxx@dcc2.paypal.com #378
  • Fix - 3D Secure failing for certain credit card types with PayPal Card Processing #379
  • Fix - Error messages are not cleared even when checkout is re-attempted (DCC) #366
  • Add - New additions for system report status #377
Download this release

Release Info

Developer woothemes
Plugin Icon 128x128 WooCommerce PayPal Payments
Version 1.6.3
Comparing to
See all releases

Code changes from version 1.6.2 to 1.6.3

Files changed (38) hide show
  1. changelog.txt +11 -0
  2. modules/ppcp-api-client/services.php +323 -46
  3. modules/ppcp-api-client/src/Endpoint/BillingAgreementsEndpoint.php +134 -0
  4. modules/ppcp-api-client/src/Endpoint/IdentityToken.php +20 -6
  5. modules/ppcp-api-client/src/Factory/AmountFactory.php +16 -8
  6. modules/ppcp-api-client/src/Factory/ItemFactory.php +21 -8
  7. modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php +2 -3
  8. modules/ppcp-api-client/src/Helper/DccApplies.php +47 -182
  9. modules/ppcp-button/assets/css/hosted-fields.css +1 -1
  10. modules/ppcp-button/assets/js/button.js +1 -1
  11. modules/ppcp-button/resources/css/hosted-fields.scss +4 -0
  12. modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js +50 -53
  13. modules/ppcp-button/resources/js/modules/ContextBootstrap/PayNowBootstrap.js +5 -74
  14. modules/ppcp-button/resources/js/modules/ErrorHandler.js +3 -3
  15. modules/ppcp-button/resources/js/modules/Helper/Hiding.js +44 -0
  16. modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForPayNow.js +2 -0
  17. modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js +17 -0
  18. modules/ppcp-button/services.php +6 -2
  19. modules/ppcp-button/src/Assets/SmartButton.php +19 -8
  20. modules/ppcp-button/src/Helper/MessagesApply.php +17 -3
  21. modules/ppcp-button/src/Helper/MessagesDisclaimers.php +17 -4
  22. modules/ppcp-compat/src/PPEC/PPECHelper.php +9 -0
  23. modules/ppcp-compat/src/PPEC/SettingsImporter.php +1 -1
  24. modules/ppcp-status-report/src/Renderer.php +4 -2
  25. modules/ppcp-status-report/src/StatusReportModule.php +112 -34
  26. modules/ppcp-vaulting/src/VaultingModule.php +5 -0
  27. modules/ppcp-wc-gateway/services.php +17 -13
  28. modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php +2 -2
  29. modules/ppcp-webhooks/services.php +11 -0
  30. modules/ppcp-webhooks/src/Handler/PrefixTrait.php +4 -1
  31. modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php +12 -0
  32. modules/ppcp-webhooks/src/WebhookInfoStorage.php +76 -0
  33. modules/ppcp-webhooks/src/WebhookRegistrar.php +16 -4
  34. readme.txt +12 -1
  35. vendor/autoload.php +1 -1
  36. vendor/composer/autoload_real.php +7 -7
  37. vendor/composer/autoload_static.php +3 -3
  38. woocommerce-paypal-payments.php +1 -1
changelog.txt CHANGED
@@ -1,5 +1,16 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.6.2 - 2021-11-22 =
4
  * Fix - Order of WooCommerce checkout actions causing incompatibility with AvaTax address validation #335
5
  * Fix - Can't checkout to certain countries with optional postcode #330
1
  *** Changelog ***
2
 
3
+ = 1.6.3 - 2021-12-14 =
4
+ * Fix - Payments fail when using custom order numbers #354
5
+ * Fix - Do not display saved payments on PayPal buttons if vault option is disabled #358
6
+ * Fix - Double "Place Order" button #362
7
+ * Fix - Coupon causes TAX_TOTAL_MISMATCH #372
8
+ * Fix - Funding sources Mercado Pago and BLIK can't be disabled #383
9
+ * Fix - Customer details not available in order and name gets replaced by xxx@dcc2.paypal.com #378
10
+ * Fix - 3D Secure failing for certain credit card types with PayPal Card Processing #379
11
+ * Fix - Error messages are not cleared even when checkout is re-attempted (DCC) #366
12
+ * Add - New additions for system report status #377
13
+
14
  = 1.6.2 - 2021-11-22 =
15
  * Fix - Order of WooCommerce checkout actions causing incompatibility with AvaTax address validation #335
16
  * Fix - Can't checkout to certain countries with optional postcode #330
modules/ppcp-api-client/services.php CHANGED
@@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\ApiClient;
12
  use Psr\Container\ContainerInterface;
13
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
14
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
 
15
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\IdentityToken;
16
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\LoginSeller;
17
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
@@ -48,31 +49,31 @@ use WooCommerce\PayPalCommerce\ApiClient\Repository\PayPalRequestIdRepository;
48
  use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
49
 
50
  return array(
51
- 'api.host' => function( ContainerInterface $container ) : string {
52
  return PAYPAL_API_URL;
53
  },
54
- 'api.paypal-host' => function( ContainerInterface $container ) : string {
55
  return PAYPAL_API_URL;
56
  },
57
- 'api.partner_merchant_id' => static function () : string {
58
  return '';
59
  },
60
- 'api.merchant_email' => function () : string {
61
  return '';
62
  },
63
- 'api.merchant_id' => function () : string {
64
  return '';
65
  },
66
- 'api.key' => static function (): string {
67
  return '';
68
  },
69
- 'api.secret' => static function (): string {
70
  return '';
71
  },
72
- 'api.prefix' => static function (): string {
73
  return 'WC-';
74
  },
75
- 'api.bearer' => static function ( ContainerInterface $container ): Bearer {
76
  $cache = new Cache( 'ppcp-paypal-bearer' );
77
  $key = $container->get( 'api.key' );
78
  $secret = $container->get( 'api.secret' );
@@ -88,7 +89,7 @@ return array(
88
  $settings
89
  );
90
  },
91
- 'api.endpoint.partners' => static function ( ContainerInterface $container ) : PartnersEndpoint {
92
  return new PartnersEndpoint(
93
  $container->get( 'api.host' ),
94
  $container->get( 'api.bearer' ),
@@ -98,10 +99,10 @@ return array(
98
  $container->get( 'api.merchant_id' )
99
  );
100
  },
101
- 'api.factory.sellerstatus' => static function ( ContainerInterface $container ) : SellerStatusFactory {
102
  return new SellerStatusFactory();
103
  },
104
- 'api.endpoint.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenEndpoint {
105
  return new PaymentTokenEndpoint(
106
  $container->get( 'api.host' ),
107
  $container->get( 'api.bearer' ),
@@ -110,7 +111,7 @@ return array(
110
  $container->get( 'api.prefix' )
111
  );
112
  },
113
- 'api.endpoint.webhook' => static function ( ContainerInterface $container ) : WebhookEndpoint {
114
 
115
  return new WebhookEndpoint(
116
  $container->get( 'api.host' ),
@@ -120,7 +121,7 @@ return array(
120
  $container->get( 'woocommerce.logger.woocommerce' )
121
  );
122
  },
123
- 'api.endpoint.partner-referrals' => static function ( ContainerInterface $container ) : PartnerReferrals {
124
 
125
  return new PartnerReferrals(
126
  $container->get( 'api.host' ),
@@ -129,18 +130,19 @@ return array(
129
  $container->get( 'woocommerce.logger.woocommerce' )
130
  );
131
  },
132
- 'api.endpoint.identity-token' => static function ( ContainerInterface $container ) : IdentityToken {
133
-
134
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
135
  $prefix = $container->get( 'api.prefix' );
 
136
  return new IdentityToken(
137
  $container->get( 'api.host' ),
138
  $container->get( 'api.bearer' ),
139
  $logger,
140
- $prefix
 
141
  );
142
  },
143
- 'api.endpoint.payments' => static function ( ContainerInterface $container ): PaymentsEndpoint {
144
  $authorizations_factory = $container->get( 'api.factory.authorization' );
145
  $capture_factory = $container->get( 'api.factory.capture' );
146
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
@@ -153,7 +155,7 @@ return array(
153
  $logger
154
  );
155
  },
156
- 'api.endpoint.login-seller' => static function ( ContainerInterface $container ) : LoginSeller {
157
 
158
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
159
  return new LoginSeller(
@@ -162,7 +164,7 @@ return array(
162
  $logger
163
  );
164
  },
165
- 'api.endpoint.order' => static function ( ContainerInterface $container ): OrderEndpoint {
166
  $order_factory = $container->get( 'api.factory.order' );
167
  $patch_collection_factory = $container->get( 'api.factory.patch-collection-factory' );
168
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
@@ -189,47 +191,54 @@ return array(
189
  $subscription_helper
190
  );
191
  },
192
- 'api.repository.paypal-request-id' => static function( ContainerInterface $container ) : PayPalRequestIdRepository {
 
 
 
 
 
 
 
193
  return new PayPalRequestIdRepository();
194
  },
195
- 'api.repository.application-context' => static function( ContainerInterface $container ) : ApplicationContextRepository {
196
 
197
  $settings = $container->get( 'wcgateway.settings' );
198
  return new ApplicationContextRepository( $settings );
199
  },
200
- 'api.repository.partner-referrals-data' => static function ( ContainerInterface $container ) : PartnerReferralsData {
201
 
202
  $merchant_email = $container->get( 'api.merchant_email' );
203
  $dcc_applies = $container->get( 'api.helpers.dccapplies' );
204
  return new PartnerReferralsData( $merchant_email, $dcc_applies );
205
  },
206
- 'api.repository.cart' => static function ( ContainerInterface $container ): CartRepository {
207
  $factory = $container->get( 'api.factory.purchase-unit' );
208
  return new CartRepository( $factory );
209
  },
210
- 'api.repository.payee' => static function ( ContainerInterface $container ): PayeeRepository {
211
  $merchant_email = $container->get( 'api.merchant_email' );
212
  $merchant_id = $container->get( 'api.merchant_id' );
213
  return new PayeeRepository( $merchant_email, $merchant_id );
214
  },
215
- 'api.factory.application-context' => static function ( ContainerInterface $container ) : ApplicationContextFactory {
216
  return new ApplicationContextFactory();
217
  },
218
- 'api.factory.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenFactory {
219
  return new PaymentTokenFactory();
220
  },
221
- 'api.factory.webhook' => static function ( ContainerInterface $container ): WebhookFactory {
222
  return new WebhookFactory();
223
  },
224
- 'api.factory.webhook-event' => static function ( ContainerInterface $container ): WebhookEventFactory {
225
  return new WebhookEventFactory();
226
  },
227
- 'api.factory.capture' => static function ( ContainerInterface $container ): CaptureFactory {
228
 
229
  $amount_factory = $container->get( 'api.factory.amount' );
230
  return new CaptureFactory( $amount_factory );
231
  },
232
- 'api.factory.purchase-unit' => static function ( ContainerInterface $container ): PurchaseUnitFactory {
233
 
234
  $amount_factory = $container->get( 'api.factory.amount' );
235
  $payee_repository = $container->get( 'api.repository.payee' );
@@ -249,34 +258,39 @@ return array(
249
  $prefix
250
  );
251
  },
252
- 'api.factory.patch-collection-factory' => static function ( ContainerInterface $container ): PatchCollectionFactory {
253
  return new PatchCollectionFactory();
254
  },
255
- 'api.factory.payee' => static function ( ContainerInterface $container ): PayeeFactory {
256
  return new PayeeFactory();
257
  },
258
- 'api.factory.item' => static function ( ContainerInterface $container ): ItemFactory {
259
- return new ItemFactory();
 
 
260
  },
261
- 'api.factory.shipping' => static function ( ContainerInterface $container ): ShippingFactory {
262
  $address_factory = $container->get( 'api.factory.address' );
263
  return new ShippingFactory( $address_factory );
264
  },
265
- 'api.factory.amount' => static function ( ContainerInterface $container ): AmountFactory {
266
  $item_factory = $container->get( 'api.factory.item' );
267
- return new AmountFactory( $item_factory );
 
 
 
268
  },
269
- 'api.factory.payer' => static function ( ContainerInterface $container ): PayerFactory {
270
  $address_factory = $container->get( 'api.factory.address' );
271
  return new PayerFactory( $address_factory );
272
  },
273
- 'api.factory.address' => static function ( ContainerInterface $container ): AddressFactory {
274
  return new AddressFactory();
275
  },
276
- 'api.factory.payment-source' => static function ( ContainerInterface $container ): PaymentSourceFactory {
277
  return new PaymentSourceFactory();
278
  },
279
- 'api.factory.order' => static function ( ContainerInterface $container ): OrderFactory {
280
  $purchase_unit_factory = $container->get( 'api.factory.purchase-unit' );
281
  $payer_factory = $container->get( 'api.factory.payer' );
282
  $application_context_repository = $container->get( 'api.repository.application-context' );
@@ -290,15 +304,278 @@ return array(
290
  $payment_source_factory
291
  );
292
  },
293
- 'api.factory.payments' => static function ( ContainerInterface $container ): PaymentsFactory {
294
  $authorizations_factory = $container->get( 'api.factory.authorization' );
295
  $capture_factory = $container->get( 'api.factory.capture' );
296
  return new PaymentsFactory( $authorizations_factory, $capture_factory );
297
  },
298
- 'api.factory.authorization' => static function ( ContainerInterface $container ): AuthorizationFactory {
299
  return new AuthorizationFactory();
300
  },
301
- 'api.helpers.dccapplies' => static function ( ContainerInterface $container ) : DccApplies {
302
- return new DccApplies();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  },
304
  );
12
  use Psr\Container\ContainerInterface;
13
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
14
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
15
+ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
16
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\IdentityToken;
17
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\LoginSeller;
18
  use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
49
  use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
50
 
51
  return array(
52
+ 'api.host' => function( ContainerInterface $container ) : string {
53
  return PAYPAL_API_URL;
54
  },
55
+ 'api.paypal-host' => function( ContainerInterface $container ) : string {
56
  return PAYPAL_API_URL;
57
  },
58
+ 'api.partner_merchant_id' => static function () : string {
59
  return '';
60
  },
61
+ 'api.merchant_email' => function () : string {
62
  return '';
63
  },
64
+ 'api.merchant_id' => function () : string {
65
  return '';
66
  },
67
+ 'api.key' => static function (): string {
68
  return '';
69
  },
70
+ 'api.secret' => static function (): string {
71
  return '';
72
  },
73
+ 'api.prefix' => static function (): string {
74
  return 'WC-';
75
  },
76
+ 'api.bearer' => static function ( ContainerInterface $container ): Bearer {
77
  $cache = new Cache( 'ppcp-paypal-bearer' );
78
  $key = $container->get( 'api.key' );
79
  $secret = $container->get( 'api.secret' );
89
  $settings
90
  );
91
  },
92
+ 'api.endpoint.partners' => static function ( ContainerInterface $container ) : PartnersEndpoint {
93
  return new PartnersEndpoint(
94
  $container->get( 'api.host' ),
95
  $container->get( 'api.bearer' ),
99
  $container->get( 'api.merchant_id' )
100
  );
101
  },
102
+ 'api.factory.sellerstatus' => static function ( ContainerInterface $container ) : SellerStatusFactory {
103
  return new SellerStatusFactory();
104
  },
105
+ 'api.endpoint.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenEndpoint {
106
  return new PaymentTokenEndpoint(
107
  $container->get( 'api.host' ),
108
  $container->get( 'api.bearer' ),
111
  $container->get( 'api.prefix' )
112
  );
113
  },
114
+ 'api.endpoint.webhook' => static function ( ContainerInterface $container ) : WebhookEndpoint {
115
 
116
  return new WebhookEndpoint(
117
  $container->get( 'api.host' ),
121
  $container->get( 'woocommerce.logger.woocommerce' )
122
  );
123
  },
124
+ 'api.endpoint.partner-referrals' => static function ( ContainerInterface $container ) : PartnerReferrals {
125
 
126
  return new PartnerReferrals(
127
  $container->get( 'api.host' ),
130
  $container->get( 'woocommerce.logger.woocommerce' )
131
  );
132
  },
133
+ 'api.endpoint.identity-token' => static function ( ContainerInterface $container ) : IdentityToken {
 
134
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
135
  $prefix = $container->get( 'api.prefix' );
136
+ $settings = $container->get( 'wcgateway.settings' );
137
  return new IdentityToken(
138
  $container->get( 'api.host' ),
139
  $container->get( 'api.bearer' ),
140
  $logger,
141
+ $prefix,
142
+ $settings
143
  );
144
  },
145
+ 'api.endpoint.payments' => static function ( ContainerInterface $container ): PaymentsEndpoint {
146
  $authorizations_factory = $container->get( 'api.factory.authorization' );
147
  $capture_factory = $container->get( 'api.factory.capture' );
148
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
155
  $logger
156
  );
157
  },
158
+ 'api.endpoint.login-seller' => static function ( ContainerInterface $container ) : LoginSeller {
159
 
160
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
161
  return new LoginSeller(
164
  $logger
165
  );
166
  },
167
+ 'api.endpoint.order' => static function ( ContainerInterface $container ): OrderEndpoint {
168
  $order_factory = $container->get( 'api.factory.order' );
169
  $patch_collection_factory = $container->get( 'api.factory.patch-collection-factory' );
170
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
191
  $subscription_helper
192
  );
193
  },
194
+ 'api.endpoint.billing-agreements' => static function ( ContainerInterface $container ): BillingAgreementsEndpoint {
195
+ return new BillingAgreementsEndpoint(
196
+ $container->get( 'api.host' ),
197
+ $container->get( 'api.bearer' ),
198
+ $container->get( 'woocommerce.logger.woocommerce' )
199
+ );
200
+ },
201
+ 'api.repository.paypal-request-id' => static function( ContainerInterface $container ) : PayPalRequestIdRepository {
202
  return new PayPalRequestIdRepository();
203
  },
204
+ 'api.repository.application-context' => static function( ContainerInterface $container ) : ApplicationContextRepository {
205
 
206
  $settings = $container->get( 'wcgateway.settings' );
207
  return new ApplicationContextRepository( $settings );
208
  },
209
+ 'api.repository.partner-referrals-data' => static function ( ContainerInterface $container ) : PartnerReferralsData {
210
 
211
  $merchant_email = $container->get( 'api.merchant_email' );
212
  $dcc_applies = $container->get( 'api.helpers.dccapplies' );
213
  return new PartnerReferralsData( $merchant_email, $dcc_applies );
214
  },
215
+ 'api.repository.cart' => static function ( ContainerInterface $container ): CartRepository {
216
  $factory = $container->get( 'api.factory.purchase-unit' );
217
  return new CartRepository( $factory );
218
  },
219
+ 'api.repository.payee' => static function ( ContainerInterface $container ): PayeeRepository {
220
  $merchant_email = $container->get( 'api.merchant_email' );
221
  $merchant_id = $container->get( 'api.merchant_id' );
222
  return new PayeeRepository( $merchant_email, $merchant_id );
223
  },
224
+ 'api.factory.application-context' => static function ( ContainerInterface $container ) : ApplicationContextFactory {
225
  return new ApplicationContextFactory();
226
  },
227
+ 'api.factory.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenFactory {
228
  return new PaymentTokenFactory();
229
  },
230
+ 'api.factory.webhook' => static function ( ContainerInterface $container ): WebhookFactory {
231
  return new WebhookFactory();
232
  },
233
+ 'api.factory.webhook-event' => static function ( ContainerInterface $container ): WebhookEventFactory {
234
  return new WebhookEventFactory();
235
  },
236
+ 'api.factory.capture' => static function ( ContainerInterface $container ): CaptureFactory {
237
 
238
  $amount_factory = $container->get( 'api.factory.amount' );
239
  return new CaptureFactory( $amount_factory );
240
  },
241
+ 'api.factory.purchase-unit' => static function ( ContainerInterface $container ): PurchaseUnitFactory {
242
 
243
  $amount_factory = $container->get( 'api.factory.amount' );
244
  $payee_repository = $container->get( 'api.repository.payee' );
258
  $prefix
259
  );
260
  },
261
+ 'api.factory.patch-collection-factory' => static function ( ContainerInterface $container ): PatchCollectionFactory {
262
  return new PatchCollectionFactory();
263
  },
264
+ 'api.factory.payee' => static function ( ContainerInterface $container ): PayeeFactory {
265
  return new PayeeFactory();
266
  },
267
+ 'api.factory.item' => static function ( ContainerInterface $container ): ItemFactory {
268
+ return new ItemFactory(
269
+ $container->get( 'api.shop.currency' )
270
+ );
271
  },
272
+ 'api.factory.shipping' => static function ( ContainerInterface $container ): ShippingFactory {
273
  $address_factory = $container->get( 'api.factory.address' );
274
  return new ShippingFactory( $address_factory );
275
  },
276
+ 'api.factory.amount' => static function ( ContainerInterface $container ): AmountFactory {
277
  $item_factory = $container->get( 'api.factory.item' );
278
+ return new AmountFactory(
279
+ $item_factory,
280
+ $container->get( 'api.shop.currency' )
281
+ );
282
  },
283
+ 'api.factory.payer' => static function ( ContainerInterface $container ): PayerFactory {
284
  $address_factory = $container->get( 'api.factory.address' );
285
  return new PayerFactory( $address_factory );
286
  },
287
+ 'api.factory.address' => static function ( ContainerInterface $container ): AddressFactory {
288
  return new AddressFactory();
289
  },
290
+ 'api.factory.payment-source' => static function ( ContainerInterface $container ): PaymentSourceFactory {
291
  return new PaymentSourceFactory();
292
  },
293
+ 'api.factory.order' => static function ( ContainerInterface $container ): OrderFactory {
294
  $purchase_unit_factory = $container->get( 'api.factory.purchase-unit' );
295
  $payer_factory = $container->get( 'api.factory.payer' );
296
  $application_context_repository = $container->get( 'api.repository.application-context' );
304
  $payment_source_factory
305
  );
306
  },
307
+ 'api.factory.payments' => static function ( ContainerInterface $container ): PaymentsFactory {
308
  $authorizations_factory = $container->get( 'api.factory.authorization' );
309
  $capture_factory = $container->get( 'api.factory.capture' );
310
  return new PaymentsFactory( $authorizations_factory, $capture_factory );
311
  },
312
+ 'api.factory.authorization' => static function ( ContainerInterface $container ): AuthorizationFactory {
313
  return new AuthorizationFactory();
314
  },
315
+ 'api.helpers.dccapplies' => static function ( ContainerInterface $container ) : DccApplies {
316
+ return new DccApplies(
317
+ $container->get( 'api.dcc-supported-country-currency-matrix' ),
318
+ $container->get( 'api.dcc-supported-country-card-matrix' ),
319
+ $container->get( 'api.shop.currency' ),
320
+ $container->get( 'api.shop.country' )
321
+ );
322
+ },
323
+
324
+ 'api.shop.currency' => static function ( ContainerInterface $container ) : string {
325
+ return get_woocommerce_currency();
326
+ },
327
+ 'api.shop.country' => static function ( ContainerInterface $container ) : string {
328
+ $location = wc_get_base_location();
329
+ return $location['country'];
330
+ },
331
+ 'api.shop.is-psd2-country' => static function ( ContainerInterface $container ) : bool {
332
+ return in_array(
333
+ $container->get( 'api.shop.country' ),
334
+ $container->get( 'api.psd2-countries' ),
335
+ true
336
+ );
337
+ },
338
+ 'api.shop.is-currency-supported' => static function ( ContainerInterface $container ) : bool {
339
+ return in_array(
340
+ $container->get( 'api.shop.currency' ),
341
+ $container->get( 'api.supported-currencies' ),
342
+ true
343
+ );
344
+ },
345
+
346
+ /**
347
+ * Currencies supported by PayPal.
348
+ *
349
+ * From https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/
350
+ */
351
+ 'api.supported-currencies' => static function ( ContainerInterface $container ) : array {
352
+ return array(
353
+ 'AUD',
354
+ 'BRL',
355
+ 'CAD',
356
+ 'CNY',
357
+ 'CZK',
358
+ 'DKK',
359
+ 'EUR',
360
+ 'HKD',
361
+ 'HUF',
362
+ 'ILS',
363
+ 'JPY',
364
+ 'MYR',
365
+ 'MXN',
366
+ 'TWD',
367
+ 'NZD',
368
+ 'NOK',
369
+ 'PHP',
370
+ 'PLN',
371
+ 'GBP',
372
+ 'RUB',
373
+ 'SGD',
374
+ 'SEK',
375
+ 'CHF',
376
+ 'THB',
377
+ 'USD',
378
+ );
379
+ },
380
+
381
+ /**
382
+ * The matrix which countries and currency combinations can be used for DCC.
383
+ */
384
+ 'api.dcc-supported-country-currency-matrix' => static function ( ContainerInterface $container ) : array {
385
+ return array(
386
+ 'AU' => array(
387
+ 'AUD',
388
+ 'CAD',
389
+ 'CHF',
390
+ 'CZK',
391
+ 'DKK',
392
+ 'EUR',
393
+ 'GBP',
394
+ 'HKD',
395
+ 'HUF',
396
+ 'JPY',
397
+ 'NOK',
398
+ 'NZD',
399
+ 'PLN',
400
+ 'SEK',
401
+ 'SGD',
402
+ 'USD',
403
+ ),
404
+ 'ES' => array(
405
+ 'AUD',
406
+ 'CAD',
407
+ 'CHF',
408
+ 'CZK',
409
+ 'DKK',
410
+ 'EUR',
411
+ 'GBP',
412
+ 'HKD',
413
+ 'HUF',
414
+ 'JPY',
415
+ 'NOK',
416
+ 'NZD',
417
+ 'PLN',
418
+ 'SEK',
419
+ 'SGD',
420
+ 'USD',
421
+ ),
422
+ 'FR' => array(
423
+ 'AUD',
424
+ 'CAD',
425
+ 'CHF',
426
+ 'CZK',
427
+ 'DKK',
428
+ 'EUR',
429
+ 'GBP',
430
+ 'HKD',
431
+ 'HUF',
432
+ 'JPY',
433
+ 'NOK',
434
+ 'NZD',
435
+ 'PLN',
436
+ 'SEK',
437
+ 'SGD',
438
+ 'USD',
439
+ ),
440
+ 'GB' => array(
441
+ 'AUD',
442
+ 'CAD',
443
+ 'CHF',
444
+ 'CZK',
445
+ 'DKK',
446
+ 'EUR',
447
+ 'GBP',
448
+ 'HKD',
449
+ 'HUF',
450
+ 'JPY',
451
+ 'NOK',
452
+ 'NZD',
453
+ 'PLN',
454
+ 'SEK',
455
+ 'SGD',
456
+ 'USD',
457
+ ),
458
+ 'IT' => array(
459
+ 'AUD',
460
+ 'CAD',
461
+ 'CHF',
462
+ 'CZK',
463
+ 'DKK',
464
+ 'EUR',
465
+ 'GBP',
466
+ 'HKD',
467
+ 'HUF',
468
+ 'JPY',
469
+ 'NOK',
470
+ 'NZD',
471
+ 'PLN',
472
+ 'SEK',
473
+ 'SGD',
474
+ 'USD',
475
+ ),
476
+ 'US' => array(
477
+ 'AUD',
478
+ 'CAD',
479
+ 'EUR',
480
+ 'GBP',
481
+ 'JPY',
482
+ 'USD',
483
+ ),
484
+ 'CA' => array(
485
+ 'AUD',
486
+ 'CAD',
487
+ 'CHF',
488
+ 'CZK',
489
+ 'DKK',
490
+ 'EUR',
491
+ 'GBP',
492
+ 'HKD',
493
+ 'HUF',
494
+ 'JPY',
495
+ 'NOK',
496
+ 'NZD',
497
+ 'PLN',
498
+ 'SEK',
499
+ 'SGD',
500
+ 'USD',
501
+ ),
502
+ );
503
+ },
504
+
505
+ /**
506
+ * Which countries support which credit cards. Empty credit card arrays mean no restriction on currency.
507
+ */
508
+ 'api.dcc-supported-country-card-matrix' => static function ( ContainerInterface $container ) : array {
509
+ return array(
510
+ 'AU' => array(
511
+ 'mastercard' => array(),
512
+ 'visa' => array(),
513
+ ),
514
+ 'ES' => array(
515
+ 'mastercard' => array(),
516
+ 'visa' => array(),
517
+ 'amex' => array( 'EUR' ),
518
+ ),
519
+ 'FR' => array(
520
+ 'mastercard' => array(),
521
+ 'visa' => array(),
522
+ 'amex' => array( 'EUR' ),
523
+ ),
524
+ 'GB' => array(
525
+ 'mastercard' => array(),
526
+ 'visa' => array(),
527
+ 'amex' => array( 'GBP', 'USD' ),
528
+ ),
529
+ 'IT' => array(
530
+ 'mastercard' => array(),
531
+ 'visa' => array(),
532
+ 'amex' => array( 'EUR' ),
533
+ ),
534
+ 'US' => array(
535
+ 'mastercard' => array(),
536
+ 'visa' => array(),
537
+ 'amex' => array( 'USD' ),
538
+ 'discover' => array( 'USD' ),
539
+ ),
540
+ 'CA' => array(
541
+ 'mastercard' => array(),
542
+ 'visa' => array(),
543
+ 'amex' => array( 'CAD' ),
544
+ 'jcb' => array( 'CAD' ),
545
+ ),
546
+ );
547
+ },
548
+
549
+ 'api.psd2-countries' => static function ( ContainerInterface $container ) : array {
550
+ return array(
551
+ 'AT',
552
+ 'BE',
553
+ 'BG',
554
+ 'CY',
555
+ 'CZ',
556
+ 'DK',
557
+ 'EE',
558
+ 'FI',
559
+ 'FR',
560
+ 'DE',
561
+ 'GB',
562
+ 'GR',
563
+ 'HU',
564
+ 'IE',
565
+ 'IT',
566
+ 'LV',
567
+ 'LT',
568
+ 'LU',
569
+ 'MT',
570
+ 'NL',
571
+ 'NO',
572
+ 'PL',
573
+ 'PT',
574
+ 'RO',
575
+ 'SK',
576
+ 'SI',
577
+ 'ES',
578
+ 'SE',
579
+ );
580
  },
581
  );
modules/ppcp-api-client/src/Endpoint/BillingAgreementsEndpoint.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The billing agreements endpoint.
4
+ *
5
+ * @package WooCommerce\PayPalCommerce\ApiClient\Endpoint
6
+ */
7
+
8
+ declare(strict_types=1);
9
+
10
+ namespace WooCommerce\PayPalCommerce\ApiClient\Endpoint;
11
+
12
+ use stdClass;
13
+ use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
14
+ use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
15
+ use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
16
+ use Psr\Log\LoggerInterface;
17
+
18
+ /**
19
+ * Class BillingAgreementsEndpoint
20
+ */
21
+ class BillingAgreementsEndpoint {
22
+ use RequestTrait;
23
+
24
+ /**
25
+ * The host.
26
+ *
27
+ * @var string
28
+ */
29
+ private $host;
30
+
31
+ /**
32
+ * The bearer.
33
+ *
34
+ * @var Bearer
35
+ */
36
+ private $bearer;
37
+
38
+ /**
39
+ * The logger.
40
+ *
41
+ * @var LoggerInterface
42
+ */
43
+ private $logger;
44
+
45
+ /**
46
+ * BillingAgreementsEndpoint constructor.
47
+ *
48
+ * @param string $host The host.
49
+ * @param Bearer $bearer The bearer.
50
+ * @param LoggerInterface $logger The logger.
51
+ */
52
+ public function __construct(
53
+ string $host,
54
+ Bearer $bearer,
55
+ LoggerInterface $logger
56
+ ) {
57
+ $this->host = $host;
58
+ $this->bearer = $bearer;
59
+ $this->logger = $logger;
60
+ }
61
+
62
+ /**
63
+ * Creates a billing agreement token.
64
+ *
65
+ * @param string $description The description.
66
+ * @param string $return_url The return URL.
67
+ * @param string $cancel_url The cancel URL.
68
+ *
69
+ * @throws RuntimeException If the request fails.
70
+ * @throws PayPalApiException If the request fails.
71
+ */
72
+ public function create_token( string $description, string $return_url, string $cancel_url ): stdClass {
73
+ $data = array(
74
+ 'description' => $description,
75
+ 'payer' => array(
76
+ 'payment_method' => 'PAYPAL',
77
+ ),
78
+ 'plan' => array(
79
+ 'type' => 'MERCHANT_INITIATED_BILLING',
80
+ 'merchant_preferences' => array(
81
+ 'return_url' => $return_url,
82
+ 'cancel_url' => $cancel_url,
83
+ 'skip_shipping_address' => true,
84
+ ),
85
+ ),
86
+ );
87
+
88
+ $bearer = $this->bearer->bearer();
89
+ $url = trailingslashit( $this->host ) . 'v1/billing-agreements/agreement-tokens';
90
+ $args = array(
91
+ 'method' => 'POST',
92
+ 'headers' => array(
93
+ 'Authorization' => 'Bearer ' . $bearer->token(),
94
+ 'Content-Type' => 'application/json',
95
+ ),
96
+ 'body' => wp_json_encode( $data ),
97
+ );
98
+ $response = $this->request( $url, $args );
99
+
100
+ if ( is_wp_error( $response ) || ! is_array( $response ) ) {
101
+ throw new RuntimeException( 'Not able to create a billing agreement token.' );
102
+ }
103
+
104
+ $json = json_decode( $response['body'] );
105
+ $status_code = (int) wp_remote_retrieve_response_code( $response );
106
+ if ( 201 !== $status_code ) {
107
+ throw new PayPalApiException(
108
+ $json,
109
+ $status_code
110
+ );
111
+ }
112
+
113
+ return $json;
114
+ }
115
+
116
+ /**
117
+ * Checks if reference transactions are enabled in account.
118
+ *
119
+ * @throws RuntimeException If the request fails (no auth, no connection, etc.).
120
+ */
121
+ public function reference_transaction_enabled(): bool {
122
+ try {
123
+ $this->create_token(
124
+ 'Checking if reference transactions are enabled',
125
+ 'https://example.com/return',
126
+ 'https://example.com/cancel'
127
+ );
128
+
129
+ return true;
130
+ } catch ( PayPalApiException $exception ) {
131
+ return false;
132
+ }
133
+ }
134
+ }
modules/ppcp-api-client/src/Endpoint/IdentityToken.php CHANGED
@@ -14,6 +14,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\Token;
14
  use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
15
  use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
16
  use Psr\Log\LoggerInterface;
 
17
 
18
  /**
19
  * Class IdentityToken
@@ -50,6 +51,13 @@ class IdentityToken {
50
  */
51
  private $prefix;
52
 
 
 
 
 
 
 
 
53
  /**
54
  * IdentityToken constructor.
55
  *
@@ -57,12 +65,14 @@ class IdentityToken {
57
  * @param Bearer $bearer The bearer.
58
  * @param LoggerInterface $logger The logger.
59
  * @param string $prefix The prefix.
 
60
  */
61
- public function __construct( string $host, Bearer $bearer, LoggerInterface $logger, string $prefix ) {
62
- $this->host = $host;
63
- $this->bearer = $bearer;
64
- $this->logger = $logger;
65
- $this->prefix = $prefix;
 
66
  }
67
 
68
  /**
@@ -84,7 +94,11 @@ class IdentityToken {
84
  'Content-Type' => 'application/json',
85
  ),
86
  );
87
- if ( $customer_id && defined( 'PPCP_FLAG_SUBSCRIPTION' ) && PPCP_FLAG_SUBSCRIPTION ) {
 
 
 
 
88
  $args['body'] = wp_json_encode( array( 'customer_id' => $this->prefix . $customer_id ) );
89
  }
90
 
14
  use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException;
15
  use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
16
  use Psr\Log\LoggerInterface;
17
+ use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
18
 
19
  /**
20
  * Class IdentityToken
51
  */
52
  private $prefix;
53
 
54
+ /**
55
+ * The settings
56
+ *
57
+ * @var Settings
58
+ */
59
+ private $settings;
60
+
61
  /**
62
  * IdentityToken constructor.
63
  *
65
  * @param Bearer $bearer The bearer.
66
  * @param LoggerInterface $logger The logger.
67
  * @param string $prefix The prefix.
68
+ * @param Settings $settings The settings.
69
  */
70
+ public function __construct( string $host, Bearer $bearer, LoggerInterface $logger, string $prefix, Settings $settings ) {
71
+ $this->host = $host;
72
+ $this->bearer = $bearer;
73
+ $this->logger = $logger;
74
+ $this->prefix = $prefix;
75
+ $this->settings = $settings;
76
  }
77
 
78
  /**
94
  'Content-Type' => 'application/json',
95
  ),
96
  );
97
+ if (
98
+ $customer_id
99
+ && ( $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ) )
100
+ && defined( 'PPCP_FLAG_SUBSCRIPTION' ) && PPCP_FLAG_SUBSCRIPTION
101
+ ) {
102
  $args['body'] = wp_json_encode( array( 'customer_id' => $this->prefix . $customer_id ) );
103
  }
104
 
modules/ppcp-api-client/src/Factory/AmountFactory.php CHANGED
@@ -28,13 +28,22 @@ class AmountFactory {
28
  */
29
  private $item_factory;
30
 
 
 
 
 
 
 
 
31
  /**
32
  * AmountFactory constructor.
33
  *
34
  * @param ItemFactory $item_factory The Item factory.
 
35
  */
36
- public function __construct( ItemFactory $item_factory ) {
37
  $this->item_factory = $item_factory;
 
38
  }
39
 
40
  /**
@@ -45,8 +54,7 @@ class AmountFactory {
45
  * @return Amount
46
  */
47
  public function from_wc_cart( \WC_Cart $cart ): Amount {
48
- $currency = get_woocommerce_currency();
49
- $total = new Money( (float) $cart->get_total( 'numeric' ), $currency );
50
 
51
  $total_fees_amount = 0;
52
  $fees = WC()->session->get( 'ppcp_fees' );
@@ -57,22 +65,22 @@ class AmountFactory {
57
  }
58
 
59
  $item_total = $cart->get_cart_contents_total() + $cart->get_discount_total() + $total_fees_amount;
60
- $item_total = new Money( (float) $item_total, $currency );
61
  $shipping = new Money(
62
  (float) $cart->get_shipping_total() + $cart->get_shipping_tax(),
63
- $currency
64
  );
65
 
66
  $taxes = new Money(
67
- (float) $cart->get_cart_contents_tax() + (float) $cart->get_discount_tax(),
68
- $currency
69
  );
70
 
71
  $discount = null;
72
  if ( $cart->get_discount_total() ) {
73
  $discount = new Money(
74
  (float) $cart->get_discount_total() + $cart->get_discount_tax(),
75
- $currency
76
  );
77
  }
78
 
28
  */
29
  private $item_factory;
30
 
31
+ /**
32
+ * 3-letter currency code of the shop.
33
+ *
34
+ * @var string
35
+ */
36
+ private $currency;
37
+
38
  /**
39
  * AmountFactory constructor.
40
  *
41
  * @param ItemFactory $item_factory The Item factory.
42
+ * @param string $currency 3-letter currency code of the shop.
43
  */
44
+ public function __construct( ItemFactory $item_factory, string $currency ) {
45
  $this->item_factory = $item_factory;
46
+ $this->currency = $currency;
47
  }
48
 
49
  /**
54
  * @return Amount
55
  */
56
  public function from_wc_cart( \WC_Cart $cart ): Amount {
57
+ $total = new Money( (float) $cart->get_total( 'numeric' ), $this->currency );
 
58
 
59
  $total_fees_amount = 0;
60
  $fees = WC()->session->get( 'ppcp_fees' );
65
  }
66
 
67
  $item_total = $cart->get_cart_contents_total() + $cart->get_discount_total() + $total_fees_amount;
68
+ $item_total = new Money( (float) $item_total, $this->currency );
69
  $shipping = new Money(
70
  (float) $cart->get_shipping_total() + $cart->get_shipping_tax(),
71
+ $this->currency
72
  );
73
 
74
  $taxes = new Money(
75
+ $cart->get_subtotal_tax(),
76
+ $this->currency
77
  );
78
 
79
  $discount = null;
80
  if ( $cart->get_discount_total() ) {
81
  $discount = new Money(
82
  (float) $cart->get_discount_total() + $cart->get_discount_tax(),
83
+ $this->currency
84
  );
85
  }
86
 
modules/ppcp-api-client/src/Factory/ItemFactory.php CHANGED
@@ -17,7 +17,21 @@ use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
17
  * Class ItemFactory
18
  */
19
  class ItemFactory {
 
 
 
 
 
 
20
 
 
 
 
 
 
 
 
 
21
 
22
  /**
23
  * Creates items based off a WooCommerce cart.
@@ -27,9 +41,8 @@ class ItemFactory {
27
  * @return Item[]
28
  */
29
  public function from_wc_cart( \WC_Cart $cart ): array {
30
- $currency = get_woocommerce_currency();
31
- $items = array_map(
32
- static function ( array $item ) use ( $currency ): Item {
33
  $product = $item['data'];
34
 
35
  /**
@@ -43,10 +56,10 @@ class ItemFactory {
43
  $price_without_tax = (float) wc_get_price_excluding_tax( $product );
44
  $price_without_tax_rounded = round( $price_without_tax, 2 );
45
  $tax = round( $price - $price_without_tax_rounded, 2 );
46
- $tax = new Money( $tax, $currency );
47
  return new Item(
48
  mb_substr( $product->get_name(), 0, 127 ),
49
- new Money( $price_without_tax_rounded, $currency ),
50
  $quantity,
51
  mb_substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ),
52
  $tax,
@@ -61,13 +74,13 @@ class ItemFactory {
61
  $fees_from_session = WC()->session->get( 'ppcp_fees' );
62
  if ( $fees_from_session ) {
63
  $fees = array_map(
64
- static function ( \stdClass $fee ) use ( $currency ): Item {
65
  return new Item(
66
  $fee->name,
67
- new Money( (float) $fee->amount, $currency ),
68
  1,
69
  '',
70
- new Money( (float) $fee->tax, $currency )
71
  );
72
  },
73
  $fees_from_session
17
  * Class ItemFactory
18
  */
19
  class ItemFactory {
20
+ /**
21
+ * 3-letter currency code of the shop.
22
+ *
23
+ * @var string
24
+ */
25
+ private $currency;
26
 
27
+ /**
28
+ * ItemFactory constructor.
29
+ *
30
+ * @param string $currency 3-letter currency code of the shop.
31
+ */
32
+ public function __construct( string $currency ) {
33
+ $this->currency = $currency;
34
+ }
35
 
36
  /**
37
  * Creates items based off a WooCommerce cart.
41
  * @return Item[]
42
  */
43
  public function from_wc_cart( \WC_Cart $cart ): array {
44
+ $items = array_map(
45
+ function ( array $item ): Item {
 
46
  $product = $item['data'];
47
 
48
  /**
56
  $price_without_tax = (float) wc_get_price_excluding_tax( $product );
57
  $price_without_tax_rounded = round( $price_without_tax, 2 );
58
  $tax = round( $price - $price_without_tax_rounded, 2 );
59
+ $tax = new Money( $tax, $this->currency );
60
  return new Item(
61
  mb_substr( $product->get_name(), 0, 127 ),
62
+ new Money( $price_without_tax_rounded, $this->currency ),
63
  $quantity,
64
  mb_substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ),
65
  $tax,
74
  $fees_from_session = WC()->session->get( 'ppcp_fees' );
75
  if ( $fees_from_session ) {
76
  $fees = array_map(
77
+ function ( \stdClass $fee ): Item {
78
  return new Item(
79
  $fee->name,
80
+ new Money( (float) $fee->amount, $this->currency ),
81
  1,
82
  '',
83
+ new Money( (float) $fee->tax, $this->currency )
84
  );
85
  },
86
  $fees_from_session
modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php CHANGED
@@ -119,10 +119,9 @@ class PurchaseUnitFactory {
119
  $reference_id = 'default';
120
  $description = '';
121
  $payee = $this->payee_repository->payee();
122
- $wc_order_id = $order->get_order_number();
123
- $custom_id = $this->prefix . $wc_order_id;
124
  $retry = $order->get_meta( 'ppcp-retry' ) ? '-' . $order->get_meta( 'ppcp-retry' ) : '';
125
- $invoice_id = $this->prefix . $wc_order_id . $retry;
126
  $soft_descriptor = '';
127
 
128
  $purchase_unit = new PurchaseUnit(
119
  $reference_id = 'default';
120
  $description = '';
121
  $payee = $this->payee_repository->payee();
122
+ $custom_id = (string) $order->get_id();
123
+ $invoice_id = $this->prefix . $order->get_order_number();
124
  $retry = $order->get_meta( 'ppcp-retry' ) ? '-' . $order->get_meta( 'ppcp-retry' ) : '';
 
125
  $soft_descriptor = '';
126
 
127
  $purchase_unit = new PurchaseUnit(
modules/ppcp-api-client/src/Helper/DccApplies.php CHANGED
@@ -19,169 +19,50 @@ class DccApplies {
19
  *
20
  * @var array
21
  */
22
- private $allowed_country_currency_matrix = array(
23
- 'AU' => array(
24
- 'AUD',
25
- 'CAD',
26
- 'CHF',
27
- 'CZK',
28
- 'DKK',
29
- 'EUR',
30
- 'GBP',
31
- 'HKD',
32
- 'HUF',
33
- 'JPY',
34
- 'NOK',
35
- 'NZD',
36
- 'PLN',
37
- 'SEK',
38
- 'SGD',
39
- 'USD',
40
- ),
41
- 'ES' => array(
42
- 'AUD',
43
- 'CAD',
44
- 'CHF',
45
- 'CZK',
46
- 'DKK',
47
- 'EUR',
48
- 'GBP',
49
- 'HKD',
50
- 'HUF',
51
- 'JPY',
52
- 'NOK',
53
- 'NZD',
54
- 'PLN',
55
- 'SEK',
56
- 'SGD',
57
- 'USD',
58
- ),
59
- 'FR' => array(
60
- 'AUD',
61
- 'CAD',
62
- 'CHF',
63
- 'CZK',
64
- 'DKK',
65
- 'EUR',
66
- 'GBP',
67
- 'HKD',
68
- 'HUF',
69
- 'JPY',
70
- 'NOK',
71
- 'NZD',
72
- 'PLN',
73
- 'SEK',
74
- 'SGD',
75
- 'USD',
76
- ),
77
- 'GB' => array(
78
- 'AUD',
79
- 'CAD',
80
- 'CHF',
81
- 'CZK',
82
- 'DKK',
83
- 'EUR',
84
- 'GBP',
85
- 'HKD',
86
- 'HUF',
87
- 'JPY',
88
- 'NOK',
89
- 'NZD',
90
- 'PLN',
91
- 'SEK',
92
- 'SGD',
93
- 'USD',
94
- ),
95
- 'IT' => array(
96
- 'AUD',
97
- 'CAD',
98
- 'CHF',
99
- 'CZK',
100
- 'DKK',
101
- 'EUR',
102
- 'GBP',
103
- 'HKD',
104
- 'HUF',
105
- 'JPY',
106
- 'NOK',
107
- 'NZD',
108
- 'PLN',
109
- 'SEK',
110
- 'SGD',
111
- 'USD',
112
- ),
113
- 'US' => array(
114
- 'AUD',
115
- 'CAD',
116
- 'EUR',
117
- 'GBP',
118
- 'JPY',
119
- 'USD',
120
- ),
121
- 'CA' => array(
122
- 'AUD',
123
- 'CAD',
124
- 'CHF',
125
- 'CZK',
126
- 'DKK',
127
- 'EUR',
128
- 'GBP',
129
- 'HKD',
130
- 'HUF',
131
- 'JPY',
132
- 'NOK',
133
- 'NZD',
134
- 'PLN',
135
- 'SEK',
136
- 'SGD',
137
- 'USD',
138
- ),
139
- );
140
 
141
  /**
142
  * Which countries support which credit cards. Empty credit card arrays mean no restriction on
143
- * currency. Otherwise only the currencies in the array are supported.
144
  *
145
  * @var array
146
  */
147
- private $country_card_matrix = array(
148
- 'AU' => array(
149
- 'mastercard' => array(),
150
- 'visa' => array(),
151
- ),
152
- 'ES' => array(
153
- 'mastercard' => array(),
154
- 'visa' => array(),
155
- 'amex' => array( 'EUR' ),
156
- ),
157
- 'FR' => array(
158
- 'mastercard' => array(),
159
- 'visa' => array(),
160
- 'amex' => array( 'EUR' ),
161
- ),
162
- 'GB' => array(
163
- 'mastercard' => array(),
164
- 'visa' => array(),
165
- 'amex' => array( 'GBP', 'USD' ),
166
- ),
167
- 'IT' => array(
168
- 'mastercard' => array(),
169
- 'visa' => array(),
170
- 'amex' => array( 'EUR' ),
171
- ),
172
- 'US' => array(
173
- 'mastercard' => array(),
174
- 'visa' => array(),
175
- 'amex' => array( 'USD' ),
176
- 'discover' => array( 'USD' ),
177
- ),
178
- 'CA' => array(
179
- 'mastercard' => array(),
180
- 'visa' => array(),
181
- 'amex' => array( 'CAD' ),
182
- 'jcb' => array( 'CAD' ),
183
- ),
184
- );
185
 
186
  /**
187
  * Returns whether DCC can be used in the current country and the current currency used.
@@ -189,12 +70,10 @@ class DccApplies {
189
  * @return bool
190
  */
191
  public function for_country_currency(): bool {
192
- $country = $this->country();
193
- $currency = get_woocommerce_currency();
194
- if ( ! in_array( $country, array_keys( $this->allowed_country_currency_matrix ), true ) ) {
195
  return false;
196
  }
197
- $applies = in_array( $currency, $this->allowed_country_currency_matrix[ $country ], true );
198
  return $applies;
199
  }
200
 
@@ -204,13 +83,12 @@ class DccApplies {
204
  * @return array
205
  */
206
  public function valid_cards() : array {
207
- $country = $this->country();
208
- $cards = array();
209
- if ( ! isset( $this->country_card_matrix[ $country ] ) ) {
210
  return $cards;
211
  }
212
 
213
- $supported_currencies = $this->country_card_matrix[ $country ];
214
  foreach ( $supported_currencies as $card => $currencies ) {
215
  if ( $this->can_process_card( $card ) ) {
216
  $cards[] = $card;
@@ -233,11 +111,10 @@ class DccApplies {
233
  * @return bool
234
  */
235
  public function can_process_card( string $card ) : bool {
236
- $country = $this->country();
237
- if ( ! isset( $this->country_card_matrix[ $country ] ) ) {
238
  return false;
239
  }
240
- if ( ! isset( $this->country_card_matrix[ $country ][ $card ] ) ) {
241
  return false;
242
  }
243
 
@@ -245,19 +122,7 @@ class DccApplies {
245
  * If the supported currencies array is empty, there are no
246
  * restrictions, which currencies are supported by a card.
247
  */
248
- $supported_currencies = $this->country_card_matrix[ $country ][ $card ];
249
- $currency = get_woocommerce_currency();
250
- return empty( $supported_currencies ) || in_array( $currency, $supported_currencies, true );
251
- }
252
-
253
- /**
254
- * Returns the country code of the shop.
255
- *
256
- * @return string
257
- */
258
- private function country() : string {
259
- $region = wc_get_base_location();
260
- $country = $region['country'];
261
- return $country;
262
  }
263
  }
19
  *
20
  * @var array
21
  */
22
+ private $allowed_country_currency_matrix;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  /**
25
  * Which countries support which credit cards. Empty credit card arrays mean no restriction on
26
+ * currency.
27
  *
28
  * @var array
29
  */
30
+ private $country_card_matrix;
31
+
32
+ /**
33
+ * 3-letter currency code of the shop.
34
+ *
35
+ * @var string
36
+ */
37
+ private $currency;
38
+
39
+ /**
40
+ * 2-letter country code of the shop.
41
+ *
42
+ * @var string
43
+ */
44
+ private $country;
45
+
46
+ /**
47
+ * DccApplies constructor.
48
+ *
49
+ * @param array $allowed_country_currency_matrix The matrix which countries and currency combinations can be used for DCC.
50
+ * @param array $country_card_matrix Which countries support which credit cards. Empty credit card arrays mean no restriction on
51
+ * currency.
52
+ * @param string $currency 3-letter currency code of the shop.
53
+ * @param string $country 2-letter country code of the shop.
54
+ */
55
+ public function __construct(
56
+ array $allowed_country_currency_matrix,
57
+ array $country_card_matrix,
58
+ string $currency,
59
+ string $country
60
+ ) {
61
+ $this->allowed_country_currency_matrix = $allowed_country_currency_matrix;
62
+ $this->country_card_matrix = $country_card_matrix;
63
+ $this->currency = $currency;
64
+ $this->country = $country;
65
+ }
 
 
66
 
67
  /**
68
  * Returns whether DCC can be used in the current country and the current currency used.
70
  * @return bool
71
  */
72
  public function for_country_currency(): bool {
73
+ if ( ! in_array( $this->country, array_keys( $this->allowed_country_currency_matrix ), true ) ) {
 
 
74
  return false;
75
  }
76
+ $applies = in_array( $this->currency, $this->allowed_country_currency_matrix[ $this->country ], true );
77
  return $applies;
78
  }
79
 
83
  * @return array
84
  */
85
  public function valid_cards() : array {
86
+ $cards = array();
87
+ if ( ! isset( $this->country_card_matrix[ $this->country ] ) ) {
 
88
  return $cards;
89
  }
90
 
91
+ $supported_currencies = $this->country_card_matrix[ $this->country ];
92
  foreach ( $supported_currencies as $card => $currencies ) {
93
  if ( $this->can_process_card( $card ) ) {
94
  $cards[] = $card;
111
  * @return bool
112
  */
113
  public function can_process_card( string $card ) : bool {
114
+ if ( ! isset( $this->country_card_matrix[ $this->country ] ) ) {
 
115
  return false;
116
  }
117
+ if ( ! isset( $this->country_card_matrix[ $this->country ][ $card ] ) ) {
118
  return false;
119
  }
120
 
122
  * If the supported currencies array is empty, there are no
123
  * restrictions, which currencies are supported by a card.
124
  */
125
+ $supported_currencies = $this->country_card_matrix[ $this->country ][ $card ];
126
+ return empty( $supported_currencies ) || in_array( $this->currency, $supported_currencies, true );
 
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
  }
modules/ppcp-button/assets/css/hosted-fields.css CHANGED
@@ -1 +1 @@
1
- #payment ul.payment_methods li img.ppcp-card-icon{padding:0 0 3px 3px;max-height:25px;display:inline-block}.payments-sdk-contingency-handler{z-index:1000 !important}.ppcp-credit-card-gateway-form-field-disabled{opacity:.5 !important}
1
+ #payment ul.payment_methods li img.ppcp-card-icon{padding:0 0 3px 3px;max-height:25px;display:inline-block}.payments-sdk-contingency-handler{z-index:1000 !important}.ppcp-credit-card-gateway-form-field-disabled{opacity:.5 !important}.ppcp-dcc-order-button{float:right}
modules/ppcp-button/assets/js/button.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var __webpack_modules__={94:()=>{eval("\n;// CONCATENATED MODULE: ./resources/js/modules/ErrorHandler.js\nclass ErrorHandler {\n constructor(genericErrorText) {\n this.genericErrorText = genericErrorText;\n this.wrapper = document.querySelector('.woocommerce-notices-wrapper');\n this.messagesList = document.querySelector('ul.woocommerce-error');\n }\n\n genericError() {\n if (this.wrapper.classList.contains('ppcp-persist')) {\n return;\n }\n\n this.clear();\n this.message(this.genericErrorText);\n }\n\n appendPreparedErrorMessageElement(errorMessageElement) {\n if (this.messagesList === null) {\n this.prepareMessagesList();\n }\n\n this.messagesList.replaceWith(errorMessageElement);\n }\n\n message(text, persist = false) {\n if (!typeof String || text.length === 0) {\n throw new Error('A new message text must be a non-empty string.');\n }\n\n if (this.messagesList === null) {\n this.prepareMessagesList();\n }\n\n if (persist) {\n this.wrapper.classList.add('ppcp-persist');\n } else {\n this.wrapper.classList.remove('ppcp-persist');\n }\n\n let messageNode = this.prepareMessagesListItem(text);\n this.messagesList.appendChild(messageNode);\n jQuery.scroll_to_notices(jQuery('.woocommerce-notices-wrapper'));\n }\n\n prepareMessagesList() {\n if (this.messagesList === null) {\n this.messagesList = document.createElement('ul');\n this.messagesList.setAttribute('class', 'woocommerce-error');\n this.messagesList.setAttribute('role', 'alert');\n this.wrapper.appendChild(this.messagesList);\n }\n }\n\n prepareMessagesListItem(message) {\n const li = document.createElement('li');\n li.innerHTML = message;\n return li;\n }\n\n sanitize(text) {\n const textarea = document.createElement('textarea');\n textarea.innerHTML = text;\n return textarea.value.replace('Error: ', '');\n }\n\n clear() {\n if (!this.wrapper.classList.contains('woocommerce-error')) {\n return;\n }\n\n this.wrapper.classList.remove('woocommerce-error');\n this.wrapper.innerText = '';\n }\n\n}\n\n/* harmony default export */ const modules_ErrorHandler = (ErrorHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/OnApproveHandler/onApproveForContinue.js\nconst onApprove = (context, errorHandler) => {\n return (data, actions) => {\n return fetch(context.config.ajax.approve_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: context.config.ajax.approve_order.nonce,\n order_id: data.orderID\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n if (!data.success) {\n errorHandler.genericError();\n return actions.restart().catch(err => {\n errorHandler.genericError();\n });\n ;\n }\n\n location.href = context.config.redirect;\n });\n };\n};\n\n/* harmony default export */ const onApproveForContinue = (onApprove);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/PayerData.js\nconst payerData = () => {\n const payer = PayPalCommerceGateway.payer;\n\n if (!payer) {\n return null;\n }\n\n const phone = document.querySelector('#billing_phone') || typeof payer.phone !== 'undefined' ? {\n phone_type: \"HOME\",\n phone_number: {\n national_number: document.querySelector('#billing_phone') ? document.querySelector('#billing_phone').value : payer.phone.phone_number.national_number\n }\n } : null;\n const payerData = {\n email_address: document.querySelector('#billing_email') ? document.querySelector('#billing_email').value : payer.email_address,\n name: {\n surname: document.querySelector('#billing_last_name') ? document.querySelector('#billing_last_name').value : payer.name.surname,\n given_name: document.querySelector('#billing_first_name') ? document.querySelector('#billing_first_name').value : payer.name.given_name\n },\n address: {\n country_code: document.querySelector('#billing_country') ? document.querySelector('#billing_country').value : payer.address.country_code,\n address_line_1: document.querySelector('#billing_address_1') ? document.querySelector('#billing_address_1').value : payer.address.address_line_1,\n address_line_2: document.querySelector('#billing_address_2') ? document.querySelector('#billing_address_2').value : payer.address.address_line_2,\n admin_area_1: document.querySelector('#billing_state') ? document.querySelector('#billing_state').value : payer.address.admin_area_1,\n admin_area_2: document.querySelector('#billing_city') ? document.querySelector('#billing_city').value : payer.address.admin_area_2,\n postal_code: document.querySelector('#billing_postcode') ? document.querySelector('#billing_postcode').value : payer.address.postal_code\n }\n };\n\n if (phone) {\n payerData.phone = phone;\n }\n\n return payerData;\n};\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/CartActionHandler.js\n\n\n\nclass CartActionHandler {\n constructor(config, errorHandler) {\n this.config = config;\n this.errorHandler = errorHandler;\n }\n\n configuration() {\n const createOrder = (data, actions) => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n purchase_units: [],\n bn_code: bnCode,\n payer,\n context: this.config.context\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n console.error(data);\n throw Error(data.data.message);\n }\n\n return data.data.id;\n });\n };\n\n return {\n createOrder,\n onApprove: onApproveForContinue(this, this.errorHandler),\n onError: error => {\n this.errorHandler.genericError();\n }\n };\n }\n\n}\n\n/* harmony default export */ const ActionHandler_CartActionHandler = (CartActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/MiniCartBootstap.js\n\n\n\nclass MiniCartBootstap {\n constructor(gateway, renderer) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.actionHandler = null;\n }\n\n init() {\n this.actionHandler = new ActionHandler_CartActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.render();\n jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => {\n this.render();\n });\n }\n\n shouldRender() {\n return document.querySelector(this.gateway.button.mini_cart_wrapper) !== null || document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !== null;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n this.renderer.render(this.gateway.button.mini_cart_wrapper, this.gateway.hosted_fields.mini_cart_wrapper, this.actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_MiniCartBootstap = (MiniCartBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/UpdateCart.js\n\n\nclass UpdateCart {\n constructor(endpoint, nonce) {\n this.endpoint = endpoint;\n this.nonce = nonce;\n }\n /**\n *\n * @param onResolve\n * @param {Product[]} products\n * @returns {Promise<unknown>}\n */\n\n\n update(onResolve, products) {\n return new Promise((resolve, reject) => {\n fetch(this.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.nonce,\n products\n })\n }).then(result => {\n return result.json();\n }).then(result => {\n if (!result.success) {\n reject(result.data);\n return;\n }\n\n const resolved = onResolve(result.data);\n resolve(resolved);\n });\n });\n }\n\n}\n\n/* harmony default export */ const Helper_UpdateCart = (UpdateCart);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/ButtonsToggleListener.js\n/**\n * When you can't add something to the cart, the PayPal buttons should not show.\n * Therefore we listen for changes on the add to cart button and show/hide the buttons accordingly.\n */\nclass ButtonsToggleListener {\n constructor(element, showCallback, hideCallback) {\n this.element = element;\n this.showCallback = showCallback;\n this.hideCallback = hideCallback;\n this.observer = null;\n }\n\n init() {\n const config = {\n attributes: true\n };\n\n const callback = () => {\n if (this.element.classList.contains('disabled')) {\n this.hideCallback();\n return;\n }\n\n this.showCallback();\n };\n\n this.observer = new MutationObserver(callback);\n this.observer.observe(this.element, config);\n callback();\n }\n\n disconnect() {\n this.observer.disconnect();\n }\n\n}\n\n/* harmony default export */ const Helper_ButtonsToggleListener = (ButtonsToggleListener);\n;// CONCATENATED MODULE: ./resources/js/modules/Entity/Product.js\nclass Product {\n constructor(id, quantity, variations) {\n this.id = id;\n this.quantity = quantity;\n this.variations = variations;\n }\n\n data() {\n return {\n id: this.id,\n quantity: this.quantity,\n variations: this.variations\n };\n }\n\n}\n\n/* harmony default export */ const Entity_Product = (Product);\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/SingleProductActionHandler.js\n\n\n\n\n\nclass SingleProductActionHandler {\n constructor(config, updateCart, showButtonCallback, hideButtonCallback, formElement, errorHandler) {\n this.config = config;\n this.updateCart = updateCart;\n this.showButtonCallback = showButtonCallback;\n this.hideButtonCallback = hideButtonCallback;\n this.formElement = formElement;\n this.errorHandler = errorHandler;\n }\n\n configuration() {\n if (this.hasVariations()) {\n const observer = new Helper_ButtonsToggleListener(this.formElement.querySelector('.single_add_to_cart_button'), this.showButtonCallback, this.hideButtonCallback);\n observer.init();\n }\n\n return {\n createOrder: this.createOrder(),\n onApprove: onApproveForContinue(this, this.errorHandler),\n onError: error => {\n this.errorHandler.genericError();\n }\n };\n }\n\n createOrder() {\n var getProducts = null;\n\n if (!this.isGroupedProduct()) {\n getProducts = () => {\n const id = document.querySelector('[name=\"add-to-cart\"]').value;\n const qty = document.querySelector('[name=\"quantity\"]').value;\n const variations = this.variations();\n return [new Entity_Product(id, qty, variations)];\n };\n } else {\n getProducts = () => {\n const products = [];\n this.formElement.querySelectorAll('input[type=\"number\"]').forEach(element => {\n if (!element.value) {\n return;\n }\n\n const elementName = element.getAttribute('name').match(/quantity\\[([\\d]*)\\]/);\n\n if (elementName.length !== 2) {\n return;\n }\n\n const id = parseInt(elementName[1]);\n const quantity = parseInt(element.value);\n products.push(new Entity_Product(id, quantity, null));\n });\n return products;\n };\n }\n\n const createOrder = (data, actions) => {\n this.errorHandler.clear();\n\n const onResolve = purchase_units => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n purchase_units,\n payer,\n bn_code: bnCode,\n context: this.config.context\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n console.error(data);\n throw Error(data.data.message);\n }\n\n return data.data.id;\n });\n };\n\n const promise = this.updateCart.update(onResolve, getProducts());\n return promise;\n };\n\n return createOrder;\n }\n\n variations() {\n if (!this.hasVariations()) {\n return null;\n }\n\n const attributes = [...this.formElement.querySelectorAll(\"[name^='attribute_']\")].map(element => {\n return {\n value: element.value,\n name: element.name\n };\n });\n return attributes;\n }\n\n hasVariations() {\n return this.formElement.classList.contains('variations_form');\n }\n\n isGroupedProduct() {\n return this.formElement.classList.contains('grouped_form');\n }\n\n}\n\n/* harmony default export */ const ActionHandler_SingleProductActionHandler = (SingleProductActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/SingleProductBootstap.js\n\n\n\n\nclass SingleProductBootstap {\n constructor(gateway, renderer, messages) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.messages = messages;\n }\n\n init() {\n if (!this.shouldRender()) {\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n return;\n }\n\n this.render();\n }\n\n shouldRender() {\n if (document.querySelector('form.cart') === null) {\n return false;\n }\n\n return true;\n }\n\n render() {\n const actionHandler = new ActionHandler_SingleProductActionHandler(this.gateway, new Helper_UpdateCart(this.gateway.ajax.change_cart.endpoint, this.gateway.ajax.change_cart.nonce), () => {\n this.renderer.showButtons(this.gateway.button.wrapper);\n this.renderer.showButtons(this.gateway.hosted_fields.wrapper);\n let priceText = \"0\";\n\n if (document.querySelector('form.cart ins .woocommerce-Price-amount')) {\n priceText = document.querySelector('form.cart ins .woocommerce-Price-amount').innerText;\n } else if (document.querySelector('form.cart .woocommerce-Price-amount')) {\n priceText = document.querySelector('form.cart .woocommerce-Price-amount').innerText;\n }\n\n const amount = parseInt(priceText.replace(/([^\\d,\\.\\s]*)/g, ''));\n this.messages.renderWithAmount(amount);\n }, () => {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n }, document.querySelector('form.cart'), new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_SingleProductBootstap = (SingleProductBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/CartBootstap.js\n\n\n\nclass CartBootstrap {\n constructor(gateway, renderer) {\n this.gateway = gateway;\n this.renderer = renderer;\n }\n\n init() {\n if (!this.shouldRender()) {\n return;\n }\n\n this.render();\n jQuery(document.body).on('updated_cart_totals updated_checkout', () => {\n this.render();\n });\n }\n\n shouldRender() {\n return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;\n }\n\n render() {\n const actionHandler = new ActionHandler_CartActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const CartBootstap = (CartBootstrap);\n;// CONCATENATED MODULE: ./resources/js/modules/OnApproveHandler/onApproveForPayNow.js\nconst onApproveForPayNow_onApprove = (context, errorHandler, spinner) => {\n return (data, actions) => {\n spinner.block();\n return fetch(context.config.ajax.approve_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: context.config.ajax.approve_order.nonce,\n order_id: data.orderID\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n spinner.unblock();\n\n if (!data.success) {\n if (data.data.code === 100) {\n errorHandler.message(data.data.message);\n } else {\n errorHandler.genericError();\n }\n\n if (typeof actions !== 'undefined' && typeof actions.restart !== 'undefined') {\n return actions.restart();\n }\n\n throw new Error(data.data.message);\n }\n\n document.querySelector('#place_order').click();\n });\n };\n};\n\n/* harmony default export */ const onApproveForPayNow = (onApproveForPayNow_onApprove);\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/CheckoutActionHandler.js\n\n\n\nclass CheckoutActionHandler {\n constructor(config, errorHandler, spinner) {\n this.config = config;\n this.errorHandler = errorHandler;\n this.spinner = spinner;\n }\n\n configuration() {\n const spinner = this.spinner;\n\n const createOrder = (data, actions) => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n const errorHandler = this.errorHandler;\n const formSelector = this.config.context === 'checkout' ? 'form.checkout' : 'form#order_review';\n const formValues = jQuery(formSelector).serialize();\n const createaccount = jQuery('#createaccount').is(\":checked\") ? true : false;\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n payer,\n bn_code: bnCode,\n context: this.config.context,\n order_id: this.config.order_id,\n form: formValues,\n createaccount: createaccount\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n spinner.unblock(); //handle both messages sent from Woocommerce (data.messages) and this plugin (data.data.message)\n\n if (typeof data.messages !== 'undefined') {\n const domParser = new DOMParser();\n errorHandler.appendPreparedErrorMessageElement(domParser.parseFromString(data.messages, 'text/html').querySelector('ul'));\n } else {\n errorHandler.message(data.data.message, true);\n }\n\n return;\n }\n\n const input = document.createElement('input');\n input.setAttribute('type', 'hidden');\n input.setAttribute('name', 'ppcp-resume-order');\n input.setAttribute('value', data.data.purchase_units[0].custom_id);\n document.querySelector(formSelector).append(input);\n return data.data.id;\n });\n };\n\n return {\n createOrder,\n onApprove: onApproveForPayNow(this, this.errorHandler, this.spinner),\n onCancel: () => {\n spinner.unblock();\n },\n onError: () => {\n this.errorHandler.genericError();\n spinner.unblock();\n }\n };\n }\n\n}\n\n/* harmony default export */ const ActionHandler_CheckoutActionHandler = (CheckoutActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/CheckoutBootstap.js\n\n\n\nclass CheckoutBootstap {\n constructor(gateway, renderer, messages, spinner) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.messages = messages;\n this.spinner = spinner;\n }\n\n init() {\n this.render();\n jQuery(document.body).on('updated_checkout', () => {\n this.render();\n });\n jQuery(document.body).on('updated_checkout payment_method_selected', () => {\n this.switchBetweenPayPalandOrderButton();\n this.displayPlaceOrderButtonForSavedCreditCards();\n });\n jQuery(document).on('hosted_fields_loaded', () => {\n jQuery('#saved-credit-card').on('change', () => {\n this.displayPlaceOrderButtonForSavedCreditCards();\n });\n });\n this.switchBetweenPayPalandOrderButton();\n this.displayPlaceOrderButtonForSavedCreditCards();\n }\n\n shouldRender() {\n if (document.querySelector(this.gateway.button.cancel_wrapper)) {\n return false;\n }\n\n return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n if (document.querySelector(this.gateway.hosted_fields.wrapper + '>div')) {\n document.querySelector(this.gateway.hosted_fields.wrapper + '>div').setAttribute('style', '');\n }\n\n const actionHandler = new ActionHandler_CheckoutActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic), this.spinner);\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n switchBetweenPayPalandOrderButton() {\n jQuery('#saved-credit-card').val(jQuery('#saved-credit-card option:first').val());\n const currentPaymentMethod = jQuery('input[name=\"payment_method\"]:checked').val();\n\n if (currentPaymentMethod !== 'ppcp-gateway' && currentPaymentMethod !== 'ppcp-credit-card-gateway') {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n jQuery('#place_order').show();\n } else {\n jQuery('#place_order').hide();\n\n if (currentPaymentMethod === 'ppcp-gateway') {\n this.renderer.showButtons(this.gateway.button.wrapper);\n this.renderer.showButtons(this.gateway.messages.wrapper);\n this.messages.render();\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n }\n\n if (currentPaymentMethod === 'ppcp-credit-card-gateway') {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.showButtons(this.gateway.hosted_fields.wrapper);\n }\n }\n }\n\n displayPlaceOrderButtonForSavedCreditCards() {\n const currentPaymentMethod = jQuery('input[name=\"payment_method\"]:checked').val();\n\n if (currentPaymentMethod !== 'ppcp-credit-card-gateway') {\n return;\n }\n\n if (jQuery('#saved-credit-card').length && jQuery('#saved-credit-card').val() !== '') {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n jQuery('#place_order').show();\n this.disableCreditCardFields();\n } else {\n jQuery('#place_order').hide();\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.showButtons(this.gateway.hosted_fields.wrapper);\n this.enableCreditCardFields();\n }\n }\n\n disableCreditCardFields() {\n jQuery('label[for=\"ppcp-credit-card-gateway-card-number\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-number').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-expiry\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-expiry').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-cvc\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-cvc').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"vault\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').attr(\"disabled\", true);\n this.renderer.disableCreditCardFields();\n }\n\n enableCreditCardFields() {\n jQuery('label[for=\"ppcp-credit-card-gateway-card-number\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-number').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-expiry\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-expiry').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-cvc\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-cvc').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"vault\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').attr(\"disabled\", false);\n this.renderer.enableCreditCardFields();\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_CheckoutBootstap = (CheckoutBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/PayNowBootstrap.js\n\n\n\nclass PayNowBootstrap {\n constructor(gateway, renderer, messages, spinner) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.messages = messages;\n this.spinner = spinner;\n }\n\n init() {\n this.render();\n jQuery(document.body).on('updated_checkout', () => {\n this.render();\n });\n jQuery(document.body).on('updated_checkout payment_method_selected', () => {\n this.switchBetweenPayPalandOrderButton();\n });\n this.switchBetweenPayPalandOrderButton();\n }\n\n shouldRender() {\n if (document.querySelector(this.gateway.button.cancel_wrapper)) {\n return false;\n }\n\n return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n if (document.querySelector(this.gateway.hosted_fields.wrapper + '>div')) {\n document.querySelector(this.gateway.hosted_fields.wrapper + '>div').setAttribute('style', '');\n }\n\n const actionHandler = new ActionHandler_CheckoutActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic), this.spinner);\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n switchBetweenPayPalandOrderButton() {\n const urlParams = new URLSearchParams(window.location.search);\n\n if (urlParams.has('change_payment_method')) {\n return;\n }\n\n const currentPaymentMethod = jQuery('input[name=\"payment_method\"]:checked').val();\n\n if (currentPaymentMethod !== 'ppcp-gateway' && currentPaymentMethod !== 'ppcp-credit-card-gateway') {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n jQuery('#place_order').show();\n } else {\n jQuery('#place_order').hide();\n\n if (currentPaymentMethod === 'ppcp-gateway') {\n this.renderer.showButtons(this.gateway.button.wrapper);\n this.renderer.showButtons(this.gateway.messages.wrapper);\n this.messages.render();\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n }\n\n if (currentPaymentMethod === 'ppcp-credit-card-gateway') {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.messages.wrapper);\n this.renderer.showButtons(this.gateway.hosted_fields.wrapper);\n }\n }\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_PayNowBootstrap = (PayNowBootstrap);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/Renderer.js\nclass Renderer {\n constructor(creditCardRenderer, defaultConfig) {\n this.defaultConfig = defaultConfig;\n this.creditCardRenderer = creditCardRenderer;\n }\n\n render(wrapper, hostedFieldsWrapper, contextConfig) {\n this.renderButtons(wrapper, contextConfig);\n this.creditCardRenderer.render(hostedFieldsWrapper, contextConfig);\n }\n\n renderButtons(wrapper, contextConfig) {\n if (!document.querySelector(wrapper) || this.isAlreadyRendered(wrapper) || 'undefined' === typeof paypal.Buttons) {\n return;\n }\n\n const style = wrapper === this.defaultConfig.button.wrapper ? this.defaultConfig.button.style : this.defaultConfig.button.mini_cart_style;\n paypal.Buttons({\n style,\n ...contextConfig\n }).render(wrapper);\n }\n\n isAlreadyRendered(wrapper) {\n return document.querySelector(wrapper).hasChildNodes();\n }\n\n hideButtons(element) {\n const domElement = document.querySelector(element);\n\n if (!domElement) {\n return false;\n }\n\n domElement.style.display = 'none';\n return true;\n }\n\n showButtons(element) {\n const domElement = document.querySelector(element);\n\n if (!domElement) {\n return false;\n }\n\n domElement.style.display = 'block';\n return true;\n }\n\n disableCreditCardFields() {\n this.creditCardRenderer.disableFields();\n }\n\n enableCreditCardFields() {\n this.creditCardRenderer.enableFields();\n }\n\n}\n\n/* harmony default export */ const Renderer_Renderer = (Renderer);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/DccInputFactory.js\nconst dccInputFactory = original => {\n const styles = window.getComputedStyle(original);\n const newElement = document.createElement('span');\n newElement.setAttribute('id', original.id);\n Object.values(styles).forEach(prop => {\n if (!styles[prop] || !isNaN(prop)) {\n return;\n }\n\n newElement.style.setProperty(prop, '' + styles[prop]);\n });\n return newElement;\n};\n\n/* harmony default export */ const DccInputFactory = (dccInputFactory);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/CreditCardRenderer.js\n\n\nclass CreditCardRenderer {\n constructor(defaultConfig, errorHandler, spinner) {\n this.defaultConfig = defaultConfig;\n this.errorHandler = errorHandler;\n this.spinner = spinner;\n this.cardValid = false;\n this.formValid = false;\n this.currentHostedFieldsInstance = null;\n this.formSubmissionSubscribed = false;\n }\n\n render(wrapper, contextConfig) {\n if (this.defaultConfig.context !== 'checkout' && this.defaultConfig.context !== 'pay-now' || wrapper === null || document.querySelector(wrapper) === null) {\n return;\n }\n\n if (typeof paypal.HostedFields === 'undefined' || !paypal.HostedFields.isEligible()) {\n const wrapperElement = document.querySelector(wrapper);\n wrapperElement.parentNode.removeChild(wrapperElement);\n return;\n }\n\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.teardown().catch(err => console.error(`Hosted fields teardown error: ${err}`));\n this.currentHostedFieldsInstance = null;\n }\n\n const gateWayBox = document.querySelector('.payment_box.payment_method_ppcp-credit-card-gateway');\n const oldDisplayStyle = gateWayBox.style.display;\n gateWayBox.style.display = 'block';\n const hideDccGateway = document.querySelector('#ppcp-hide-dcc');\n\n if (hideDccGateway) {\n hideDccGateway.parentNode.removeChild(hideDccGateway);\n }\n\n const cardNumberField = document.querySelector('#ppcp-credit-card-gateway-card-number');\n const stylesRaw = window.getComputedStyle(cardNumberField);\n let styles = {};\n Object.values(stylesRaw).forEach(prop => {\n if (!stylesRaw[prop]) {\n return;\n }\n\n styles[prop] = '' + stylesRaw[prop];\n });\n const cardNumber = DccInputFactory(cardNumberField);\n cardNumberField.parentNode.replaceChild(cardNumber, cardNumberField);\n const cardExpiryField = document.querySelector('#ppcp-credit-card-gateway-card-expiry');\n const cardExpiry = DccInputFactory(cardExpiryField);\n cardExpiryField.parentNode.replaceChild(cardExpiry, cardExpiryField);\n const cardCodeField = document.querySelector('#ppcp-credit-card-gateway-card-cvc');\n const cardCode = DccInputFactory(cardCodeField);\n cardCodeField.parentNode.replaceChild(cardCode, cardCodeField);\n gateWayBox.style.display = oldDisplayStyle;\n const formWrapper = '.payment_box payment_method_ppcp-credit-card-gateway';\n\n if (this.defaultConfig.enforce_vault && document.querySelector(formWrapper + ' .ppcp-credit-card-vault')) {\n document.querySelector(formWrapper + ' .ppcp-credit-card-vault').checked = true;\n document.querySelector(formWrapper + ' .ppcp-credit-card-vault').setAttribute('disabled', true);\n }\n\n paypal.HostedFields.render({\n createOrder: contextConfig.createOrder,\n styles: {\n 'input': styles\n },\n fields: {\n number: {\n selector: '#ppcp-credit-card-gateway-card-number',\n placeholder: this.defaultConfig.hosted_fields.labels.credit_card_number\n },\n cvv: {\n selector: '#ppcp-credit-card-gateway-card-cvc',\n placeholder: this.defaultConfig.hosted_fields.labels.cvv\n },\n expirationDate: {\n selector: '#ppcp-credit-card-gateway-card-expiry',\n placeholder: this.defaultConfig.hosted_fields.labels.mm_yy\n }\n }\n }).then(hostedFields => {\n document.dispatchEvent(new CustomEvent(\"hosted_fields_loaded\"));\n this.currentHostedFieldsInstance = hostedFields;\n hostedFields.on('inputSubmitRequest', () => {\n this._submit(contextConfig);\n });\n hostedFields.on('cardTypeChange', event => {\n if (!event.cards.length) {\n this.cardValid = false;\n return;\n }\n\n const validCards = this.defaultConfig.hosted_fields.valid_cards;\n this.cardValid = validCards.indexOf(event.cards[0].type) !== -1;\n });\n hostedFields.on('validityChange', event => {\n const formValid = Object.keys(event.fields).every(function (key) {\n return event.fields[key].isValid;\n });\n this.formValid = formValid;\n });\n\n if (!this.formSubmissionSubscribed) {\n document.querySelector(wrapper + ' button').addEventListener('click', event => {\n event.preventDefault();\n\n this._submit(contextConfig);\n });\n this.formSubmissionSubscribed = true;\n }\n });\n document.querySelector('#payment_method_ppcp-credit-card-gateway').addEventListener('click', () => {\n document.querySelector('label[for=ppcp-credit-card-gateway-card-number]').click();\n });\n }\n\n disableFields() {\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.setAttribute({\n field: 'number',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.setAttribute({\n field: 'cvv',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.setAttribute({\n field: 'expirationDate',\n attribute: 'disabled'\n });\n }\n }\n\n enableFields() {\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'number',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'cvv',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'expirationDate',\n attribute: 'disabled'\n });\n }\n }\n\n _submit(contextConfig) {\n this.spinner.block();\n this.errorHandler.clear();\n\n if (this.formValid && this.cardValid) {\n const save_card = this.defaultConfig.save_card ? true : false;\n let vault = document.getElementById('ppcp-credit-card-vault') ? document.getElementById('ppcp-credit-card-vault').checked : save_card;\n\n if (this.defaultConfig.enforce_vault) {\n vault = true;\n }\n\n const contingency = this.defaultConfig.hosted_fields.contingency;\n const hostedFieldsData = {\n vault: vault\n };\n\n if (contingency !== 'NO_3D_SECURE') {\n hostedFieldsData.contingencies = [contingency];\n }\n\n this.currentHostedFieldsInstance.submit(hostedFieldsData).then(payload => {\n payload.orderID = payload.orderId;\n this.spinner.unblock();\n return contextConfig.onApprove(payload);\n }).catch(err => {\n console.error(err);\n this.spinner.unblock();\n });\n } else {\n this.spinner.unblock();\n const message = !this.cardValid ? this.defaultConfig.hosted_fields.labels.card_not_supported : this.defaultConfig.hosted_fields.labels.fields_not_valid;\n this.errorHandler.message(message);\n }\n }\n\n}\n\n/* harmony default export */ const Renderer_CreditCardRenderer = (CreditCardRenderer);\n;// CONCATENATED MODULE: ./resources/js/modules/DataClientIdAttributeHandler.js\nconst storageKey = 'ppcp-data-client-id';\n\nconst validateToken = (token, user) => {\n if (!token) {\n return false;\n }\n\n if (token.user !== user) {\n return false;\n }\n\n const currentTime = new Date().getTime();\n const isExpired = currentTime >= token.expiration * 1000;\n return !isExpired;\n};\n\nconst storedTokenForUser = user => {\n const token = JSON.parse(sessionStorage.getItem(storageKey));\n\n if (validateToken(token, user)) {\n return token.token;\n }\n\n return null;\n};\n\nconst storeToken = token => {\n sessionStorage.setItem(storageKey, JSON.stringify(token));\n};\n\nconst dataClientIdAttributeHandler = (script, config) => {\n fetch(config.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: config.nonce\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n const isValid = validateToken(data, config.user);\n\n if (!isValid) {\n return;\n }\n\n storeToken(data);\n script.setAttribute('data-client-token', data.token);\n document.body.append(script);\n });\n};\n\n/* harmony default export */ const DataClientIdAttributeHandler = (dataClientIdAttributeHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/MessageRenderer.js\nclass MessageRenderer {\n constructor(config) {\n this.config = config;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n paypal.Messages({\n amount: this.config.amount,\n placement: this.config.placement,\n style: this.config.style\n }).render(this.config.wrapper);\n }\n\n renderWithAmount(amount) {\n if (!this.shouldRender()) {\n return;\n }\n\n const newWrapper = document.createElement('div');\n newWrapper.setAttribute('id', this.config.wrapper.replace('#', ''));\n const sibling = document.querySelector(this.config.wrapper).nextSibling;\n document.querySelector(this.config.wrapper).parentElement.removeChild(document.querySelector(this.config.wrapper));\n sibling.parentElement.insertBefore(newWrapper, sibling);\n paypal.Messages({\n amount,\n placement: this.config.placement,\n style: this.config.style\n }).render(this.config.wrapper);\n }\n\n shouldRender() {\n if (typeof paypal.Messages === 'undefined' || typeof this.config.wrapper === 'undefined') {\n return false;\n }\n\n if (!document.querySelector(this.config.wrapper)) {\n return false;\n }\n\n return true;\n }\n\n}\n\n/* harmony default export */ const Renderer_MessageRenderer = (MessageRenderer);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/Spinner.js\nclass Spinner {\n constructor() {\n this.target = 'form.woocommerce-checkout';\n }\n\n setTarget(target) {\n this.target = target;\n }\n\n block() {\n jQuery(this.target).block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n\n unblock() {\n jQuery(this.target).unblock();\n }\n\n}\n\n/* harmony default export */ const Helper_Spinner = (Spinner);\n;// CONCATENATED MODULE: ./resources/js/button.js\n\n\n\n\n\n\n\n\n\n\n\n\nconst bootstrap = () => {\n const errorHandler = new modules_ErrorHandler(PayPalCommerceGateway.labels.error.generic);\n const spinner = new Helper_Spinner();\n const creditCardRenderer = new Renderer_CreditCardRenderer(PayPalCommerceGateway, errorHandler, spinner);\n const renderer = new Renderer_Renderer(creditCardRenderer, PayPalCommerceGateway);\n const messageRenderer = new Renderer_MessageRenderer(PayPalCommerceGateway.messages);\n const context = PayPalCommerceGateway.context;\n\n if (context === 'mini-cart' || context === 'product') {\n if (PayPalCommerceGateway.mini_cart_buttons_enabled === '1') {\n const miniCartBootstrap = new ContextBootstrap_MiniCartBootstap(PayPalCommerceGateway, renderer);\n miniCartBootstrap.init();\n }\n }\n\n if (context === 'product' && PayPalCommerceGateway.single_product_buttons_enabled === '1') {\n const singleProductBootstrap = new ContextBootstrap_SingleProductBootstap(PayPalCommerceGateway, renderer, messageRenderer);\n singleProductBootstrap.init();\n }\n\n if (context === 'cart') {\n const cartBootstrap = new CartBootstap(PayPalCommerceGateway, renderer);\n cartBootstrap.init();\n }\n\n if (context === 'checkout') {\n const checkoutBootstap = new ContextBootstrap_CheckoutBootstap(PayPalCommerceGateway, renderer, messageRenderer, spinner);\n checkoutBootstap.init();\n }\n\n if (context === 'pay-now') {\n const payNowBootstrap = new ContextBootstrap_PayNowBootstrap(PayPalCommerceGateway, renderer, messageRenderer, spinner);\n payNowBootstrap.init();\n }\n\n if (context !== 'checkout') {\n messageRenderer.render();\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n if (!typeof PayPalCommerceGateway) {\n console.error('PayPal button could not be configured.');\n return;\n }\n\n const script = document.createElement('script');\n script.addEventListener('load', event => {\n bootstrap();\n });\n script.setAttribute('src', PayPalCommerceGateway.button.url);\n Object.entries(PayPalCommerceGateway.script_attributes).forEach(keyValue => {\n script.setAttribute(keyValue[0], keyValue[1]);\n });\n\n if (PayPalCommerceGateway.data_client_id.set_attribute) {\n DataClientIdAttributeHandler(script, PayPalCommerceGateway.data_client_id);\n return;\n }\n\n document.body.append(script);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQuanMiLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNQSxZQUFOLENBQW1CO0FBRWZDLEVBQUFBLFdBQVcsQ0FBQ0MsZ0JBQUQsRUFDWDtBQUNJLFNBQUtBLGdCQUFMLEdBQXdCQSxnQkFBeEI7QUFDQSxTQUFLQyxPQUFMLEdBQWVDLFFBQVEsQ0FBQ0MsYUFBVCxDQUF1Qiw4QkFBdkIsQ0FBZjtBQUNBLFNBQUtDLFlBQUwsR0FBb0JGLFFBQVEsQ0FBQ0MsYUFBVCxDQUF1QixzQkFBdkIsQ0FBcEI7QUFDSDs7QUFFREUsRUFBQUEsWUFBWSxHQUFHO0FBQ1gsUUFBSSxLQUFLSixPQUFMLENBQWFLLFNBQWIsQ0FBdUJDLFFBQXZCLENBQWdDLGNBQWhDLENBQUosRUFBcUQ7QUFDakQ7QUFDSDs7QUFDRCxTQUFLQyxLQUFMO0FBQ0EsU0FBS0MsT0FBTCxDQUFhLEtBQUtULGdCQUFsQjtBQUNIOztBQUVEVSxFQUFBQSxpQ0FBaUMsQ0FBQ0MsbUJBQU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B7XG4gICAgICAgIHJldHVybiBmZXRjaChjb250ZXh0LmNvbmZpZy5hamF4LmFwcHJvdmVfb3JkZXIuZW5kcG9pbnQsIHtcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgIG5vbmNlOiBjb250ZXh0LmNvbmZpZy5hamF4LmFwcHJvdmVfb3JkZXIubm9uY2UsXG4gICAgICAgICAgICAgICAgb3JkZXJfaWQ6ZGF0YS5vcmRlcklEXG4gICAgICAgICAgICB9KVxuICAgICAgICB9KS50aGVuKChyZXMpPT57XG4gICAgICAgICAgICByZXR1cm4gcmVzLmpzb24oKTtcbiAgICAgICAgfSkudGhlbigoZGF0YSk9PntcbiAgICAgICAgICAgIGlmICghZGF0YS5zdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JIYW5kbGVyLmdlbmVyaWNFcnJvcigpO1xuICAgICAgICAgICAgICAgIHJldHVybiBhY3Rpb25zLnJlc3RhcnQoKS5jYXRjaChlcnIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBlcnJvckhhbmRsZXIuZ2VuZXJpY0Vycm9yKCk7XG4gICAgICAgICAgICAgICAgfSk7O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IGNvbnRleHQuY29uZmlnLnJlZGlyZWN0O1xuICAgICAgICB9KTtcblxuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgb25BcHByb3ZlO1xuIiwiZXhwb3J0IGNvbnN0IHBheWVyRGF0YSA9ICgpID0+IHtcbiAgICBjb25zdCBwYXllciA9IFBheVBhbENvbW1lcmNlR2F0ZXdheS5wYXllcjtcbiAgICBpZiAoISBwYXllcikge1xuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBjb25zdCBwaG9uZSA9IChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsbGlu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JykpID8gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2JpbGxpbmdfcG9zdGNvZGUnKS52YWx1ZSA6IHBheWVyLmFkZHJlc3MucG9zdGFsX2NvZGVcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBpZiAocGhvbmUpIHtcbiAgICAgICAgcGF5ZXJEYXRhLnBob25lID0gcGhvbmU7XG4gICAgfVxuICAgIHJldHVybiBwYXllckRhdGE7XG59XG4iLCJpbXBvcnQgb25BcHByb3ZlIGZyb20gJy4uL09uQXBwcm92ZUhhbmRsZXIvb25BcHByb3ZlRm9yQ29udGludWUuanMnO1xuaW1wb3J0IHtwYXllckRhdGF9IGZyb20gXCIuLi9IZWxwZXIvUGF5ZXJEYXRhXCI7XG5cbmNsYXNzIENhcnRBY3Rpb25IYW5kbGVyIHtcblxuICAgIGNvbnN0cnVjdG9yKGNvbmZpZywgZXJyb3JIYW5kbGVyKSB7XG4gICAgICAgIHRoaXMuY29uZmlnID0gY29uZmlnO1xuICAgICAgICB0aGlzLmVycm9ySGFuZGxlciA9IGVycm9ySGFuZGxlcjtcbiAgICB9XG5cbiAgICBjb25maWd1cmF0aW9uKCkge1xuICAgICAgICBjb25zdCBjcmVhdGVPcmRlciA9IChkYXRhLCBhY3Rpb25zKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBwYXllciA9IHBheWVyRGF0YSgpO1xuICAgICAgICAgICAgY29uc3QgYm5Db2RlID0gdHlwZW9mIHRoaXMuY29uZmlnLmJuX2NvZGVzW3RoaXMuY29uZmlnLmNvbnRleHRdICE9PSAndW5kZWZpbmVkJyA/XG4gICAgICAgICAgICAgICAgdGhpcy5jb25maWcuYm5fY29kZXNbdGhpcy5jb25maWcuY29udGV4dF0gOiAnJztcbiAgICAgICAgICAgIHJldHVybiBmZXRjaCh0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5lbmRwb2ludCwge1xuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgbm9uY2U6IHRoaXMuY29uZmlnLmFqYXguY3JlYXRlX29yZGVyLm5vbmNlLFxuICAgICAgICAgICAgICAgICAgICBwdXJjaGFzZV91bml0czogW10sXG4gICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICBwYXllcixcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dDp0aGlzLmNvbmZpZy5jb250ZXh0XG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uKHJlcykge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXMuanNvbigpO1xuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbihkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihkYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgRXJyb3IoZGF0YS5kYXRhLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0YS5kYXRhLmlkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGNyZWF0ZU9yZGVyLFxuICAgICAgICAgICAgb25BcHByb3ZlOiBvbkFwcHJvdmUodGhpcywgdGhpcy5lcnJvckhhbmRsZXIpLFxuICAgICAgICAgICAgb25FcnJvcjogKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5lcnJvckhhbmRsZXIuZ2VuZXJpY0Vycm9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBDYXJ0QWN0aW9uSGFuZGxlcjtcbiIsImltcG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cikgIT09XG4gICAgICAgIG51bGw7XG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICBpZiAoIXRoaXMuc2hvdWxkUmVuZGVyKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmVuZGVyZXIucmVuZGVyKFxuICAgICAgICAgICAgdGhpcy5nYXRld2F5LmJ1dHRvbi5taW5pX2NhcnRfd3JhcHBlcixcbiAgICAgICAgICAgIHRoaXMuZ2F0ZXdheS5ob3N0ZWRfZmllbGRzLm1pbmlfY2FydF93cmFwcGVyLFxuICAgICAgICAgICAgdGhpcy5hY3Rpb25IYW5kbGVyLmNvbmZpZ3VyYXRpb24oKVxuICAgICAgICApO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgTWluaUNhcnRCb290c3RhcDsiLCJpbXBvcnQgUHJvZHVjdCBmcm9tIFwiLi4vRW50aXR5L1Byb2R1Y3RcIjtcbmNsYXNzIFVwZGF0ZUNhcnQge1xuXG4gICAgY29uc3RydWN0b3IoZW5kcG9pbnQsIG5vbmNlKVxuICAgIHtcbiAgICAgICAgdGhpcy5lbmRwb2ludCA9IGVuZHBvaW50O1xuICAgICAgICB0aGlzLm5vbmNlID0gbm9uY2U7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICpcbiAgICAgKiBAcGFyYW0gb25SZXNvbHZlXG4gICAgICogQHBhcmFtIHtQcm9kdWN0W119IHByb2R1Y3RzXG4gICAgICogQHJldHVybnMge1Byb21pc2U8dW5rbm93bj59XG4gICAgICovXG4gICAgdXBkYXRlKG9uUmVzb2x2ZSwgcHJvZHVjdHMpXG4gICAge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgZmV0Y2goXG4gICAgICAgICAgICAgICAgdGhpcy5lbmRwb2ludCxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBub25jZTogdGhpcy5ub25jZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2R1Y3RzLFxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICkudGhlbihcbiAgICAgICAgICAgICAgICAocmVzdWx0KSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC5qc29uKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKS50aGVuKChyZXN1bHQpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoISByZXN1bHQuc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QocmVzdWx0LmRhdGEpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlc29sdmVkID0gb25SZXNvbHZlKHJlc3VsdC5kYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXNvbHZlZCk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgfSk7XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBVcGRhdGVDYXJ0OyIsIi8qKlxuICogV2hlbiB5b3UgY2FuJ3QgYWRkIHNvbWV0aGluZyB0byB0aGUgY2FydCwgdGhlIFBheVBhbCBidXR0b25zIHNob3VsZCBub3Qgc2hvdy5cbiAqIFRoZXJlZm9yZSB3ZSBsaXN0ZW4gZm9yIGNoYW5nZXMgb24gdGhlIGFkZCB0byBjYXJ0IGJ1dHRvbiBhbmQgc2hvdy9oaWRlIHRoZSBidXR0b25zIGFjY29yZGluZ2x5LlxuICovXG5cbmNsYXNzIEJ1dHRvbnNUb2dnbGVMaXN0ZW5lciB7XG4gICAgY29uc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gpICkge1xuICAgICAgICAgICAgZ2V0UHJvZHVjdHMgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaWQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdbbmFtZT1cImFkZC10by1jYXJ0XCJdJykudmFsdWU7XG4gICAgICAgICAgICAgICAgY29uc3QgcXR5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW25hbWU9XCJxdWFudGl0eVwiXScpLnZhbHVlO1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhcmlhdGlvbnMgPSB0aGlzLnZhcmlhdGlvbnMoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gW25ldyBQcm9kdWN0KGlkLCBxdHksIHZhcmlhdGlvbnMpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGdldFByb2R1Y3RzID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHByb2R1Y3RzID0gW107XG4gICAgICAgICAgICAgICAgdGhpcy5mb3JtRWxlbWVudC5xdWVyeVNlbGVjdG9yQWxsKCdpbnB1dFt0eXBlPVwibnVtYmVyXCJdJykuZm9yRWFjaCgoZWxlbWVudCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoISBlbGVtZW50LnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudE5hbWUgPSBlbGVtZW50LmdldEF0dHJpYnV0ZSgnbmFtZScpLm1hdGNoKC9xdWFudGl0eVxcWyhbXFxkXSopXFxdLyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50TmFtZS5sZW5ndGggIT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBpZCA9IHBhcnNlSW50KGVsZW1lbnROYW1lWzFdKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcXVhbnRpdHkgPSBwYXJzZUludChlbGVtZW50LnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZHVjdHMucHVzaChuZXcgUHJvZHVjdChpZCwgcXVhbnRpdHksIG51bGwpKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIHJldHVybiBwcm9kdWN0cztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb25zdCBjcmVhdGVPcmRlciA9IChkYXRhLCBhY3Rpb25zKSA9PiB7XG4gICAgICAgICAgICB0aGlzLmVycm9ySGFuZGxlci5jbGVhcigpO1xuXG4gICAgICAgICAgICBjb25zdCBvblJlc29sdmUgPSAocHVyY2hhc2VfdW5pdHMpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXllciA9IHBheWVyRGF0YSgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGJuQ29kZSA9IHR5cGVvZiB0aGlzLmNvbmZpZy5ibl9jb2Rlc1t0aGlzLmNvbmZpZy5jb250ZXh0XSAhPT0gJ3VuZGVmaW5lZCcgP1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5ibl9jb2Rlc1t0aGlzLmNvbmZpZy5jb250ZXh0XSA6ICcnO1xuICAgICAgICAgICAgICAgIHJldHVybiBmZXRjaCh0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5lbmRwb2ludCwge1xuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9uY2U6IHRoaXMuY29uZmlnLmFqYXguY3JlYXRlX29yZGVyLm5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVyY2hhc2VfdW5pdHMsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXllcixcbiAgICAgICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDp0aGlzLmNvbmZpZy5jb250ZXh0XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXMuanNvbigpO1xuICAgICAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBFcnJvcihkYXRhLmRhdGEubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEuZGF0YS5pZDtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSB0aGlzLnVwZGF0ZUNhcnQudXBkYXRlKG9uUmVzb2x2ZSwgZ2V0UHJvZHVjdHMoKSk7XG4gICAgICAgICAgICByZXR1cm4gcHJvbWlzZTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGNyZWF0ZU9yZGVyO1xuICAgIH1cblxuICAgIHZhcmlhdGlvbnMoKVxuICAgIHtcblxuICAgICAgICBpZiAoISB0aGlzLmhhc1ZhcmlhdGlvbnMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgYXR0cmlidXRlcyA9IFsuLi50aGlzLmZvcm1FbGVtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXCJbbmFtZV49J2F0dHJpYnV0ZV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B0aGlzLm1lc3NhZ2VzID0gbWVzc2FnZXM7XG4gICAgfVxuXG4gICAgaW5pdCgpIHtcbiAgICAgICAgaWYgKCF0aGlzLnNob3VsZFJlbmRlcigpKSB7XG4gICAgICAgICAgIHRoaXMucmVuZGVyZXIuaGlkZUJ1dHRvbnModGhpcy5nYXRld2F5Lmhvc3RlZF9maWVsZHMud3JhcHBlcik7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnJlbmRlcigpO1xuICAgIH1cblxuICAgIHNob3VsZFJlbmRlcigpIHtcbiAgICAgICAgaWYgKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2Zvcm0uY2FydCcpID09PSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIGNvbnN0IGFjdGlvbkhhbmRsZXIgPSBuZXcgU2luZ2xlUHJvZHVjdEFjdGlvbkhhbmRsZXIoXG4gICAgICAgICAgICB0aGlzLmdhdGV3YXksXG4gICAgICAgICAgICBuZXcgVXBkYXRlQ2FydChcbiAgICAgICAgICAgICAgICB0aGlzLmdhdGV3YXkuYWpheC5jaGFuZ2VfY2FydC5lbmRwb2ludCxcbiAgICAgICAgICAgICAgICB0aGlzLmdhdGV3YXkuYWpheC5jaGFuZ2VfY2FydC5ub25jZSxcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5zaG93QnV0dG9ucyh0aGlzLmdhdGV3YXkuYnV0dG9uLndyYXBwZXIpO1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuc2hvd0J1dHRvbnModGhpcy5nYXRld2F5Lmhvc3RlZF9maWVsZHMud3JhcHBlcik7XG4gICAgICAgICAgICAgICAgbGV0IHByaWNlVGV4dCA9IFwiMFwiO1xuICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdmb3JtLmNhcnQgaW5zIC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKSkge1xuICAgICAgICAgICAgICAgICAgICBwcmljZVRleHQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdmb3JtLmNhcnQgaW5zIC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKS5pbm5lclRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2Zvcm0uY2FydCAud29vY29tbWVyY2UtUHJpY2UtYW1vdW50JykpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJpY2VUZXh0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZm9ybS5jYXJ0IC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKS5pbm5lclRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGFtb3VudCA9IHBhcnNlSW50KHByaWNlVGV4dC5yZXBsYWNlKC8oW15cXGQsXFwuXFxzXSopL2csICcnKSk7XG4gICAgICAgICAgICAgICAgdGhpcy5tZXNzYWdlcy5yZW5kZXJXaXRoQW1vdW50KGFtb3VudClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5oaWRlQnV0dG9ucyh0aGlzLmdhdGV3YXkuYnV0dG9uLndyYXBwZXIpO1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuaGlkZUJ1dHRvbnModGhpcy5nYXRld2F5Lmhvc3RlZF9maWVsZHMud3JhcHBlcik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZm9ybS5jYXJ0JyksXG4gICAgICAgICAgICBuZX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ICAgICAgICAgIG5vbmNlOiBjb250ZXh0LmNvbmZpZy5hamF4LmFwcHJvdmVfb3JkZXIubm9uY2UsXG4gICAgICAgICAgICAgICAgb3JkZXJfaWQ6ZGF0YS5vcmRlcklEXG4gICAgICAgICAgICB9KVxuICAgICAgICB9KS50aGVuKChyZXMpPT57XG4gICAgICAgICAgICByZXR1cm4gcmVzLmpzb24oKTtcbiAgICAgICAgfSkudGhlbigoZGF0YSk9PntcbiAgICAgICAgICAgIHNwaW5uZXIudW5ibG9jaygpO1xuICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICBpZiAoZGF0YS5kYXRhLmNvZGUgPT09IDEwMCkge1xuICAgICAgICAgICAgICAgICAgICBlcnJvckhhbmRsZXIubWVzc2FnZShkYXRhLmRhdGEubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZXJyb3JIYW5kbGVyLmdlbmVyaWNFcnJvcigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFjdGlvbnMgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBhY3Rpb25zLnJlc3RhcnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhY3Rpb25zLnJlc3RhcnQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGRhdGEuZGF0YS5tZXNzYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNwbGFjZV9vcmRlcicpLmNsaWNrKClcbiAgICAgICAgfSk7XG5cbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IG9uQXBwcm92ZTtcbiIsImltcG9ydCBvbkFwcHJvdmUgZnJvbSAnLi4vT25BcHByb3ZlSGFuZ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JpYWxpemUoKTtcblxuICAgICAgICAgICAgY29uc3QgY3JlYXRlYWNjb3VudCA9IGpRdWVyeSgnI2NyZWF0ZWFjY291bnQnKS5pcyhcIjpjaGVja2VkXCIpID8gdHJ1ZSA6IGZhbHNlO1xuXG4gICAgICAgICAgICByZXR1cm4gZmV0Y2godGhpcy5jb25maWcuYWpheC5jcmVhdGVfb3JkZXIuZW5kcG9pbnQsIHtcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgIG5vbmNlOiB0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5ub25jZSxcbiAgICAgICAgICAgICAgICAgICAgcGF5ZXIsXG4gICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0OnRoaXMuY29uZmlnLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyX2lkOnRoaXMuY29uZmlnLm9yZGVyX2lkLFxuICAgICAgICAgICAgICAgICAgICBmb3JtOmZvcm1WYWx1ZXMsXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZWFjY291bnQ6IGNyZWF0ZWFjY291bnRcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5qc29uKCk7XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgc3Bpbm5lci51bmJsb2NrKCk7XG4gICAgICAgICAgICAgICAgICAgIC8vaGFuZGxlIGJvdGggbWVzc2FnZXMgc2VudCBmcm9tIFdvb2NvbW1lcmNlIChkYXRhLm1lc3NhZ2VzKSBhbmQgdGhpcyBwbHVnaW4gKGRhdGEuZGF0YS5tZXNzYWdlKVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKGRhdGEubWVzc2FnZXMpICE9PSAndW5kZWZpbmVkJyApXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGRvbVBhcnNlciA9IG5ldyBET01QYXJzZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ySGFuZGxlci5hcHBlbmRQcmVwYXJlZEVycm9yTWVzc2FnZUVsZW1lbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tUGFyc2VyLnBhcnNlRnJvbVN0cmluZyhkYXRhLm1lc3NhZ2VzLCAndGV4dC9odG1sJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnF1ZXJ5U2VsZWN0b3IoJ3VsJylcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvckhhbmRsZXIubWVzc2FnZShkYXRhLmRhdGEubWVzc2FnZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGlucHV0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKTtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZXRBdHRyaWJ1dGUoJ3R5cGUnLCAnaGlkZGVuJyk7XG4gICAgICAgICAgICAgICAgaW5wdXQuc2V0QXR0cmlidXRlKCduYW1lJywgJ3BwY3AtcmVzdW1lLW9yZGVyJyk7XG4gICAgICAgICAgICAgICAgaW5wdXQuc2V0QXR0cmlidXRlKCd2YWx1ZScsIGRhdGEuZGF0YS5wdXJjaGFzZV91bml0c1swXS5jdXN0b21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AgICAgICAgICAgY3JlYXRlT3JkZXI6IGNvbnRleHRDb25maWcuY3JlYXRlT3JkZXIsXG4gICAgICAgICAgICBzdHlsZXM6IHtcbiAgICAgICAgICAgICAgICAnaW5wdXQnOiBzdHlsZXNcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmaWVsZHM6IHtcbiAgICAgICAgICAgICAgICBudW1iZXI6IHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICcjcHBjcC1jcmVkaXQtY2FyZC1nYXRld2F5LWNhcmQtbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI6IHRoaXMuZGVmYXVsdENvbmZpZy5ob3N0ZWRfZmllbGRzLmxhYmVscy5jcmVkaXRfY2FyZF9udW1iZXIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjdnY6IHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3I6ICcjcHBjcC1jcmVkaXQtY2FyZC1nYXRld2F5LWNhcmQtY3ZjJyxcbiAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI6IHRoaXMuZGVmYXVsdENvbmZpZy5ob3N0ZWRfZmllbGRzLmxhYmVscy5jdnYsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBleHBpcmF0aW9uRGF0ZToge1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcjogJyNwcGNwLWNyZWRpdC1jYXJkLWdhdGV3YXktY2FyZC1leHBpcnknLFxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogdGhpcy5kZWZhdWx0Q29uZmlnLmhvc3RlZF9maWVsZHMubGFiZWxzLm1tX3l5LFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkudGhlbihob3N0ZWRGaWVsZHMgPT4ge1xuICAgICAgICAgICAgZG9jdW1lbnQuZGlzcGF0Y2hFdmVudChuZXcgQ3VzdG9tRXZlbnQoXCJob3N0ZWRfZmllbGRzX2xvYWRlZFwiKSk7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSA9IGhvc3RlZEZpZWxkcztcblxuICAgICAgICAgICAgaG9zdGVkRmllbGRzLm9uKCdpbnB1dFN1Ym1pdFJlcXVlc3QnLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3VibWl0KGNvbnRleHRDb25maWcpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBob3N0ZWRGaWVsZHMub24oJ2NhcmRUeXBlQ2hhbmdlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCAhIGV2ZW50LmNhcmRzLmxlbmd0aCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYXJkVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCB2YWxpZENhcmRzID0gdGhpcy5kZWZhdWx0Q29uZmlnLmhvc3RlZF9maWVsZHMudmFsaWRfY2FyZHM7XG4gICAgICAgICAgICAgICAgdGhpcy5jYXJkVmFsaWQgPSB2YWxpZENhcmRzLmluZGV4T2YoZXZlbnQuY2FyZHNbMF0udHlwZSkgIT09IC0xO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIGhvc3RlZEZpZWxkcy5vbigndmFsaWRpdHlDaGFuZ2UnLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBmb3JtVmFsaWQgPSBPYmplY3Qua2V5cyhldmVudC5maWVsZHMpLmV2ZXJ5KGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2ZW50LmZpZWxkc1trZXldLmlzVmFsaWQ7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICB0aGlzLmZvcm1WYWxpZCA9IGZvcm1WYWxpZDtcblxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmICghdGhpcy5mb3JtU3VibWlzc2lvblN1YnNjcmliZWQpIHtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHdyYXBwZXIgKyAnIGJ1dHRvbicpLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICdjbGljaycsXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdWJtaXQoY29udGV4dENvbmZpZyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuZm9ybVN1Ym1pc3Npb25TdWJzY3JpYmVkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BheW1lbnRfbWV0aG9kX3BwY3AtY3JlZGl0LWNhcmQtZ2F0ZXdheScpLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAnY2xpY2snLFxuICAgICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2xhYmVsW2Zvcj1wcGNwLWNyZWRpdC1jYXJkLWdhdGV3YXktY2FyZC1udW1iZXJdJykuY2xpY2soKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKVxuICAgIH1cblxuICAgIGRpc2FibGVGaWVsZHMoKSB7XG4gICAgICAgIGlmKCB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ251bWJlcicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ2N2dicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ2V4cGlyYXRpb25EYXRlJyxcbiAgICAgICAgICAgICAgICBhdHRyaWJ1dGU6ICdkaXNhYmxlZCdcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBlbmFibGVGaWVsZHMoKSB7XG4gICAgICAgIGlmKCB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2UucmVtb3ZlQXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ251bWJlcicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2UucmVtb3ZlQXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ2N2dicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2UucmVtb3ZlQXR0cmlid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GhlbigoZGF0YSk9PntcbiAgICAgICAgY29uc3QgaXNWYWxpZCA9IHZhbGlkYXRlVG9rZW4oZGF0YSwgY29uZmlnLnVzZXIpO1xuICAgICAgICBpZiAoIWlzVmFsaWQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBzdG9yZVRva2VuKGRhdGEpO1xuICAgICAgICBzY3JpcHQuc2V0QXR0cmlidXRlKCdkYXRhLWNsaWVudC10b2tlbicsIGRhdGEudG9rZW4pO1xuICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZChzY3JpcHQpO1xuICAgIH0pO1xufVxuXG5leHBvcnQgZGVmYXVsdCBkYXRhQ2xpZW50SWRBdHRyaWJ1dGVIYW5kbGVyO1xuIiwiY2xhc3MgTWVzc2FnZVJlbmRlcmVyIHtcblxuICAgIGNvbnN0cnVjdG9yKGNvbmZpZykge1xuICAgICAgICB0aGlzLmNvbmZpZyA9IGNvbmZpZztcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIGlmICghIHRoaXMuc2hvdWxkUmVuZGVyKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHBheXBhbC5NZXNzYWdlcyh7XG4gICAgICAgICAgICBhbW91bnQ6IHRoaXMuY29uZmlnLmFtb3VudCxcbiAgICAgICAgICAgIHBsYWNlbWVudDogdGhpcy5jb25maWcucGxhY2VtZW50LFxuICAgICAgICAgICAgc3R5bGU6IHRoaXMuY29uZmlnLnN0eWxlXG4gICAgICAgIH0pLnJlbmRlcih0aGlzLmNvbmZpZy53cmFwcGVyKTtcbiAgICB9XG5cbiAgICByZW5kZXJXaXRoQW1vdW50KGFtb3VudCkge1xuXG4gICAgICAgIGlmICghIHRoaXMuc2hvdWxkUmVuZGVyKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IG5ld1dyYXBwZXIgPSBkb2N1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xuICAgICAgICBjb25zdCBjYXJ0Qm9vdHN0cmFwID0gbmV3IENhcnRCb290c3RyYXAoXG4gICAgICAgICAgICBQYXlQYWxDb21tZXJjZUdhdGV3YXksXG4gICAgICAgICAgICByZW5kZXJlcixcbiAgICAgICAgKTtcblxuICAgICAgICBjYXJ0Qm9vdHN0cmFwLmluaXQoKTtcbiAgICB9XG5cbiAgICBpZiAoY29udGV4dCA9PT0gJ2NoZWNrb3V0Jykge1xuICAgICAgICBjb25zdCBjaGVja291dEJvb3RzdGFwID0gbmV3IENoZWNrb3V0Qm9vdHN0YXAoXG4gICAgICAgICAgICBQYXlQYWxDb21tZXJjZUdhdGV3YXksXG4gICAgICAgICAgICByZW5kZXJlcixcbiAgICAgICAgICAgIG1lc3NhZ2VSZW5kZXJlcixcbiAgICAgICAgICAgIHNwaW5uZXJcbiAgICAgICAgKTtcblxuICAgICAgICBjaGVja291dEJvb3RzdGFwLmluaXQoKTtcbiAgICB9XG5cbiAgICBpZiAoY29udGV4dCA9PT0gJ3BheS1ub3cnICkge1xuICAgICAgICBjb25zdCBwYXlOb3dCb290c3RyYXAgPSBuZXcgUGF5Tm93Qm9vdHN0cmFwKFxuICAgICAgICAgICAgUGF5UGFsQ29tbWVyY2VHYXRld2F5LFxuICAgICAgICAgICAgcmVuZGVyZXIsXG4gICAgICAgICAgICBtZXNzYWdlUmVuZGVyZXIsXG4gICAgICAgICAgICBzcGlubmVyXG4gICAgICAgICk7XG4gICAgICAgIHBheU5vd0Jvb3RzdHJhcC5pbml0KCk7XG4gICAgfVxuXG4gICAgaWYgKGNvbnRleHQgIT09ICdjaGVja291dCcpIHtcbiAgICAgICAgbWVzc2FnZVJlbmRlcmVyLnJlbmRlcigpO1xuICAgIH1cbn07XG5kb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICdET01Db250ZW50TG9hZGVkJyxcbiAgICAoKSA9PiB7XG4gICAgICAgIGlmICghdHlwZW9mIChQYXlQYWxDb21tZXJjZUdhdGV3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JvdW5kIiwib3BhY2l0eSIsImJvb3RzdHJhcCIsIm1lc3NhZ2VSZW5kZXJlciIsIm1pbmlfY2FydF9idXR0b25zX2VuYWJsZWQiLCJtaW5pQ2FydEJvb3RzdHJhcCIsInNpbmdsZV9wcm9kdWN0X2J1dHRvbnNfZW5hYmxlZCIsInNpbmdsZVByb2R1Y3RCb290c3RyYXAiLCJjYXJ0Qm9vdHN0cmFwIiwiY2hlY2tvdXRCb290c3RhcCIsInBheU5vd0Jvb3RzdHJhcCIsInVybCIsImVudHJpZXMiLCJzY3JpcHRfYXR0cmlidXRlcyIsImtleVZhbHVlIiwiZGF0YV9jbGllbnRfaWQiLCJzZXRfYXR0cmlidXRlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///94\n")}},__webpack_exports__={};__webpack_modules__[94]()})();
1
+ (()=>{"use strict";var __webpack_modules__={964:()=>{eval("\n;// CONCATENATED MODULE: ./resources/js/modules/ErrorHandler.js\nclass ErrorHandler {\n constructor(genericErrorText) {\n this.genericErrorText = genericErrorText;\n this.wrapper = document.querySelector('.woocommerce-notices-wrapper');\n this.messagesList = document.querySelector('ul.woocommerce-error');\n }\n\n genericError() {\n if (this.wrapper.classList.contains('ppcp-persist')) {\n return;\n }\n\n this.clear();\n this.message(this.genericErrorText);\n }\n\n appendPreparedErrorMessageElement(errorMessageElement) {\n if (this.messagesList === null) {\n this.prepareMessagesList();\n }\n\n this.messagesList.replaceWith(errorMessageElement);\n }\n\n message(text, persist = false) {\n if (!typeof String || text.length === 0) {\n throw new Error('A new message text must be a non-empty string.');\n }\n\n if (this.messagesList === null) {\n this.prepareMessagesList();\n }\n\n if (persist) {\n this.wrapper.classList.add('ppcp-persist');\n } else {\n this.wrapper.classList.remove('ppcp-persist');\n }\n\n let messageNode = this.prepareMessagesListItem(text);\n this.messagesList.appendChild(messageNode);\n jQuery.scroll_to_notices(jQuery('.woocommerce-notices-wrapper'));\n }\n\n prepareMessagesList() {\n if (this.messagesList === null) {\n this.messagesList = document.createElement('ul');\n this.messagesList.setAttribute('class', 'woocommerce-error');\n this.messagesList.setAttribute('role', 'alert');\n this.wrapper.appendChild(this.messagesList);\n }\n }\n\n prepareMessagesListItem(message) {\n const li = document.createElement('li');\n li.innerHTML = message;\n return li;\n }\n\n sanitize(text) {\n const textarea = document.createElement('textarea');\n textarea.innerHTML = text;\n return textarea.value.replace('Error: ', '');\n }\n\n clear() {\n if (this.messagesList === null) {\n return;\n }\n\n this.messagesList.innerHTML = '';\n }\n\n}\n\n/* harmony default export */ const modules_ErrorHandler = (ErrorHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/OnApproveHandler/onApproveForContinue.js\nconst onApprove = (context, errorHandler) => {\n return (data, actions) => {\n return fetch(context.config.ajax.approve_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: context.config.ajax.approve_order.nonce,\n order_id: data.orderID\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n if (!data.success) {\n errorHandler.genericError();\n return actions.restart().catch(err => {\n errorHandler.genericError();\n });\n ;\n }\n\n location.href = context.config.redirect;\n });\n };\n};\n\n/* harmony default export */ const onApproveForContinue = (onApprove);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/PayerData.js\nconst payerData = () => {\n const payer = PayPalCommerceGateway.payer;\n\n if (!payer) {\n return null;\n }\n\n const phone = document.querySelector('#billing_phone') || typeof payer.phone !== 'undefined' ? {\n phone_type: \"HOME\",\n phone_number: {\n national_number: document.querySelector('#billing_phone') ? document.querySelector('#billing_phone').value : payer.phone.phone_number.national_number\n }\n } : null;\n const payerData = {\n email_address: document.querySelector('#billing_email') ? document.querySelector('#billing_email').value : payer.email_address,\n name: {\n surname: document.querySelector('#billing_last_name') ? document.querySelector('#billing_last_name').value : payer.name.surname,\n given_name: document.querySelector('#billing_first_name') ? document.querySelector('#billing_first_name').value : payer.name.given_name\n },\n address: {\n country_code: document.querySelector('#billing_country') ? document.querySelector('#billing_country').value : payer.address.country_code,\n address_line_1: document.querySelector('#billing_address_1') ? document.querySelector('#billing_address_1').value : payer.address.address_line_1,\n address_line_2: document.querySelector('#billing_address_2') ? document.querySelector('#billing_address_2').value : payer.address.address_line_2,\n admin_area_1: document.querySelector('#billing_state') ? document.querySelector('#billing_state').value : payer.address.admin_area_1,\n admin_area_2: document.querySelector('#billing_city') ? document.querySelector('#billing_city').value : payer.address.admin_area_2,\n postal_code: document.querySelector('#billing_postcode') ? document.querySelector('#billing_postcode').value : payer.address.postal_code\n }\n };\n\n if (phone) {\n payerData.phone = phone;\n }\n\n return payerData;\n};\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/CartActionHandler.js\n\n\n\nclass CartActionHandler {\n constructor(config, errorHandler) {\n this.config = config;\n this.errorHandler = errorHandler;\n }\n\n configuration() {\n const createOrder = (data, actions) => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n purchase_units: [],\n bn_code: bnCode,\n payer,\n context: this.config.context\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n console.error(data);\n throw Error(data.data.message);\n }\n\n return data.data.id;\n });\n };\n\n return {\n createOrder,\n onApprove: onApproveForContinue(this, this.errorHandler),\n onError: error => {\n this.errorHandler.genericError();\n }\n };\n }\n\n}\n\n/* harmony default export */ const ActionHandler_CartActionHandler = (CartActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/MiniCartBootstap.js\n\n\n\nclass MiniCartBootstap {\n constructor(gateway, renderer) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.actionHandler = null;\n }\n\n init() {\n this.actionHandler = new ActionHandler_CartActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.render();\n jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => {\n this.render();\n });\n }\n\n shouldRender() {\n return document.querySelector(this.gateway.button.mini_cart_wrapper) !== null || document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !== null;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n this.renderer.render(this.gateway.button.mini_cart_wrapper, this.gateway.hosted_fields.mini_cart_wrapper, this.actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_MiniCartBootstap = (MiniCartBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/UpdateCart.js\n\n\nclass UpdateCart {\n constructor(endpoint, nonce) {\n this.endpoint = endpoint;\n this.nonce = nonce;\n }\n /**\n *\n * @param onResolve\n * @param {Product[]} products\n * @returns {Promise<unknown>}\n */\n\n\n update(onResolve, products) {\n return new Promise((resolve, reject) => {\n fetch(this.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.nonce,\n products\n })\n }).then(result => {\n return result.json();\n }).then(result => {\n if (!result.success) {\n reject(result.data);\n return;\n }\n\n const resolved = onResolve(result.data);\n resolve(resolved);\n });\n });\n }\n\n}\n\n/* harmony default export */ const Helper_UpdateCart = (UpdateCart);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/ButtonsToggleListener.js\n/**\n * When you can't add something to the cart, the PayPal buttons should not show.\n * Therefore we listen for changes on the add to cart button and show/hide the buttons accordingly.\n */\nclass ButtonsToggleListener {\n constructor(element, showCallback, hideCallback) {\n this.element = element;\n this.showCallback = showCallback;\n this.hideCallback = hideCallback;\n this.observer = null;\n }\n\n init() {\n const config = {\n attributes: true\n };\n\n const callback = () => {\n if (this.element.classList.contains('disabled')) {\n this.hideCallback();\n return;\n }\n\n this.showCallback();\n };\n\n this.observer = new MutationObserver(callback);\n this.observer.observe(this.element, config);\n callback();\n }\n\n disconnect() {\n this.observer.disconnect();\n }\n\n}\n\n/* harmony default export */ const Helper_ButtonsToggleListener = (ButtonsToggleListener);\n;// CONCATENATED MODULE: ./resources/js/modules/Entity/Product.js\nclass Product {\n constructor(id, quantity, variations) {\n this.id = id;\n this.quantity = quantity;\n this.variations = variations;\n }\n\n data() {\n return {\n id: this.id,\n quantity: this.quantity,\n variations: this.variations\n };\n }\n\n}\n\n/* harmony default export */ const Entity_Product = (Product);\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/SingleProductActionHandler.js\n\n\n\n\n\nclass SingleProductActionHandler {\n constructor(config, updateCart, showButtonCallback, hideButtonCallback, formElement, errorHandler) {\n this.config = config;\n this.updateCart = updateCart;\n this.showButtonCallback = showButtonCallback;\n this.hideButtonCallback = hideButtonCallback;\n this.formElement = formElement;\n this.errorHandler = errorHandler;\n }\n\n configuration() {\n if (this.hasVariations()) {\n const observer = new Helper_ButtonsToggleListener(this.formElement.querySelector('.single_add_to_cart_button'), this.showButtonCallback, this.hideButtonCallback);\n observer.init();\n }\n\n return {\n createOrder: this.createOrder(),\n onApprove: onApproveForContinue(this, this.errorHandler),\n onError: error => {\n this.errorHandler.genericError();\n }\n };\n }\n\n createOrder() {\n var getProducts = null;\n\n if (!this.isGroupedProduct()) {\n getProducts = () => {\n const id = document.querySelector('[name=\"add-to-cart\"]').value;\n const qty = document.querySelector('[name=\"quantity\"]').value;\n const variations = this.variations();\n return [new Entity_Product(id, qty, variations)];\n };\n } else {\n getProducts = () => {\n const products = [];\n this.formElement.querySelectorAll('input[type=\"number\"]').forEach(element => {\n if (!element.value) {\n return;\n }\n\n const elementName = element.getAttribute('name').match(/quantity\\[([\\d]*)\\]/);\n\n if (elementName.length !== 2) {\n return;\n }\n\n const id = parseInt(elementName[1]);\n const quantity = parseInt(element.value);\n products.push(new Entity_Product(id, quantity, null));\n });\n return products;\n };\n }\n\n const createOrder = (data, actions) => {\n this.errorHandler.clear();\n\n const onResolve = purchase_units => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n purchase_units,\n payer,\n bn_code: bnCode,\n context: this.config.context\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n console.error(data);\n throw Error(data.data.message);\n }\n\n return data.data.id;\n });\n };\n\n const promise = this.updateCart.update(onResolve, getProducts());\n return promise;\n };\n\n return createOrder;\n }\n\n variations() {\n if (!this.hasVariations()) {\n return null;\n }\n\n const attributes = [...this.formElement.querySelectorAll(\"[name^='attribute_']\")].map(element => {\n return {\n value: element.value,\n name: element.name\n };\n });\n return attributes;\n }\n\n hasVariations() {\n return this.formElement.classList.contains('variations_form');\n }\n\n isGroupedProduct() {\n return this.formElement.classList.contains('grouped_form');\n }\n\n}\n\n/* harmony default export */ const ActionHandler_SingleProductActionHandler = (SingleProductActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/SingleProductBootstap.js\n\n\n\n\nclass SingleProductBootstap {\n constructor(gateway, renderer, messages) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.messages = messages;\n }\n\n init() {\n if (!this.shouldRender()) {\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n return;\n }\n\n this.render();\n }\n\n shouldRender() {\n if (document.querySelector('form.cart') === null) {\n return false;\n }\n\n return true;\n }\n\n render() {\n const actionHandler = new ActionHandler_SingleProductActionHandler(this.gateway, new Helper_UpdateCart(this.gateway.ajax.change_cart.endpoint, this.gateway.ajax.change_cart.nonce), () => {\n this.renderer.showButtons(this.gateway.button.wrapper);\n this.renderer.showButtons(this.gateway.hosted_fields.wrapper);\n let priceText = \"0\";\n\n if (document.querySelector('form.cart ins .woocommerce-Price-amount')) {\n priceText = document.querySelector('form.cart ins .woocommerce-Price-amount').innerText;\n } else if (document.querySelector('form.cart .woocommerce-Price-amount')) {\n priceText = document.querySelector('form.cart .woocommerce-Price-amount').innerText;\n }\n\n const amount = parseInt(priceText.replace(/([^\\d,\\.\\s]*)/g, ''));\n this.messages.renderWithAmount(amount);\n }, () => {\n this.renderer.hideButtons(this.gateway.button.wrapper);\n this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);\n }, document.querySelector('form.cart'), new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_SingleProductBootstap = (SingleProductBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/CartBootstap.js\n\n\n\nclass CartBootstrap {\n constructor(gateway, renderer) {\n this.gateway = gateway;\n this.renderer = renderer;\n }\n\n init() {\n if (!this.shouldRender()) {\n return;\n }\n\n this.render();\n jQuery(document.body).on('updated_cart_totals updated_checkout', () => {\n this.render();\n });\n }\n\n shouldRender() {\n return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;\n }\n\n render() {\n const actionHandler = new ActionHandler_CartActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic));\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n }\n\n}\n\n/* harmony default export */ const CartBootstap = (CartBootstrap);\n;// CONCATENATED MODULE: ./resources/js/modules/OnApproveHandler/onApproveForPayNow.js\nconst onApproveForPayNow_onApprove = (context, errorHandler, spinner) => {\n return (data, actions) => {\n spinner.block();\n errorHandler.clear();\n return fetch(context.config.ajax.approve_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: context.config.ajax.approve_order.nonce,\n order_id: data.orderID\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n spinner.unblock();\n\n if (!data.success) {\n if (data.data.code === 100) {\n errorHandler.message(data.data.message);\n } else {\n errorHandler.genericError();\n }\n\n if (typeof actions !== 'undefined' && typeof actions.restart !== 'undefined') {\n return actions.restart();\n }\n\n throw new Error(data.data.message);\n }\n\n document.querySelector('#place_order').click();\n });\n };\n};\n\n/* harmony default export */ const onApproveForPayNow = (onApproveForPayNow_onApprove);\n;// CONCATENATED MODULE: ./resources/js/modules/ActionHandler/CheckoutActionHandler.js\n\n\n\nclass CheckoutActionHandler {\n constructor(config, errorHandler, spinner) {\n this.config = config;\n this.errorHandler = errorHandler;\n this.spinner = spinner;\n }\n\n configuration() {\n const spinner = this.spinner;\n\n const createOrder = (data, actions) => {\n const payer = payerData();\n const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ? this.config.bn_codes[this.config.context] : '';\n const errorHandler = this.errorHandler;\n const formSelector = this.config.context === 'checkout' ? 'form.checkout' : 'form#order_review';\n const formValues = jQuery(formSelector).serialize();\n const createaccount = jQuery('#createaccount').is(\":checked\") ? true : false;\n return fetch(this.config.ajax.create_order.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: this.config.ajax.create_order.nonce,\n payer,\n bn_code: bnCode,\n context: this.config.context,\n order_id: this.config.order_id,\n form: formValues,\n createaccount: createaccount\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n spinner.unblock(); //handle both messages sent from Woocommerce (data.messages) and this plugin (data.data.message)\n\n if (typeof data.messages !== 'undefined') {\n const domParser = new DOMParser();\n errorHandler.appendPreparedErrorMessageElement(domParser.parseFromString(data.messages, 'text/html').querySelector('ul'));\n } else {\n errorHandler.message(data.data.message, true);\n }\n\n return;\n }\n\n const input = document.createElement('input');\n input.setAttribute('type', 'hidden');\n input.setAttribute('name', 'ppcp-resume-order');\n input.setAttribute('value', data.data.purchase_units[0].custom_id);\n document.querySelector(formSelector).append(input);\n return data.data.id;\n });\n };\n\n return {\n createOrder,\n onApprove: onApproveForPayNow(this, this.errorHandler, this.spinner),\n onCancel: () => {\n spinner.unblock();\n },\n onError: () => {\n this.errorHandler.genericError();\n spinner.unblock();\n }\n };\n }\n\n}\n\n/* harmony default export */ const ActionHandler_CheckoutActionHandler = (CheckoutActionHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/Hiding.js\nconst getElement = selectorOrElement => {\n if (typeof selectorOrElement === 'string') {\n return document.querySelector(selectorOrElement);\n }\n\n return selectorOrElement;\n};\n\nconst isVisible = element => {\n return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length);\n};\nconst setVisible = (selectorOrElement, show, important = false) => {\n const element = getElement(selectorOrElement);\n\n if (!element) {\n return;\n }\n\n const currentValue = element.style.getPropertyValue('display');\n\n if (!show) {\n if (currentValue === 'none') {\n return;\n }\n\n element.style.setProperty('display', 'none', important ? 'important' : '');\n } else {\n if (currentValue === 'none') {\n element.style.removeProperty('display');\n } // still not visible (if something else added display: none in CSS)\n\n\n if (!isVisible(element)) {\n element.style.setProperty('display', 'block');\n }\n }\n};\nconst hide = (selectorOrElement, important = false) => {\n setVisible(selectorOrElement, false, important);\n};\nconst show = selectorOrElement => {\n setVisible(selectorOrElement, true);\n};\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/CheckoutBootstap.js\n\n\n\n\nclass CheckoutBootstap {\n constructor(gateway, renderer, messages, spinner) {\n this.gateway = gateway;\n this.renderer = renderer;\n this.messages = messages;\n this.spinner = spinner;\n this.standardOrderButtonSelector = '#place_order';\n this.buttonChangeObserver = new MutationObserver(el => {\n this.updateUi();\n });\n }\n\n init() {\n this.render(); // Unselect saved card.\n // WC saves form values, so with our current UI it would be a bit weird\n // if the user paid with saved, then after some time tries to pay again,\n // but wants to enter a new card, and to do that they have to choose “Select payment” in the list.\n\n jQuery('#saved-credit-card').val(jQuery('#saved-credit-card option:first').val());\n jQuery(document.body).on('updated_checkout', () => {\n this.render();\n });\n jQuery(document.body).on('updated_checkout payment_method_selected', () => {\n this.updateUi();\n });\n jQuery(document).on('hosted_fields_loaded', () => {\n jQuery('#saved-credit-card').on('change', () => {\n this.updateUi();\n });\n });\n this.updateUi();\n }\n\n shouldRender() {\n if (document.querySelector(this.gateway.button.cancel_wrapper)) {\n return false;\n }\n\n return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n if (document.querySelector(this.gateway.hosted_fields.wrapper + '>div')) {\n document.querySelector(this.gateway.hosted_fields.wrapper + '>div').setAttribute('style', '');\n }\n\n const actionHandler = new ActionHandler_CheckoutActionHandler(PayPalCommerceGateway, new modules_ErrorHandler(this.gateway.labels.error.generic), this.spinner);\n this.renderer.render(this.gateway.button.wrapper, this.gateway.hosted_fields.wrapper, actionHandler.configuration());\n this.buttonChangeObserver.observe(document.querySelector(this.standardOrderButtonSelector), {\n attributes: true\n });\n }\n\n updateUi() {\n const currentPaymentMethod = this.currentPaymentMethod();\n const isPaypal = currentPaymentMethod === 'ppcp-gateway';\n const isCard = currentPaymentMethod === 'ppcp-credit-card-gateway';\n const isSavedCard = isCard && this.isSavedCardSelected();\n const isNotOurGateway = !isPaypal && !isCard;\n setVisible(this.standardOrderButtonSelector, isNotOurGateway || isSavedCard, true);\n setVisible(this.gateway.button.wrapper, isPaypal);\n setVisible(this.gateway.messages.wrapper, isPaypal);\n setVisible(this.gateway.hosted_fields.wrapper, isCard && !isSavedCard);\n\n if (isPaypal) {\n this.messages.render();\n }\n\n if (isCard) {\n if (isSavedCard) {\n this.disableCreditCardFields();\n } else {\n this.enableCreditCardFields();\n }\n }\n }\n\n disableCreditCardFields() {\n jQuery('label[for=\"ppcp-credit-card-gateway-card-number\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-number').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-expiry\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-expiry').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-cvc\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-cvc').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"vault\"]').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').addClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').attr(\"disabled\", true);\n this.renderer.disableCreditCardFields();\n }\n\n enableCreditCardFields() {\n jQuery('label[for=\"ppcp-credit-card-gateway-card-number\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-number').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-expiry\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-expiry').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"ppcp-credit-card-gateway-card-cvc\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-gateway-card-cvc').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('label[for=\"vault\"]').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').removeClass('ppcp-credit-card-gateway-form-field-disabled');\n jQuery('#ppcp-credit-card-vault').attr(\"disabled\", false);\n this.renderer.enableCreditCardFields();\n }\n\n currentPaymentMethod() {\n return jQuery('input[name=\"payment_method\"]:checked').val();\n }\n\n isSavedCardSelected() {\n const savedCardList = jQuery('#saved-credit-card');\n return savedCardList.length && savedCardList.val() !== '';\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_CheckoutBootstap = (CheckoutBootstap);\n;// CONCATENATED MODULE: ./resources/js/modules/ContextBootstrap/PayNowBootstrap.js\n\n\nclass PayNowBootstrap extends ContextBootstrap_CheckoutBootstap {\n constructor(gateway, renderer, messages, spinner) {\n super(gateway, renderer, messages, spinner);\n }\n\n updateUi() {\n const urlParams = new URLSearchParams(window.location.search);\n\n if (urlParams.has('change_payment_method')) {\n return;\n }\n\n super.updateUi();\n }\n\n}\n\n/* harmony default export */ const ContextBootstrap_PayNowBootstrap = (PayNowBootstrap);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/Renderer.js\nclass Renderer {\n constructor(creditCardRenderer, defaultConfig) {\n this.defaultConfig = defaultConfig;\n this.creditCardRenderer = creditCardRenderer;\n }\n\n render(wrapper, hostedFieldsWrapper, contextConfig) {\n this.renderButtons(wrapper, contextConfig);\n this.creditCardRenderer.render(hostedFieldsWrapper, contextConfig);\n }\n\n renderButtons(wrapper, contextConfig) {\n if (!document.querySelector(wrapper) || this.isAlreadyRendered(wrapper) || 'undefined' === typeof paypal.Buttons) {\n return;\n }\n\n const style = wrapper === this.defaultConfig.button.wrapper ? this.defaultConfig.button.style : this.defaultConfig.button.mini_cart_style;\n paypal.Buttons({\n style,\n ...contextConfig\n }).render(wrapper);\n }\n\n isAlreadyRendered(wrapper) {\n return document.querySelector(wrapper).hasChildNodes();\n }\n\n hideButtons(element) {\n const domElement = document.querySelector(element);\n\n if (!domElement) {\n return false;\n }\n\n domElement.style.display = 'none';\n return true;\n }\n\n showButtons(element) {\n const domElement = document.querySelector(element);\n\n if (!domElement) {\n return false;\n }\n\n domElement.style.display = 'block';\n return true;\n }\n\n disableCreditCardFields() {\n this.creditCardRenderer.disableFields();\n }\n\n enableCreditCardFields() {\n this.creditCardRenderer.enableFields();\n }\n\n}\n\n/* harmony default export */ const Renderer_Renderer = (Renderer);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/DccInputFactory.js\nconst dccInputFactory = original => {\n const styles = window.getComputedStyle(original);\n const newElement = document.createElement('span');\n newElement.setAttribute('id', original.id);\n Object.values(styles).forEach(prop => {\n if (!styles[prop] || !isNaN(prop)) {\n return;\n }\n\n newElement.style.setProperty(prop, '' + styles[prop]);\n });\n return newElement;\n};\n\n/* harmony default export */ const DccInputFactory = (dccInputFactory);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/CreditCardRenderer.js\n\n\nclass CreditCardRenderer {\n constructor(defaultConfig, errorHandler, spinner) {\n this.defaultConfig = defaultConfig;\n this.errorHandler = errorHandler;\n this.spinner = spinner;\n this.cardValid = false;\n this.formValid = false;\n this.currentHostedFieldsInstance = null;\n this.formSubmissionSubscribed = false;\n }\n\n render(wrapper, contextConfig) {\n if (this.defaultConfig.context !== 'checkout' && this.defaultConfig.context !== 'pay-now' || wrapper === null || document.querySelector(wrapper) === null) {\n return;\n }\n\n if (typeof paypal.HostedFields === 'undefined' || !paypal.HostedFields.isEligible()) {\n const wrapperElement = document.querySelector(wrapper);\n wrapperElement.parentNode.removeChild(wrapperElement);\n return;\n }\n\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.teardown().catch(err => console.error(`Hosted fields teardown error: ${err}`));\n this.currentHostedFieldsInstance = null;\n }\n\n const gateWayBox = document.querySelector('.payment_box.payment_method_ppcp-credit-card-gateway');\n const oldDisplayStyle = gateWayBox.style.display;\n gateWayBox.style.display = 'block';\n const hideDccGateway = document.querySelector('#ppcp-hide-dcc');\n\n if (hideDccGateway) {\n hideDccGateway.parentNode.removeChild(hideDccGateway);\n }\n\n const cardNumberField = document.querySelector('#ppcp-credit-card-gateway-card-number');\n const stylesRaw = window.getComputedStyle(cardNumberField);\n let styles = {};\n Object.values(stylesRaw).forEach(prop => {\n if (!stylesRaw[prop]) {\n return;\n }\n\n styles[prop] = '' + stylesRaw[prop];\n });\n const cardNumber = DccInputFactory(cardNumberField);\n cardNumberField.parentNode.replaceChild(cardNumber, cardNumberField);\n const cardExpiryField = document.querySelector('#ppcp-credit-card-gateway-card-expiry');\n const cardExpiry = DccInputFactory(cardExpiryField);\n cardExpiryField.parentNode.replaceChild(cardExpiry, cardExpiryField);\n const cardCodeField = document.querySelector('#ppcp-credit-card-gateway-card-cvc');\n const cardCode = DccInputFactory(cardCodeField);\n cardCodeField.parentNode.replaceChild(cardCode, cardCodeField);\n gateWayBox.style.display = oldDisplayStyle;\n const formWrapper = '.payment_box payment_method_ppcp-credit-card-gateway';\n\n if (this.defaultConfig.enforce_vault && document.querySelector(formWrapper + ' .ppcp-credit-card-vault')) {\n document.querySelector(formWrapper + ' .ppcp-credit-card-vault').checked = true;\n document.querySelector(formWrapper + ' .ppcp-credit-card-vault').setAttribute('disabled', true);\n }\n\n paypal.HostedFields.render({\n createOrder: contextConfig.createOrder,\n styles: {\n 'input': styles\n },\n fields: {\n number: {\n selector: '#ppcp-credit-card-gateway-card-number',\n placeholder: this.defaultConfig.hosted_fields.labels.credit_card_number\n },\n cvv: {\n selector: '#ppcp-credit-card-gateway-card-cvc',\n placeholder: this.defaultConfig.hosted_fields.labels.cvv\n },\n expirationDate: {\n selector: '#ppcp-credit-card-gateway-card-expiry',\n placeholder: this.defaultConfig.hosted_fields.labels.mm_yy\n }\n }\n }).then(hostedFields => {\n document.dispatchEvent(new CustomEvent(\"hosted_fields_loaded\"));\n this.currentHostedFieldsInstance = hostedFields;\n hostedFields.on('inputSubmitRequest', () => {\n this._submit(contextConfig);\n });\n hostedFields.on('cardTypeChange', event => {\n if (!event.cards.length) {\n this.cardValid = false;\n return;\n }\n\n const validCards = this.defaultConfig.hosted_fields.valid_cards;\n this.cardValid = validCards.indexOf(event.cards[0].type) !== -1;\n });\n hostedFields.on('validityChange', event => {\n const formValid = Object.keys(event.fields).every(function (key) {\n return event.fields[key].isValid;\n });\n this.formValid = formValid;\n });\n\n if (!this.formSubmissionSubscribed) {\n document.querySelector(wrapper + ' button').addEventListener('click', event => {\n event.preventDefault();\n\n this._submit(contextConfig);\n });\n this.formSubmissionSubscribed = true;\n }\n });\n document.querySelector('#payment_method_ppcp-credit-card-gateway').addEventListener('click', () => {\n document.querySelector('label[for=ppcp-credit-card-gateway-card-number]').click();\n });\n }\n\n disableFields() {\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.setAttribute({\n field: 'number',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.setAttribute({\n field: 'cvv',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.setAttribute({\n field: 'expirationDate',\n attribute: 'disabled'\n });\n }\n }\n\n enableFields() {\n if (this.currentHostedFieldsInstance) {\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'number',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'cvv',\n attribute: 'disabled'\n });\n this.currentHostedFieldsInstance.removeAttribute({\n field: 'expirationDate',\n attribute: 'disabled'\n });\n }\n }\n\n _submit(contextConfig) {\n this.spinner.block();\n this.errorHandler.clear();\n\n if (this.formValid && this.cardValid) {\n const save_card = this.defaultConfig.save_card ? true : false;\n let vault = document.getElementById('ppcp-credit-card-vault') ? document.getElementById('ppcp-credit-card-vault').checked : save_card;\n\n if (this.defaultConfig.enforce_vault) {\n vault = true;\n }\n\n const contingency = this.defaultConfig.hosted_fields.contingency;\n const hostedFieldsData = {\n vault: vault\n };\n\n if (contingency !== 'NO_3D_SECURE') {\n hostedFieldsData.contingencies = [contingency];\n }\n\n if (this.defaultConfig.payer) {\n hostedFieldsData.cardholderName = this.defaultConfig.payer.name.given_name + ' ' + this.defaultConfig.payer.name.surname;\n }\n\n if (!hostedFieldsData.cardholderName) {\n const firstName = document.getElementById('billing_first_name') ? document.getElementById('billing_first_name').value : '';\n const lastName = document.getElementById('billing_last_name') ? document.getElementById('billing_last_name').value : '';\n\n if (!firstName || !lastName) {\n this.spinner.unblock();\n this.errorHandler.message(this.defaultConfig.hosted_fields.labels.cardholder_name_required);\n return;\n }\n\n hostedFieldsData.cardholderName = firstName + ' ' + lastName;\n }\n\n this.currentHostedFieldsInstance.submit(hostedFieldsData).then(payload => {\n payload.orderID = payload.orderId;\n this.spinner.unblock();\n return contextConfig.onApprove(payload);\n }).catch(err => {\n console.error(err);\n this.spinner.unblock();\n });\n } else {\n this.spinner.unblock();\n const message = !this.cardValid ? this.defaultConfig.hosted_fields.labels.card_not_supported : this.defaultConfig.hosted_fields.labels.fields_not_valid;\n this.errorHandler.message(message);\n }\n }\n\n}\n\n/* harmony default export */ const Renderer_CreditCardRenderer = (CreditCardRenderer);\n;// CONCATENATED MODULE: ./resources/js/modules/DataClientIdAttributeHandler.js\nconst storageKey = 'ppcp-data-client-id';\n\nconst validateToken = (token, user) => {\n if (!token) {\n return false;\n }\n\n if (token.user !== user) {\n return false;\n }\n\n const currentTime = new Date().getTime();\n const isExpired = currentTime >= token.expiration * 1000;\n return !isExpired;\n};\n\nconst storedTokenForUser = user => {\n const token = JSON.parse(sessionStorage.getItem(storageKey));\n\n if (validateToken(token, user)) {\n return token.token;\n }\n\n return null;\n};\n\nconst storeToken = token => {\n sessionStorage.setItem(storageKey, JSON.stringify(token));\n};\n\nconst dataClientIdAttributeHandler = (script, config) => {\n fetch(config.endpoint, {\n method: 'POST',\n body: JSON.stringify({\n nonce: config.nonce\n })\n }).then(res => {\n return res.json();\n }).then(data => {\n const isValid = validateToken(data, config.user);\n\n if (!isValid) {\n return;\n }\n\n storeToken(data);\n script.setAttribute('data-client-token', data.token);\n document.body.append(script);\n });\n};\n\n/* harmony default export */ const DataClientIdAttributeHandler = (dataClientIdAttributeHandler);\n;// CONCATENATED MODULE: ./resources/js/modules/Renderer/MessageRenderer.js\nclass MessageRenderer {\n constructor(config) {\n this.config = config;\n }\n\n render() {\n if (!this.shouldRender()) {\n return;\n }\n\n paypal.Messages({\n amount: this.config.amount,\n placement: this.config.placement,\n style: this.config.style\n }).render(this.config.wrapper);\n }\n\n renderWithAmount(amount) {\n if (!this.shouldRender()) {\n return;\n }\n\n const newWrapper = document.createElement('div');\n newWrapper.setAttribute('id', this.config.wrapper.replace('#', ''));\n const sibling = document.querySelector(this.config.wrapper).nextSibling;\n document.querySelector(this.config.wrapper).parentElement.removeChild(document.querySelector(this.config.wrapper));\n sibling.parentElement.insertBefore(newWrapper, sibling);\n paypal.Messages({\n amount,\n placement: this.config.placement,\n style: this.config.style\n }).render(this.config.wrapper);\n }\n\n shouldRender() {\n if (typeof paypal.Messages === 'undefined' || typeof this.config.wrapper === 'undefined') {\n return false;\n }\n\n if (!document.querySelector(this.config.wrapper)) {\n return false;\n }\n\n return true;\n }\n\n}\n\n/* harmony default export */ const Renderer_MessageRenderer = (MessageRenderer);\n;// CONCATENATED MODULE: ./resources/js/modules/Helper/Spinner.js\nclass Spinner {\n constructor() {\n this.target = 'form.woocommerce-checkout';\n }\n\n setTarget(target) {\n this.target = target;\n }\n\n block() {\n jQuery(this.target).block({\n message: null,\n overlayCSS: {\n background: '#fff',\n opacity: 0.6\n }\n });\n }\n\n unblock() {\n jQuery(this.target).unblock();\n }\n\n}\n\n/* harmony default export */ const Helper_Spinner = (Spinner);\n;// CONCATENATED MODULE: ./resources/js/button.js\n\n\n\n\n\n\n\n\n\n\n\n\nconst bootstrap = () => {\n const errorHandler = new modules_ErrorHandler(PayPalCommerceGateway.labels.error.generic);\n const spinner = new Helper_Spinner();\n const creditCardRenderer = new Renderer_CreditCardRenderer(PayPalCommerceGateway, errorHandler, spinner);\n const renderer = new Renderer_Renderer(creditCardRenderer, PayPalCommerceGateway);\n const messageRenderer = new Renderer_MessageRenderer(PayPalCommerceGateway.messages);\n const context = PayPalCommerceGateway.context;\n\n if (context === 'mini-cart' || context === 'product') {\n if (PayPalCommerceGateway.mini_cart_buttons_enabled === '1') {\n const miniCartBootstrap = new ContextBootstrap_MiniCartBootstap(PayPalCommerceGateway, renderer);\n miniCartBootstrap.init();\n }\n }\n\n if (context === 'product' && PayPalCommerceGateway.single_product_buttons_enabled === '1') {\n const singleProductBootstrap = new ContextBootstrap_SingleProductBootstap(PayPalCommerceGateway, renderer, messageRenderer);\n singleProductBootstrap.init();\n }\n\n if (context === 'cart') {\n const cartBootstrap = new CartBootstap(PayPalCommerceGateway, renderer);\n cartBootstrap.init();\n }\n\n if (context === 'checkout') {\n const checkoutBootstap = new ContextBootstrap_CheckoutBootstap(PayPalCommerceGateway, renderer, messageRenderer, spinner);\n checkoutBootstap.init();\n }\n\n if (context === 'pay-now') {\n const payNowBootstrap = new ContextBootstrap_PayNowBootstrap(PayPalCommerceGateway, renderer, messageRenderer, spinner);\n payNowBootstrap.init();\n }\n\n if (context !== 'checkout') {\n messageRenderer.render();\n }\n};\n\ndocument.addEventListener('DOMContentLoaded', () => {\n if (!typeof PayPalCommerceGateway) {\n console.error('PayPal button could not be configured.');\n return;\n }\n\n const script = document.createElement('script');\n script.addEventListener('load', event => {\n bootstrap();\n });\n script.setAttribute('src', PayPalCommerceGateway.button.url);\n Object.entries(PayPalCommerceGateway.script_attributes).forEach(keyValue => {\n script.setAttribute(keyValue[0], keyValue[1]);\n });\n\n if (PayPalCommerceGateway.data_client_id.set_attribute) {\n DataClientIdAttributeHandler(script, PayPalCommerceGateway.data_client_id);\n return;\n }\n\n document.body.append(script);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTY0LmpzIiwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTUEsWUFBTixDQUFtQjtBQUVmQyxFQUFBQSxXQUFXLENBQUNDLGdCQUFELEVBQ1g7QUFDSSxTQUFLQSxnQkFBTCxHQUF3QkEsZ0JBQXhCO0FBQ0EsU0FBS0MsT0FBTCxHQUFlQyxRQUFRLENBQUNDLGFBQVQsQ0FBdUIsOEJBQXZCLENBQWY7QUFDQSxTQUFLQyxZQUFMLEdBQW9CRixRQUFRLENBQUNDLGFBQVQsQ0FBdUIsc0JBQXZCLENBQXBCO0FBQ0g7O0FBRURFLEVBQUFBLFlBQVksR0FBRztBQUNYLFFBQUksS0FBS0osT0FBTCxDQUFhSyxTQUFiLENBQXVCQyxRQUF2QixDQUFnQyxjQUFoQyxDQUFKLEVBQXFEO0FBQ2pEO0FBQ0g7O0FBQ0QsU0FBS0MsS0FBTDtBQUNBLFNBQUtDLE9BQUwsQ0FBYSxLQUFLVCxnQkFBbEI7QUFDSDs7QUFFRFUsRUFBQUEsaUNBQWlDLENBQUNDLG1CQUFELEVBQ2pDO0FBQ0ksUUFBRyxLQUFLUCxZQUFMLE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zLmpzb24oKTtcbiAgICAgICAgfSkudGhlbigoZGF0YSk9PntcbiAgICAgICAgICAgIGlmICghZGF0YS5zdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JIYW5kbGVyLmdlbmVyaWNFcnJvcigpO1xuICAgICAgICAgICAgICAgIHJldHVybiBhY3Rpb25zLnJlc3RhcnQoKS5jYXRjaChlcnIgPT4ge1xuICAgICAgICAgICAgICAgICAgICBlcnJvckhhbmRsZXIuZ2VuZXJpY0Vycm9yKCk7XG4gICAgICAgICAgICAgICAgfSk7O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IGNvbnRleHQuY29uZmlnLnJlZGlyZWN0O1xuICAgICAgICB9KTtcblxuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgb25BcHByb3ZlO1xuIiwiZXhwb3J0IGNvbnN0IHBheWVyRGF0YSA9ICgpID0+IHtcbiAgICBjb25zdCBwYXllciA9IFBheVBhbENvbW1lcmNlR2F0ZXdheS5wYXllcjtcbiAgICBpZiAoISBwYXllcikge1xuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBjb25zdCBwaG9uZSA9IChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsbGluZ19waG9uZScpIHx8IHR5cGVvZiBwYXllci5waG9uZSAhPT0gJ3VuZGVmaW5lZCcpID9cbiAgICB7XG4gICAgICAgIHBob25lX3R5cGU6XCJIT01FXCIsXG4gICAgICAgICAgICBwaG9uZV9udW1iZXI6e1xuICAgICAgICAgICAgbmF0aW9uYWxfbnVtYmVyIDogKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiaWxsaW5nX3Bob25lJykpID8gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2JpbGxpbmdfcGhvbmUnKS52YWx1ZSA6IHBheWVyLnBob25lLnBob25lX251bWJlci5uYXRpb25hbF9udW1iZXJcbiAgICAgICAgfVxuICAgIH0gO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XIvUGF5ZXJEYXRhXCI7XG5cbmNsYXNzIENhcnRBY3Rpb25IYW5kbGVyIHtcblxuICAgIGNvbnN0cnVjdG9yKGNvbmZpZywgZXJyb3JIYW5kbGVyKSB7XG4gICAgICAgIHRoaXMuY29uZmlnID0gY29uZmlnO1xuICAgICAgICB0aGlzLmVycm9ySGFuZGxlciA9IGVycm9ySGFuZGxlcjtcbiAgICB9XG5cbiAgICBjb25maWd1cmF0aW9uKCkge1xuICAgICAgICBjb25zdCBjcmVhdGVPcmRlciA9IChkYXRhLCBhY3Rpb25zKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBwYXllciA9IHBheWVyRGF0YSgpO1xuICAgICAgICAgICAgY29uc3QgYm5Db2RlID0gdHlwZW9mIHRoaXMuY29uZmlnLmJuX2NvZGVzW3RoaXMuY29uZmlnLmNvbnRleHRdICE9PSAndW5kZWZpbmVkJyA/XG4gICAgICAgICAgICAgICAgdGhpcy5jb25maWcuYm5fY29kZXNbdGhpcy5jb25maWcuY29udGV4dF0gOiAnJztcbiAgICAgICAgICAgIHJldHVybiBmZXRjaCh0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5lbmRwb2ludCwge1xuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgbm9uY2U6IHRoaXMuY29uZmlnLmFqYXguY3JlYXRlX29yZGVyLm5vbmNlLFxuICAgICAgICAgICAgICAgICAgICBwdXJjaGFzZV91bml0czogW10sXG4gICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICBwYXllcixcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dDp0aGlzLmNvbmZpZy5jb250ZXh0XG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uKHJlcykge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXMuanNvbigpO1xuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbihkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihkYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgRXJyb3IoZGF0YS5kYXRhLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0YS5kYXRhLmlkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGNyZWF0ZU9yZGVyLFxuICAgICAgICAgICAgb25BcHByb3ZlOiBvbkFwcHJvdmUodGhpcywgdGhpcy5lcnJvckhhbmRsZXIpLFxuICAgICAgICAgICAgb25FcnJvcjogKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5lcnJvckhhbmRsZXIuZ2VuZXJpY0Vycm9yKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBDYXJ0QWN0aW9uSGFuZGxlcjtcbiIsImltcG9ydCBFcnJvckhhbmRsZXIgZnJvbSAnLi4vRXJyb3JIYW5kbGVyJztcbmltcG9ydCBDYXJ0QWN0aW9uSGFuZGxlciBmcm9tICcuLi9BY3Rpb25IYW5kbGVyL0NhcnRBY3Rpb25IYW5kbGVyJztcblxuY2xhc3MgTWluaUNhcnRCb290c3RhcCB7XG4gICAgY29uc3RydWN0b3IoZ2F0ZXdheSwgcmVuZGVyZXIpIHtcbiAgICAgICAgdGhpcy5nYXRld2F5ID0gZ2F0ZXdheTtcbiAgICAgICAgdGhpcy5yZW5kZXJlciA9IHJlbmRlcmVyO1xuICAgICAgICB0aGlzLmFjdGlvbkhhbmRsZXIgPSBudWxsO1xuICAgIH1cbl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3VyYXRpb24oKVxuICAgICAgICApO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgTWluaUNhcnRCb290c3RhcDsiLCJpbXBvcnQgUHJvZHVjdCBmcm9tIFwiLi4vRW50aXR5L1Byb2R1Y3RcIjtcbmNsYXNzIFVwZGF0ZUNhcnQge1xuXG4gICAgY29uc3RydWN0b3IoZW5kcG9pbnQsIG5vbmNlKVxuICAgIHtcbiAgICAgICAgdGhpcy5lbmRwb2ludCA9IGVuZHBvaW50O1xuICAgICAgICB0aGlzLm5vbmNlID0gbm9uY2U7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICpcbiAgICAgKiBAcGFyYW0gb25SZXNvbHZlXG4gICAgICogQHBhcmFtIHtQcm9kdWN0W119IHByb2R1Y3RzXG4gICAgICogQHJldHVybnMge1Byb21pc2U8dW5rbm93bj59XG4gICAgICovXG4gICAgdXBkYXRlKG9uUmVzb2x2ZSwgcHJvZHVjdHMpXG4gICAge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgZmV0Y2goXG4gICAgICAgICAgICAgICAgdGhpcy5lbmRwb2ludCxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBub25jZTogdGhpcy5ub25jZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2R1Y3RzLFxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICkudGhlbihcbiAgICAgICAgICAgICAgICAocmVzdWx0KSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC5qc29uKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKS50aGVuKChyZXN1bHQpID0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gdGhpcy5mb3JtRWxlbWVudC5xdWVyeVNlbGVjdG9yKCcuc2luZ2xlX2FkZF90b19jYXJ0X2J1dHRvbicpLFxuICAgICAgICAgICAgICAgIHRoaXMuc2hvd0J1dHRvbkNhbGxiYWNrLFxuICAgICAgICAgICAgICAgIHRoaXMuaGlkZUJ1dHRvbkNhbGxiYWNrXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgb2JzZXJ2ZXIuaW5pdCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGNyZWF0ZU9yZGVyOiB0aGlzLmNyZWF0ZU9yZGVyKCksXG4gICAgICAgICAgICBvbkFwcHJvdmU6IG9uQXBwcm92ZSh0aGlzLCB0aGlzLmVycm9ySGFuZGxlciksXG4gICAgICAgICAgICBvbkVycm9yOiAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmVycm9ySGFuZGxlci5nZW5lcmljRXJyb3IoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNyZWF0ZU9yZGVyKClcbiAgICB7XG4gICAgICAgIHZhciBnZXRQcm9kdWN0cyA9IG51bGw7XG4gICAgICAgIGlmICghIHRoaXMuaXNHcm91cGVkUHJvZHVjdCgpICkge1xuICAgICAgICAgICAgZ2V0UHJvZHVjdHMgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaWQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdbbmFtZT1cImFkZC10by1jYXJ0XCJdJykudmFsdWU7XG4gICAgICAgICAgICAgICAgY29uc3QgcXR5ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW25hbWU9XCJxdWFudGl0eVwiXScpLnZhbHVlO1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhcmlhdGlvbnMgPSB0aGlzLnZhcmlhdGlvbnMoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gW25ldyBQcm9kdWN0KGlkLCBxdHksIHZhcmlhdGlvbnMpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGdldFByb2R1Y3RzID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHByb2R1Y3RzID0gW107XG4gICAgICAgICAgICAgICAgdGhpcy5mb3JtRWxlbWVudC5xdWVyeVNlbGVjdG9yQWxsKCdpbnB1dFt0eXBlPVwibnVtYmVyXCJdJykuZm9yRWFjaCgoZWxlbWVudCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoISBlbGVtZW50LnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZWxlbWVudE5hbWUgPSBlbGVtZW50LmdldEF0dHJpYnV0ZSgnbmFtZScpLm1hdGNoKC9xdWFudGl0eVxcWyhbXFxkXSopXFxdLyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50TmFtZS5sZW5ndGggIT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBpZCA9IHBhcnNlSW50KGVsZW1lbnROYW1lWzFdKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcXVhbnRpdHkgPSBwYXJzZUludChlbGVtZW50LnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZHVjdHMucHVzaChuZXcgUHJvZHVjdChpZCwgcXVhbnRpdHksIG51bGwpKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIHJldHVybiBwcm9kdWN0cztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjb25zdCBjcmVhdGVPcmRlciA9IChkYXRhLCBhY3Rpb25zKSA9PiB7XG4gICAgICAgICAgICB0aGlzLmVycm9ySGFuZGxlci5jbGVhcigpO1xuXG4gICAgICAgICAgICBjb25zdCBvblJlc29sdmUgPSAocHVyY2hhc2VfdW5pdHMpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXllciA9IHBheWVyRGF0YSgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGJuQ29kZSA9IHR5cGVvZiB0aGlzLmNvbmZpZy5ibl9jb2Rlc1t0aGlzLmNvbmZpZy5jb250ZXh0XSAhPT0gJ3VuZGVmaW5lZCcgP1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbmZpZy5ibl9jb2Rlc1t0aGlzLmNvbmZpZy5jb250ZXh0XSA6ICcnO1xuICAgICAgICAgICAgICAgIHJldHVybiBmZXRjaCh0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5lbmRwb2ludCwge1xuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9uY2U6IHRoaXMuY29uZmlnLmFqYXguY3JlYXRlX29yZGVyLm5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVyY2hhc2VfdW5pdHMsXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXllcixcbiAgICAgICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dDp0aGlzLmNvbmZpZy5jb250ZXh0XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXMuanNvbigpO1xuICAgICAgICAgICAgICAgIH0pLnRoZW4oZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBFcnJvcihkYXRhLmRhdGEubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEuZGF0YS5pZDtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSB0aGlzLnVwZGF0ZUNhcnQudXBkYXRlKG9uUmVzb2x2ZSwgZ2V0UHJvZHVjdHMoKSk7XG4gICAgICAgICAgICByZXR1cm4gcHJvbWlzZTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGNyZWF0ZU9yZGVyO1xuICAgIH1cblxuICAgIHZhcmlhdGlvbnMoKVxuICAgIHtcblxuICAgICAgICBpZiAoISB0aGlzLmhhc1ZhcmlhdGlvbnMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgYXR0cmlidXRlcyA9IFsuLi50aGlzLmZvcm1FbGVtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXCJbbmFtZV49J2F0dHJpYnV0ZV8nXVwiKV0ubWFwKFxuICAgICAgICAgICAgKGVsZW1lbnQpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOmVsZW1lbnQudmFsdWUsXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6ZWxlbWVudC5uYW1lXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgICAgICByZXR1cm4gYXR0cmlidXRlcztcbiAgICB9XG5cbiAgICBoYXNWYXJpYXRpb25zKClcbiAgICB7XG4gICAgICAgIHJldHVybiB0aGlzLmZvcm1FbGVtZW50LmNsYXNzTGlzdC5jb250YWlucygndmFyaWF0a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ydCcpID09PSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIGNvbnN0IGFjdGlvbkhhbmRsZXIgPSBuZXcgU2luZ2xlUHJvZHVjdEFjdGlvbkhhbmRsZXIoXG4gICAgICAgICAgICB0aGlzLmdhdGV3YXksXG4gICAgICAgICAgICBuZXcgVXBkYXRlQ2FydChcbiAgICAgICAgICAgICAgICB0aGlzLmdhdGV3YXkuYWpheC5jaGFuZ2VfY2FydC5lbmRwb2ludCxcbiAgICAgICAgICAgICAgICB0aGlzLmdhdGV3YXkuYWpheC5jaGFuZ2VfY2FydC5ub25jZSxcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5zaG93QnV0dG9ucyh0aGlzLmdhdGV3YXkuYnV0dG9uLndyYXBwZXIpO1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuc2hvd0J1dHRvbnModGhpcy5nYXRld2F5Lmhvc3RlZF9maWVsZHMud3JhcHBlcik7XG4gICAgICAgICAgICAgICAgbGV0IHByaWNlVGV4dCA9IFwiMFwiO1xuICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdmb3JtLmNhcnQgaW5zIC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKSkge1xuICAgICAgICAgICAgICAgICAgICBwcmljZVRleHQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdmb3JtLmNhcnQgaW5zIC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKS5pbm5lclRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2Zvcm0uY2FydCAud29vY29tbWVyY2UtUHJpY2UtYW1vdW50JykpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJpY2VUZXh0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZm9ybS5jYXJ0IC53b29jb21tZXJjZS1QcmljZS1hbW91bnQnKS5pbm5lclRleHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGFtb3VudCA9IHBhcnNlSW50KHByaWNlVGV4dC5yZXBsYWNlKC8oW15cXGQsXFwuXFxzXSopL2csICcnKSk7XG4gICAgICAgICAgICAgICAgdGhpcy5tZXNzYWdlcy5yZW5kZXJXaXRoQW1vdW50KGFtb3VudClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJlci5oaWRlQnV0dG9ucyh0aGlzLmdhdGV3YXkuYnV0dG9uLndyYXBwZXIpO1xuICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyZXIuaGlkZUJ1dHRvbnModGhpcy5nYXRld2F5Lmhvc3RlZF9maWVsZHMud3JhcHBlcik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZm9ybS5jYXJ0JyksXG4gICAgICAgICAgICBuZXcgRXJyb3JIYW5kbGVyKHRoaXMuZ2F0ZXdheS5sYWJlbHMuZXJyb3IuZ2VuZXJpYyksXG4gICAgICAgICk7XG5cbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoXG4gICAgICAgICAgICB0aGlzLmdhdGV3YXkuYnV0dG9uLndyYXBwZXIsXG4gICAgICAgICAgICB0aGlzLmdhdGV3YXkuaG9zdGVkX2ZpZWxkcy53cmFwcGVyLFxuICAgICAgICAgICAgYWN0aW9uSGFuZGxlci5jb25maWd1cmF0aW9uKCksXG4gICAgICAgICk7XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBTaW5nbGVQcm9kdWN0Qm9vdHN0YXA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G5vbmNlOiB0aGlzLmNvbmZpZy5hamF4LmNyZWF0ZV9vcmRlci5ub25jZSxcbiAgICAgICAgICAgICAgICAgICAgcGF5ZXIsXG4gICAgICAgICAgICAgICAgICAgIGJuX2NvZGU6Ym5Db2RlLFxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0OnRoaXMuY29uZmlnLmNvbnRleHQsXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyX2lkOnRoaXMuY29uZmlnLm9yZGVyX2lkLFxuICAgICAgICAgICAgICAgICAgICBmb3JtOmZvcm1WYWx1ZXMsXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZWFjY291bnQ6IGNyZWF0ZWFjY291bnRcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSkudGhlbihmdW5jdGlvbiAocmVzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5qc29uKCk7XG4gICAgICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFkYXRhLnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgc3Bpbm5lci51bmJsb2NrKCk7XG4gICAgICAgICAgICAgICAgICAgIC8vaGFuZGxlIGJvdGggbWVzc2FnZXMgc2VudCBmcm9tIFdvb2NvbW1lcmNlIChkYXRhLm1lc3NhZ2VzKSBhbmQgdGhpcyBwbHVnaW4gKGRhdGEuZGF0YS5tZXNzYWdlKVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKGRhdGEubWVzc2FnZXMpICE9PSAndW5kZWZpbmVkJyApXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGRvbVBhcnNlciA9IG5ldyBET01QYXJzZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ySGFuZGxlci5hcHBlbmRQcmVwYXJlZEVycm9yTWVzc2FnZUVsZW1lbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9tUGFyc2VyLnBhcnNlRnJvbVN0cmluZyhkYXRhLm1lc3NhZ2VzLCAndGV4dC9odG1sJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnF1ZXJ5U2VsZWN0b3IoJ3VsJylcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvckhhbmRsZXIubWVzc2FnZShkYXRhLmRhdGEubWVzc2FnZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbnN0IGlucHV0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW5wdXQnKTtcbiAgICAgICAgICAgICAgICBpbnB1dC5zZXRBdHRyaWJ1dGUoJ3R5cGUnLCAnaGlkZGVuJyk7XG4gICAgICAgICAgICAgICAgaW5wdXQuc2V0QXR0cmlidXRlKCduYW1lJywgJ3BwY3AtcmVzdW1lLW9yZGVyJyk7XG4gICAgICAgICAgICAgICAgaW5wdXQuc2V0QXR0cmlidXRlKCd2YWx1ZScsIGRhdGEuZGF0YS5wdXJjaGFzZV91bml0c1swXS5jdXN0b21faWQpO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoZm9ybVNlbGVjdG9yKS5hcHBlbmQoaW5wdXQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBkYXRhLmRhdGEuaWQ7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgY3JlYXRlT3JkZXIsXG4gICAgICAgICAgICBvbkFwcHJvdmU6b25BcHByb3ZlKHRoaXMsIHRoaXMuZXJyb3JIYW5kbGVyLCB0aGlzLnNwaW5uZXIpLFxuICAgICAgICA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tcblxuICAgICAgICBpZiAoXG4gICAgICAgICAgICAoXG4gICAgICAgICAgICAgICAgdGhpcy5kZWZhdWx0Q29uZmlnLmNvbnRleHQgIT09ICdjaGVja291dCdcbiAgICAgICAgICAgICAgICAmJiB0aGlzLmRlZmF1bHRDb25maWcuY29udGV4dCAhPT0gJ3BheS1ub3cnXG4gICAgICAgICAgICApXG4gICAgICAgICAgICB8fCB3cmFwcGVyID09PSBudWxsXG4gICAgICAgICAgICB8fCBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHdyYXBwZXIpID09PSBudWxsXG4gICAgICAgICkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIHR5cGVvZiBwYXlwYWwuSG9zdGVkRmllbGRzID09PSAndW5kZWZpbmVkJ1xuICAgICAgICAgICAgfHwgISBwYXlwYWwuSG9zdGVkRmllbGRzLmlzRWxpZ2libGUoKVxuICAgICAgICApIHtcbiAgICAgICAgICAgIGNvbnN0IHdyYXBwZXJFbGVtZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3Rvcih3cmFwcGVyKTtcbiAgICAgICAgICAgIHdyYXBwZXJFbGVtZW50LnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQod3JhcHBlckVsZW1lbnQpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuY3VycmVudEhvc3RlZEZpZWxkc0luc3RhbmNlKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZS50ZWFyZG93bigpXG4gICAgICAgICAgICAgICAgLmNhdGNoKGVyciA9PiBjb25zb2xlLmVycm9yKGBIb3N0ZWQgZmllbGRzIHRlYXJkb3duIGVycm9yOiAke2Vycn1gKSk7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSA9IG51bGw7XG4gICAg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jdnYsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBleHBpcmF0aW9uRGF0ZToge1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcjogJyNwcGNwLWNyZWRpdC1jYXJkLWdhdGV3YXktY2FyZC1leHBpcnknLFxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogdGhpcy5kZWZhdWx0Q29uZmlnLmhvc3RlZF9maWVsZHMubGFiZWxzLm1tX3l5LFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkudGhlbihob3N0ZWRGaWVsZHMgPT4ge1xuICAgICAgICAgICAgZG9jdW1lbnQuZGlzcGF0Y2hFdmVudChuZXcgQ3VzdG9tRXZlbnQoXCJob3N0ZWRfZmllbGRzX2xvYWRlZFwiKSk7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSA9IGhvc3RlZEZpZWxkcztcblxuICAgICAgICAgICAgaG9zdGVkRmllbGRzLm9uKCdpbnB1dFN1Ym1pdFJlcXVlc3QnLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3VibWl0KGNvbnRleHRDb25maWcpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBob3N0ZWRGaWVsZHMub24oJ2NhcmRUeXBlQ2hhbmdlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCAhIGV2ZW50LmNhcmRzLmxlbmd0aCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jYXJkVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCB2YWxpZENhcmRzID0gdGhpcy5kZWZhdWx0Q29uZmlnLmhvc3RlZF9maWVsZHMudmFsaWRfY2FyZHM7XG4gICAgICAgICAgICAgICAgdGhpcy5jYXJkVmFsaWQgPSB2YWxpZENhcmRzLmluZGV4T2YoZXZlbnQuY2FyZHNbMF0udHlwZSkgIT09IC0xO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIGhvc3RlZEZpZWxkcy5vbigndmFsaWRpdHlDaGFuZ2UnLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBmb3JtVmFsaWQgPSBPYmplY3Qua2V5cyhldmVudC5maWVsZHMpLmV2ZXJ5KGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2ZW50LmZpZWxkc1trZXldLmlzVmFsaWQ7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICB0aGlzLmZvcm1WYWxpZCA9IGZvcm1WYWxpZDtcblxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmICghdGhpcy5mb3JtU3VibWlzc2lvblN1YnNjcmliZWQpIHtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHdyYXBwZXIgKyAnIGJ1dHRvbicpLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICdjbGljaycsXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdWJtaXQoY29udGV4dENvbmZpZyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuZm9ybVN1Ym1pc3Npb25TdWJzY3JpYmVkID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BheW1lbnRfbWV0aG9kX3BwY3AtY3JlZGl0LWNhcmQtZ2F0ZXdheScpLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAnY2xpY2snLFxuICAgICAgICAgICAgKCkgPT4ge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2xhYmVsW2Zvcj1wcGNwLWNyZWRpdC1jYXJkLWdhdGV3YXktY2FyZC1udW1iZXJdJykuY2xpY2soKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKVxuICAgIH1cblxuICAgIGRpc2FibGVGaWVsZHMoKSB7XG4gICAgICAgIGlmKCB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ251bWJlcicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ2N2dicsXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlOiAnZGlzYWJsZWQnXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVkRmllbGRzSW5zdGFuY2Uuc2V0QXR0cmlidXRlKHtcbiAgICAgICAgICAgICAgICBmaWVsZDogJ2V4cGlyYXRpb25EYXRlJyxcbiAgICAgICAgICAgICAgICBhdHRyaWJ1dGU6ICdkaXNhYmxlZCdcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBlbmFibGVGaWVsZHMoKSB7XG4gICAgICAgIGlmKCB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50SG9zdGVk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9jYXJkO1xuICAgICAgICAgICAgaWYgKHRoaXMuZGVmYXVsdENvbmZpZy5lbmZvcmNlX3ZhdWx0KSB7XG4gICAgICAgICAgICAgICAgdmF1bHQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29uc3QgY29udGluZ2VuY3kgPSB0aGlzLmRlZmF1bHRDb25maWcuaG9zdGVkX2ZpZWxkcy5jb250aW5nZW5jeTtcbiAgICAgICAgICAgIGNvbnN0IGhvc3RlZEZpZWxkc0RhdGEgPSB7XG4gICAgICAgICAgICAgICAgdmF1bHQ6IHZhdWx0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNvbnRpbmdlbmN5ICE9PSAnTk9fM0RfU0VDVVJFJykge1xuICAgICAgICAgICAgICAgIGhvc3RlZEZpZWxkc0RhdGEuY29udGluZ2VuY2llcyA9IFtjb250aW5nZW5jeV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLmRlZmF1bHRDb25maWcucGF5ZXIpIHtcbiAgICAgICAgICAgICAgICBob3N0ZWRGaWVsZHNEYXRhLmNhcmRob2xkZXJOYW1lID0gdGhpcy5kZWZhdWx0Q29uZmlnLnBheWVyLm5hbWUuZ2l2ZW5fbmFtZSArICcgJyArIHRoaXMuZGVmYXVsdENvbmZpZy5wYXllci5uYW1lLnN1cm5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWhvc3RlZEZpZWxkc0RhdGEuY2FyZGhvbGRlck5hbWUpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBmaXJzdE5hbWUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYmlsbGluZ19maXJzdF9uYW1lJykgPyBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYmlsbGluZ19maXJzdF9uYW1lJykudmFsdWUgOiAnJztcbiAgICAgICAgICAgICAgICBjb25zdCBsYXN0TmFtZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdiaWxsaW5nX2xhc3RfbmFtZScpID8gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2JpbGxpbmdfbGFzdF9uYW1lJykudmFsdWUgOiAnJztcblxuICAgICAgICAgICAgICAgIGlmICghZmlyc3ROYW1lIHx8ICFsYXN0TmFtZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNwaW5uZXIudW5ibG9jaygpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmVycm9ySGFuZGxlci5tZXNzYWdlKHRoaXMuZGVmYXVsdENvbmZpZy5ob3N0ZWRfZmllbGRzLmxhYmVscy5jYXJkaG9sZGVyX25hbWVfcmVxdWlyZWQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaG9zdGVkRmllbGRzRGF0YS5jYXJkaG9sZGVyTmFtZSA9IGZpcnN0TmFtZSArICcgJyArIGxhc3ROYW1lO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRIb3N0ZWRGaWVsZHNJbnN0YW5jZS5zdWJtaXQoaG9zdGVkRmllbGRzRGF0YSkudGhlbigocGF5bG9hZCkgPT4ge1xuICAgICAgICAgICAgICAgIHBheWxvYWQub3JkZXJJRCA9IHBheWxvYWQub3JkZXJJZDtcbiAgICAgICAgICAgICAgICB0aGlzLnNwaW5uZXIudW5ibG9jaygpO1xuICAgICAgICAgICAgICAgIHJldHVybiBjb250ZXh0Q29uZmlnLm9uQXBwcm92ZShwYXlsb2FkKTtcbiAgICAgICAgICAgIH0pLmNhdGNoKGVyciA9PiB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnIpO1xuICAgICAgICAgICAgICAgIHRoaXMuc3Bpbm5lci51bmJsb2NrKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuc3Bpbm5lci51bmJsb2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G4gICAgICAgICAgICBzdHlsZTogdGhpcy5jb25maWcuc3R5bGVcbiAgICAgICAgfSkucmVuZGVyKHRoaXMuY29uZmlnLndyYXBwZXIpO1xuICAgIH1cblxuICAgIHNob3VsZFJlbmRlcigpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHBheXBhbC5NZXNzYWdlcyA9PT0gJ3VuZGVmaW5lZCcgfHwgdHlwZW9mIHRoaXMuY29uZmlnLndyYXBwZXIgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICghIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IodGhpcy5jb25maWcud3JhcHBlcikpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG59XG5leHBvcnQgZGVmYXVsdCBNZXNzYWdlUmVuZGVyZXI7IiwiY2xhc3MgU3Bpbm5lciB7XG5cbiAgICBjb25zdHJ1Y3RvcigpIHtcbiAgICAgICAgdGhpcy50YXJnZXQgPSAnZm9ybS53b29jb21tZXJjZS1jaGVja291dCc7XG4gICAgfVxuXG4gICAgc2V0VGFyZ2V0KHRhcmdldCkge1xuICAgICAgICB0aGlzLnRhcmdldCA9IHRhcmdldDtcbiAgICB9XG5cbiAgICBibG9jaygpIHtcblxuICAgICAgICBqUXVlcnkoIHRoaXMudGFyZ2V0ICkuYmxvY2soe1xuICAgICAgICAgICAgbWVzc2FnZTogbnVsbCxcbiAgICAgICAgICAgIG92ZXJsYXlDU1M6IHtcbiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiAnI2ZmZicsXG4gICAgICAgICAgICAgICAgb3BhY2l0eTogMC42XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHVuYmxvY2soKSB7XG5cbiAgICAgICAgalF1ZXJ5KCB0aGlzLnRhcmdldCApLnVuYmx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AgIH1cblxuICAgIGlmIChjb250ZXh0ID09PSAncHJvZHVjdCcgJiYgUGF5UGFsQ29tbWVyY2VHYXRld2F5LnNpbmdsZV9wcm9kdWN0X2J1dHRvbnNfZW5hYmxlZCA9PT0gJzEnKSB7XG4gICAgICAgIGNvbnN0IHNpbmdsZVByb2R1Y3RCb290c3RyYXAgPSBuZXcgU2luZ2xlUHJvZHVjdEJvb3RzdGFwKFxuICAgICAgICAgICAgUGF5UGFsQ29tbWVyY2VHYXRld2F5LFxuICAgICAgICAgICAgcmVuZGVyZXIsXG4gICAgICAgICAgICBtZXNzYWdlUmVuZGVyZXIsXG4gICAgICAgICk7XG5cbiAgICAgICAgc2luZ2xlUHJvZHVjdEJvb3RzdHJhcC5pbml0KCk7XG4gICAgfVxuXG4gICAgaWYgKGNvbnRleHQgPT09ICdjYXJ0Jykge1xuICAgICAgICBjb25zdCBjYXJ0Qm9vdHN0cmFwID0gbmV3IENhcnRCb290c3RyYXAoXG4gICAgICAgICAgICBQYXlQYWxDb21tZXJjZUdhdGV3YXksXG4gICAgICAgICAgICByZW5kZXJlcixcbiAgICAgICAgKTtcblxuICAgICAgICBjYXJ0Qm9vdHN0cmFwLmluaXQoKTtcbiAgICB9XG5cbiAgICBpZiAoY29udGV4dCA9PT0gJ2NoZWNrb3V0Jykge1xuICAgICAgICBjb25zdCBjaGVja291dEJvb3RzdGFwID0gbmV3IENoZWNrb3V0Qm9vdHN0YXAoXG4gICAgICAgICAgICBQYXlQYWxDb21tZXJjZUdhdGV3YXksXG4gICAgICAgICAgICByZW5kZXJlcixcbiAgICAgICAgICAgIG1lc3NhZ2VSZW5kZXJlcixcbiAgICAgICAgICAgIHNwaW5uZXJcbiAgICAgICAgKTtcblxuICAgICAgICBjaGVja291dEJvb3RzdGFwLmluaXQoKTtcbiAgICB9XG5cbiAgICBpZiAoY29udGV4dCA9PT0gJ3BheS1ub3cnICkge1xuICAgICAgICBjb25zdCBwYXlOb3dCb290c3RyYXAgPSBuZXcgUGF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m9vdHN0cmFwIiwiY2hlY2tvdXRCb290c3RhcCIsInBheU5vd0Jvb3RzdHJhcCIsInVybCIsImVudHJpZXMiLCJzY3JpcHRfYXR0cmlidXRlcyIsImtleVZhbHVlIiwiZGF0YV9jbGllbnRfaWQiLCJzZXRfYXR0cmlidXRlIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///964\n")}},__webpack_exports__={};__webpack_modules__[964]()})();
modules/ppcp-button/resources/css/hosted-fields.scss CHANGED
@@ -11,3 +11,7 @@
11
  .ppcp-credit-card-gateway-form-field-disabled {
12
  opacity: .5 !important;
13
  }
 
 
 
 
11
  .ppcp-credit-card-gateway-form-field-disabled {
12
  opacity: .5 !important;
13
  }
14
+
15
+ .ppcp-dcc-order-button {
16
+ float: right;
17
+ }
modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js CHANGED
@@ -1,5 +1,6 @@
1
  import ErrorHandler from '../ErrorHandler';
2
  import CheckoutActionHandler from '../ActionHandler/CheckoutActionHandler';
 
3
 
4
  class CheckoutBootstap {
5
  constructor(gateway, renderer, messages, spinner) {
@@ -7,31 +8,38 @@ class CheckoutBootstap {
7
  this.renderer = renderer;
8
  this.messages = messages;
9
  this.spinner = spinner;
 
 
 
 
 
 
10
  }
11
 
12
  init() {
13
-
14
  this.render();
15
 
 
 
 
 
 
 
16
  jQuery(document.body).on('updated_checkout', () => {
17
  this.render()
18
  });
19
 
20
- jQuery(document.body).
21
- on('updated_checkout payment_method_selected', () => {
22
- this.switchBetweenPayPalandOrderButton()
23
- this.displayPlaceOrderButtonForSavedCreditCards()
24
-
25
- })
26
 
27
  jQuery(document).on('hosted_fields_loaded', () => {
28
  jQuery('#saved-credit-card').on('change', () => {
29
- this.displayPlaceOrderButtonForSavedCreditCards()
30
  })
31
  });
32
 
33
- this.switchBetweenPayPalandOrderButton()
34
- this.displayPlaceOrderButtonForSavedCreditCards()
35
  }
36
 
37
  shouldRender() {
@@ -60,55 +68,35 @@ class CheckoutBootstap {
60
  this.gateway.hosted_fields.wrapper,
61
  actionHandler.configuration(),
62
  );
 
 
 
 
 
63
  }
64
 
65
- switchBetweenPayPalandOrderButton() {
66
- jQuery('#saved-credit-card').val(jQuery('#saved-credit-card option:first').val());
 
 
 
 
67
 
68
- const currentPaymentMethod = jQuery(
69
- 'input[name="payment_method"]:checked').val();
 
 
70
 
71
- if (currentPaymentMethod !== 'ppcp-gateway' && currentPaymentMethod !== 'ppcp-credit-card-gateway') {
72
- this.renderer.hideButtons(this.gateway.button.wrapper);
73
- this.renderer.hideButtons(this.gateway.messages.wrapper);
74
- this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
75
- jQuery('#place_order').show();
76
- }
77
- else {
78
- jQuery('#place_order').hide();
79
- if (currentPaymentMethod === 'ppcp-gateway') {
80
- this.renderer.showButtons(this.gateway.button.wrapper);
81
- this.renderer.showButtons(this.gateway.messages.wrapper);
82
- this.messages.render()
83
- this.renderer.hideButtons(this.gateway.hosted_fields.wrapper)
84
- }
85
- if (currentPaymentMethod === 'ppcp-credit-card-gateway') {
86
- this.renderer.hideButtons(this.gateway.button.wrapper)
87
- this.renderer.hideButtons(this.gateway.messages.wrapper)
88
- this.renderer.showButtons(this.gateway.hosted_fields.wrapper)
89
- }
90
- }
91
- }
92
-
93
- displayPlaceOrderButtonForSavedCreditCards() {
94
- const currentPaymentMethod = jQuery(
95
- 'input[name="payment_method"]:checked').val();
96
- if (currentPaymentMethod !== 'ppcp-credit-card-gateway') {
97
- return;
98
  }
99
 
100
- if (jQuery('#saved-credit-card').length && jQuery('#saved-credit-card').val() !== '') {
101
- this.renderer.hideButtons(this.gateway.button.wrapper)
102
- this.renderer.hideButtons(this.gateway.messages.wrapper)
103
- this.renderer.hideButtons(this.gateway.hosted_fields.wrapper)
104
- jQuery('#place_order').show()
105
- this.disableCreditCardFields()
106
- } else {
107
- jQuery('#place_order').hide()
108
- this.renderer.hideButtons(this.gateway.button.wrapper)
109
- this.renderer.hideButtons(this.gateway.messages.wrapper)
110
- this.renderer.showButtons(this.gateway.hosted_fields.wrapper)
111
- this.enableCreditCardFields()
112
  }
113
  }
114
 
@@ -137,6 +125,15 @@ class CheckoutBootstap {
137
  jQuery('#ppcp-credit-card-vault').attr("disabled", false)
138
  this.renderer.enableCreditCardFields()
139
  }
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  export default CheckoutBootstap
1
  import ErrorHandler from '../ErrorHandler';
2
  import CheckoutActionHandler from '../ActionHandler/CheckoutActionHandler';
3
+ import { setVisible } from '../Helper/Hiding';
4
 
5
  class CheckoutBootstap {
6
  constructor(gateway, renderer, messages, spinner) {
8
  this.renderer = renderer;
9
  this.messages = messages;
10
  this.spinner = spinner;
11
+
12
+ this.standardOrderButtonSelector = '#place_order';
13
+
14
+ this.buttonChangeObserver = new MutationObserver((el) => {
15
+ this.updateUi();
16
+ });
17
  }
18
 
19
  init() {
 
20
  this.render();
21
 
22
+ // Unselect saved card.
23
+ // WC saves form values, so with our current UI it would be a bit weird
24
+ // if the user paid with saved, then after some time tries to pay again,
25
+ // but wants to enter a new card, and to do that they have to choose “Select payment” in the list.
26
+ jQuery('#saved-credit-card').val(jQuery('#saved-credit-card option:first').val());
27
+
28
  jQuery(document.body).on('updated_checkout', () => {
29
  this.render()
30
  });
31
 
32
+ jQuery(document.body).on('updated_checkout payment_method_selected', () => {
33
+ this.updateUi();
34
+ });
 
 
 
35
 
36
  jQuery(document).on('hosted_fields_loaded', () => {
37
  jQuery('#saved-credit-card').on('change', () => {
38
+ this.updateUi();
39
  })
40
  });
41
 
42
+ this.updateUi();
 
43
  }
44
 
45
  shouldRender() {
68
  this.gateway.hosted_fields.wrapper,
69
  actionHandler.configuration(),
70
  );
71
+
72
+ this.buttonChangeObserver.observe(
73
+ document.querySelector(this.standardOrderButtonSelector),
74
+ {attributes: true}
75
+ );
76
  }
77
 
78
+ updateUi() {
79
+ const currentPaymentMethod = this.currentPaymentMethod();
80
+ const isPaypal = currentPaymentMethod === 'ppcp-gateway';
81
+ const isCard = currentPaymentMethod === 'ppcp-credit-card-gateway';
82
+ const isSavedCard = isCard && this.isSavedCardSelected();
83
+ const isNotOurGateway = !isPaypal && !isCard;
84
 
85
+ setVisible(this.standardOrderButtonSelector, isNotOurGateway || isSavedCard, true);
86
+ setVisible(this.gateway.button.wrapper, isPaypal);
87
+ setVisible(this.gateway.messages.wrapper, isPaypal);
88
+ setVisible(this.gateway.hosted_fields.wrapper, isCard && !isSavedCard);
89
 
90
+ if (isPaypal) {
91
+ this.messages.render();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
+ if (isCard) {
95
+ if (isSavedCard) {
96
+ this.disableCreditCardFields();
97
+ } else {
98
+ this.enableCreditCardFields();
99
+ }
 
 
 
 
 
 
100
  }
101
  }
102
 
125
  jQuery('#ppcp-credit-card-vault').attr("disabled", false)
126
  this.renderer.enableCreditCardFields()
127
  }
128
+
129
+ currentPaymentMethod() {
130
+ return jQuery('input[name="payment_method"]:checked').val();
131
+ }
132
+
133
+ isSavedCardSelected() {
134
+ const savedCardList = jQuery('#saved-credit-card');
135
+ return savedCardList.length && savedCardList.val() !== '';
136
+ }
137
  }
138
 
139
  export default CheckoutBootstap
modules/ppcp-button/resources/js/modules/ContextBootstrap/PayNowBootstrap.js CHANGED
@@ -1,86 +1,17 @@
1
- import ErrorHandler from '../ErrorHandler';
2
- import CheckoutActionHandler from '../ActionHandler/CheckoutActionHandler';
3
 
4
- class PayNowBootstrap {
5
  constructor(gateway, renderer, messages, spinner) {
6
- this.gateway = gateway;
7
- this.renderer = renderer;
8
- this.messages = messages;
9
- this.spinner = spinner;
10
  }
11
 
12
- init() {
13
-
14
- this.render();
15
-
16
- jQuery(document.body).on('updated_checkout', () => {
17
- this.render();
18
- });
19
-
20
- jQuery(document.body).
21
- on('updated_checkout payment_method_selected', () => {
22
- this.switchBetweenPayPalandOrderButton();
23
- });
24
- this.switchBetweenPayPalandOrderButton();
25
- }
26
-
27
- shouldRender() {
28
- if (document.querySelector(this.gateway.button.cancel_wrapper)) {
29
- return false;
30
- }
31
-
32
- return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null;
33
- }
34
-
35
- render() {
36
- if (!this.shouldRender()) {
37
- return;
38
- }
39
- if (document.querySelector(this.gateway.hosted_fields.wrapper + '>div')) {
40
- document.querySelector(this.gateway.hosted_fields.wrapper + '>div').setAttribute('style', '');
41
- }
42
- const actionHandler = new CheckoutActionHandler(
43
- PayPalCommerceGateway,
44
- new ErrorHandler(this.gateway.labels.error.generic),
45
- this.spinner
46
- );
47
-
48
- this.renderer.render(
49
- this.gateway.button.wrapper,
50
- this.gateway.hosted_fields.wrapper,
51
- actionHandler.configuration(),
52
- );
53
- }
54
-
55
- switchBetweenPayPalandOrderButton() {
56
  const urlParams = new URLSearchParams(window.location.search)
57
  if (urlParams.has('change_payment_method')) {
58
  return
59
  }
60
 
61
- const currentPaymentMethod = jQuery(
62
- 'input[name="payment_method"]:checked').val();
63
-
64
- if (currentPaymentMethod !== 'ppcp-gateway' && currentPaymentMethod !== 'ppcp-credit-card-gateway') {
65
- this.renderer.hideButtons(this.gateway.button.wrapper);
66
- this.renderer.hideButtons(this.gateway.messages.wrapper);
67
- this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
68
- jQuery('#place_order').show();
69
- }
70
- else {
71
- jQuery('#place_order').hide();
72
- if (currentPaymentMethod === 'ppcp-gateway') {
73
- this.renderer.showButtons(this.gateway.button.wrapper);
74
- this.renderer.showButtons(this.gateway.messages.wrapper);
75
- this.messages.render();
76
- this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
77
- }
78
- if (currentPaymentMethod === 'ppcp-credit-card-gateway') {
79
- this.renderer.hideButtons(this.gateway.button.wrapper);
80
- this.renderer.hideButtons(this.gateway.messages.wrapper);
81
- this.renderer.showButtons(this.gateway.hosted_fields.wrapper);
82
- }
83
- }
84
  }
85
  }
86
 
1
+ import CheckoutBootstap from './CheckoutBootstap'
 
2
 
3
+ class PayNowBootstrap extends CheckoutBootstap {
4
  constructor(gateway, renderer, messages, spinner) {
5
+ super(gateway, renderer, messages, spinner)
 
 
 
6
  }
7
 
8
+ updateUi() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  const urlParams = new URLSearchParams(window.location.search)
10
  if (urlParams.has('change_payment_method')) {
11
  return
12
  }
13
 
14
+ super.updateUi();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
17
 
modules/ppcp-button/resources/js/modules/ErrorHandler.js CHANGED
@@ -73,11 +73,11 @@ class ErrorHandler {
73
 
74
  clear()
75
  {
76
- if (! this.wrapper.classList.contains('woocommerce-error')) {
77
  return;
78
  }
79
- this.wrapper.classList.remove('woocommerce-error');
80
- this.wrapper.innerText = '';
81
  }
82
  }
83
 
73
 
74
  clear()
75
  {
76
+ if (this.messagesList === null) {
77
  return;
78
  }
79
+
80
+ this.messagesList.innerHTML = '';
81
  }
82
  }
83
 
modules/ppcp-button/resources/js/modules/Helper/Hiding.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const getElement = (selectorOrElement) => {
2
+ if (typeof selectorOrElement === 'string') {
3
+ return document.querySelector(selectorOrElement);
4
+ }
5
+ return selectorOrElement;
6
+ }
7
+
8
+ export const isVisible = (element) => {
9
+ return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length);
10
+ }
11
+
12
+ export const setVisible = (selectorOrElement, show, important = false) => {
13
+ const element = getElement(selectorOrElement);
14
+ if (!element) {
15
+ return;
16
+ }
17
+
18
+ const currentValue = element.style.getPropertyValue('display');
19
+
20
+ if (!show) {
21
+ if (currentValue === 'none') {
22
+ return;
23
+ }
24
+
25
+ element.style.setProperty('display', 'none', important ? 'important' : '');
26
+ } else {
27
+ if (currentValue === 'none') {
28
+ element.style.removeProperty('display');
29
+ }
30
+
31
+ // still not visible (if something else added display: none in CSS)
32
+ if (!isVisible(element)) {
33
+ element.style.setProperty('display', 'block');
34
+ }
35
+ }
36
+ };
37
+
38
+ export const hide = (selectorOrElement, important = false) => {
39
+ setVisible(selectorOrElement, false, important);
40
+ };
41
+
42
+ export const show = (selectorOrElement) => {
43
+ setVisible(selectorOrElement, true);
44
+ };
modules/ppcp-button/resources/js/modules/OnApproveHandler/onApproveForPayNow.js CHANGED
@@ -1,6 +1,8 @@
1
  const onApprove = (context, errorHandler, spinner) => {
2
  return (data, actions) => {
3
  spinner.block();
 
 
4
  return fetch(context.config.ajax.approve_order.endpoint, {
5
  method: 'POST',
6
  body: JSON.stringify({
1
  const onApprove = (context, errorHandler, spinner) => {
2
  return (data, actions) => {
3
  spinner.block();
4
+ errorHandler.clear();
5
+
6
  return fetch(context.config.ajax.approve_order.endpoint, {
7
  method: 'POST',
8
  body: JSON.stringify({
modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js CHANGED
@@ -194,6 +194,23 @@ class CreditCardRenderer {
194
  if (contingency !== 'NO_3D_SECURE') {
195
  hostedFieldsData.contingencies = [contingency];
196
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  this.currentHostedFieldsInstance.submit(hostedFieldsData).then((payload) => {
198
  payload.orderID = payload.orderId;
199
  this.spinner.unblock();
194
  if (contingency !== 'NO_3D_SECURE') {
195
  hostedFieldsData.contingencies = [contingency];
196
  }
197
+
198
+ if (this.defaultConfig.payer) {
199
+ hostedFieldsData.cardholderName = this.defaultConfig.payer.name.given_name + ' ' + this.defaultConfig.payer.name.surname;
200
+ }
201
+ if (!hostedFieldsData.cardholderName) {
202
+ const firstName = document.getElementById('billing_first_name') ? document.getElementById('billing_first_name').value : '';
203
+ const lastName = document.getElementById('billing_last_name') ? document.getElementById('billing_last_name').value : '';
204
+
205
+ if (!firstName || !lastName) {
206
+ this.spinner.unblock();
207
+ this.errorHandler.message(this.defaultConfig.hosted_fields.labels.cardholder_name_required);
208
+ return;
209
+ }
210
+
211
+ hostedFieldsData.cardholderName = firstName + ' ' + lastName;
212
+ }
213
+
214
  this.currentHostedFieldsInstance.submit(hostedFieldsData).then((payload) => {
215
  payload.orderID = payload.orderId;
216
  this.spinner.unblock();
modules/ppcp-button/services.php CHANGED
@@ -70,6 +70,7 @@ return array(
70
  $environment = $container->get( 'onboarding.environment' );
71
  $payment_token_repository = $container->get( 'vaulting.repository.payment-token' );
72
  $settings_status = $container->get( 'wcgateway.settings.status' );
 
73
  return new SmartButton(
74
  $container->get( 'button.url' ),
75
  $container->get( 'session.handler' ),
@@ -82,7 +83,8 @@ return array(
82
  $messages_apply,
83
  $environment,
84
  $payment_token_repository,
85
- $settings_status
 
86
  );
87
  },
88
  'button.url' => static function ( ContainerInterface $container ): string {
@@ -171,7 +173,9 @@ return array(
171
  return new ThreeDSecure( $logger );
172
  },
173
  'button.helper.messages-apply' => static function ( ContainerInterface $container ): MessagesApply {
174
- return new MessagesApply();
 
 
175
  },
176
 
177
  'button.is-logged-in' => static function ( ContainerInterface $container ): bool {
70
  $environment = $container->get( 'onboarding.environment' );
71
  $payment_token_repository = $container->get( 'vaulting.repository.payment-token' );
72
  $settings_status = $container->get( 'wcgateway.settings.status' );
73
+ $currency = $container->get( 'api.shop.currency' );
74
  return new SmartButton(
75
  $container->get( 'button.url' ),
76
  $container->get( 'session.handler' ),
83
  $messages_apply,
84
  $environment,
85
  $payment_token_repository,
86
+ $settings_status,
87
+ $currency
88
  );
89
  },
90
  'button.url' => static function ( ContainerInterface $container ): string {
173
  return new ThreeDSecure( $logger );
174
  },
175
  'button.helper.messages-apply' => static function ( ContainerInterface $container ): MessagesApply {
176
+ return new MessagesApply(
177
+ $container->get( 'api.shop.country' )
178
+ );
179
  },
180
 
181
  'button.is-logged-in' => static function ( ContainerInterface $container ): bool {
modules/ppcp-button/src/Assets/SmartButton.php CHANGED
@@ -114,6 +114,13 @@ class SmartButton implements SmartButtonInterface {
114
  */
115
  private $payment_token_repository;
116
 
 
 
 
 
 
 
 
117
  /**
118
  * SmartButton constructor.
119
  *
@@ -129,6 +136,7 @@ class SmartButton implements SmartButtonInterface {
129
  * @param Environment $environment The environment object.
130
  * @param PaymentTokenRepository $payment_token_repository The payment token repository.
131
  * @param SettingsStatus $settings_status The Settings status helper.
 
132
  */
133
  public function __construct(
134
  string $module_url,
@@ -142,7 +150,8 @@ class SmartButton implements SmartButtonInterface {
142
  MessagesApply $messages_apply,
143
  Environment $environment,
144
  PaymentTokenRepository $payment_token_repository,
145
- SettingsStatus $settings_status
 
146
  ) {
147
 
148
  $this->module_url = $module_url;
@@ -157,6 +166,7 @@ class SmartButton implements SmartButtonInterface {
157
  $this->environment = $environment;
158
  $this->payment_token_repository = $payment_token_repository;
159
  $this->settings_status = $settings_status;
 
160
  }
161
 
162
  /**
@@ -564,7 +574,7 @@ class SmartButton implements SmartButtonInterface {
564
 
565
  printf(
566
  '<div id="%1$s" style="display:none;">
567
- <button class="button alt">%2$s</button>
568
  </div><div id="payments-sdk__contingency-lightbox"></div><style id="ppcp-hide-dcc">.payment_method_ppcp-credit-card-gateway {display:none;}</style>',
569
  esc_attr( $id ),
570
  esc_html( $label )
@@ -684,17 +694,18 @@ class SmartButton implements SmartButtonInterface {
684
  'wrapper' => '#ppcp-hosted-fields',
685
  'mini_cart_wrapper' => '#ppcp-hosted-fields-mini-cart',
686
  'labels' => array(
687
- 'credit_card_number' => '',
688
- 'cvv' => '',
689
- 'mm_yy' => __( 'MM/YY', 'woocommerce-paypal-payments' ),
690
- 'fields_not_valid' => __(
691
  'Unfortunately, your credit card details are not valid.',
692
  'woocommerce-paypal-payments'
693
  ),
694
- 'card_not_supported' => __(
695
  'Unfortunately, we do not support your credit card.',
696
  'woocommerce-paypal-payments'
697
  ),
 
698
  ),
699
  'valid_cards' => $this->dcc_applies->valid_cards(),
700
  'contingency' => $this->get_3ds_contingency(),
@@ -749,7 +760,7 @@ class SmartButton implements SmartButtonInterface {
749
 
750
  $params = array(
751
  'client-id' => $this->client_id,
752
- 'currency' => get_woocommerce_currency(),
753
  'integration-date' => PAYPAL_INTEGRATION_DATE,
754
  'components' => implode( ',', $this->components() ),
755
  'vault' => $this->can_save_vault_token() ? 'true' : 'false',
114
  */
115
  private $payment_token_repository;
116
 
117
+ /**
118
+ * 3-letter currency code of the shop.
119
+ *
120
+ * @var string
121
+ */
122
+ private $currency;
123
+
124
  /**
125
  * SmartButton constructor.
126
  *
136
  * @param Environment $environment The environment object.
137
  * @param PaymentTokenRepository $payment_token_repository The payment token repository.
138
  * @param SettingsStatus $settings_status The Settings status helper.
139
+ * @param string $currency 3-letter currency code of the shop.
140
  */
141
  public function __construct(
142
  string $module_url,
150
  MessagesApply $messages_apply,
151
  Environment $environment,
152
  PaymentTokenRepository $payment_token_repository,
153
+ SettingsStatus $settings_status,
154
+ string $currency
155
  ) {
156
 
157
  $this->module_url = $module_url;
166
  $this->environment = $environment;
167
  $this->payment_token_repository = $payment_token_repository;
168
  $this->settings_status = $settings_status;
169
+ $this->currency = $currency;
170
  }
171
 
172
  /**
574
 
575
  printf(
576
  '<div id="%1$s" style="display:none;">
577
+ <button class="button alt ppcp-dcc-order-button">%2$s</button>
578
  </div><div id="payments-sdk__contingency-lightbox"></div><style id="ppcp-hide-dcc">.payment_method_ppcp-credit-card-gateway {display:none;}</style>',
579
  esc_attr( $id ),
580
  esc_html( $label )
694
  'wrapper' => '#ppcp-hosted-fields',
695
  'mini_cart_wrapper' => '#ppcp-hosted-fields-mini-cart',
696
  'labels' => array(
697
+ 'credit_card_number' => '',
698
+ 'cvv' => '',
699
+ 'mm_yy' => __( 'MM/YY', 'woocommerce-paypal-payments' ),
700
+ 'fields_not_valid' => __(
701
  'Unfortunately, your credit card details are not valid.',
702
  'woocommerce-paypal-payments'
703
  ),
704
+ 'card_not_supported' => __(
705
  'Unfortunately, we do not support your credit card.',
706
  'woocommerce-paypal-payments'
707
  ),
708
+ 'cardholder_name_required' => __( 'Cardholder\'s first and last name are required, please fill the checkout form required fields.', 'woocommerce-paypal-payments' ),
709
  ),
710
  'valid_cards' => $this->dcc_applies->valid_cards(),
711
  'contingency' => $this->get_3ds_contingency(),
760
 
761
  $params = array(
762
  'client-id' => $this->client_id,
763
+ 'currency' => $this->currency,
764
  'integration-date' => PAYPAL_INTEGRATION_DATE,
765
  'components' => implode( ',', $this->components() ),
766
  'vault' => $this->can_save_vault_token() ? 'true' : 'false',
modules/ppcp-button/src/Helper/MessagesApply.php CHANGED
@@ -28,14 +28,28 @@ class MessagesApply {
28
  'AU',
29
  );
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  * Determines whether a credit messaging is enabled for the shops location country.
33
  *
34
  * @return bool
35
  */
36
  public function for_country(): bool {
37
- $region = wc_get_base_location();
38
- $country = $region['country'];
39
- return in_array( $country, $this->countries, true );
40
  }
41
  }
28
  'AU',
29
  );
30
 
31
+ /**
32
+ * 2-letter country code of the shop.
33
+ *
34
+ * @var string
35
+ */
36
+ private $country;
37
+
38
+ /**
39
+ * MessagesApply constructor.
40
+ *
41
+ * @param string $country 2-letter country code of the shop.
42
+ */
43
+ public function __construct( string $country ) {
44
+ $this->country = $country;
45
+ }
46
+
47
  /**
48
  * Determines whether a credit messaging is enabled for the shops location country.
49
  *
50
  * @return bool
51
  */
52
  public function for_country(): bool {
53
+ return in_array( $this->country, $this->countries, true );
 
 
54
  }
55
  }
modules/ppcp-button/src/Helper/MessagesDisclaimers.php CHANGED
@@ -39,15 +39,28 @@ class MessagesDisclaimers {
39
  ),
40
  );
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Returns a disclaimer link based on country.
44
  *
45
  * @return string
46
  */
47
  public function link_for_country(): string {
48
- $region = wc_get_base_location();
49
- $country = $region['country'];
50
-
51
- return $this->disclaimers[ $country ]['link'] ?? '';
52
  }
53
  }
39
  ),
40
  );
41
 
42
+ /**
43
+ * 2-letter country code of the shop.
44
+ *
45
+ * @var string
46
+ */
47
+ private $country;
48
+
49
+ /**
50
+ * MessagesDisclaimers constructor.
51
+ *
52
+ * @param string $country 2-letter country code of the shop.
53
+ */
54
+ public function __construct( string $country ) {
55
+ $this->country = $country;
56
+ }
57
+
58
  /**
59
  * Returns a disclaimer link based on country.
60
  *
61
  * @return string
62
  */
63
  public function link_for_country(): string {
64
+ return $this->disclaimers[ $this->country ]['link'] ?? '';
 
 
 
65
  }
66
  }
modules/ppcp-compat/src/PPEC/PPECHelper.php CHANGED
@@ -29,6 +29,15 @@ class PPECHelper {
29
  const PPEC_SETTINGS_OPTION_NAME = 'woocommerce_ppec_paypal_settings';
30
 
31
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * Checks if the PayPal Express Checkout plugin is active.
34
  *
29
  const PPEC_SETTINGS_OPTION_NAME = 'woocommerce_ppec_paypal_settings';
30
 
31
 
32
+ /**
33
+ * Checks if the PayPal Express Checkout plugin was configured previously.
34
+ *
35
+ * @return bool
36
+ */
37
+ public static function is_plugin_configured() {
38
+ return is_array( get_option( self::PPEC_SETTINGS_OPTION_NAME ) );
39
+ }
40
+
41
  /**
42
  * Checks if the PayPal Express Checkout plugin is active.
43
  *
modules/ppcp-compat/src/PPEC/SettingsImporter.php CHANGED
@@ -142,7 +142,7 @@ class SettingsImporter {
142
  $value = array_values(
143
  array_intersect(
144
  array_map( 'strtolower', is_array( $option_value ) ? $option_value : array() ),
145
- array( 'card', 'credit', 'sepa', 'bancontact', 'eps', 'giropay', 'ideal', 'mybank', 'p24', 'sofort', 'venmo' )
146
  )
147
  );
148
 
142
  $value = array_values(
143
  array_intersect(
144
  array_map( 'strtolower', is_array( $option_value ) ? $option_value : array() ),
145
+ array( 'card', 'credit', 'sepa', 'bancontact', 'blik', 'eps', 'giropay', 'ideal', 'mercadopago', 'mybank', 'p24', 'sofort', 'venmo' )
146
  )
147
  );
148
 
modules/ppcp-status-report/src/Renderer.php CHANGED
@@ -37,9 +37,11 @@ class Renderer {
37
  foreach ( $items as $item ) {
38
  ?>
39
  <tr>
40
- <td data-export-label="<?php echo esc_attr( $item['label'] ); ?>"><?php echo esc_attr( $item['label'] ); ?></td>
 
 
41
  <td class="help"><?php echo wc_help_tip( $item['description'] ); ?></td>
42
- <td><?php echo esc_attr( $item['value'] ); ?></td>
43
  </tr>
44
  <?php
45
  }
37
  foreach ( $items as $item ) {
38
  ?>
39
  <tr>
40
+ <td data-export-label="<?php echo esc_attr( $item['exported_label'] ?? $item['label'] ); ?>">
41
+ <?php echo esc_attr( $item['label'] ); ?>
42
+ </td>
43
  <td class="help"><?php echo wc_help_tip( $item['description'] ); ?></td>
44
+ <td><?php echo wp_kses_post( $item['value'] ); ?></td>
45
  </tr>
46
  <?php
47
  }
modules/ppcp-status-report/src/StatusReportModule.php CHANGED
@@ -14,11 +14,13 @@ use Dhii\Modular\Module\ModuleInterface;
14
  use Interop\Container\ServiceProviderInterface;
15
  use Psr\Container\ContainerInterface;
16
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
17
- use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer;
18
  use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
19
  use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
20
  use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
 
21
  use WooCommerce\PayPalCommerce\Onboarding\State;
 
22
 
23
  /**
24
  * Class StatusReportModule
@@ -44,6 +46,8 @@ class StatusReportModule implements ModuleInterface {
44
  add_action(
45
  'woocommerce_system_status_report',
46
  function () use ( $c ) {
 
 
47
 
48
  /* @var State $state The state. */
49
  $state = $c->get( 'onboarding.state' );
@@ -57,38 +61,93 @@ class StatusReportModule implements ModuleInterface {
57
  /* @var MessagesApply $messages_apply The messages apply. */
58
  $messages_apply = $c->get( 'button.helper.messages-apply' );
59
 
 
 
 
 
 
 
60
  /* @var Renderer $renderer The renderer. */
61
  $renderer = $c->get( 'status-report.renderer' );
62
 
 
 
63
  $items = array(
64
  array(
65
- 'label' => esc_html__( 'Onboarded', 'woocommerce-paypal-payments' ),
66
- 'description' => esc_html__( 'Whether PayPal account is correctly configured or not.', 'woocommerce-paypal-payments' ),
67
- 'value' => $this->onboarded( $bearer, $state ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  ),
69
  array(
70
- 'label' => esc_html__( 'Shop country code', 'woocommerce-paypal-payments' ),
71
- 'description' => esc_html__( 'Country / State value on Settings / General / Store Address.', 'woocommerce-paypal-payments' ),
72
- 'value' => wc_get_base_location()['country'],
 
 
 
73
  ),
74
  array(
75
- 'label' => esc_html__( 'PayPal card processing available in country', 'woocommerce-paypal-payments' ),
76
- 'description' => esc_html__( 'Whether PayPal card processing is available in country or not.', 'woocommerce-paypal-payments' ),
77
- 'value' => $dcc_applies->for_country_currency()
78
- ? esc_html__( 'Yes', 'woocommerce-paypal-payments' )
79
- : esc_html__( 'No', 'woocommerce-paypal-payments' ),
 
80
  ),
81
  array(
82
- 'label' => esc_html__( 'Pay Later messaging available in country', 'woocommerce-paypal-payments' ),
83
- 'description' => esc_html__( 'Whether Pay Later is available in country or not.', 'woocommerce-paypal-payments' ),
84
- 'value' => $messages_apply->for_country()
85
- ? esc_html__( 'Yes', 'woocommerce-paypal-payments' )
86
- : esc_html__( 'No', 'woocommerce-paypal-payments' ),
 
87
  ),
88
  array(
89
- 'label' => esc_html__( 'Vault enabled', 'woocommerce-paypal-payments' ),
90
- 'description' => esc_html__( 'Whether vaulting is enabled on PayPal account or not.', 'woocommerce-paypal-payments' ),
91
- 'value' => $this->vault_enabled( $bearer ),
 
 
 
92
  ),
93
  );
94
 
@@ -112,37 +171,56 @@ class StatusReportModule implements ModuleInterface {
112
  *
113
  * @param Bearer $bearer The bearer.
114
  * @param State $state The state.
115
- * @return string
116
  */
117
- private function onboarded( $bearer, $state ): string {
118
  try {
119
  $token = $bearer->bearer();
120
  } catch ( RuntimeException $exception ) {
121
- return esc_html__( 'No', 'woocommerce-paypal-payments' );
122
  }
123
 
124
  $current_state = $state->current_state();
125
- if ( $token->is_valid() && $current_state === $state::STATE_ONBOARDED ) {
126
- return esc_html__( 'Yes', 'woocommerce-paypal-payments' );
127
- }
128
-
129
- return esc_html__( 'No', 'woocommerce-paypal-payments' );
130
  }
131
 
132
  /**
133
  * It returns whether vaulting is enabled or not.
134
  *
135
  * @param Bearer $bearer The bearer.
136
- * @return string
137
  */
138
- private function vault_enabled( $bearer ) {
139
  try {
140
  $token = $bearer->bearer();
141
- return $token->vaulting_available()
142
- ? esc_html__( 'Yes', 'woocommerce-paypal-payments' )
143
- : esc_html__( 'No', 'woocommerce-paypal-payments' );
144
  } catch ( RuntimeException $exception ) {
145
- return esc_html__( 'No', 'woocommerce-paypal-payments' );
146
  }
147
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  }
14
  use Interop\Container\ServiceProviderInterface;
15
  use Psr\Container\ContainerInterface;
16
  use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
17
+ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\BillingAgreementsEndpoint;
18
  use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
19
  use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
20
  use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
21
+ use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper;
22
  use WooCommerce\PayPalCommerce\Onboarding\State;
23
+ use WooCommerce\PayPalCommerce\Webhooks\WebhookInfoStorage;
24
 
25
  /**
26
  * Class StatusReportModule
46
  add_action(
47
  'woocommerce_system_status_report',
48
  function () use ( $c ) {
49
+ $settings = $c->get( 'wcgateway.settings' );
50
+ assert( $settings instanceof ContainerInterface );
51
 
52
  /* @var State $state The state. */
53
  $state = $c->get( 'onboarding.state' );
61
  /* @var MessagesApply $messages_apply The messages apply. */
62
  $messages_apply = $c->get( 'button.helper.messages-apply' );
63
 
64
+ $last_webhook_storage = $c->get( 'webhook.last-webhook-storage' );
65
+ assert( $last_webhook_storage instanceof WebhookInfoStorage );
66
+
67
+ $billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
68
+ assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
69
+
70
  /* @var Renderer $renderer The renderer. */
71
  $renderer = $c->get( 'status-report.renderer' );
72
 
73
+ $had_ppec_plugin = PPECHelper::is_plugin_configured();
74
+
75
  $items = array(
76
  array(
77
+ 'label' => esc_html__( 'Onboarded', 'woocommerce-paypal-payments' ),
78
+ 'exported_label' => 'Onboarded',
79
+ 'description' => esc_html__( 'Whether PayPal account is correctly configured or not.', 'woocommerce-paypal-payments' ),
80
+ 'value' => $this->bool_to_html(
81
+ $this->onboarded( $bearer, $state )
82
+ ),
83
+ ),
84
+ array(
85
+ 'label' => esc_html__( 'Shop country code', 'woocommerce-paypal-payments' ),
86
+ 'exported_label' => 'Shop country code',
87
+ 'description' => esc_html__( 'Country / State value on Settings / General / Store Address.', 'woocommerce-paypal-payments' ),
88
+ 'value' => $c->get( 'api.shop.country' ),
89
+ ),
90
+ array(
91
+ 'label' => esc_html__( 'WooCommerce currency supported', 'woocommerce-paypal-payments' ),
92
+ 'exported_label' => 'WooCommerce currency supported',
93
+ 'description' => esc_html__( 'Whether PayPal supports the default store currency or not.', 'woocommerce-paypal-payments' ),
94
+ 'value' => $this->bool_to_html(
95
+ $c->get( 'api.shop.is-currency-supported' )
96
+ ),
97
+ ),
98
+ array(
99
+ 'label' => esc_html__( 'PayPal card processing available in country', 'woocommerce-paypal-payments' ),
100
+ 'exported_label' => 'PayPal card processing available in country',
101
+ 'description' => esc_html__( 'Whether PayPal card processing is available in country or not.', 'woocommerce-paypal-payments' ),
102
+ 'value' => $this->bool_to_html(
103
+ $dcc_applies->for_country_currency()
104
+ ),
105
+ ),
106
+ array(
107
+ 'label' => esc_html__( 'Pay Later messaging available in country', 'woocommerce-paypal-payments' ),
108
+ 'exported_label' => 'Pay Later messaging available in country',
109
+ 'description' => esc_html__( 'Whether Pay Later is available in country or not.', 'woocommerce-paypal-payments' ),
110
+ 'value' => $this->bool_to_html(
111
+ $messages_apply->for_country()
112
+ ),
113
+ ),
114
+ array(
115
+ 'label' => esc_html__( 'Webhook status', 'woocommerce-paypal-payments' ),
116
+ 'exported_label' => 'Webhook status',
117
+ 'description' => esc_html__( 'Whether we received webhooks successfully.', 'woocommerce-paypal-payments' ),
118
+ 'value' => $this->bool_to_html( ! $last_webhook_storage->is_empty() ),
119
  ),
120
  array(
121
+ 'label' => esc_html__( 'Vault enabled', 'woocommerce-paypal-payments' ),
122
+ 'exported_label' => 'Vault enabled',
123
+ 'description' => esc_html__( 'Whether vaulting is enabled on PayPal account or not.', 'woocommerce-paypal-payments' ),
124
+ 'value' => $this->bool_to_html(
125
+ $this->vault_enabled( $bearer )
126
+ ),
127
  ),
128
  array(
129
+ 'label' => esc_html__( 'Logging enabled', 'woocommerce-paypal-payments' ),
130
+ 'exported_label' => 'Logging enabled',
131
+ 'description' => esc_html__( 'Whether logging of plugin events and errors is enabled.', 'woocommerce-paypal-payments' ),
132
+ 'value' => $this->bool_to_html(
133
+ $settings->has( 'logging_enabled' ) && $settings->get( 'logging_enabled' )
134
+ ),
135
  ),
136
  array(
137
+ 'label' => esc_html__( 'Reference Transactions', 'woocommerce-paypal-payments' ),
138
+ 'exported_label' => 'Reference Transactions',
139
+ 'description' => esc_html__( 'Whether Reference Transactions are enabled for the connected account', 'woocommerce-paypal-payments' ),
140
+ 'value' => $this->bool_to_html(
141
+ $this->reference_transaction_enabled( $billing_agreements_endpoint )
142
+ ),
143
  ),
144
  array(
145
+ 'label' => esc_html__( 'Used PayPal Checkout plugin', 'woocommerce-paypal-payments' ),
146
+ 'exported_label' => 'Used PayPal Checkout plugin',
147
+ 'description' => esc_html__( 'Whether the PayPal Checkout Gateway plugin was configured previously or not', 'woocommerce-paypal-payments' ),
148
+ 'value' => $this->bool_to_html(
149
+ $had_ppec_plugin
150
+ ),
151
  ),
152
  );
153
 
171
  *
172
  * @param Bearer $bearer The bearer.
173
  * @param State $state The state.
174
+ * @return bool
175
  */
176
+ private function onboarded( Bearer $bearer, State $state ): bool {
177
  try {
178
  $token = $bearer->bearer();
179
  } catch ( RuntimeException $exception ) {
180
+ return false;
181
  }
182
 
183
  $current_state = $state->current_state();
184
+ return $token->is_valid() && $current_state === $state::STATE_ONBOARDED;
 
 
 
 
185
  }
186
 
187
  /**
188
  * It returns whether vaulting is enabled or not.
189
  *
190
  * @param Bearer $bearer The bearer.
191
+ * @return bool
192
  */
193
+ private function vault_enabled( Bearer $bearer ): bool {
194
  try {
195
  $token = $bearer->bearer();
196
+ return $token->vaulting_available();
 
 
197
  } catch ( RuntimeException $exception ) {
198
+ return false;
199
  }
200
  }
201
+
202
+ /**
203
+ * Checks if reference transactions are enabled in account.
204
+ *
205
+ * @param BillingAgreementsEndpoint $billing_agreements_endpoint The endpoint.
206
+ */
207
+ private function reference_transaction_enabled( BillingAgreementsEndpoint $billing_agreements_endpoint ): bool {
208
+ try {
209
+ return $billing_agreements_endpoint->reference_transaction_enabled();
210
+ } catch ( RuntimeException $exception ) {
211
+ return false;
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Converts the bool value to "yes" icon or dash.
217
+ *
218
+ * @param bool $value The value.
219
+ * @return string
220
+ */
221
+ private function bool_to_html( bool $value ): string {
222
+ return $value
223
+ ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'
224
+ : '<mark class="no">&ndash;</mark>';
225
+ }
226
  }
modules/ppcp-vaulting/src/VaultingModule.php CHANGED
@@ -38,6 +38,11 @@ class VaultingModule implements ModuleInterface {
38
  */
39
  public function run( ContainerInterface $container ): void {
40
 
 
 
 
 
 
41
  add_filter(
42
  'woocommerce_account_menu_items',
43
  function( $menu_links ) {
38
  */
39
  public function run( ContainerInterface $container ): void {
40
 
41
+ $settings = $container->get( 'wcgateway.settings' );
42
+ if ( ! $settings->has( 'vault_enabled' ) || ! $settings->get( 'vault_enabled' ) ) {
43
+ return;
44
+ }
45
+
46
  add_filter(
47
  'woocommerce_account_menu_items',
48
  function( $menu_links ) {
modules/ppcp-wc-gateway/services.php CHANGED
@@ -680,17 +680,19 @@ return array(
680
  'woocommerce-paypal-payments'
681
  ),
682
  'options' => array(
683
- 'card' => _x( 'Credit or debit cards', 'Name of payment method', 'woocommerce-paypal-payments' ),
684
- 'credit' => _x( 'Pay Later', 'Name of payment method', 'woocommerce-paypal-payments' ),
685
- 'sepa' => _x( 'SEPA-Lastschrift', 'Name of payment method', 'woocommerce-paypal-payments' ),
686
- 'bancontact' => _x( 'Bancontact', 'Name of payment method', 'woocommerce-paypal-payments' ),
687
- 'eps' => _x( 'eps', 'Name of payment method', 'woocommerce-paypal-payments' ),
688
- 'giropay' => _x( 'giropay', 'Name of payment method', 'woocommerce-paypal-payments' ),
689
- 'ideal' => _x( 'iDEAL', 'Name of payment method', 'woocommerce-paypal-payments' ),
690
- 'mybank' => _x( 'MyBank', 'Name of payment method', 'woocommerce-paypal-payments' ),
691
- 'p24' => _x( 'Przelewy24', 'Name of payment method', 'woocommerce-paypal-payments' ),
692
- 'sofort' => _x( 'Sofort', 'Name of payment method', 'woocommerce-paypal-payments' ),
693
- 'venmo' => _x( 'Venmo', 'Name of payment method', 'woocommerce-paypal-payments' ),
 
 
694
  ),
695
  'screens' => array(
696
  State::STATE_PROGRESSIVE,
@@ -1905,7 +1907,7 @@ return array(
1905
  ),
1906
  'class' => array(),
1907
  'input_class' => array( 'wc-enhanced-select' ),
1908
- 'default' => 'SCA_WHEN_REQUIRED',
1909
  'desc_tip' => true,
1910
  'options' => array(
1911
  'NO_3D_SECURE' => __( 'No 3D Secure (transaction will be denied if 3D Secure is required)', 'woocommerce-paypal-payments' ),
@@ -2024,6 +2026,8 @@ return array(
2024
  },
2025
 
2026
  'button.helper.messages-disclaimers' => static function ( ContainerInterface $container ): MessagesDisclaimers {
2027
- return new MessagesDisclaimers();
 
 
2028
  },
2029
  );
680
  'woocommerce-paypal-payments'
681
  ),
682
  'options' => array(
683
+ 'card' => _x( 'Credit or debit cards', 'Name of payment method', 'woocommerce-paypal-payments' ),
684
+ 'credit' => _x( 'Pay Later', 'Name of payment method', 'woocommerce-paypal-payments' ),
685
+ 'sepa' => _x( 'SEPA-Lastschrift', 'Name of payment method', 'woocommerce-paypal-payments' ),
686
+ 'bancontact' => _x( 'Bancontact', 'Name of payment method', 'woocommerce-paypal-payments' ),
687
+ 'blik' => _x( 'BLIK', 'Name of payment method', 'woocommerce-paypal-payments' ),
688
+ 'eps' => _x( 'eps', 'Name of payment method', 'woocommerce-paypal-payments' ),
689
+ 'giropay' => _x( 'giropay', 'Name of payment method', 'woocommerce-paypal-payments' ),
690
+ 'ideal' => _x( 'iDEAL', 'Name of payment method', 'woocommerce-paypal-payments' ),
691
+ 'mercadopago' => _x( 'Mercado Pago', 'Name of payment method', 'woocommerce-paypal-payments' ),
692
+ 'mybank' => _x( 'MyBank', 'Name of payment method', 'woocommerce-paypal-payments' ),
693
+ 'p24' => _x( 'Przelewy24', 'Name of payment method', 'woocommerce-paypal-payments' ),
694
+ 'sofort' => _x( 'Sofort', 'Name of payment method', 'woocommerce-paypal-payments' ),
695
+ 'venmo' => _x( 'Venmo', 'Name of payment method', 'woocommerce-paypal-payments' ),
696
  ),
697
  'screens' => array(
698
  State::STATE_PROGRESSIVE,
1907
  ),
1908
  'class' => array(),
1909
  'input_class' => array( 'wc-enhanced-select' ),
1910
+ 'default' => $container->get( 'api.shop.is-psd2-country' ) ? '3D_SECURE' : 'NO_3D_SECURE',
1911
  'desc_tip' => true,
1912
  'options' => array(
1913
  'NO_3D_SECURE' => __( 'No 3D Secure (transaction will be denied if 3D Secure is required)', 'woocommerce-paypal-payments' ),
2026
  },
2027
 
2028
  'button.helper.messages-disclaimers' => static function ( ContainerInterface $container ): MessagesDisclaimers {
2029
+ return new MessagesDisclaimers(
2030
+ $container->get( 'api.shop.country' )
2031
+ );
2032
  },
2033
  );
modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php CHANGED
@@ -58,8 +58,8 @@ trait ProcessPaymentTrait {
58
  * If customer has chosen a saved credit card payment.
59
  */
60
  $saved_credit_card = filter_input( INPUT_POST, 'saved_credit_card', FILTER_SANITIZE_STRING );
61
- $pay_for_order = filter_input( INPUT_GET, 'pay_for_order', FILTER_SANITIZE_STRING );
62
- if ( $saved_credit_card && ! isset( $pay_for_order ) ) {
63
 
64
  $user_id = (int) $wc_order->get_customer_id();
65
  $customer = new \WC_Customer( $user_id );
58
  * If customer has chosen a saved credit card payment.
59
  */
60
  $saved_credit_card = filter_input( INPUT_POST, 'saved_credit_card', FILTER_SANITIZE_STRING );
61
+ $change_payment = filter_input( INPUT_POST, 'woocommerce_change_payment', FILTER_SANITIZE_STRING );
62
+ if ( $saved_credit_card && ! isset( $change_payment ) ) {
63
 
64
  $user_id = (int) $wc_order->get_customer_id();
65
  $customer = new \WC_Customer( $user_id );
modules/ppcp-webhooks/services.php CHANGED
@@ -32,11 +32,13 @@ return array(
32
  $factory = $container->get( 'api.factory.webhook' );
33
  $endpoint = $container->get( 'api.endpoint.webhook' );
34
  $rest_endpoint = $container->get( 'webhook.endpoint.controller' );
 
35
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
36
  return new WebhookRegistrar(
37
  $factory,
38
  $endpoint,
39
  $rest_endpoint,
 
40
  $logger
41
  );
42
  },
@@ -48,6 +50,7 @@ return array(
48
  $verify_request = ! defined( 'PAYPAL_WEBHOOK_REQUEST_VERIFICATION' ) || PAYPAL_WEBHOOK_REQUEST_VERIFICATION;
49
  $webhook_event_factory = $container->get( 'api.factory.webhook-event' );
50
  $simulation = $container->get( 'webhook.status.simulation' );
 
51
 
52
  return new IncomingWebhookEndpoint(
53
  $webhook_endpoint,
@@ -56,6 +59,7 @@ return array(
56
  $verify_request,
57
  $webhook_event_factory,
58
  $simulation,
 
59
  ... $handler
60
  );
61
  },
@@ -183,6 +187,13 @@ return array(
183
  );
184
  },
185
 
 
 
 
 
 
 
 
186
  'webhook.module-url' => static function ( ContainerInterface $container ): string {
187
  return plugins_url(
188
  '/modules/ppcp-webhooks/',
32
  $factory = $container->get( 'api.factory.webhook' );
33
  $endpoint = $container->get( 'api.endpoint.webhook' );
34
  $rest_endpoint = $container->get( 'webhook.endpoint.controller' );
35
+ $last_webhook_storage = $container->get( 'webhook.last-webhook-storage' );
36
  $logger = $container->get( 'woocommerce.logger.woocommerce' );
37
  return new WebhookRegistrar(
38
  $factory,
39
  $endpoint,
40
  $rest_endpoint,
41
+ $last_webhook_storage,
42
  $logger
43
  );
44
  },
50
  $verify_request = ! defined( 'PAYPAL_WEBHOOK_REQUEST_VERIFICATION' ) || PAYPAL_WEBHOOK_REQUEST_VERIFICATION;
51
  $webhook_event_factory = $container->get( 'api.factory.webhook-event' );
52
  $simulation = $container->get( 'webhook.status.simulation' );
53
+ $last_webhook_storage = $container->get( 'webhook.last-webhook-storage' );
54
 
55
  return new IncomingWebhookEndpoint(
56
  $webhook_endpoint,
59
  $verify_request,
60
  $webhook_event_factory,
61
  $simulation,
62
+ $last_webhook_storage,
63
  ... $handler
64
  );
65
  },
187
  );
188
  },
189
 
190
+ 'webhook.last-webhook-storage' => static function ( ContainerInterface $container ): WebhookInfoStorage {
191
+ return new WebhookInfoStorage( $container->get( 'webhook.last-webhook-storage.key' ) );
192
+ },
193
+ 'webhook.last-webhook-storage.key' => static function ( ContainerInterface $container ): string {
194
+ return 'ppcp-last-webhook';
195
+ },
196
+
197
  'webhook.module-url' => static function ( ContainerInterface $container ): string {
198
  return plugins_url(
199
  '/modules/ppcp-webhooks/',
modules/ppcp-webhooks/src/Handler/PrefixTrait.php CHANGED
@@ -31,7 +31,10 @@ trait PrefixTrait {
31
  */
32
  private function sanitize_custom_id( string $custom_id ): int {
33
 
34
- $id = str_replace( $this->prefix, '', $custom_id );
 
 
 
35
  return (int) $id;
36
  }
37
  }
31
  */
32
  private function sanitize_custom_id( string $custom_id ): int {
33
 
34
+ $id = $custom_id;
35
+ if ( strlen( $this->prefix ) > 0 && 0 === strpos( $id, $this->prefix ) ) {
36
+ $id = substr( $id, strlen( $this->prefix ) );
37
+ }
38
  return (int) $id;
39
  }
40
  }
modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php CHANGED
@@ -76,6 +76,13 @@ class IncomingWebhookEndpoint {
76
  */
77
  private $simulation;
78
 
 
 
 
 
 
 
 
79
  /**
80
  * IncomingWebhookEndpoint constructor.
81
  *
@@ -85,6 +92,7 @@ class IncomingWebhookEndpoint {
85
  * @param bool $verify_request Whether requests need to be verified or not.
86
  * @param WebhookEventFactory $webhook_event_factory The webhook event factory.
87
  * @param WebhookSimulation $simulation The simulation handler.
 
88
  * @param RequestHandler ...$handlers The handlers, which process a request in the end.
89
  */
90
  public function __construct(
@@ -94,6 +102,7 @@ class IncomingWebhookEndpoint {
94
  bool $verify_request,
95
  WebhookEventFactory $webhook_event_factory,
96
  WebhookSimulation $simulation,
 
97
  RequestHandler ...$handlers
98
  ) {
99
 
@@ -103,6 +112,7 @@ class IncomingWebhookEndpoint {
103
  $this->logger = $logger;
104
  $this->verify_request = $verify_request;
105
  $this->webhook_event_factory = $webhook_event_factory;
 
106
  $this->simulation = $simulation;
107
  }
108
 
@@ -176,6 +186,8 @@ class IncomingWebhookEndpoint {
176
  public function handle_request( \WP_REST_Request $request ): \WP_REST_Response {
177
  $event = $this->event_from_request( $request );
178
 
 
 
179
  if ( $this->simulation->is_simulation_event( $event ) ) {
180
  $this->logger->info( 'Received simulated webhook.' );
181
  $this->simulation->receive( $event );
76
  */
77
  private $simulation;
78
 
79
+ /**
80
+ * The last webhook info storage.
81
+ *
82
+ * @var WebhookInfoStorage
83
+ */
84
+ private $last_webhook_storage;
85
+
86
  /**
87
  * IncomingWebhookEndpoint constructor.
88
  *
92
  * @param bool $verify_request Whether requests need to be verified or not.
93
  * @param WebhookEventFactory $webhook_event_factory The webhook event factory.
94
  * @param WebhookSimulation $simulation The simulation handler.
95
+ * @param WebhookInfoStorage $last_webhook_storage The last webhook info storage.
96
  * @param RequestHandler ...$handlers The handlers, which process a request in the end.
97
  */
98
  public function __construct(
102
  bool $verify_request,
103
  WebhookEventFactory $webhook_event_factory,
104
  WebhookSimulation $simulation,
105
+ WebhookInfoStorage $last_webhook_storage,
106
  RequestHandler ...$handlers
107
  ) {
108
 
112
  $this->logger = $logger;
113
  $this->verify_request = $verify_request;
114
  $this->webhook_event_factory = $webhook_event_factory;
115
+ $this->last_webhook_storage = $last_webhook_storage;
116
  $this->simulation = $simulation;
117
  }
118
 
186
  public function handle_request( \WP_REST_Request $request ): \WP_REST_Response {
187
  $event = $this->event_from_request( $request );
188
 
189
+ $this->last_webhook_storage->save( $event );
190
+
191
  if ( $this->simulation->is_simulation_event( $event ) ) {
192
  $this->logger->info( 'Received simulated webhook.' );
193
  $this->simulation->receive( $event );
modules/ppcp-webhooks/src/WebhookInfoStorage.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Stores the info about webhook events.
4
+ *
5
+ * @package WooCommerce\PayPalCommerce\Webhooks
6
+ */
7
+
8
+ declare(strict_types=1);
9
+
10
+ namespace WooCommerce\PayPalCommerce\Webhooks;
11
+
12
+ use WooCommerce\PayPalCommerce\ApiClient\Entity\WebhookEvent;
13
+
14
+ /**
15
+ * Class WebhookInfoStorage
16
+ */
17
+ class WebhookInfoStorage {
18
+
19
+ /**
20
+ * The WP option key.
21
+ *
22
+ * @var string
23
+ */
24
+ private $key;
25
+
26
+ /**
27
+ * WebhookInfoStorage constructor.
28
+ *
29
+ * @param string $key The WP option key.
30
+ */
31
+ public function __construct(
32
+ string $key
33
+ ) {
34
+ $this->key = $key;
35
+ }
36
+
37
+ /**
38
+ * Saves the info about webhook event.
39
+ *
40
+ * @param WebhookEvent $webhook_event The webhook event to save.
41
+ */
42
+ public function save( WebhookEvent $webhook_event ): void {
43
+ $data = array(
44
+ 'id' => $webhook_event->id(),
45
+ 'received_time' => time(),
46
+ );
47
+
48
+ update_option( $this->key, $data );
49
+ }
50
+
51
+ /**
52
+ * Returns the stored data or null.
53
+ */
54
+ public function get_data(): ?array {
55
+ $data = get_option( $this->key );
56
+ if ( ! $data || ! is_array( $data ) ) {
57
+ return null;
58
+ }
59
+ return $data;
60
+ }
61
+
62
+ /**
63
+ * Checks if there is any stored data.
64
+ */
65
+ public function is_empty(): bool {
66
+ $data = get_option( $this->key );
67
+ return ! $data || ! is_array( $data );
68
+ }
69
+
70
+ /**
71
+ * Removes the stored data.
72
+ */
73
+ public function clear(): void {
74
+ delete_option( $this->key );
75
+ }
76
+ }
modules/ppcp-webhooks/src/WebhookRegistrar.php CHANGED
@@ -44,6 +44,13 @@ class WebhookRegistrar {
44
  */
45
  private $rest_endpoint;
46
 
 
 
 
 
 
 
 
47
  /**
48
  * The logger.
49
  *
@@ -57,19 +64,22 @@ class WebhookRegistrar {
57
  * @param WebhookFactory $webhook_factory The Webhook factory.
58
  * @param WebhookEndpoint $endpoint The Webhook endpoint.
59
  * @param IncomingWebhookEndpoint $rest_endpoint The WordPress Rest API endpoint.
 
60
  * @param LoggerInterface $logger The logger.
61
  */
62
  public function __construct(
63
  WebhookFactory $webhook_factory,
64
  WebhookEndpoint $endpoint,
65
  IncomingWebhookEndpoint $rest_endpoint,
 
66
  LoggerInterface $logger
67
  ) {
68
 
69
- $this->webhook_factory = $webhook_factory;
70
- $this->endpoint = $endpoint;
71
- $this->rest_endpoint = $rest_endpoint;
72
- $this->logger = $logger;
 
73
  }
74
 
75
  /**
@@ -92,6 +102,7 @@ class WebhookRegistrar {
92
  self::KEY,
93
  $created->to_array()
94
  );
 
95
  $this->logger->info( 'Webhooks subscribed.' );
96
  return true;
97
  } catch ( RuntimeException $error ) {
@@ -120,6 +131,7 @@ class WebhookRegistrar {
120
 
121
  if ( $success ) {
122
  delete_option( self::KEY );
 
123
  $this->logger->info( 'Webhooks deleted.' );
124
  }
125
  return $success;
44
  */
45
  private $rest_endpoint;
46
 
47
+ /**
48
+ * The last webhook info storage.
49
+ *
50
+ * @var WebhookInfoStorage
51
+ */
52
+ private $last_webhook_storage;
53
+
54
  /**
55
  * The logger.
56
  *
64
  * @param WebhookFactory $webhook_factory The Webhook factory.
65
  * @param WebhookEndpoint $endpoint The Webhook endpoint.
66
  * @param IncomingWebhookEndpoint $rest_endpoint The WordPress Rest API endpoint.
67
+ * @param WebhookInfoStorage $last_webhook_storage The last webhook info storage.
68
  * @param LoggerInterface $logger The logger.
69
  */
70
  public function __construct(
71
  WebhookFactory $webhook_factory,
72
  WebhookEndpoint $endpoint,
73
  IncomingWebhookEndpoint $rest_endpoint,
74
+ WebhookInfoStorage $last_webhook_storage,
75
  LoggerInterface $logger
76
  ) {
77
 
78
+ $this->webhook_factory = $webhook_factory;
79
+ $this->endpoint = $endpoint;
80
+ $this->rest_endpoint = $rest_endpoint;
81
+ $this->last_webhook_storage = $last_webhook_storage;
82
+ $this->logger = $logger;
83
  }
84
 
85
  /**
102
  self::KEY,
103
  $created->to_array()
104
  );
105
+ $this->last_webhook_storage->clear();
106
  $this->logger->info( 'Webhooks subscribed.' );
107
  return true;
108
  } catch ( RuntimeException $error ) {
131
 
132
  if ( $success ) {
133
  delete_option( self::KEY );
134
+ $this->last_webhook_storage->clear();
135
  $this->logger->info( 'Webhooks deleted.' );
136
  }
137
  return $success;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, paypal, payments, ecommerce, e-commerce, store, sales, sell,
4
  Requires at least: 5.3
5
  Tested up to: 5.8
6
  Requires PHP: 7.1
7
- Stable tag: 1.6.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -81,6 +81,17 @@ Follow the steps below to connect the plugin to your PayPal account:
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
 
 
 
 
84
  = 1.6.2 =
85
  * Fix - Order of WooCommerce checkout actions causing incompatibility with AvaTax address validation #335
86
  * Fix - Can't checkout to certain countries with optional postcode #330
4
  Requires at least: 5.3
5
  Tested up to: 5.8
6
  Requires PHP: 7.1
7
+ Stable tag: 1.6.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
81
 
82
  == Changelog ==
83
 
84
+ = 1.6.3 =
85
+ * Fix - Payments fail when using custom order numbers #354
86
+ * Fix - Do not display saved payments on PayPal buttons if vault option is disabled #358
87
+ * Fix - Double "Place Order" button #362
88
+ * Fix - Coupon causes TAX_TOTAL_MISMATCH #372
89
+ * Fix - Funding sources Mercado Pago and BLIK can't be disabled #383
90
+ * Fix - Customer details not available in order and name gets replaced by xxx@dcc2.paypal.com #378
91
+ * Fix - 3D Secure failing for certain credit card types with PayPal Card Processing #379
92
+ * Fix - Error messages are not cleared even when checkout is re-attempted (DCC) #366
93
+ * Add - New additions for system report status #377
94
+
95
  = 1.6.2 =
96
  * Fix - Order of WooCommerce checkout actions causing incompatibility with AvaTax address validation #335
97
  * Fix - Can't checkout to certain countries with optional postcode #330
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitab4ef10ecf6654ac031f82e5b0cb2339::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit3acb3642cf46c3f8b0d913579e285e9c
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire3acb3642cf46c3f8b0d913579e285e9c($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire3acb3642cf46c3f8b0d913579e285e9c($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitab4ef10ecf6654ac031f82e5b0cb2339
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitab4ef10ecf6654ac031f82e5b0cb2339', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitab4ef10ecf6654ac031f82e5b0cb2339', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitab4ef10ecf6654ac031f82e5b0cb2339::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInitab4ef10ecf6654ac031f82e5b0cb2339::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequireab4ef10ecf6654ac031f82e5b0cb2339($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequireab4ef10ecf6654ac031f82e5b0cb2339($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
@@ -131,8 +131,8 @@ class ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c
131
  public static function getInitializer(ClassLoader $loader)
132
  {
133
  return \Closure::bind(function () use ($loader) {
134
- $loader->prefixLengthsPsr4 = ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c::$prefixLengthsPsr4;
135
- $loader->prefixDirsPsr4 = ComposerStaticInit3acb3642cf46c3f8b0d913579e285e9c::$prefixDirsPsr4;
136
 
137
  }, null, ClassLoader::class);
138
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitab4ef10ecf6654ac031f82e5b0cb2339
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
131
  public static function getInitializer(ClassLoader $loader)
132
  {
133
  return \Closure::bind(function () use ($loader) {
134
+ $loader->prefixLengthsPsr4 = ComposerStaticInitab4ef10ecf6654ac031f82e5b0cb2339::$prefixLengthsPsr4;
135
+ $loader->prefixDirsPsr4 = ComposerStaticInitab4ef10ecf6654ac031f82e5b0cb2339::$prefixDirsPsr4;
136
 
137
  }, null, ClassLoader::class);
138
  }
woocommerce-paypal-payments.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PayPal Payments
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-paypal-payments/
5
  * Description: PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
6
- * Version: 1.6.2
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com/
9
  * License: GPL-2.0
3
  * Plugin Name: WooCommerce PayPal Payments
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-paypal-payments/
5
  * Description: PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
6
+ * Version: 1.6.3
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com/
9
  * License: GPL-2.0