mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
fixes for Paypal PPCP
This commit is contained in:
parent
1f05c10cea
commit
f0dbb10f93
@ -214,6 +214,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
public function processPaymentResponse($request)
|
public function processPaymentResponse($request)
|
||||||
{
|
{
|
||||||
|
nlog($request['gateway_response']);
|
||||||
|
|
||||||
$response = json_decode($request['gateway_response'], true);
|
$response = json_decode($request['gateway_response'], true);
|
||||||
|
|
||||||
@ -262,6 +263,8 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$_invoice = collect($this->payment_hash->data->invoices)->first();
|
$_invoice = collect($this->payment_hash->data->invoices)->first();
|
||||||
|
|
||||||
|
nlog($_invoice);
|
||||||
|
|
||||||
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
||||||
|
|
||||||
$order = [
|
$order = [
|
||||||
@ -275,8 +278,8 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
"address" => [
|
"address" => [
|
||||||
"address_line_1" => $this->client->address1,
|
"address_line_1" => $this->client->address1,
|
||||||
"address_line_2" => $this->client->address2,
|
"address_line_2" => $this->client->address2,
|
||||||
"admin_area_1" => $this->client->city,
|
"admin_area_2" => $this->client->city,
|
||||||
"admin_area_2" => $this->client->state,
|
"admin_area_1" => $this->client->state,
|
||||||
"postal_code" => $this->client->postal_code,
|
"postal_code" => $this->client->postal_code,
|
||||||
"country_code" => $this->client->country->iso_3166_2,
|
"country_code" => $this->client->country->iso_3166_2,
|
||||||
]
|
]
|
||||||
|
@ -45,23 +45,24 @@
|
|||||||
env: testMode ? 'sandbox' : 'production',
|
env: testMode ? 'sandbox' : 'production',
|
||||||
fundingSource: fundingSource,
|
fundingSource: fundingSource,
|
||||||
client: testMode ? sandbox : production,
|
client: testMode ? sandbox : production,
|
||||||
// Order is created on the server and the order id is returned
|
|
||||||
createOrder: function(data, actions) {
|
createOrder: function(data, actions) {
|
||||||
return orderId;
|
return orderId;
|
||||||
},
|
},
|
||||||
// Finalize the transaction on the server after payer approval
|
|
||||||
onApprove: function(data, actions) {
|
onApprove: function(data, actions) {
|
||||||
|
|
||||||
return actions.order.capture().then(function(details) {
|
return actions.order.capture().then(function(details) {
|
||||||
|
|
||||||
document.getElementById("gateway_response").value =JSON.stringify( details );
|
document.getElementById("gateway_response").value =JSON.stringify( details );
|
||||||
document.getElementById("server_response").submit();
|
document.getElementById("server_response").submit();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
onCancel: function() {
|
||||||
|
window.location.href = "/client/invoices/";
|
||||||
|
},
|
||||||
onError: function(err) {
|
onError: function(err) {
|
||||||
console.log(err);
|
console.log("there was an error")
|
||||||
|
console.log(err)
|
||||||
|
// document.getElementById("gateway_response").value =JSON.stringify( err );
|
||||||
|
// document.getElementById("server_response").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}).render('#paypal-button-container');
|
}).render('#paypal-button-container');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user