fix: remove verification of customer_state in payment request
This commit is contained in:
parent
b32efe96e1
commit
1a2cac4cba
|
@ -87,7 +87,7 @@ class CinetpayController extends Controller
|
||||||
'customer_address' => 'required|string',
|
'customer_address' => 'required|string',
|
||||||
'customer_city' => 'required_if:payment_method,CREDIT_CARD|string',
|
'customer_city' => 'required_if:payment_method,CREDIT_CARD|string',
|
||||||
'customer_country' => 'required|string|size:2',
|
'customer_country' => 'required|string|size:2',
|
||||||
'customer_state' => 'required_if:payment_method,CREDIT_CARD|string|size:2', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
'customer_state' => 'required_if:payment_method,CREDIT_CARD|string', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
||||||
'customer_zip_code' => 'required_if:payment_method,CREDIT_CARD|string|size:5',
|
'customer_zip_code' => 'required_if:payment_method,CREDIT_CARD|string|size:5',
|
||||||
'reason' => 'required|string'
|
'reason' => 'required|string'
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -180,15 +180,17 @@ class PaymentController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($aggregator)){
|
if(!empty($aggregator)){
|
||||||
$rate = $aggregator->rates()->where(function ($q) use($countryCode) {
|
$baseQuery = $aggregator->rates()->where('type', $paymentType)
|
||||||
return $q->where('country', $countryCode)->orWhere('country','ALL');
|
|
||||||
})->where('type', $paymentType)
|
|
||||||
->where('method', $paymentMethod)
|
->where('method', $paymentMethod)
|
||||||
->when($paymentChannel, function ($q) use($paymentChannel){
|
->when($paymentChannel, function ($q) use($paymentChannel){
|
||||||
return $q->where('channel',$paymentChannel);
|
return $q->where('channel',$paymentChannel);
|
||||||
})
|
});
|
||||||
->latest()
|
|
||||||
->first();
|
$rate = (clone $baseQuery)->where('country', $countryCode)->first();
|
||||||
|
if(empty($rate)){
|
||||||
|
$rate = (clone $baseQuery)->where('country','ALL')->first();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!empty($rate)){
|
if(!empty($rate)){
|
||||||
if(!empty($rate->fixed_fees)){
|
if(!empty($rate->fixed_fees)){
|
||||||
|
|
|
@ -73,7 +73,7 @@ class StripeController extends Controller
|
||||||
'customer_address' => 'required|string',
|
'customer_address' => 'required|string',
|
||||||
'customer_city' => 'required_if:payment_method,CARD|string',
|
'customer_city' => 'required_if:payment_method,CARD|string',
|
||||||
'customer_country' => 'required|string|size:2',
|
'customer_country' => 'required|string|size:2',
|
||||||
'customer_state' => 'required_if:payment_method,CARD|string|size:2', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
'customer_state' => 'required_if:payment_method,CARD|string', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
||||||
'customer_zip_code' => 'required_if:payment_method,CARD|string|size:5',
|
'customer_zip_code' => 'required_if:payment_method,CARD|string|size:5',
|
||||||
'reason' => 'required|string'
|
'reason' => 'required|string'
|
||||||
]);
|
]);
|
||||||
|
@ -251,8 +251,8 @@ class StripeController extends Controller
|
||||||
'customer_address' => 'required|string',
|
'customer_address' => 'required|string',
|
||||||
'customer_city' => 'required|string',
|
'customer_city' => 'required|string',
|
||||||
'customer_country' => 'required|string|size:2',
|
'customer_country' => 'required|string|size:2',
|
||||||
'customer_state' => 'required_if:customer_country,US|string|size:2', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
'customer_state' => 'nullable|string', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
||||||
'customer_zip_code' => 'required_if:customer_country,US|string|size:5',
|
'customer_zip_code' => 'nullable|string|size:5',
|
||||||
'reason' => 'required|string'
|
'reason' => 'required|string'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -379,8 +379,8 @@ class StripeController extends Controller
|
||||||
'customer_address' => 'required|string',
|
'customer_address' => 'required|string',
|
||||||
'customer_city' => 'required|string',
|
'customer_city' => 'required|string',
|
||||||
'customer_country' => 'required|string|size:2',
|
'customer_country' => 'required|string|size:2',
|
||||||
'customer_state' => 'required_if:customer_country,US|string|size:2', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
'customer_state' => 'nullable|string', //Etat du pays dans lequel se trouve le client. Cette valeur est obligatoire si le client se trouve au États Unis d’Amérique (US) ou au Canada (CA)
|
||||||
'customer_zip_code' => 'required_if:customer_country,US|string|size:5',
|
'customer_zip_code' => 'nullable|string|size:5',
|
||||||
'reason' => 'required|string'
|
'reason' => 'required|string'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('payment_transactions', function (Blueprint $table) {
|
||||||
|
$table->string('customer_state')->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('payment_transactions', function (Blueprint $table) {
|
||||||
|
$table->string('customer_state',2)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue