mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Minor fixes for PayPalOM
This commit is contained in:
parent
7444355dee
commit
0017307e39
@ -481,6 +481,7 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver
|
||||
$data['guid'] = $this->risk_guid;
|
||||
$data['identifier'] = "s:INN_".$this->company_gateway->getConfigField('merchantId')."_CHCK";
|
||||
$data['pp_client_reference'] = $this->getClientHash();
|
||||
$data['invoice_hash'] = $this->payment_hash->fee_invoice->hashed_id;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@ -434,6 +434,7 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver
|
||||
$data['guid'] = $this->risk_guid;
|
||||
$data['identifier'] = "s:INN_ACDC_CHCK";
|
||||
$data['pp_client_reference'] = $this->getClientHash();
|
||||
$data['invoice_hash'] = $this->payment_hash->fee_invoice->hashed_id;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
1
public/build/assets/app-fee1da41.css
vendored
Normal file
1
public/build/assets/app-fee1da41.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,12 @@
|
||||
@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.paypal'), 'card_title' => ''])
|
||||
|
||||
@section('gateway_head')
|
||||
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
frame-src 'self' https://c.paypal.com https://www.sandbox.paypal.com https://www.paypal.com https://www.paypalobjects.com;
|
||||
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://c.paypal.com https://www.paypalobjects.com https://www.paypal.com https://www.sandbox.paypal.com https://www.google-analytics.com;
|
||||
img-src * data: 'self';
|
||||
style-src 'self' 'unsafe-inline';"
|
||||
>
|
||||
@endsection
|
||||
|
||||
@section('gateway_content')
|
||||
@ -82,6 +87,7 @@ inset: 6px;
|
||||
},
|
||||
onApprove: function(data, actions) {
|
||||
|
||||
document.getElementById('paypal-button-container').hidden = true;
|
||||
document.getElementById('is_working').classList.remove('hidden');
|
||||
|
||||
document.getElementById("gateway_response").value =JSON.stringify( data );
|
||||
@ -125,14 +131,19 @@ inset: 6px;
|
||||
document.getElementById("server_response").submit();
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
document.getElementById('is_working').classList.add('hidden');
|
||||
document.getElementById('paypal-button-container').hidden = false;
|
||||
|
||||
console.error('Error:', error);
|
||||
document.getElementById('errors').textContent = `Sorry, your transaction could not be processed...\n\n${error.message}`;
|
||||
document.getElementById('errors').hidden = false;
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
onCancel: function() {
|
||||
window.location.href = "/client/invoices/";
|
||||
window.location.href = "/client/invoices/{{ $invoice_hash }}";
|
||||
},
|
||||
onError: function(error) {
|
||||
|
||||
@ -144,14 +155,6 @@ inset: 6px;
|
||||
},
|
||||
onClick: function (){
|
||||
|
||||
console.log(fundingSource);
|
||||
|
||||
if(fundingSource != 'card')
|
||||
document.getElementById('paypal-button-container').hidden = true;
|
||||
|
||||
// document.getElementById('is_working').classList.remove('hidden');
|
||||
document.querySelector('div[data-ref="required-fields-container').classList.add('hidden');
|
||||
|
||||
},
|
||||
onInit: function (){
|
||||
console.log("init");
|
||||
|
@ -1,5 +1,14 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden p-5 bg-white sm:gap-4"
|
||||
id="paypal-payment">
|
||||
|
||||
@section('gateway_head')
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
frame-src 'self' https://c.paypal.com https://www.sandbox.paypal.com https://www.paypal.com https://www.paypalobjects.com;
|
||||
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://c.paypal.com https://www.paypalobjects.com https://www.paypal.com https://www.sandbox.paypal.com https://www.google-analytics.com;
|
||||
img-src * data: 'self';
|
||||
style-src 'self' 'unsafe-inline';"
|
||||
>
|
||||
@endsection
|
||||
<style type="text/css">
|
||||
.loader {
|
||||
width: 48px;
|
||||
@ -106,7 +115,8 @@
|
||||
},
|
||||
onApprove: function(data, actions) {
|
||||
|
||||
console.log(data);
|
||||
document.getElementById('paypal-button-container').hidden = true;
|
||||
document.getElementById('is_working').classList.remove('hidden');
|
||||
|
||||
document.getElementById("gateway_response").value =JSON.stringify( data );
|
||||
|
||||
@ -144,34 +154,27 @@
|
||||
document.getElementById("server_response").submit();
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
document.getElementById('is_working').classList.add('hidden');
|
||||
document.getElementById('paypal-button-container').hidden = false;
|
||||
|
||||
console.error('Error:', error);
|
||||
document.getElementById('errors').textContent = `Sorry, your transaction could not be processed...\n\n${error.message}`;
|
||||
document.getElementById('errors').hidden = false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
onCancel: function() {
|
||||
window.location.href = "/client/invoices/";
|
||||
window.location.href = "/client/invoices/{{ $invoice_hash }}";
|
||||
},
|
||||
onError: function(error) {
|
||||
|
||||
console.log("on error");
|
||||
console.log(error);
|
||||
|
||||
document.getElementById("gateway_response").value = error;
|
||||
document.getElementById("server_response").submit();
|
||||
},
|
||||
onClick: function (){
|
||||
|
||||
if(fundingSource != 'card')
|
||||
document.getElementById('paypal-button-container').hidden = true;
|
||||
|
||||
document.getElementById('is_working').classList.remove('hidden');
|
||||
|
||||
// document.querySelector('div[data-ref="required-fields-container').classList.add('hidden');
|
||||
|
||||
onClick: function (data, actions){
|
||||
},
|
||||
onInit: function (){
|
||||
console.log("init");
|
||||
@ -192,5 +195,7 @@
|
||||
document.getElementById("server_response").classList.add('is-submitting');
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@endscript
|
@ -185,8 +185,7 @@
|
||||
|
||||
},
|
||||
onCancel: function() {
|
||||
|
||||
window.location.href = "/client/invoices/";
|
||||
window.location.href = "/client/invoices/{{ $invoice_hash }}";
|
||||
},
|
||||
onClick: function (){
|
||||
|
||||
|
@ -167,7 +167,7 @@
|
||||
},
|
||||
onCancel: function() {
|
||||
|
||||
window.location.href = "/client/invoices/";
|
||||
window.location.href = "/client/invoices/{{ $invoice_hash }}";
|
||||
},
|
||||
// onError: function(error) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user