There are 2 main places where you should add your code when adding a new payment gateway.

  1. The places where you put the pay now buttons and send requests to the payment processor servers
  2. A new page where the processor server will send the response to your transaction (accepted, rejected etc).

Where to add the payment buttons

Depending on the payment type you chose the “pay now” buttons can be put in 3 places.

Important : when sending the request to the payment server you also need to send what type of transaction you are doing.  For example if you are doing a membership payment you need to send a a variable like is_membership along with the required data. The processor should also return this variable in the processor page and yu would be able to know if the transaction is a membership payment or a booking payment and act accordingly.


1.My subscription page  –  in case you are using subscription membership

The subscription page is the page you created with the template “User Dashboard Subscriptions” and the file name is user_dashboard_packs.php.

Here you should put the “pay now” buttons for the subscription packages. The paypal and stripe buttons are at line 66 .

print '<div id="pick_pack">'.esc_html__( 'Pay with Paypal','wpestate').'</div>';


2. Property unit in dashboard – in case you are using  per submission payments

In this case the buy now buttons should be placed in dashboard_listing_unit.php around line 204.  As you can see in the code , first we check if the payment is in membership mode

if($paid_submission_status=='per listing'){

and then we add the checkbox for “featured” property case. The featured checkbox add the feature price to the total value of the purchase. This is made via javascript in control.js file at line 1775

var parent= $(this).parent();......



the actual buttons are around line 247

print'<span class="listing_upgrade label label-danger" data-listingid="'.$post_id.'">'.esc_html__( 'Set as Featured','wpestate').'</span>';

3. Invoice unit in dashboard – when users can pay the invoice generated for their booking.

The invoice form is generated via ajax and the php code part is in ajax_functions_booking.php, function wpestate_create_pay_user_invoice_form()  – line 168. The actual pay buttons are at line 302 for stripe and 320 for paypal.



The “processor” page.

For each new payment processor you should create a new page template and in there  you should check the the transaction response.

For example , for stripe we have the stripecharge.php page template. When we setup Stripe, beside adding a api keys a user must also create a new page with the template “Stripe Charge Pay”. The he will use this link as the return page for the Stripe setup.

So, for your new processor do the following

  1. create a template new_processor.php
  2. add in header  the following

    // Template Name: New Processor Charge Page
    // Wp Estate Pack
  3. Create a page with the new template and use that as the “return url” for the new merchant.

In the actual processor page

Here you should check if the transaction is valid and if yes – validate the transaction.  All the merchants have sample code for check this answers and you should start from their code.

In case the transaction is a booking payment – the code is at line 162

Important points in this case :

validate the booking:   update_post_meta($booking_id, 'booking_status', 'confirmed');

update the booking_dates array (we store here the reserved dates ) – update_post_meta($curent_listng_id, 'booking_dates', $reservation_array);

update the invoice with the status and deposit paid

  • update_post_meta($invoice_id, 'invoice_status', 'confirmed');
  • update_post_meta($invoice_id, 'depozit_paid', ($depozit/100) );
  • send confirmation email

 In case the transaction is a submission payment the code is at line 204

Important points in this case :

insert the invoice with wpestate_insert_invoice .

update the invoice status with   update_post_meta($invoice_id, 'invoice_status', 'confirmed');

publish the new listing if is the case –

$post = array(
'ID' => $listing_id,
'post_status' => 'publish'
$post_id = wp_update_post($post );

 In case the transaction is a recurring payment for membership the code is at line 280

Important points in this case :

check if the new package has fewer listings that the current pack with wpestate_check_downgrade_situation. If yes – use  wpestate_downgrade_to_pack.

Upgrade the membership with    wpestate_upgrade_user_membership($current_user->ID,$pack_id,2,'');

 In case the transaction is a payment for membership the code is at line 320

Important points in this case :

check if the new package has fewer listings that the current pack with wpestate_check_downgrade_situation. If yes – use  wpestate_downgrade_to_pack.

Upgrade the membership with    wpestate_upgrade_user_membership($current_user->ID,$pack_id,2,'');

If you need additional explanations about how to implement the merchant please post a ticket at and will update this document.