-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettle.php
More file actions
34 lines (30 loc) · 1.2 KB
/
settle.php
File metadata and controls
34 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once("payread_post_api.php");
require_once("../../../wp-load.php");
/**
* settle.php
* Is called by Payer right after a settlement has been performed.
* Payer will add two parameters:
* payread_payment_id=XXXXXXXX
* md5hash=F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
* Example:
* http://www.myshop.com/settle.php?payread_payment_id=XXXXXXXX&md5hash=F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
* If you have any OrderID enclosed it will look similar:
* http://www.myshop.com/settle.php?orderid=S1234567&payread_payment_id=XXXXXXXX&md5hash=F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
* Payer will only add to its parameters and not remove any.
* When you receive the signal from the settle, you can reserve goods/services in your shop.
* Should always print "TRUE" if it works.
*/
die ("TRUE");
$postAPI=new payread_post_api();
wp_mail('christian@bolstad.se','betalning',print_r($_GET,1));
if($postAPI->is_valid_ip())
//Checks if the IP address comes from Payer else return false!
{
$order = new WC_Order( $_GET['myOrderId'] );
$order->add_order_note( __('Payerbetalningmottagen - betalningsid:' . $_GET['payread_payment_id'], 'woothemes') );
$order->payment_complete();
die("TRUE");
}
die("FALSE");
?>