Skip to content

Commit

Permalink
Merge pull request #17 from edvinas1995/master
Browse files Browse the repository at this point in the history
Changed from update_post_meta() to add_meta_data() for better integration with WooCommerce.
  • Loading branch information
ibaciulis authored Nov 4, 2024
2 parents 5ed5a22 + 96623e7 commit 25e584d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/class-coingate-for-woocommerce-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ public function process_payment( $order_id ) {
try {
$gateway_order = $client->order->create( $params );
if ( $gateway_order ) {
update_post_meta( $order->get_id(), static::ORDER_TOKEN_META_KEY, $gateway_order->token );
$order->add_meta_data( static::ORDER_TOKEN_META_KEY, $gateway_order->token, true );
$order->save();
$response['result'] = 'success';
$response['redirect'] = $gateway_order->payment_url;
}
Expand Down

0 comments on commit 25e584d

Please sign in to comment.