diff --git a/src/Gateway.php b/src/Gateway.php index 66f4580..de14a85 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -174,6 +174,10 @@ public function start( Payment $payment ) { // Purchase ID. $purchase_id = $payment->format_string( (string) $this->config->get_purchase_id() ); + if ( '' === $purchase_id ) { + $purchase_id = $payment->get_id(); + } + $payment->set_meta( 'purchase_id', $purchase_id ); /**