File size: 2,490 Bytes
bdb1674
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php

if ( $_POST )

{

	$dosya = fopen('merhaba.txt', 'w');

	fwrite($dosya, $_POST);

	fclose($dosya);

}

else

{



	$shopierApi    = '60b8c8a1b88022231732ab2906423aec';

	$shopierSecret = 'c55a261c1a49a0a347ff1b6a6962184b';



	$data[ 'shopier_payment_url' ]  = 'https://www.shopier.com/ShowProduct/api_pay4product.php';

	$data[ 'shopier_shipping_url' ] = 'https://www.shopier.com/pg_sandbox/pg_shipping_info.php';

	$data[ 'shopier_cancel_url' ]   = 'https://www.shopier.com/pg_sandbox/pg_cancel.php';



	srand( time( null ) );

	$args                = array(

		'API_key'           => '',

		'website_index'     => 'http://tall.sonyazilim.com/shopier.php',

		'platform_order_id' => '123',

		'product_name'      => '',

		'product_type'      => '2',

		'buyer_name'        => 'Talha',

		'buyer_surname'     => 'Turhan',

		'buyer_email'       => 'info@talhaturhan.com',

		'buyer_account_age' => '2',

		'buyer_id_nr'       => '123',

		'buyer_phone'       => '05548686342',

		'billing_address'   => 'Kayasehir',

		'billing_city'      => 'Istanbul',

		'billing_country'   => 'Turkiye',

		'billing_postcode'  => '34306',

		'shipping_address'  => 'Kayasehir',

		'shipping_city'     => 'Istanbul',

		'shipping_country'  => 'Turkiye',

		'shipping_postcode' => '34306',

		'total_order_value' => 1,

		'currency'          => 0,

		'platform'          => 1,

		'is_in_frame'       => 0,

		'current_language'  => 0,

		'modul_version'     => 1.6,

		'random_nr'         => rand( 100000, 999999 )



	);

	$params              = implode( '', $args );

	$signature           = hash_hmac( 'SHA256', $args[ 'random_nr' ] . $args[ 'platform_order_id' ] . $args[ 'total_order_value' ] . $args[ 'currency' ], $shopierSecret, true );

	$signature           = base64_encode( $signature );

	$args[ 'signature' ] = $signature;



	$data[ 'params' ]      = $args;

	$data[ 'payment_url' ] = 'https://www.shopier.com/ShowProduct/api_pay4product.php';



	$curl = curl_init($data[ 'payment_url' ]);

	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

	curl_setopt($curl, CURLOPT_TIMEOUT, 30);

	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

	curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);

	curl_setopt($curl, CURLOPT_POST, true);

	curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($args));

	$data = curl_exec($curl);

	print_r($data);

	curl_close($curl);

}