# Not Copying Stripe Billing information When Using Another Address field Values

**URL:** <https://community.gravityforms.com/t/not-copying-stripe-billing-information-when-using-another-address-field-values/7643>\
**Category:** Get Help\
**Tags:** gform\_stripe\_charge\_pre\_create, stripe\
**Created:** [January 28, 2021, 7:17pm UTC](https://community.gravityforms.com/t/not-copying-stripe-billing-information-when-using-another-address-field-values/7643 "2021-01-28T19:17:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5a15e07408d433.5](https://avatars.discourse-cdn.com/v4/letter/u/c37758/32.png) [@user5a15e07408d433.5](https://community.gravityforms.com/u/user5a15e07408d433.5)\
**Post date:** [January 28, 2021, 7:17pm UTC](https://community.gravityforms.com/t/not-copying-stripe-billing-information-when-using-another-address-field-values/7643/1 "2021-01-28T19:17:25Z")

</div>

In my Stripe feed settings, I’m mapping the billing information fields to an Address field used to collect the billing address.

Because the client home address can be different, I have a second field to collect the home address. So I decided to use the GF functionnality for Address field that can copy values from the home address field to the billing one. Unfortunately, some elements are not working.

1- When I check “Activated by default” in the address field options, it doesn’t work. The “Same as home address” checkbox remains unchecked and the fields are displayed in the form.

2- When I’m testing the form submission and I check “Same as home address” checkbox to tell GF that home address has to be the billing address, Stripe receives empty billing details values. It seems like GF is not filling the billing address field with the home address values on submit.

So I’ve discovered the **gform\_stripe\_charge\_pre\_create** filter that could possibly solve my problems by forcing Stripe to pick the home address values. So I’ve came with this piece of code, that unfortunately doesn’t work :

```
    function stripe_charge_pre_create( $charge_meta, $feed, $submission_data, $form, $entry ) {

      if(rgar($entry, '33.1') == "1") {

          $charge_meta['billing_details']['address']['city'] = rgar($entry, '5.3');

            $charge_meta['billing_details']['address']['country'] = rgar($entry, '5.6');

             $charge_meta['billing_details']['address']['line1'] = rgar($entry, '5.1');

           $charge_meta['billing_details']['address']['line2'] = rgar($entry, '5.2');

            $charge_meta['billing_details']['address']['postal_code'] = rgar($entry, '5.5');

            $charge_meta['billing_details']['address']['state'] = rgar($entry, '5.4');

         }
 return $charge_meta;

 }

```

Can you help me to solve this please?

 ![Capture d’écran 2021-01-28 140053](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/c/c2b2063ee8f06d817cf61d69d00a7704fa8ce47b.png)

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [January 28, 2021, 9:08pm UTC](https://community.gravityforms.com/t/not-copying-stripe-billing-information-when-using-another-address-field-values/7643/2 "2021-01-28T21:08:30Z")

</div>

Hi Patrick, I recommend opening a support ticket for any payment related issue, due to the importance of payments on most websites. Additionally, sensitive information may need to be shared, and that’s not appropriate in a public forum. You can open a support ticket here:

> **[Support | Gravity Forms](https://www.gravityforms.com/support/)**
>
> We are always here to help. If you have any issues/questions about our plugin, please create a ticket here to get immediate support from our team.

Thank you.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:44am UTC](https://community.gravityforms.com/t/not-copying-stripe-billing-information-when-using-another-address-field-values/7643/3 "2022-01-05T08:44:59Z")

</div>


