Advertisement
eventsmanager

Add shipping details when using Stripe Payment

Nov 9th, 2023 (edited)
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <?php
  2.  
  3. function my_em_stripe_session_vars($stripe_checkout,$EM_Booking){
  4. $stripe_checkout['locale'] = "ja";
  5.  
  6. $stripe_checkout['metadata'] = array( 'first_name' => $EM_Booking->get_person()->first_name, 'last_name' => $EM_Booking->get_person()->last_name, 'customer_email' => $EM_Booking->get_person()->user_email );
  7.  
  8. $stripe_checkout['payment_intent_data']['shipping'] = array (
  9. 'address' => array(
  10. 'line1' => $EM_Booking->booking_meta['registration']['billing_address_1'],
  11. 'city' => $EM_Booking->booking_meta['registration']['billing_city'],
  12. 'country' => $EM_Booking->booking_meta['registration']['dbem_country'],
  13. 'postal_code' => $EM_Booking->booking_meta['registration']['billing_postcode'],
  14. ),
  15. 'name' => $EM_Booking->booking_meta['registration']['first_name'].' '.$EM_Booking->booking_meta['registration']['last_name'],
  16. 'phone' => $EM_Booking->booking_meta['registration']['phone'],
  17. );
  18.  
  19. return $stripe_checkout;
  20. }
  21. add_filter('em_gateway_stripe_checkout_session_vars', 'my_em_stripe_session_vars', 100,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement