email, $stripePaymentMethodId); if (!$giveStripeCustomer->get_id()) { throw new StripeCustomerException(__('Unable to find or create stripe customer object.', 'give')); } $this->saveStripeCustomerId($donation, $giveStripeCustomer->get_id()); return $giveStripeCustomer; } /** * @since 2.21.0 Update function first argument type to Donation model * @since 2.19.0 * @throws Exception */ protected function saveStripeCustomerId(Donation $donation, string $stripeCustomerId) { give()->donor_meta->update_meta($donation->donorId, give_stripe_get_customer_key(), $stripeCustomerId); DonationNote::create([ 'donationId' => $donation->id, 'content' => sprintf(__('Stripe Customer ID: %s', 'give'), $stripeCustomerId) ]); give_update_meta($donation->id, give_stripe_get_customer_key(), $stripeCustomerId); } }