t
$payload = [
'shop_key' => '00112233-4455-6677-8899-aabbccddeeff',
'amount' => 29900,
'order_currency' => 'USD',
'payment_currency' => 'USD',
'payment_method' => 'card',
'order_number' => 'order-12345',
'payment_details' => 'Payment via order 12345',
'success_url' => 'https://example.com/success',
'fail_url' => 'https://example.com/fail',
'lang' => 'en',
'payment_account_data': [
'email': 'email@example.com',
]
];
$api_sign = get_api_sign($payload, $secret_key);
$headers = [
'Content-Type:application/json',
'Api-sign:' . $api_sign
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url . '/rest/paymentgate/simple/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
curl_close($ch);
Comments
Post a Comment