Advertisement
eventsmanager

Add shipping details when using Stripe Payment

Nov 9th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. function my_em_stripe_session_vars($stripe_checkout,$EM_Booking){
  2. $stripe_checkout['locale'] = "ja";
  3.  
  4. $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 );
  5.  
  6. $stripe_checkout['payment_intent_data']['shipping'] = array (
  7. 'address' => array(
  8. 'line1' => $EM_Booking->booking_meta['registration']['billing_address_1'],
  9. 'city' => $EM_Booking->booking_meta['registration']['billing_city'],
  10. 'country' => $EM_Booking->booking_meta['registration']['dbem_country'],
  11. 'postal_code' => $EM_Booking->booking_meta['registration']['billing_postcode'],
  12. ),
  13. 'name' => $EM_Booking->booking_meta['registration']['first_name'].' '.$EM_Booking->booking_meta['registration']['last_name'],
  14. 'phone' => $EM_Booking->booking_meta['registration']['phone'],
  15. );
  16.  
  17. return $stripe_checkout;
  18. }
  19. 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