mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
✨ Decouple PayerData from global PPCP object
This commit is contained in:
parent
3e0a44ca1f
commit
15a09d9722
1 changed files with 3 additions and 3 deletions
|
@ -149,12 +149,12 @@ function setCheckoutBillingDetails( payer ) {
|
|||
|
||||
export function getWooCommerceCustomerDetails() {
|
||||
// Populated on server-side with details about the current WooCommerce customer.
|
||||
return window.PayPalCommerceGateway?.payer;
|
||||
return window?.PayPalCommerceGateway?.payer;
|
||||
}
|
||||
|
||||
export function getSessionBillingDetails() {
|
||||
// Populated by JS via `setSessionBillingDetails()`
|
||||
return window.PayPalCommerceGateway?.tempPayer;
|
||||
return window._PpcpPayerSessionDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -168,7 +168,7 @@ export function setSessionBillingDetails( details ) {
|
|||
return;
|
||||
}
|
||||
|
||||
window.PayPalCommerceGateway.tempPayer = normalizePayerDetails( details );
|
||||
window._PpcpPayerSessionDetails = normalizePayerDetails( details );
|
||||
}
|
||||
|
||||
export function payerData() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue