Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Sep 10, 2021
1 parent e2b8579 commit 13adaf2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,17 @@ private function update_entry_payment_meta( $entry, PayFeed $pay_feed, Payment $
gform_update_meta( $entry['id'], 'ideal_feed_id', $pay_feed->id );
gform_update_meta( $entry['id'], 'payment_gateway', 'pronamic_pay' );

/**
* The `gform_update_meta` and `gform_get_meta` functions don't handle
* `null` values very well. A `null` value can result in multiple meta
* values for 1 meta key. That is why we check if the payment ID is
* not `null`.
*
* @link https://github.com/pronamic/wp-pronamic-pay/issues/208
*/
$payment_id = $payment->get_id();

if ( ! empty( $payment_id ) ) {
if ( null !== $payment_id ) {
gform_update_meta( $entry['id'], 'pronamic_payment_id', $payment_id );
}

Expand Down

0 comments on commit 13adaf2

Please sign in to comment.