Option to only set missing billing details

This commit is contained in:
Philipp Stracker 2024-08-16 18:45:49 +02:00
parent 63e9c8bf27
commit c007d7909c
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View file

@ -634,8 +634,8 @@ class GooglepayButton extends PaymentButton {
const propagatePayerDataToForm = () => {
const raw = paymentData?.paymentMethodData?.info?.billingAddress;
const payer = {
email_address: paymentData?.email,
name: {
given_name: raw.name.split( ' ' )[ 0 ], // Assuming first name is the first part
surname: raw.name.split( ' ' ).slice( 1 ).join( ' ' ), // Assuming last name is the rest