|
@@ -88,23 +88,14 @@ class PayPlusLogic extends BaseApiLogic
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
$result = $this->service->postPayin($payload);
|
|
$result = $this->service->postPayin($payload);
|
|
|
|
|
+ Util::WriteLog('PayPlus', 'PayPlus payment response: ' . json_encode($result));
|
|
|
|
|
+ return $result;
|
|
|
|
|
|
|
|
} catch (\Exception $exception) {
|
|
} catch (\Exception $exception) {
|
|
|
Util::WriteLog('PayPlus_error', $exception->getMessage());
|
|
Util::WriteLog('PayPlus_error', $exception->getMessage());
|
|
|
$this->error = 'Payment processing error';
|
|
$this->error = 'Payment processing error';
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $returnData = [
|
|
|
|
|
- 'code' => 0,
|
|
|
|
|
- 'data' => [
|
|
|
|
|
- 'cashierUrl' => $this->resolvePaymentUrl($result),
|
|
|
|
|
- 'mchOrderNo' => $orderSn,
|
|
|
|
|
- 'raw' => $result,
|
|
|
|
|
- ],
|
|
|
|
|
- ];
|
|
|
|
|
- Util::WriteLog('PayPlus', 'PayPlus payment response: ' . json_encode($returnData));
|
|
|
|
|
- return $returnData;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function buildPaymentPayload(array $input)
|
|
public function buildPaymentPayload(array $input)
|
|
@@ -143,8 +134,8 @@ class PayPlusLogic extends BaseApiLogic
|
|
|
'email' => $this->emailOrDefault($input['user_email'] ?? '', $input['user_id']),
|
|
'email' => $this->emailOrDefault($input['user_email'] ?? '', $input['user_id']),
|
|
|
'phone' => preg_replace('/\D+/', '', (string) ($input['user_phone'] ?? '')) ?: '0000000000',
|
|
'phone' => preg_replace('/\D+/', '', (string) ($input['user_phone'] ?? '')) ?: '0000000000',
|
|
|
'area_code' => $config['area_code'] ?? '1',
|
|
'area_code' => $config['area_code'] ?? '1',
|
|
|
- 'first_name' => $this->stringOrDefault($nameParts[0] ?? '', 'unknown'),
|
|
|
|
|
- 'last_name' => $this->stringOrDefault($nameParts[1] ?? '', 'user'),
|
|
|
|
|
|
|
+ 'first_name' => 'user',
|
|
|
|
|
+ 'last_name' => 'user',
|
|
|
'vip_level' => 0,
|
|
'vip_level' => 0,
|
|
|
],
|
|
],
|
|
|
];
|
|
];
|