PluginProbe
HyperPay Payments / 5.3.0
HyperPay Payments v5.3.0
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / src / assets / js / applePay.jsx

applePay.jsx in HyperPay Payments 5.3.0, at src/assets/js/applePay.jsx

44 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1
2 import { Helmet } from "react-helmet";
3 import { useState, useEffect, useRef } from 'react'
4 import { clearUpCopyAndPay, generateOptions, useFetch } from './Helpers';
5
6
7
8 const ApplePay = React.memo((props) => {
9
10 const [checkoutId, setCheckoutId] = useState(null)
11 const shippingMethod = useRef(null)
12
13 useEffect(() => {
14 useFetch("hyperpay_prepare_checkout")
15 .get("").then(res => {
16 setCheckoutId(res.data)
17 window.wpwlOptions = generateOptions(props, shippingMethod, res.data);
18 })
19
20 return clearUpCopyAndPay()
21
22 }, [])
23
24
25 return (
26 <div>
27 {checkoutId && <div>
28 <form action="" className="paymentWidgets" data-brands={props.setting.brands}></form>
29 <Helmet>
30 <script src={`https://eu-test.oppwa.com/v1/paymentWidgets.js?checkoutId=${checkoutId}`}></script>
31 </Helmet>
32 </div>
33 }
34 </div>
35 )
36
37 }, () => true)
38
39
40 export default ApplePay
41
42
43
44