Stripe Shipping Address

Hi
I have problem with gravity and stripe. If you capture payments for the indian market you are obliged to sent shipping details of the order in a specific way. Unfortunately the stripe add on is not supporting that by default. As a temporary work around i found some code to add to the functions.php that fills those fields but it is done in a static way so the same shipping info gets added to every order.
So thats not good and i want to populate the fields of my form.
Here is the static code. Can someone let me know how to change the static entries into field values from the form? i tried inserting code like => rgar( $entry, ‘1.3’ ), But this did not work.

add_filter( 'gform_stripe_payment_intent_pre_create', 'add_shipping_address1', 10, 2 );
function add_shipping_address1( $data, $feed ) {
    $data['shipping[name]'] = 'Test User';
	$data['shipping[address][line1]'] = 'Teststreet';
	$data['shipping[address][postal_code]'] = '1234';
	$data['shipping[address][city]'] = 'Testcity';
	$data['shipping[address][country]'] = 'CH';
 
    return $data;
}

Any help is very much appreciated.
Thanks
Mike

Which collection method are you using: Stripe Elements or Stripe Checkout?

Dear Chris. Thanks for your reply.
I am using Stripe Elements.
Any idea how i could solve this problem?

Hi Mike. With Stripe Elements, you can use the gform_stripe_charge_pre_create filter.

Documentation:

That filter has access to the $entry which is what you will need to send form data to Stripe that is not already covered in your Stripe Feed. Please let us know if you have any other questions. Thank you.

Hi Chris. Thanks for your answer. Can you give me an example of how i would use the $entry in gform_stripe_charge_pre_create filter to take - for example - the information of the address fields of my form. I am unfortunately not a programmer but only able to adapt examples. But the ones from the gravity pages are still to difficult for me to adapt.

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.