wip
This commit is contained in:
@@ -34,17 +34,17 @@ class OnlinePaymentController extends Controller
|
||||
/** @var \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem */
|
||||
$resource = $data['resource'];
|
||||
|
||||
if ($data['success'] && $paymentHistory && is_array($paymentHistory->api_response)) {
|
||||
info(OnlinePaymentRepo::syncWithBilling(
|
||||
uuid: $paymentHistory->orderId,
|
||||
bank_code: $bank->unique_code,
|
||||
terminal_id: $paymentHistory->api_response['terminalId'],
|
||||
account_number: $resource->parent->sender_datas[0]['deposit_account'],
|
||||
rrn: $paymentHistory->api_response['authRefNum'],
|
||||
amount: $resource->tmt_payment_amount,
|
||||
pay_purpose: $resource->created_at->translatedFormat('F').' '.$resource->created_at->format('Y'),
|
||||
));
|
||||
}
|
||||
// if ($data['success'] && $paymentHistory && is_array($paymentHistory->api_response)) {
|
||||
// info(OnlinePaymentRepo::syncWithBilling(
|
||||
// uuid: $paymentHistory->orderId,
|
||||
// bank_code: $bank->unique_code,
|
||||
// terminal_id: $paymentHistory->api_response['terminalId'],
|
||||
// account_number: $resource->parent->sender_datas[0]['deposit_account'],
|
||||
// rrn: $paymentHistory->api_response['authRefNum'],
|
||||
// amount: $resource->tmt_payment_amount,
|
||||
// pay_purpose: $resource->created_at->translatedFormat('F').' '.$resource->created_at->format('Y'),
|
||||
// ));
|
||||
// }
|
||||
|
||||
return view(OnlinePaymentRepo::statusView(), $data);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace App\Repos\Payment\Billing;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
|
||||
trait HandlesBillingSyncing
|
||||
{
|
||||
/**
|
||||
@@ -16,15 +19,14 @@ trait HandlesBillingSyncing
|
||||
string $amount,
|
||||
string $pay_purpose,
|
||||
) {
|
||||
return sprintf(
|
||||
'{
|
||||
"ecomId" : "%s",
|
||||
"agentId" : "%s",
|
||||
"eposId" : "%s",
|
||||
"account" : "%s",
|
||||
"rnn" : "%s",
|
||||
"amount" : %s,
|
||||
"payPurpose" : "%s"
|
||||
$body = sprintf('{
|
||||
"ecomId": "%s",
|
||||
"agentId": "%s",
|
||||
"eposId": "%s",
|
||||
"account": "%s",
|
||||
"rnn": "%s",
|
||||
"amount": "%s",
|
||||
"payPurpose": "%s"
|
||||
}',
|
||||
$uuid,
|
||||
$bank_code,
|
||||
@@ -34,45 +36,33 @@ trait HandlesBillingSyncing
|
||||
$amount,
|
||||
$pay_purpose,
|
||||
);
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, [
|
||||
CURLOPT_URL => 'http://10.3.158.102:8888/api/paytrn/new',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => sprintf(
|
||||
'{
|
||||
"ecomId" : "%s",
|
||||
"agentId" : "%s",
|
||||
"eposId" : "%s",
|
||||
"account" : "%s",
|
||||
"rnn" : "%s",
|
||||
"amount" : %s,
|
||||
"payPurpose" : "%s"
|
||||
}',
|
||||
$uuid,
|
||||
$bank_code,
|
||||
$terminal_id,
|
||||
$account_number,
|
||||
$rrn,
|
||||
$amount,
|
||||
$pay_purpose,
|
||||
),
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Basic YWRtaW46UUFad3N4MTIz',
|
||||
'Content-Type: application/json',
|
||||
$request = new Request(
|
||||
method: 'POST',
|
||||
uri: 'http://10.3.158.102:8888/api/paytrn/new',
|
||||
headers: [
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Basic YWRtaW46UUFad3N4MTIz',
|
||||
],
|
||||
]);
|
||||
body: $body
|
||||
);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
$client = new Client;
|
||||
$response = $client->sendAsync($request)->wait();
|
||||
|
||||
curl_close($curl);
|
||||
// curl --location --request POST 'http://10.3.158.102:8888/api/paytrn/new' \
|
||||
// --header 'Authorization: Basic YWRtaW46UUFad3N4MTIz' \
|
||||
// --header 'Content-Type: application/json' \
|
||||
// --data-raw '{
|
||||
// "ecomId" : "0c406ee2-097d-42f7-86c8-18127bd87e10",
|
||||
// "agentId" : "1307",
|
||||
// "eposId" : "30400225",
|
||||
// "account" : "4324234234",
|
||||
// "rnn" : "002959773584",
|
||||
// "amount" : 0.1,
|
||||
// "payPurpose" : "Mart 2025"
|
||||
// }'
|
||||
|
||||
return $response;
|
||||
return $response->getBody();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
'{{ $card_month }}/{{ substr($card_year, 2) }}',
|
||||
'card-history-details',
|
||||
)"
|
||||
>{{ $resource->card_number }}</div>
|
||||
>{{ trim(chunk_split($resource->card_number, 4, ' ')) }}</div>
|
||||
<div class="expiry-container">
|
||||
<div class="card-holder dark:text-white">{{ $resource->card_name }}</div>
|
||||
<div class="expiry-date dark:text-white">{{ $card_month }}/{{ $card_year }}</div>
|
||||
|
||||
Reference in New Issue
Block a user