Skip to content

Commit 26dbc15

Browse files
committed
Fix confirmation_url generation
1 parent a970591 commit 26dbc15

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

plugin/classes/sdk/Serializers.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,16 @@ public static function get_order( $order ) {
163163
/**
164164
* @param WC_Order $order
165165
* @param string $checkout_url
166+
* @param int $redirect_id
166167
* @param WP_User $user
167168
*
168169
* @return array
169170
*/
170-
public static function get_checkout( $order, $checkout_url, $user ) {
171+
public static function get_checkout( $order, $checkout_url, $redirect_id, $user ) {
171172
$serializer = array(
172173
'toc' => true,
173174
'merchant' => array(
174-
'confirmation_url' => home_url( add_query_arg( 'action', 'confirm' ) ),
175+
'confirmation_url' => add_query_arg( 'action', 'confirm', get_permalink( $redirect_id ) ),
175176
'cancel_url' => html_entity_decode( $order->get_cancel_order_url() ),
176177
'checkout_url' => html_entity_decode( $order->get_cancel_order_url( $checkout_url ) ),
177178
'success_url' => html_entity_decode( $order->get_checkout_order_received_url() ),

plugin/templates/gateway/redirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
?>
2020

2121
<script type="text/javascript">
22-
aplazame.checkout(<?php echo json_encode( Aplazame_Serializers::get_checkout( $order, $cart->get_checkout_url(), $user ),
22+
aplazame.checkout(<?php echo json_encode( Aplazame_Serializers::get_checkout( $order, $cart->get_checkout_url(), $aplazame->redirect->id, $user ),
2323
128 ) ?>);
2424
</script>

0 commit comments

Comments
 (0)