Closed remcotolsma closed 2 years ago
I was thinking of grouping it.
I think grouping in an object also has advantages, we could also store additional data in addition to a key and id.
payment {
"source": {
"key": "woocommerce",
"id": "50"
}
}
Are source.key
and source.id
the most logic names? Or should we go for source.key
and source.value
just like meta key and value?
key
and value
LGTM 👍
- Same for subscriptions?
Yes, it's the same for subscriptions, both Payment
and Subscription
extend the PaymentInfo
class.
- I think post meta can now override the value from the stored JSON, is that desired? Or should we only read from meta as fallback, when the source details are not yet available in the JSON?
Good question, it's easier to update post meta than update a JSON property in post_content
. We will still use _pronamic_payment_source
and _pronamic_payment_source_id
for WP_Query
. And we have some upgrade scripts in place:
For now i think it's ok that post meta _pronamic_payment_source
are _pronamic_payment_source_id
are leading. In the future we can always change this behaviour?
Should we group
_pronamic_payment_source
and_pronamic_payment_source_id
in a object?or keep it more in line what we have now?
@rvdsteege ?