The following code:
merge({Turtle.Payments.Models.PaymentIntent, e.payment_intent_id},
status: :processing,
amount: e.amount,
payment_method_id: e.payment_method_id,
payment_method_type: String.to_atom(e.payment_method_type),
payment_method_brand: e.payment_method_brand,
payment_method_last4: e.payment_method_last4
)
Fails in my codebase because it's not passing along the created_at field. It's trying to set the created_at to null but that probably means there's a bug in which missing fields in the struct are mistakenly set.
I need to write a test case to reproduce this behavior