2022-07-13 04:44:44 +00:00
import React from 'react' ;
2021-08-18 20:40:11 +00:00
import { useLocation } from 'react-router-dom' ;
2022-07-13 04:44:44 +00:00
import { Container , Header } from 'semantic-ui-react' ;
2020-02-09 06:59:22 +00:00
2020-02-21 06:10:52 +00:00
export function PayPalPayNow ( props ) {
2020-02-09 06:59:22 +00:00
const { amount , custom , name } = props ;
return (
< div className = 'paypal-container' >
2022-10-27 10:38:04 +00:00
< form action = 'https://www.paypal.com/cgi-bin/webscr' method = 'post' target = '_blank' >
2020-02-09 06:59:22 +00:00
< input type = 'hidden' name = 'cmd' value = '_xclick' / >
< input type = 'hidden' name = 'business' value = 'info@protospace.ca' / >
< input type = 'hidden' name = 'lc' value = 'CA' / >
< input type = 'hidden' name = 'item_name' value = { name } / >
< input type = 'hidden' name = 'amount' value = { amount } / >
2022-07-12 06:13:18 +00:00
< input type = 'hidden' name = 'custom' value = { custom . replace ( /\"/g , '`' ) } / >
2020-02-09 06:59:22 +00:00
< input type = 'hidden' name = 'currency_code' value = 'CAD' / >
< input type = 'hidden' name = 'button_subtype' value = 'services' / >
< input type = 'hidden' name = 'no_note' value = '0' / >
< input type = 'hidden' name = 'tax_rate' value = '0.000' / >
< input type = 'hidden' name = 'shipping' value = '0.00' / >
< input type = 'hidden' name = 'bn' value = 'PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest' / >
< input type = 'image' src = 'https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif' border = '0' name = 'submit' alt = 'PayPal - The safer, easier way to pay online!' / >
< img alt = '' border = '0' src = 'https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width = '1' height = '1' / >
< / f o r m >
< / d i v >
) ;
}
2020-02-21 06:10:52 +00:00
export function PayPalSubscribe ( props ) {
const { amount , custom , name } = props ;
return (
< div className = 'paypal-container' >
2022-10-27 10:38:04 +00:00
< form action = 'https://www.paypal.com/cgi-bin/webscr' method = 'post' target = '_blank' >
2020-02-21 06:10:52 +00:00
< input type = 'hidden' name = 'cmd' value = '_xclick-subscriptions' / >
< input type = 'hidden' name = 'business' value = 'info@protospace.ca' / >
< input type = 'hidden' name = 'lc' value = 'US' / >
< input type = 'hidden' name = 'item_name' value = { name } / >
< input type = 'hidden' name = 'no_note' value = '1' / >
< input type = 'hidden' name = 'src' value = '1' / >
< input type = 'hidden' name = 'a3' value = { amount } / >
2022-07-12 06:13:18 +00:00
< input type = 'hidden' name = 'custom' value = { custom . replace ( /\"/g , '`' ) } / >
2020-02-21 06:10:52 +00:00
< input type = 'hidden' name = 'p3' value = '1' / >
< input type = 'hidden' name = 't3' value = 'M' / >
< input type = 'hidden' name = 'currency_code' value = 'CAD' / >
< input type = 'hidden' name = 'bn' value = 'PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest' / >
< input type = 'image' src = 'https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif' border = '0' name = 'submit' alt = 'PayPal - The safer, easier way to pay online!' / >
< img alt = '' border = '0' src = 'https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width = '1' height = '1' / >
< / f o r m >
< / d i v >
) ;
}
export function PayPalSubscribeDeal ( props ) {
const { amount , custom , name } = props ;
return (
< div className = 'paypal-container' >
2022-10-27 10:38:04 +00:00
< form action = 'https://www.paypal.com/cgi-bin/webscr' method = 'post' target = '_blank' >
2020-02-21 06:10:52 +00:00
< input type = 'hidden' name = 'cmd' value = '_xclick-subscriptions' / >
< input type = 'hidden' name = 'business' value = 'info@protospace.ca' / >
< input type = 'hidden' name = 'lc' value = 'US' / >
< input type = 'hidden' name = 'item_name' value = { name } / >
< input type = 'hidden' name = 'no_note' value = '1' / >
< input type = 'hidden' name = 'a1' value = { amount * 2 } / >
< input type = 'hidden' name = 'p1' value = '3' / >
< input type = 'hidden' name = 't1' value = 'M' / >
< input type = 'hidden' name = 'src' value = '1' / >
< input type = 'hidden' name = 'a3' value = { amount } / >
2022-07-12 06:13:18 +00:00
< input type = 'hidden' name = 'custom' value = { custom . replace ( /\"/g , '`' ) } / >
2020-02-21 06:10:52 +00:00
< input type = 'hidden' name = 'p3' value = '1' / >
< input type = 'hidden' name = 't3' value = 'M' / >
< input type = 'hidden' name = 'currency_code' value = 'CAD' / >
< input type = 'hidden' name = 'bn' value = 'PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest' / >
< input type = 'image' src = 'https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif' border = '0' name = 'submit' alt = 'PayPal - The safer, easier way to pay online!' / >
< img alt = '' border = '0' src = 'https://www.paypalobjects.com/en_US/i/scr/pixel.gif' width = '1' height = '1' / >
< / f o r m >
< / d i v >
) ;
}
2021-08-18 20:40:11 +00:00
export function Subscribe ( props ) {
const qs = useLocation ( ) . search ;
const params = new URLSearchParams ( qs ) ;
const monthly _fees = params . get ( 'monthly_fees' ) || false ;
const id = params . get ( 'id' ) || false ;
return (
< Container >
< Header size = 'large' > Create a PayPal Subscription < / H e a d e r >
< p > Use this page to set up a Protospace membership subscription . < / p >
{ monthly _fees && id ?
< PayPalSubscribeDeal
amount = { monthly _fees }
name = 'Protospace Membership'
custom = { JSON . stringify ( { deal : 3 , member : id } ) }
/ >
:
< p > Error , invalid subscribe link . < / p >
}
< p > Click "Checkout as Guest" if you don ' t have a PayPal account . < / p >
< / C o n t a i n e r >
) ;
}