Shopier Nedir?
Shopier, Türkiye merkezli bir ödeme çözümüdür. Bireysel satıcılar ve küçük işletmeler için ideal olan Shopier, hızlı kurulum, düşük komisyon ve taksit desteği sunar.
1. Ödeme Formu Oluşturma
$api_key = 'SHOPIER_API_KEY';
$api_secret = 'SHOPIER_API_SECRET';
$order_id = uniqid('SHP-');
$total = '100.00';
$currency = 0;
$data = implode('', [
$api_key, '[email protected]',
$total, $order_id, $currency
]);
$signature = base64_encode(
hash_hmac('sha256', $data,
$api_secret, true)
);
2. Callback Doğrulama
$received = $_POST;
$hash_data = $received['random_nr']
. $received['platform_order_id'];
$expected = base64_encode(
hash_hmac('sha256', $hash_data,
$api_secret, true)
);
if ($expected === $received['signature']) {
if ($received['status'] === 'success') {
approve_order($received['platform_order_id']);
}
}