mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
correct html syntax for onboarding field
This commit is contained in:
parent
aa2e7e7427
commit
a1148df786
1 changed files with 35 additions and 17 deletions
|
@ -23,23 +23,41 @@ class OnboardingRenderer
|
|||
$this->partnerReferrals->signupLink()
|
||||
);
|
||||
?>
|
||||
<script>
|
||||
function onboardingCallback(authCode, sharedId) => {
|
||||
fetch(PayPalCommerceGatewayOnboarding.endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
authCode: authCode,
|
||||
sharedId: sharedId,
|
||||
nonce: PayPalCommerceGatewayOnboarding.nonce
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<a target="_blank" data-paypal-onboard-complete="onboardingCallback" href="<?php echo $url; ?>" data-paypal-button="true">Sign up for PayPal</a>
|
||||
<script id="paypal-js" src="https://www.sandbox.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js"></script>
|
||||
<tr valign="top">
|
||||
<th scope="row" class="titledesc">
|
||||
<?php echo esc_html_e('Connect to PayPal', 'woocommerce-paypal-commerce-gateway'); ?>
|
||||
</th>
|
||||
<td class="forminp">
|
||||
<script>
|
||||
function onboardingCallback(authCode, sharedId) {
|
||||
fetch(PayPalCommerceGatewayOnboarding.endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
authCode: authCode,
|
||||
sharedId: sharedId,
|
||||
nonce: PayPalCommerceGatewayOnboarding.nonce
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<a
|
||||
target="_blank"
|
||||
class="button-primary"
|
||||
data-paypal-onboard-complete="onboardingCallback"
|
||||
href="<?php echo esc_url($url); ?>"
|
||||
data-paypal-button="true"
|
||||
><?php
|
||||
esc_html_e('Sign up for PayPal', 'woocommerce-paypal-commerce-gateway');
|
||||
?></a>
|
||||
<script
|
||||
id="paypal-js"
|
||||
src="https://www.sandbox.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js"
|
||||
></script>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue