Updated translations

This commit is contained in:
David Bomba 2023-06-23 20:05:36 +10:00
parent 9f969d9f7a
commit 2efd4f55f0
6 changed files with 56 additions and 37 deletions

View File

@ -711,6 +711,29 @@ class CreateSingleAccount extends Command
$cg->save(); $cg->save();
} }
if (config('ninja.testvars.paypal_rest') && ($this->gateway == 'all' || $this->gateway == 'paypal_rest')) {
$cg = new CompanyGateway;
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '80af24a6a691230bbec33e930ab40665';
$cg->require_cvv = true;
$cg->require_billing_address = true;
$cg->require_shipping_address = true;
$cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.paypal_rest'));
$cg->save();
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) { if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) {
$cg = new CompanyGateway; $cg = new CompanyGateway;
$cg->company_id = $company->id; $cg->company_id = $company->id;

View File

@ -93,11 +93,17 @@ class PayPalRestPaymentDriver extends BaseDriver
$data['client_id'] = $this->company_gateway->getConfigField('clientId'); $data['client_id'] = $this->company_gateway->getConfigField('clientId');
$data['token'] = $this->getClientToken(); $data['token'] = $this->getClientToken();
$data['order_id'] = $this->createOrder($data); $data['order_id'] = $this->createOrder($data);
$data['funding_options'] = $this->getFundingOptions();
return render('gateways.paypal.pay', $data); return render('gateways.paypal.pay', $data);
} }
private function getFundingOptions():string
{
}
public function processPaymentResponse($request) public function processPaymentResponse($request)
{ {
@ -152,6 +158,21 @@ class PayPalRestPaymentDriver extends BaseDriver
$order = [ $order = [
"intent" => "CAPTURE", "intent" => "CAPTURE",
"payer" => [
"name" => [
"given_name" => $this->client->present()->first_name(),
"surname" => $this->client->present()->last_name(),
],
"email_address" => $this->client->present()->email(),
"address" => [
"address_line_1" => $this->client->address1,
"address_line_2" => $this->client->address2,
"admin_area_1" => $this->client->city,
"admin_area_2" => $this->client->state,
"postal_code" => $this->client->postal_code,
"country_code" => $this->client->country->iso_3166_2,
]
],
"purchase_units" => [ "purchase_units" => [
[ [
"description" =>ctrans('texts.invoice_number').'# '.$invoice->number, "description" =>ctrans('texts.invoice_number').'# '.$invoice->number,

View File

@ -84,6 +84,7 @@ return [
'password' => 'password', 'password' => 'password',
'stripe' => env('STRIPE_KEYS', ''), 'stripe' => env('STRIPE_KEYS', ''),
'paypal' => env('PAYPAL_KEYS', ''), 'paypal' => env('PAYPAL_KEYS', ''),
'paypal_rest' => env('PAYPAL_REST_KEYS', ''),
'authorize' => env('AUTHORIZE_KEYS', ''), 'authorize' => env('AUTHORIZE_KEYS', ''),
'checkout' => env('CHECKOUT_KEYS', ''), 'checkout' => env('CHECKOUT_KEYS', ''),
'travis' => env('TRAVIS', false), 'travis' => env('TRAVIS', false),

View File

@ -5112,6 +5112,7 @@ $LANG = array(
'mercado_pago' => 'Mercado Pago', 'mercado_pago' => 'Mercado Pago',
'mybank' => 'MyBank', 'mybank' => 'MyBank',
'paypal_paylater' => 'Pay in 4', 'paypal_paylater' => 'Pay in 4',
'paid_date' => 'Paid Date',
); );

View File

@ -7,11 +7,11 @@ parameters:
- '#Call to an undefined method .*badMethod\(\)#' - '#Call to an undefined method .*badMethod\(\)#'
- '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#' - '#Call to an undefined method Illuminate\Database\Eloquent\Builder::exclude#'
parallel: parallel:
maximumNumberOfProcesses: 8 maximumNumberOfProcesses: 1
level: 4 level: 4
paths: paths:
- 'app/' - 'app/'
excludePaths: excludePaths:
- 'vendor/' - 'vendor/'
universalObjectCratesClasses: universalObjectCratesClasses:
- App\DataMapper\Tax\RuleInterface - App\DataMapper\Tax\RuleInterface

View File

@ -1,4 +1,4 @@
@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.payment_type_credit_card'), 'card_title' => ctrans('texts.payment_type_credit_card')]) @extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.payment_type_credit_card'), 'card_title' => 'PayPal'])
@section('gateway_head') @section('gateway_head')
<link <link
@ -28,7 +28,7 @@
@endsection @endsection
@push('footer') @push('footer')
<script src="https://www.paypal.com/sdk/js?components=buttons,hosted-fields&intent=capture&client-id={!! $client_id !!}" data-client-token="{!! $token !!}"> <script src="https://www.paypal.com/sdk/js?buyer-country=DE&currency=EUR&enable-funding={$funding_options}&components=buttons,hosted-fields,funding-eligibility&intent=capture&client-id={!! $client_id !!}" data-client-token="{!! $token !!}">
</script> </script>
<script> <script>
@ -55,40 +55,13 @@
}); });
},
onError: function(err) {
} console.log(err);
});
var FUNDING_SOURCES = [
paypal.FUNDING.PAYPAL,
paypal.FUNDING.CARD,
paypal.FUNDING.VENMO,
paypal.FUNDING.SEPA,
paypal.FUNDING.BANCONTACT,
paypal.FUNDING.EPS,
paypal.FUNDING.GIROPAY,
paypal.FUNDING.IDEAL,
paypal.FUNDING.MERCADOPAGO,
paypal.FUNDING.MYBANK,
paypal.FUNDING.PAYLATER,
paypal.FUNDING.P24,
paypal.FUNDING.SOFORT,
];
// Loop over each funding source
FUNDING_SOURCES.forEach(function (fundingSource) {
// Initialize the buttons
var button = paypal.Buttons({
fundingSource: fundingSource,
})
// Check if the button is eligible
if (button.isEligible()) {
// Render the standalone button for that funding source
button.render('#paypal-button-container')
} }
})
}).render('#paypal-button-container');
</script> </script>