The correct method for generating a payment URL is:
So my code changed to to:
$payment_page = $order->get_checkout_payment_url();
Which generates the following URL:
http://www.example.co.za/checkout/order-pay/[order-number]?pay_for_order=true&key=order_[order-key]
Which is what I was looking for.
Note that the order status must be set to unpaid or pending in order for the generated link to be valid
Related Posts:
- Re-order Woocommerce single product and echo div around moved & duplicated Woocommerce hooks
- WooCommerce wp_insert_post action firing on every save
- remove_action or remove_filter with external classes?
- Why does save_post action fire when creating a new post?
- Difference between do_action_ref_array() and do_action()
- Why is there both a save_post and wp_insert_post action?
- When is admin_init Action ran?
- Can an action callback prevent the parent from continuing execution?
- How do I enqueue a script to run inside the Gutenberg editor?
- How can I find out what functions are assigned to actions?
- Disable WooCommerce action
- How can I remove the WP menu from the admin bar?
- Passing arguments into ‘init’ function
- How to use conditional add_action for WordPress
- WP Schedule Event – Every Day When First Visitor Comes
- How to remove an action that is added inside a class
- add action which returns modified value
- How to Remove a Filter from the Admin List Table?
- WordPress admin WP_table_list show incorrectly
- How to add a checkbox inside the “Publish post” widget?
- Remove action on product archive page [closed]
- What’s the usage of action do_meta_boxes?
- Custom bulk actions in WP 3.7.1
- How to remove_action inside class [duplicate]
- Modify query in pre_get_posts action is messing up my nav menu
- How to check if an action is already fired?
- add_action and wp_head not display content in head section
- use add_action(‘wp_head’) in a widget
- Unable to programmatically remove product from WooCommerce cart
- Preventing frontpage to be deleted/moved to trash
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- How to remove a custom action on child theme?
- Pass parameters to function through an action
- Remove action added through function
- Action hook on only publishing post not on editing or updating
- Performance : Duplicating `add_action`
- add_action in class and use it in theme
- Better action hook for creating table than after_switch_theme and switch_theme action hook
- Adding the hook ‘vc_before_init’ inside a object
- How to apply action the_post to the post that is only being mainly displayed
- admin_notices on runtime in function
- Using several add_action with parameters inside a class
- Action hook load_textdomain $domain variable
- Action hook for editing post
- add_action and do_action: multiple calls to same callback?
- remove_action returns false regardless of priority
- How to check current user before all actions and filters?
- Set a custom display_name on user_register?
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- How to make an action run in the background?
- WP cron doesn’t pass through my arguments
- how to add submenu item under parent menu item with code
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- Why does my wp_safe_redirect output the ERR_TOO_MANY_REDIRECTS error?
- Custom Post type forgetting data
- Insert custom postmeta when custom post type published
- Create post revision on slug change
- Is dynamic action name building a bad practice?
- Can’t Get Metabox Data Saved Assistance Needed
- is there an update_post_meta action
- Add new users to “add new user” page on admin’s dashboard
- add_action( ‘publish_pelicula’, ‘post_published_notification’, 10, 2 ); does not trigger propperly
- Filter WooCommerce archive pages by an additional category
- How to remove products-links after the product title using remove_action
- Change Post Publish Date to Post Modified Date in All Places
- save_post not triggered when a post is updated
- Woocommerce custom Plugin in wordpress [closed]
- add_action to wp_head is added, but not called
- Where to place add_action when enqueueing?
- Insert Google authorship into WordPress header
- add_action before theme setup
- How can I get the user that publishes a post?
- add_action which contains first argument admin_print_scripts-$page
- update_user_meta not updating
- How do i know which action / filters are called when i call get_option()
- Display custom product option in admin order details
- Assign user role by text field in WordPress (Woocommerce) [closed]
- How can I send information when a order is completed to my own POS?
- Remove action not working in child theme
- Parameters in woocommerce_before_add_to_cart_button hook
- Call to Action Button – Resize Help [closed]
- How to change lost password email text using custom plugin wordpress?
- Translate are not working for standard admin
- How do I remove an action hook inside a class that is called by another class?
- add_action don’t updates theme layout when using values from the WordPress customizer
- Woocommerce add a text field if specific option is selected
- add_filter not works in ajax
- add_action init breaks site on PHP 7.1
- WordPress Reset password Strength set to medium
- Help needed with woocommerce (wc stripe) filter
- action future_post returns wrong date
- Hook into admin_notices after sending mail
- WordPress’ work or execution flow manipulating $wpdb
- Add-action in function
- Building WP Web App: Creating a Feed for post revisions
- Can admin_bar_menu or another action be used to modify the admin bar on the admin side?
- How to add custom checkout field in user details mail template
- What is the first action or filter executed by wordpress?
- Using add action for class with construct
- Webhook: save_post action fires wp_remote_post twice