give
/
src
/
PaymentGateways
/
Gateways
/
PayPalStandard
/
resources
/
js
/
payPalStandardGateway.tsx
payPalStandardGateway.tsx
36 lines
| 1 | import type {Gateway} from '@givewp/forms/types'; |
| 2 | import PayPalLogo from './PayPalLogo'; |
| 3 | |
| 4 | type PayPalStandardGatewaySettings = { |
| 5 | fields: { |
| 6 | heading: string; |
| 7 | subheading: string; |
| 8 | body: string; |
| 9 | }; |
| 10 | }; |
| 11 | |
| 12 | let fields: PayPalStandardGatewaySettings['fields']; |
| 13 | |
| 14 | const paypalStandardGateway: Gateway = { |
| 15 | id: 'paypal', |
| 16 | initialize() { |
| 17 | fields = this.settings.fields; |
| 18 | }, |
| 19 | Fields() { |
| 20 | return ( |
| 21 | <div style={{ |
| 22 | display: "flex", |
| 23 | flexDirection: "column", |
| 24 | alignItems: "center", |
| 25 | rowGap: "1rem", |
| 26 | textAlign: "center" |
| 27 | }}> |
| 28 | <PayPalLogo/> |
| 29 | <b>{fields.heading}</b> |
| 30 | <div><b>{fields.subheading}:</b> {fields.body}</div> |
| 31 | </div> |
| 32 | ); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | window.givewp.gateways.register(paypalStandardGateway); |