mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
service fee related issue solved.
This commit is contained in:
parent
a503518ff8
commit
203f6184bf
@ -87,7 +87,10 @@ class CreditCard
|
|||||||
public function paymentResponse(PaymentResponseRequest $request)
|
public function paymentResponse(PaymentResponseRequest $request)
|
||||||
{
|
{
|
||||||
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail();
|
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail();
|
||||||
|
$amount_with_fee = $payment_hash->data->total->amount_with_fee;
|
||||||
|
$fee_total = ( 3 * $amount_with_fee) / 100;
|
||||||
|
$amount_with_fee = $amount_with_fee + $fee_total;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
|
|
||||||
@ -102,8 +105,8 @@ class CreditCard
|
|||||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||||
CURLOPT_POSTFIELDS =>'{
|
CURLOPT_POSTFIELDS =>'{
|
||||||
"action":"sale",
|
"action":"sale",
|
||||||
"authorization_amount":'.$payment_hash->data->total->amount_with_fee.',
|
"authorization_amount":'.$amount_with_fee.',
|
||||||
"service_fee_amount":'.$payment_hash->data->total->fee_total.',
|
"service_fee_amount":'.$fee_total.',
|
||||||
"billing_address":{
|
"billing_address":{
|
||||||
"first_name":"'.$this->forte->client->name.'",
|
"first_name":"'.$this->forte->client->name.'",
|
||||||
"last_name":"'.$this->forte->client->name.'"
|
"last_name":"'.$this->forte->client->name.'"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user